|
@@ -396,16 +396,17 @@ public class JobUserServiceImpl implements JobUserService {
|
|
|
jobUserExp2.or().andUserMobileEqualTo(data.getUserMobile()).andJobuserIDNotEqualTo(data.getJobUserID());
|
|
|
var ifRepeatMobile = pcJobuserMapper.selectByExample(jobUserExp2).size()>0;
|
|
|
|
|
|
-
|
|
|
- result += ifRepeatIdentity? 1:0;
|
|
|
- result += ifRepeatMobile? 2:0;
|
|
|
-
|
|
|
if(!stringUtils.IsNullOrEmpty(data.getSocialSecurityCard())){
|
|
|
PcJobuserExample jobUserExp3= new PcJobuserExample();
|
|
|
jobUserExp3.or().andUserMobileEqualTo(data.getSocialSecurityCard()).andJobuserIDNotEqualTo(data.getJobUserID());
|
|
|
var ifRepeatSocialCard = pcJobuserMapper.selectByExample(jobUserExp3).size()>0;
|
|
|
result += ifRepeatSocialCard ? 4:0;
|
|
|
}
|
|
|
+
|
|
|
+ result += ifRepeatIdentity? 1:0;
|
|
|
+ result += ifRepeatMobile? 2:0;
|
|
|
+
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -424,7 +425,7 @@ public class JobUserServiceImpl implements JobUserService {
|
|
|
case 3:
|
|
|
throw new BaseException("1004","身份证号码、联系电话重复!");
|
|
|
case 4:
|
|
|
- throw new BaseException("1004","社保卡已绑定其他人员!");
|
|
|
+ throw new BaseException("1004","社保卡已绑定其他求职人员!");
|
|
|
case 5:
|
|
|
throw new BaseException("1004","身份证号码、社保卡号重复!");
|
|
|
case 6:
|
|
@@ -545,33 +546,23 @@ public class JobUserServiceImpl implements JobUserService {
|
|
|
}
|
|
|
|
|
|
//验证身份证号是否合法
|
|
|
- private boolean identityNumberIsValid(String idNumber) {
|
|
|
- if (idNumber == null || (idNumber.length() != 18 && idNumber.length() != 15)) {
|
|
|
+ private boolean identityNumberIsValid(String idCard) {
|
|
|
+ if (idCard.length() != 18) {
|
|
|
return false;
|
|
|
}
|
|
|
- // 校验18位身份证
|
|
|
- if (idNumber.length() == 18) {
|
|
|
- String[] idInfo = idNumber.substring(0, 17).split("");
|
|
|
- String birth = idInfo[6] + idInfo[7] + '-' + idInfo[8] + idInfo[9] + '-' + idInfo[10] + idInfo[11];
|
|
|
- try {
|
|
|
- if (!idInfo[12].equals("19") && !idInfo[12].equals("20")) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- java.time.LocalDate.parse(birth, java.time.format.DateTimeFormatter.ISO_DATE);
|
|
|
- } catch (Exception e) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- int sum = 0;
|
|
|
- int[] weights = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
|
|
|
- char[] checkCode = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'};
|
|
|
- for (int i = 0; i < 17; i++) {
|
|
|
- sum += Integer.parseInt(idInfo[i]) * weights[i];
|
|
|
- }
|
|
|
- return idInfo[17].equals(String.valueOf(checkCode[sum % 11]));
|
|
|
+ // 正则表达式验证身份证格式
|
|
|
+ String regex = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\\d{3}([0-9Xx])$";
|
|
|
+ if (!idCard.matches(regex)) {
|
|
|
+ return false;
|
|
|
}
|
|
|
-
|
|
|
- return true;
|
|
|
+ // 计算身份证校验码
|
|
|
+ int[] weights = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
|
|
|
+ char[] checkCode = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'};
|
|
|
+ int sum = 0;
|
|
|
+ for (int i = 0; i < weights.length; i++) {
|
|
|
+ sum += weights[i] * Integer.parseInt(idCard.substring(i, i + 1));
|
|
|
+ }
|
|
|
+ return idCard.charAt(17) == checkCode[sum % 11];
|
|
|
}
|
|
|
|
|
|
//验证手机号是否合法
|
|
@@ -615,7 +606,7 @@ public class JobUserServiceImpl implements JobUserService {
|
|
|
//职业资格类别
|
|
|
List<SysDictionaryItem> secondLevelOcCategoryList = new ArrayList<>();
|
|
|
PcOccupationalExample occupationalExp = new PcOccupationalExample();
|
|
|
- occupationalExp.or().andParentOccupationalIDEqualTo("").andStatusEqualTo(1);
|
|
|
+ occupationalExp.or().andParentOccupationalIDEqualTo("0").andStatusEqualTo(1);
|
|
|
var firstLevelData = pcOccupationalMapper.selectByExample(occupationalExp);
|
|
|
for (PcOccupational curOccupational : firstLevelData) {
|
|
|
occupationalExp = new PcOccupationalExample();
|
|
@@ -677,18 +668,25 @@ public class JobUserServiceImpl implements JobUserService {
|
|
|
break;
|
|
|
case 1:
|
|
|
errorInfo += "身份证号码已存在!";
|
|
|
+ break;
|
|
|
case 2:
|
|
|
errorInfo += "联系电话已存在!";
|
|
|
+ break;
|
|
|
case 3:
|
|
|
errorInfo += "身份证号码、联系电话重复!";
|
|
|
+ break;
|
|
|
case 4:
|
|
|
errorInfo += "社保卡已绑定其他人员!";
|
|
|
+ break;
|
|
|
case 5:
|
|
|
errorInfo += "身份证号码、社保卡号重复!";
|
|
|
+ break;
|
|
|
case 6:
|
|
|
errorInfo += "联系电话、社保卡号重复!";
|
|
|
+ break;
|
|
|
case 7:
|
|
|
errorInfo += "身份证号码、联系电话、社保卡号重复!";
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
if (stringUtils.IsNullOrEmpty(item.getName())){
|
|
@@ -699,10 +697,10 @@ public class JobUserServiceImpl implements JobUserService {
|
|
|
errorInfo += "请填写身份证号码!";
|
|
|
else{
|
|
|
if(identityNumberIsValid(item.getIdentityNumber())) {
|
|
|
- var birthDay = dateUtils.StrToDate(item.getIdentityNumber().substring(6,14));
|
|
|
+ var birthDay = dateUtils.StrToDate((item.getIdentityNumber().substring(6,10)+"-"+item.getIdentityNumber().substring(10,12)+"-"+item.getIdentityNumber().substring(12,14)),"yyyy-MM-dd");
|
|
|
var sexStr = Integer.parseInt(item.getIdentityNumber().substring(16,17));
|
|
|
if(!stringUtils.IsNullOrEmpty(item.getBirthDayStr())){
|
|
|
- if(birthDay!=dateUtils.StrToDate(item.getBirthDayStr())){
|
|
|
+ if(!birthDay.equals(dateUtils.StrToDate(item.getBirthDayStr(),"yyyy-MM-dd"))){
|
|
|
errorInfo += "出生日期与身份证号不匹配!";
|
|
|
}
|
|
|
}else{
|
|
@@ -768,6 +766,16 @@ public class JobUserServiceImpl implements JobUserService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (!stringUtils.IsNullOrEmpty(item.getSocialSecurityCard())){
|
|
|
+ PcJobuserExample jobUserExp= new PcJobuserExample();
|
|
|
+ jobUserExp.or().andUserMobileEqualTo(item.getSocialSecurityCard());
|
|
|
+ if(pcJobuserMapper.selectByExample(jobUserExp).size()>0){
|
|
|
+ errorInfo += "社保卡已绑定其他求职人员!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (!stringUtils.IsNullOrEmpty(item.getIsFullTimeName())){
|
|
|
item.setIsFullTime(dicIsFullTimeList.stream().filter(it -> it.getName().equals(item.getIsFullTimeName().trim()))
|
|
|
.findFirst().orElse(new SysDictionaryItem()).getValue());
|
|
@@ -866,7 +874,7 @@ public class JobUserServiceImpl implements JobUserService {
|
|
|
errorInfo += "请选择相关市/县!";
|
|
|
}else{
|
|
|
AreaCodeExample curStreetExp = new AreaCodeExample();
|
|
|
- streetExp.or().andCodeEqualTo(item.getStreetCode());
|
|
|
+ curStreetExp.or().andCodeEqualTo(item.getStreetCode());
|
|
|
var curStreetReginCode = areaCodeMapper.selectByExample(curStreetExp).get(0).getFid();
|
|
|
if(item.getRegionCode()!= null&&!curStreetReginCode.equals(item.getRegionCode())){
|
|
|
errorInfo += "镇街不属于当前市/县!";
|
|
@@ -874,6 +882,8 @@ public class JobUserServiceImpl implements JobUserService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ item.setJobEducation(new ArrayList<>());
|
|
|
+ item.setJobExperience(new ArrayList<>());
|
|
|
|
|
|
if (stringUtils.IsNullOrEmpty(errorInfo)) {
|
|
|
resultList.add(item);
|