优化教育程度转换逻辑

This commit is contained in:
dxfeng 2024-12-18 16:33:35 +08:00
parent a3a6f8b8e2
commit 63ae6aa3a0
1 changed files with 40 additions and 5 deletions

View File

@ -82,7 +82,7 @@ public class JcRecruitInfoCollectServiceImpl extends Service implements JcRecrui
// 婚姻状况 // 婚姻状况
applicantDataMap.put("hyzk", getMaritalStatus(Util.null2String(mainDataMap.get("field014")))); applicantDataMap.put("hyzk", getMaritalStatus(Util.null2String(mainDataMap.get("field014"))));
// 最高学历 转换为浏览按钮对应的值 // 最高学历 转换为浏览按钮对应的值
applicantDataMap.put("zgxl", getEducationLevelId(Util.null2String(mainDataMap.get("field015")))); applicantDataMap.put("zgxl", getEducationLevelIdByValue(Util.null2String(mainDataMap.get("field015"))));
// 现居住地 // 现居住地
applicantDataMap.put("xjzd", mainDataMap.get("field016")); applicantDataMap.put("xjzd", mainDataMap.get("field016"));
// 户口性质 // 户口性质
@ -287,6 +287,40 @@ public class JcRecruitInfoCollectServiceImpl extends Service implements JcRecrui
return ModeBrowserCommonInfo.getEducationLevelId(name); return ModeBrowserCommonInfo.getEducationLevelId(name);
} }
private String getEducationLevelIdByValue(String value) {
if (StringUtils.isBlank(value)) {
return null;
}
switch (value) {
case "0":
// 小学
return "1";
case "1":
// 初中
return "2";
case "2":
// 高中
return "3";
case "3":
// 中专
return "5";
case "4":
// 大专
return "6";
case "5":
// 本科
return "7";
case "6":
// 硕士
return "8";
case "7":
// 博士
return "9";
default:
return null;
}
}
/** /**
* 获取下拉框值 * 获取下拉框值
@ -307,14 +341,15 @@ public class JcRecruitInfoCollectServiceImpl extends Service implements JcRecrui
/** /**
* 获取婚姻状况 * 获取婚姻状况
* *
* @param name * @param value
* @return * @return
*/ */
private String getMaritalStatus(String name) { private String getMaritalStatus(String value) {
if (StringUtils.isBlank(name)) { if (StringUtils.isBlank(value)) {
return null; return null;
} }
if (!"未婚".equals(name)) { String name = "未婚";
if (!"0".equals(value)) {
name = "已婚"; name = "已婚";
} }
return ModeBrowserCommonInfo.getBrowserId(ModeBrowserCommonInfo.TYPE_MARITAL_STATUS, name); return ModeBrowserCommonInfo.getBrowserId(ModeBrowserCommonInfo.TYPE_MARITAL_STATUS, name);