Commit 364b242f authored by hongguangwu's avatar hongguangwu

员工类型为外包和派遣,并且是否大专及以上为是

parent 1169719f
......@@ -9,6 +9,22 @@ public class EmployeeConstants {
public static final String REMARL_LENGTH = "备注长度超过200";
public static final String POST_LENGTH = "就职岗位长度超过20";
public static final String DEPT_NO_LENGTH = "项目编码长度超过20";
public static final String VALIDITY_START = "身份证开始日期必填!";
public static final String VALIDITY_END = "身份证截止日期必填!";
public static final String EMP_NATIONAL = "民族必填!";
public static final String ID_PROVINCE = "户籍所在地必填!";
public static final String FILE_PROVINCE = "档案所在地必填!";
public static final String EMP_REGIS_TYPE = "户口性质必填!";
public static final String IS_COLLEGE = "是否大专及以上必填!";
public static final String CONTACT_ADDRESS = "通信地址必填!";
public static final String EMP_NATRUE_ZERO = "派遣";
public static final String EMP_NATRUE_ONE = "外包";
public static final String HIGN_EDUCATION = "最高学历必填";
public static final String SCHOOL = "学校必填";
public static final String MAJOR = "专业必填";
public static final String ADMISSION_DATE = "入学时间必填";
public static final String GRADUTION_DATE = "毕业时间必填";
/**
* 无数据可更新
**/
......
......@@ -630,8 +630,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private void checkEmployeeVOR(long lineNum, EmployeeVO employeeInfo, Map<Long, ErrorMessage> errorMsgMap, Set<String> errorMsg) {
if (Common.isEmpty(employeeInfo.getEmpIdcard())) {
errorMsg.add("员工身份证必填!");
errorMsgMap.put(lineNum, new ErrorMessage("员工身份证必填!"));
errorMsg.add("身份证号必填!");
errorMsgMap.put(lineNum, new ErrorMessage("身份证号必填!"));
}
if (Common.isEmpty(employeeInfo.getDeptNo())) {
errorMsg.add("项目编码必填!");
......@@ -645,12 +645,73 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMsgMap.put(lineNum, new ErrorMessage("员工姓名必填!"));
}
if (Common.isEmpty(employeeInfo.getEmpPhone())) {
errorMsg.add("手机号必填!");
errorMsgMap.put(lineNum, new ErrorMessage("手机号必填!"));
errorMsg.add("手机号必填!");
errorMsgMap.put(lineNum, new ErrorMessage("手机号必填!"));
}
if (Common.isEmpty(employeeInfo.getEmpNatrue())) {
errorMsg.add("员工类型必填!");
errorMsgMap.put(lineNum, new ErrorMessage("员工类型必填!"));
} else if (EmployeeConstants.EMP_NATRUE_ZERO.equals(employeeInfo.getEmpNatrue())
|| EmployeeConstants.EMP_NATRUE_ONE.equals(employeeInfo.getEmpNatrue())) {
// 2.员工类型为外包和派遣,额外必填项有:身份证开始日期、身份证截止日期、民族、户籍所在(省市县)、户口性质、档案所在地(省市县)、是否大专及以上、通信地址
if (Common.isEmpty(employeeInfo.getValidityStart())) {
errorMsg.add(EmployeeConstants.VALIDITY_START);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.VALIDITY_START));
}
if (Common.isEmpty(employeeInfo.getValidityEnd())) {
errorMsg.add(EmployeeConstants.VALIDITY_END);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.VALIDITY_END));
}
if (Common.isEmpty(employeeInfo.getEmpNational())) {
errorMsg.add(EmployeeConstants.EMP_NATIONAL);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.EMP_NATIONAL));
}
if (Common.isEmpty(employeeInfo.getIdProvince())) {
errorMsg.add(EmployeeConstants.ID_PROVINCE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.ID_PROVINCE));
}
if (Common.isEmpty(employeeInfo.getEmpRegisType())) {
errorMsg.add(EmployeeConstants.EMP_REGIS_TYPE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.EMP_REGIS_TYPE));
}
if (Common.isEmpty(employeeInfo.getFileProvince())) {
errorMsg.add(EmployeeConstants.FILE_PROVINCE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.FILE_PROVINCE));
}
if (Common.isEmpty(employeeInfo.getContactAddress())) {
errorMsg.add(EmployeeConstants.CONTACT_ADDRESS);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.CONTACT_ADDRESS));
}
if (Common.isEmpty(employeeInfo.getIsCollege())) {
errorMsg.add(EmployeeConstants.IS_COLLEGE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.IS_COLLEGE));
} else if (CommonConstants.IS_TRUE.equals(employeeInfo.getIsCollege())) {
// 3.员工类型为外包和派遣,并且是否大专及以上为是,再增加必填项:最高学历、学校、专业、入学时间、毕业时间
if (Common.isEmpty(employeeInfo.getHignEducation())) {
errorMsg.add(EmployeeConstants.HIGN_EDUCATION);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.HIGN_EDUCATION));
}
if (Common.isEmpty(employeeInfo.getSchool())) {
errorMsg.add(EmployeeConstants.SCHOOL);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.SCHOOL));
}
if (Common.isEmpty(employeeInfo.getMajor())) {
errorMsg.add(EmployeeConstants.MAJOR);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.MAJOR));
}
if (Common.isEmpty(employeeInfo.getAdmissionDate())) {
errorMsg.add(EmployeeConstants.ADMISSION_DATE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.ADMISSION_DATE));
}
if (Common.isEmpty(employeeInfo.getGradutionDate())) {
errorMsg.add(EmployeeConstants.GRADUTION_DATE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.GRADUTION_DATE));
}
}
}
if (Common.isEmpty(employeeInfo.getPost())) {
errorMsg.add("就职岗位必填!");
errorMsgMap.put(lineNum, new ErrorMessage("就职岗位必填!"));
}
}
......@@ -1154,10 +1215,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 获取身份证、手机号列表,批量查询档案
List<String> idCardList = new ArrayList<>();
List<String> phoneList = new ArrayList<>();
EmployeeVO employeeVO;
long lineNum;
for (int i = 0; i < excelVOList.size(); i++) {
lineNum = i + 2L;
employeeVO = excelVOList.get(i);
// 判断空值
this.judgeNull(errorMsgMap, employeeVO, lineNum);
// 判空
if (Common.isEmpty(excelVOList.get(i).getEmpIdcard())) {
errorMsgMap.put((i + 2L), new ErrorMessage("员工身份证必填"));
errorMsgMap.put(lineNum, new ErrorMessage("员工身份证必填"));
} else {
idCardList.add(excelVOList.get(i).getEmpIdcard());
}
......@@ -1493,6 +1560,60 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return R.ok();
}
/**
* @Description: 批量更新的判断
* @Author: hgw
* @Date: 2022/7/6 15:10
* @return: void
**/
private void judgeNull(Map<Long, ErrorMessage> errorMsgMap, EmployeeVO employeeInfo, long lineNum) {
if (Common.isNotNull(employeeInfo.getEmpNatrue())
&& (EmployeeConstants.EMP_NATRUE_ZERO.equals(employeeInfo.getEmpNatrue())
|| EmployeeConstants.EMP_NATRUE_ONE.equals(employeeInfo.getEmpNatrue()))) {
// 2.员工类型为外包和派遣,额外必填项有:身份证开始日期、身份证截止日期、民族、户籍所在(省市县)、户口性质、档案所在地(省市县)、是否大专及以上、通信地址
if (Common.isEmpty(employeeInfo.getValidityStart())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.VALIDITY_START));
}
if (Common.isEmpty(employeeInfo.getValidityEnd())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.VALIDITY_END));
}
if (Common.isEmpty(employeeInfo.getEmpNational())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.EMP_NATIONAL));
}
if (Common.isEmpty(employeeInfo.getIdProvince())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.ID_PROVINCE));
}
if (Common.isEmpty(employeeInfo.getEmpRegisType())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.EMP_REGIS_TYPE));
}
if (Common.isEmpty(employeeInfo.getFileProvince())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.FILE_PROVINCE));
}
if (Common.isEmpty(employeeInfo.getContactAddress())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.CONTACT_ADDRESS));
}
if (Common.isNotNull(employeeInfo.getIsCollege())
&& CommonConstants.IS_TRUE.equals(employeeInfo.getIsCollege())) {
// 3.员工类型为外包和派遣,并且是否大专及以上为是,再增加必填项:最高学历、学校、专业、入学时间、毕业时间
if (Common.isEmpty(employeeInfo.getHignEducation())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.HIGN_EDUCATION));
}
if (Common.isEmpty(employeeInfo.getSchool())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.SCHOOL));
}
if (Common.isEmpty(employeeInfo.getMajor())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.MAJOR));
}
if (Common.isEmpty(employeeInfo.getAdmissionDate())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.ADMISSION_DATE));
}
if (Common.isEmpty(employeeInfo.getGradutionDate())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.GRADUTION_DATE));
}
}
}
}
// 更新学历-房
private void saveOrUpdateEducation(List<TEmployeeInfo> saveList) {
TEmpEducation education;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment