添加用户的组织转换和企业的组织机构转换

This commit is contained in:
sh
2026-01-30 17:14:49 +08:00
parent 3a02e2972a
commit 10e81e9236
3 changed files with 51 additions and 0 deletions

View File

@@ -181,6 +181,10 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
if(StringUtils.isNotEmpty(appUser.getYtjPassword())){ if(StringUtils.isNotEmpty(appUser.getYtjPassword())){
appUser.setYtjPassword(SiteSecurityUtils.encryptPassword(appUser.getYtjPassword())); appUser.setYtjPassword(SiteSecurityUtils.encryptPassword(appUser.getYtjPassword()));
} }
//保存region
if(!StringUtils.isBlank(appUser.getArea())){
appUser.setRegionCode(StringUtil.getAreaToRegionCode(appUser.getArea()));
}
return appUserMapper.updateById(appUser); return appUserMapper.updateById(appUser);
} }
@@ -341,6 +345,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
} else { } else {
appUser.setPhone(dbUser.getPhone()); appUser.setPhone(dbUser.getPhone());
appUser.setUserId(dbUser.getUserId()); appUser.setUserId(dbUser.getUserId());
appUser.setRegionCode(StringUtils.isBlank(dbUser.getRegionCode())?StringUtil.getAreaToRegionCode(dbUser.getArea()):null);
return appUser; return appUser;
} }
} }

View File

@@ -356,6 +356,9 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
@Override @Override
public int insertJob(Job job) public int insertJob(Job job)
{ {
if(job.getJobLocationAreaCode()!=null){
job.setRegionCode(StringUtil.getAreaToRegionCode(String.valueOf(job.getJobLocationAreaCode())));
}
int insert = jobMapper.insert(job); int insert = jobMapper.insert(job);
//todo 线程池管理 //todo 线程池管理
// Thread thread = new Thread(() -> { // Thread thread = new Thread(() -> {
@@ -395,6 +398,9 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
@Transactional @Transactional
public int updateJob(Job job) public int updateJob(Job job)
{ {
if(job.getJobLocationAreaCode()!=null){
job.setRegionCode(StringUtil.getAreaToRegionCode(String.valueOf(job.getJobLocationAreaCode())));
}
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); 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("请先完成招聘企业登记"); // throw new ServiceException("请先完成招聘企业登记");
// } // }
// job.setCompanyId(company.getCompanyId()); // job.setCompanyId(company.getCompanyId());
//保存region
if(job.getJobLocationAreaCode()!=null){
job.setRegionCode(StringUtil.getAreaToRegionCode(String.valueOf(job.getJobLocationAreaCode())));
}
jobMapper.insert(job); jobMapper.insert(job);
//修改联系人 //修改联系人

View File

@@ -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 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> EDU_DESC_TO_CODE_MAP;
/**
* 组织机构转换
*/
public static final Map<String, String> REGION_CODE_CODE_MAP;
static { static {
Map<String, String> tempMap = new HashMap<>(); Map<String, String> tempMap = new HashMap<>();
@@ -99,6 +106,35 @@ public class StringUtil {
EDU_DESC_TO_CODE_MAP = Collections.unmodifiableMap(tempMap); 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 * @param eduDesc