添加用户的组织转换和企业的组织机构转换
This commit is contained in:
@@ -181,6 +181,10 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
|
||||
if(StringUtils.isNotEmpty(appUser.getYtjPassword())){
|
||||
appUser.setYtjPassword(SiteSecurityUtils.encryptPassword(appUser.getYtjPassword()));
|
||||
}
|
||||
//保存region
|
||||
if(!StringUtils.isBlank(appUser.getArea())){
|
||||
appUser.setRegionCode(StringUtil.getAreaToRegionCode(appUser.getArea()));
|
||||
}
|
||||
return appUserMapper.updateById(appUser);
|
||||
}
|
||||
|
||||
@@ -341,6 +345,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
|
||||
} else {
|
||||
appUser.setPhone(dbUser.getPhone());
|
||||
appUser.setUserId(dbUser.getUserId());
|
||||
appUser.setRegionCode(StringUtils.isBlank(dbUser.getRegionCode())?StringUtil.getAreaToRegionCode(dbUser.getArea()):null);
|
||||
return appUser;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,6 +356,9 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
@Override
|
||||
public int insertJob(Job job)
|
||||
{
|
||||
if(job.getJobLocationAreaCode()!=null){
|
||||
job.setRegionCode(StringUtil.getAreaToRegionCode(String.valueOf(job.getJobLocationAreaCode())));
|
||||
}
|
||||
int insert = jobMapper.insert(job);
|
||||
//todo 线程池管理
|
||||
// Thread thread = new Thread(() -> {
|
||||
@@ -395,6 +398,9 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
@Transactional
|
||||
public int updateJob(Job job)
|
||||
{
|
||||
if(job.getJobLocationAreaCode()!=null){
|
||||
job.setRegionCode(StringUtil.getAreaToRegionCode(String.valueOf(job.getJobLocationAreaCode())));
|
||||
}
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
//修改岗位状态
|
||||
@@ -1047,6 +1053,10 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
// throw new ServiceException("请先完成招聘企业登记");
|
||||
// }
|
||||
// job.setCompanyId(company.getCompanyId());
|
||||
//保存region
|
||||
if(job.getJobLocationAreaCode()!=null){
|
||||
job.setRegionCode(StringUtil.getAreaToRegionCode(String.valueOf(job.getJobLocationAreaCode())));
|
||||
}
|
||||
jobMapper.insert(job);
|
||||
|
||||
//修改联系人
|
||||
|
||||
@@ -87,7 +87,14 @@ public class StringUtil {
|
||||
*/
|
||||
public static final String SFZ_VALID_REGEX="^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$";
|
||||
|
||||
/**
|
||||
* 学历转换
|
||||
*/
|
||||
public static final Map<String, String> EDU_DESC_TO_CODE_MAP;
|
||||
/**
|
||||
* 组织机构转换
|
||||
*/
|
||||
public static final Map<String, String> REGION_CODE_CODE_MAP;
|
||||
|
||||
static {
|
||||
Map<String, String> tempMap = new HashMap<>();
|
||||
@@ -99,6 +106,35 @@ public class StringUtil {
|
||||
EDU_DESC_TO_CODE_MAP = Collections.unmodifiableMap(tempMap);
|
||||
}
|
||||
|
||||
static {
|
||||
Map<String, String> tempMap = new HashMap<>();
|
||||
tempMap.put("0", "653101000000");
|
||||
tempMap.put("1", "653121000000");
|
||||
tempMap.put("2", "653122000000");
|
||||
tempMap.put("3", "653123000000");
|
||||
tempMap.put("4", "653128000000");
|
||||
tempMap.put("5", "653129000000");
|
||||
tempMap.put("6", "653125000000");
|
||||
tempMap.put("7", "653124000000");
|
||||
tempMap.put("8", "653126000000");
|
||||
tempMap.put("9", "653127000000");
|
||||
tempMap.put("10", "653130000000");
|
||||
tempMap.put("11", "653131000000");
|
||||
REGION_CODE_CODE_MAP = Collections.unmodifiableMap(tempMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* areaToRegion
|
||||
* @param area
|
||||
* @return
|
||||
*/
|
||||
public static String getAreaToRegionCode(String area) {
|
||||
if (area == null || area.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return REGION_CODE_CODE_MAP.get(area.trim());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学历
|
||||
* @param eduDesc
|
||||
|
||||
Reference in New Issue
Block a user