package com.thhy.staff.utils;
|
|
import com.thhy.general.utils.password.PasswdUtils;
|
import com.thhy.staff.modules.biz.platuser.entity.PlatUser;
|
import com.thhy.staff.modules.biz.platuser.entity.PlatUserDto;
|
import com.thhy.staff.modules.biz.platuser.entity.SysUsers;
|
|
public class StaffNoUtils {
|
|
public static String create(int type,Integer maxNo){
|
int newMaxNo = maxNo+1;
|
String jobnum = "";
|
if(String.valueOf(newMaxNo).length()<5){
|
String demo = "0000000000";
|
jobnum=demo.substring(0,(5-String.valueOf(newMaxNo).length()))+newMaxNo;
|
}
|
if(type==1){
|
return "G"+jobnum;
|
}else{
|
return "L"+jobnum;
|
}
|
}
|
|
public static SysUsers PlatoSys(PlatUserDto platUserDto){
|
SysUsers sysUsers = new SysUsers();
|
sysUsers.setRealName(platUserDto.getRealName());
|
sysUsers.setSex(platUserDto.getSex());
|
sysUsers.setUsername(platUserDto.getJobNum());
|
sysUsers.setTelphone(platUserDto.getPhone());
|
sysUsers.setPassword(PasswdUtils.encodePassword("123456"));
|
sysUsers.setPlatId(platUserDto.getUserId());
|
sysUsers.setIsPlat(1);
|
sysUsers.setPhotoUrl(platUserDto.getPhotoUrl());
|
return sysUsers;
|
|
}
|
|
public static void main(String[] args) {
|
//System.out.println(StaffNoUtils.create(2,5));
|
System.out.println(PasswdUtils.encodePassword("123456"));
|
}
|
}
|