Commit a0f5cf38 authored by fangxinjiang's avatar fangxinjiang

区域调整

parent ac5ee37d
...@@ -73,9 +73,12 @@ public class TEmpDisabilityInfoServiceImpl extends ServiceImpl<TEmpDisabilityInf ...@@ -73,9 +73,12 @@ public class TEmpDisabilityInfoServiceImpl extends ServiceImpl<TEmpDisabilityInf
@Override @Override
public void importTmpDisability(List<EmpDisabilityExcelVO> excelVOList, List<ErrorMessage> errorMessageList) { public void importTmpDisability(List<EmpDisabilityExcelVO> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑 // 个性化校验逻辑
List<TEmpDisabilityInfo> list = this.list(Wrappers.<TEmpDisabilityInfo>query().lambda() List<TEmpDisabilityInfo> list = null;
.in(TEmpDisabilityInfo::getEmpIdcard,excelVOList.stream().map(EmpDisabilityExcelVO::getEmpIdcard).collect(Collectors.toList())) if (Common.isNotNull(excelVOList)){
.eq(TEmpDisabilityInfo::getDeleteFlag,CommonConstants.ZERO_STRING)); this.list(Wrappers.<TEmpDisabilityInfo>query().lambda()
.in(TEmpDisabilityInfo::getEmpIdcard,excelVOList.stream().map(EmpDisabilityExcelVO::getEmpIdcard).collect(Collectors.toList()))
.eq(TEmpDisabilityInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
}
TEmployeeInfo emp; TEmployeeInfo emp;
TEmpDisabilityInfo exist; TEmpDisabilityInfo exist;
ErrorMessage errorMsg; ErrorMessage errorMsg;
...@@ -114,12 +117,14 @@ public class TEmpDisabilityInfoServiceImpl extends ServiceImpl<TEmpDisabilityInf ...@@ -114,12 +117,14 @@ public class TEmpDisabilityInfoServiceImpl extends ServiceImpl<TEmpDisabilityInf
if (CommonConstants.ONE_STRING.equals(Integer.toString(emp.getFileStatus()))){ if (CommonConstants.ONE_STRING.equals(Integer.toString(emp.getFileStatus()))){
return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED)); return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED));
} }
// 检查添加是否已经存在 if (Common.isNotNull(list)){
boolean match = list.stream().anyMatch(info -> excel.getDisabilityName().equals(info.getDisabilityName()) // 检查添加是否已经存在
&& excel.getEmpIdcard().equals(info.getEmpIdcard())); boolean match = list.stream().anyMatch(info -> excel.getDisabilityName().equals(info.getDisabilityName())
&& excel.getEmpIdcard().equals(info.getEmpIdcard()));
if (match) { if (match) {
return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_DISABILITY_NAME_EXISTING)); return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_DISABILITY_NAME_EXISTING));
}
} }
return null; return null;
} }
......
...@@ -76,9 +76,12 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T ...@@ -76,9 +76,12 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T
@Override @Override
public void importEmpEducation(List<EmpEducationExcelVO> excelVOList, List<ErrorMessage> errorMessageList) { public void importEmpEducation(List<EmpEducationExcelVO> excelVOList, List<ErrorMessage> errorMessageList) {
/// 个性化校验逻辑 /// 个性化校验逻辑
List<TEmpEducation> list = this.list(Wrappers.<TEmpEducation>query().lambda() List<TEmpEducation> list = null;
.in(TEmpEducation::getEmpIdcard,excelVOList.stream().map(EmpEducationExcelVO::getEmpIdcard).collect(Collectors.toList())) if (Common.isNotNull(excelVOList)){
.eq(TEmpEducation::getDeleteFlag,CommonConstants.ZERO_STRING)); this.list(Wrappers.<TEmpEducation>query().lambda()
.in(TEmpEducation::getEmpIdcard,excelVOList.stream().map(EmpEducationExcelVO::getEmpIdcard).collect(Collectors.toList()))
.eq(TEmpEducation::getDeleteFlag,CommonConstants.ZERO_STRING));
}
TEmployeeInfo emp; TEmployeeInfo emp;
TEmpEducation exist; TEmpEducation exist;
ErrorMessage errorMsg; ErrorMessage errorMsg;
...@@ -218,12 +221,14 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T ...@@ -218,12 +221,14 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T
&& CommonConstants.ONE_STRING.equals(Integer.toString(emp.getFileStatus()))){ && CommonConstants.ONE_STRING.equals(Integer.toString(emp.getFileStatus()))){
return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED)); return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED));
} }
// 检查添加是否已经存在 if (Common.isNotNull(list)){
boolean match = list.stream().anyMatch(info -> excel.getEducationName().equals(info.getEducationName()) // 检查添加是否已经存在
&& excel.getEmpIdcard().equals(info.getEmpIdcard())); boolean match = list.stream().anyMatch(info -> excel.getEducationName().equals(info.getEducationName())
&& excel.getEmpIdcard().equals(info.getEmpIdcard()));
if (match) { if (match) {
return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_EDUCATION_EXISTING)); return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_EDUCATION_EXISTING));
}
} }
return null; return null;
} }
......
...@@ -75,9 +75,12 @@ public class TEmpFamilyServiceImpl extends ServiceImpl<TEmpFamilyMapper, TEmpFam ...@@ -75,9 +75,12 @@ public class TEmpFamilyServiceImpl extends ServiceImpl<TEmpFamilyMapper, TEmpFam
@Override @Override
public void importEmpFamily(List<EmpFamilyExcelVO> excelVOList,List<ErrorMessage> errorMessageList) { public void importEmpFamily(List<EmpFamilyExcelVO> excelVOList,List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑 // 个性化校验逻辑
List<TEmpFamily> list = this.list(Wrappers.<TEmpFamily>query().lambda() List<TEmpFamily> list = null;
.in(TEmpFamily::getEmpIdcard,excelVOList.stream().map(EmpFamilyExcelVO::getEmpIdcard).collect(Collectors.toList())) if (Common.isNotNull(excelVOList)){
.eq(TEmpFamily::getDeleteFlag,CommonConstants.ZERO_STRING)); this.list(Wrappers.<TEmpFamily>query().lambda()
.in(TEmpFamily::getEmpIdcard,excelVOList.stream().map(EmpFamilyExcelVO::getEmpIdcard).collect(Collectors.toList()))
.eq(TEmpFamily::getDeleteFlag,CommonConstants.ZERO_STRING));
}
TEmployeeInfo emp; TEmployeeInfo emp;
TEmpFamily exist; TEmpFamily exist;
ErrorMessage errorMsg; ErrorMessage errorMsg;
...@@ -118,12 +121,14 @@ public class TEmpFamilyServiceImpl extends ServiceImpl<TEmpFamilyMapper, TEmpFam ...@@ -118,12 +121,14 @@ public class TEmpFamilyServiceImpl extends ServiceImpl<TEmpFamilyMapper, TEmpFam
return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED)); return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED));
} }
// 检查添加是否已经存在 if (Common.isNotNull(list)){
boolean match = list.stream().anyMatch(info -> excel.getFamilyName().equals(info.getFamilyName()) // 检查添加是否已经存在
&& excel.getEmpIdcard().equals(info.getEmpIdcard())); boolean match = list.stream().anyMatch(info -> excel.getFamilyName().equals(info.getFamilyName())
&& excel.getEmpIdcard().equals(info.getEmpIdcard()));
if (match) { if (match) {
return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_FAMILY_NAME_EXISTING)); return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_FAMILY_NAME_EXISTING));
}
} }
return null; return null;
} }
......
...@@ -94,9 +94,12 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr ...@@ -94,9 +94,12 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
@Override @Override
public void importEmpCertificate(List<EmpCertificateExcelVO> excelVOList, List<ErrorMessage> errorMessageList) { public void importEmpCertificate(List<EmpCertificateExcelVO> excelVOList, List<ErrorMessage> errorMessageList) {
List<TEmpProfessionalQualification> list = this.list(Wrappers.<TEmpProfessionalQualification>query().lambda() List<TEmpProfessionalQualification> list = null;
.in(TEmpProfessionalQualification::getEmpIdcard,excelVOList.stream().map(EmpCertificateExcelVO::getEmpIdcard).collect(Collectors.toList())) if (Common.isNotNull(excelVOList)){
.eq(TEmpProfessionalQualification::getDeleteFlag,CommonConstants.ZERO_STRING)); list = this.list(Wrappers.<TEmpProfessionalQualification>query().lambda()
.in(TEmpProfessionalQualification::getEmpIdcard,excelVOList.stream().map(EmpCertificateExcelVO::getEmpIdcard).collect(Collectors.toList()))
.eq(TEmpProfessionalQualification::getDeleteFlag,CommonConstants.ZERO_STRING));
}
TEmployeeInfo emp; TEmployeeInfo emp;
TEmpProfessionalQualification exist; TEmpProfessionalQualification exist;
ErrorMessage errorMsg; ErrorMessage errorMsg;
...@@ -119,6 +122,7 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr ...@@ -119,6 +122,7 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
continue; continue;
} }
excel.setEmpName(emp.getEmpName()); excel.setEmpName(emp.getEmpName());
excel.setEmpIdcard(emp.getEmpIdcard());
exist = baseMapper.selectOne(Wrappers.<TEmpProfessionalQualification>query().lambda() exist = baseMapper.selectOne(Wrappers.<TEmpProfessionalQualification>query().lambda()
.eq(TEmpProfessionalQualification::getEmpIdcard,excel.getEmpIdcard()) .eq(TEmpProfessionalQualification::getEmpIdcard,excel.getEmpIdcard())
.eq(TEmpProfessionalQualification::getQualificationLevel,excel.getQualificationLevel()) .eq(TEmpProfessionalQualification::getQualificationLevel,excel.getQualificationLevel())
...@@ -152,14 +156,16 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr ...@@ -152,14 +156,16 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
if (CommonConstants.ONE_STRING.equals(Integer.toString(emp.getFileStatus()))){ if (CommonConstants.ONE_STRING.equals(Integer.toString(emp.getFileStatus()))){
return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED)); return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED));
} }
// 检查添加是否已经存在 if (Common.isNotNull(list)){
boolean match = list.stream().anyMatch(info -> excel.getQualificationLevel() // 检查添加是否已经存在
.equals(info.getQualificationLevel()) boolean match = list.stream().anyMatch(info -> excel.getQualificationLevel()
&& excel.getEmpIdcard().equals(info.getEmpIdcard()) .equals(info.getQualificationLevel())
&& excel.getQualificationType().equals(info.getQualificationType())); && excel.getEmpIdcard().equals(info.getEmpIdcard())
&& excel.getQualificationType().equals(info.getQualificationType()));
if (match) { if (match) {
return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_CERTIFICATE_NAME_EXISTING)); return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_CERTIFICATE_NAME_EXISTING));
}
} }
return null; return null;
} }
......
...@@ -68,9 +68,12 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM ...@@ -68,9 +68,12 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM
@Override @Override
public void importEmpWorkRecord(List<EmpWorkRecordExcelVO> excelVOList, List<ErrorMessage> errorMessageList) { public void importEmpWorkRecord(List<EmpWorkRecordExcelVO> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑 // 个性化校验逻辑
List<TEmpWorkRecording> list = this.list(Wrappers.<TEmpWorkRecording>query().lambda() List<TEmpWorkRecording> list =null;
.in(TEmpWorkRecording::getEmpIdcard,excelVOList.stream().map(EmpWorkRecordExcelVO::getEmpIdcard).collect(Collectors.toList())) if (Common.isNotNull(excelVOList)){
.eq(TEmpWorkRecording::getDeleteFlag,CommonConstants.ZERO_STRING)); this.list(Wrappers.<TEmpWorkRecording>query().lambda()
.in(TEmpWorkRecording::getEmpIdcard,excelVOList.stream().map(EmpWorkRecordExcelVO::getEmpIdcard).collect(Collectors.toList()))
.eq(TEmpWorkRecording::getDeleteFlag,CommonConstants.ZERO_STRING));
}
TEmployeeInfo emp; TEmployeeInfo emp;
TEmpWorkRecording exist; TEmpWorkRecording exist;
ErrorMessage errorMsg; ErrorMessage errorMsg;
...@@ -155,13 +158,15 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM ...@@ -155,13 +158,15 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM
if (CommonConstants.ONE_STRING.equals(Integer.toString(emp.getFileStatus()))){ if (CommonConstants.ONE_STRING.equals(Integer.toString(emp.getFileStatus()))){
return new com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED)); return new com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED));
} }
// 检查添加是否已经存在 if (Common.isNotNull(list)){
boolean match = list.stream().anyMatch(info -> excel.getWorkDepart().equals(info.getWorkDepart()) // 检查添加是否已经存在
&& excel.getWorkUnit().equals(info.getWorkUnit()) boolean match = list.stream().anyMatch(info -> excel.getWorkDepart().equals(info.getWorkDepart())
&& excel.getEmpIdcard().equals(info.getEmpIdcard())); && excel.getWorkUnit().equals(info.getWorkUnit())
&& excel.getEmpIdcard().equals(info.getEmpIdcard()));
if (match) { if (match) {
return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_WORK_RECORD_EXISTING)); return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_WORK_RECORD_EXISTING));
}
} }
return null; return null;
} }
......
...@@ -53,7 +53,7 @@ public class GlobalExceptionHandler { ...@@ -53,7 +53,7 @@ public class GlobalExceptionHandler {
* @ExceptionHandler:当这个Controller中任何一个方法发生异常,一定会被这个方法拦截到 * @ExceptionHandler:当这个Controller中任何一个方法发生异常,一定会被这个方法拦截到
*/ */
@ExceptionHandler(Exception.class) @ExceptionHandler(Exception.class)
//@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseBody @ResponseBody
public R exception(Exception e) { public R exception(Exception e) {
errorLog( e ); errorLog( e );
......
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