Commit 8633f077 authored by fangxinjiang's avatar fangxinjiang

入离职导入限制-fxj

parent 6bf43d86
......@@ -2152,23 +2152,25 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (Common.isEmpty(checkRes) || checkRes.getCode() != CommonConstants.SUCCESS){
return checkRes.getMsg();
}
EmployeeRegistration exit = baseMapper.selectOne(Wrappers.<EmployeeRegistration>query().lambda()
// 查询该员工在该项目下最新的入职登记记录(不限状态)
EmployeeRegistration latestExit = baseMapper.selectOne(Wrappers.<EmployeeRegistration>query().lambda()
.eq(EmployeeRegistration::getEmpIdcard, registration.getEmpIdcard())
.eq(EmployeeRegistration::getDeptNo, registration.getDeptNo())
.eq(EmployeeRegistration::getFeedbackType, registration.getFeedbackType())
.orderByDesc(EmployeeRegistration::getCreateTime)
.in(EmployeeRegistration::getProcessStatus, CommonConstants.processStatus)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exit)) {
// 如果存在历史记录,根据不同状态处理
if (Common.isNotNull(latestExit)) {
String processStatus = latestExit.getProcessStatus();
// 状态为待处理(0)或已接收(1) → 拦截重复登记
if (CommonConstants.processStatus.contains(processStatus)) {
return RegistConstants.REGIST_SAME_CHECK;
}
//针对入职的判断
if (CommonConstants.ONE_STRING.equals(registration.getFeedbackType())) {
int nowDay = Integer.parseInt(DateUtil.getThisDay());
if (Common.isNot16Age(registration.getEmpIdcard(), nowDay)) {
return CommonConstants.UNDER_16_ERROR;
}
//针对入职的判断是否存在在项项目档案
// 状态为已处理(2) → 需要校验项目档案
if (CommonConstants.TWO_STRING.equals(processStatus)) {
EmpProjectStatusVo vo = new EmpProjectStatusVo();
vo.setEmpIdcard(registration.getEmpIdcard());
vo.setDeptNo(registration.getDeptNo());
......@@ -2177,6 +2179,16 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
return RegistConstants.EMP_PROJECT_IS_EXIT_CHECK;
}
}
// 其他状态(如拒绝入职3、已离职等)→ 允许重新登记,不校验项目档案
}
//针对入职的其他判断
if (CommonConstants.ONE_STRING.equals(registration.getFeedbackType())) {
int nowDay = Integer.parseInt(DateUtil.getThisDay());
if (Common.isNot16Age(registration.getEmpIdcard(), nowDay)) {
return CommonConstants.UNDER_16_ERROR;
}
}
//针对离职的判断人员项目档案状态是否正常
if (CommonConstants.TWO_STRING.equals(registration.getFeedbackType())) {
EmpProjectStatusVo vo = new EmpProjectStatusVo();
......@@ -3194,15 +3206,19 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
.eq(EmployeeRegistration::getEmpIdcard, insert.getEmpIdcard())
.eq(EmployeeRegistration::getDeptNo, insert.getDeptNo())
.eq(EmployeeRegistration::getFeedbackType, insert.getFeedbackType())
.in(EmployeeRegistration::getProcessStatus, CommonConstants.processStatus)
.orderByDesc(EmployeeRegistration::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
// 如果存在历史记录,根据不同状态处理
if (Common.isNotNull(exit)) {
String processStatus = exit.getProcessStatus();
// 状态为待处理(0)或已接收(1) → 拦截重复登记
if (CommonConstants.processStatus.contains(processStatus)) {
errorList.add(RegistConstants.REGIST_SAME_CHECK);
}
//针对入职的判断是否存在在项项目档案
if (CommonConstants.ONE_STRING.equals(insert.getFeedbackType())) {
// 状态为已处理(2) → 需要校验项目档案
else if (CommonConstants.TWO_STRING.equals(processStatus)) {
EmpProjectStatusVo vo = new EmpProjectStatusVo();
vo.setEmpIdcard(insert.getEmpIdcard());
vo.setDeptNo(insert.getDeptNo());
......@@ -3211,6 +3227,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
errorList.add(RegistConstants.EMP_PROJECT_IS_EXIT_CHECK);
}
}
// 其他状态(如拒绝入职3、已离职等)→ 允许重新登记,不校验项目档案
}
//针对离职的判断人员项目档案状态是否正常(前置条件:项目存在)
if (CommonConstants.TWO_STRING.equals(insert.getFeedbackType()) && Common.isNotNull(selectVo)) {
......
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