Commit 1da50ef6 authored by hongguangwu's avatar hongguangwu

MVP1.7.17-离职待办-优化代码

parent aa6997cb
...@@ -115,6 +115,7 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac ...@@ -115,6 +115,7 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
String getContractByEmpIdCardAndDeptId(@Param("empIdCard") String empIdCard, @Param("deptId") String deptId); String getContractByEmpIdCardAndDeptId(@Param("empIdCard") String empIdCard, @Param("deptId") String deptId);
String getContractByEmpIdCardAndDeptNo(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo); String getContractByEmpIdCardAndDeptNo(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
String getContractByEmpIdCardAndDeptNoByEnd(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
String getMinDateByCardAndDeptId(@Param("vo") IdNameNoVo vo); String getMinDateByCardAndDeptId(@Param("vo") IdNameNoVo vo);
......
...@@ -204,5 +204,7 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract ...@@ -204,5 +204,7 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
// 获取合同ID,在用,已审核 // 获取合同ID,在用,已审核
String getContractByEmpIdCardAndDeptNo(String empIdCard, String deptNo); String getContractByEmpIdCardAndDeptNo(String empIdCard, String deptNo);
// 查找最近的终止合同
String getContractByEmpIdCardAndDeptNoByEnd(String empIdCard, String deptNo);
} }
...@@ -2277,6 +2277,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -2277,6 +2277,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
public String getContractByEmpIdCardAndDeptNo(String empIdCard, String deptNo) { public String getContractByEmpIdCardAndDeptNo(String empIdCard, String deptNo) {
return baseMapper.getContractByEmpIdCardAndDeptNo(empIdCard, deptNo); return baseMapper.getContractByEmpIdCardAndDeptNo(empIdCard, deptNo);
} }
@Override
public String getContractByEmpIdCardAndDeptNoByEnd(String empIdCard, String deptNo) {
return baseMapper.getContractByEmpIdCardAndDeptNoByEnd(empIdCard, deptNo);
}
@Override @Override
public String getMinDateByCardAndDeptId(IdNameNoVo vo) { public String getMinDateByCardAndDeptId(IdNameNoVo vo) {
......
...@@ -4769,6 +4769,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -4769,6 +4769,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(contractId)) { if (Common.isNotNull(contractId)) {
returnVo.setResultIdThree(contractId); returnVo.setResultIdThree(contractId);
returnVo.setResultIdThreeStatus("可用"); returnVo.setResultIdThreeStatus("可用");
} else {
// 如果没有可用的,查找终止的,放在离职待办的详情里
contractId = contractServicer.getContractByEmpIdCardAndDeptNoByEnd(paramVo.getEmpIdCard(), paramVo.getDeptNo());
returnVo.setResultIdFour(contractId);
} }
} }
return returnVo; return returnVo;
......
...@@ -878,6 +878,15 @@ ...@@ -878,6 +878,15 @@
and e.DELETE_FLAG = '0' and e.AUDIT_STATUS = '2' AND e.IN_USE = '0' and e.DELETE_FLAG = '0' and e.AUDIT_STATUS = '2' AND e.IN_USE = '0'
limit 1 limit 1
</select> </select>
<!-- 查找最近一次终止的合同 -->
<select id="getContractByEmpIdCardAndDeptNoByEnd" resultType="java.lang.String">
select
e.id
from t_employee_contract_info e
where e.EMP_IDCARD = #{empIdCard} and e.DEPT_NO = #{deptNo}
and e.DELETE_FLAG = '0' and e.AUDIT_STATUS = '2' AND e.IN_USE = '1' and e.SITUATION = '终止'
ORDER BY e.CREATE_TIME desc limit 1
</select>
<!-- 获取最小的审核通过的合同,税友自动生成 离职证明书使用 --> <!-- 获取最小的审核通过的合同,税友自动生成 离职证明书使用 -->
<select id="getMinDateByCardAndDeptId" resultType="java.lang.String"> <select id="getMinDateByCardAndDeptId" resultType="java.lang.String">
......
...@@ -604,6 +604,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -604,6 +604,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
logInfo.append("商险;"); logInfo.append("商险;");
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusInsurance()) if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusInsurance())
&& !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusInsurance())) { && !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusInsurance())) {
leave.setInsuranceId(leave.getInsuranceIdOld());
leave.setCloseRemarkInsurance(remark); leave.setCloseRemarkInsurance(remark);
leave.setDoStatusInsurance(CommonConstants.ONE_STRING); leave.setDoStatusInsurance(CommonConstants.ONE_STRING);
} else { } else {
...@@ -614,6 +615,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -614,6 +615,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
logInfo.append("人员档案;"); logInfo.append("人员档案;");
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusEmp()) if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusEmp())
&& !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusEmp())) { && !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusEmp())) {
leave.setEmpId(leave.getEmpIdOld());
leave.setCloseRemarkEmp(remark); leave.setCloseRemarkEmp(remark);
leave.setDoStatusEmp(CommonConstants.ONE_STRING); leave.setDoStatusEmp(CommonConstants.ONE_STRING);
...@@ -656,9 +658,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -656,9 +658,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
&& !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusSocial())) { && !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusSocial())) {
if (Common.isEmpty(socialDispatchId)) { if (Common.isEmpty(socialDispatchId)) {
errorInfo.append("社保未派减完结!"); errorInfo.append("社保未派减完结!");
} else {
leave.setSocialId(socialDispatchId);
leave.setDoStatusSocial(CommonConstants.ONE_STRING);
leave.setCloseRemarkSocial(closeRemark);
} }
leave.setDoStatusSocial(CommonConstants.ONE_STRING);
leave.setCloseRemarkSocial(closeRemark);
} else { } else {
errorInfo.append("社保状态已完结,不可处理!"); errorInfo.append("社保状态已完结,不可处理!");
} }
...@@ -669,9 +673,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -669,9 +673,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
&& !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusFund())) { && !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusFund())) {
if (Common.isEmpty(fundDispatchId)) { if (Common.isEmpty(fundDispatchId)) {
errorInfo.append("公积金未派减完结!"); errorInfo.append("公积金未派减完结!");
} else {
leave.setFundId(fundDispatchId);
leave.setDoStatusFund(CommonConstants.ONE_STRING);
leave.setCloseRemarkFund(closeRemark);
} }
leave.setDoStatusFund(CommonConstants.ONE_STRING);
leave.setCloseRemarkFund(closeRemark);
} else { } else {
errorInfo.append("公积金状态已完结,不可处理!"); errorInfo.append("公积金状态已完结,不可处理!");
} }
...@@ -691,9 +697,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -691,9 +697,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
// 这个反着查的,有未减完的,表示不可以关闭它,只能忽略它 // 这个反着查的,有未减完的,表示不可以关闭它,只能忽略它
if (Common.isNotNull(insuranceId)) { if (Common.isNotNull(insuranceId)) {
errorInfo.append("商险未派减完结!"); errorInfo.append("商险未派减完结!");
} else {
leave.setInsuranceId(leave.getInsuranceIdOld());
leave.setDoStatusInsurance(CommonConstants.ONE_STRING);
leave.setCloseRemarkInsurance(closeRemark);
} }
leave.setDoStatusInsurance(CommonConstants.ONE_STRING);
leave.setCloseRemarkInsurance(closeRemark);
} else { } else {
errorInfo.append("商险状态已完结,不可处理!"); errorInfo.append("商险状态已完结,不可处理!");
} }
...@@ -701,20 +709,28 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -701,20 +709,28 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
if (doTypeYi.contains(CommonConstants.FOUR_STRING)) { if (doTypeYi.contains(CommonConstants.FOUR_STRING)) {
logInfo.append("合同;"); logInfo.append("合同;");
String contractId = ""; String contractId = "";
String contractIdEnd = "";
returnR = archivesDaprUtil.getEmpAndContractStatus(paramVo); returnR = archivesDaprUtil.getEmpAndContractStatus(paramVo);
if (null != returnR && Common.isNotNull(returnR.getData())) { if (null != returnR && Common.isNotNull(returnR.getData())) {
returnVo = returnR.getData(); returnVo = returnR.getData();
if (Common.isNotNull(returnVo.getResultIdThree())) { if (Common.isNotNull(returnVo.getResultIdThree())) {
contractId = returnVo.getResultIdThree(); contractId = returnVo.getResultIdThree();
contractIdEnd = returnVo.getResultIdFour();
} }
} }
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusContract()) if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusContract())
&& !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusContract())) { && !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusContract())) {
if (Common.isNotNull(contractId)) { if (Common.isNotNull(contractId)) {
errorInfo.append("存在可用的合同!"); errorInfo.append("存在可用的合同!");
} else {
if (Common.isNotNull(contractIdEnd)) {
leave.setContractId(contractIdEnd);
leave.setDoStatusContract(CommonConstants.ONE_STRING);
leave.setCloseRemarkContract(closeRemark);
} else {
errorInfo.append("未找到终止的合同!");
}
} }
leave.setDoStatusContract(CommonConstants.ONE_STRING);
leave.setCloseRemarkContract(closeRemark);
} else { } else {
errorInfo.append("合同状态已完结,不可处理!"); errorInfo.append("合同状态已完结,不可处理!");
} }
...@@ -1431,7 +1447,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1431,7 +1447,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
paramVoProject.setListParam(tempProject); paramVoProject.setListParam(tempProject);
R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceProject(paramVoProject); R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceProject(paramVoProject);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().getErrorMessageList().isEmpty()) { if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().getErrorMessageList().isEmpty()) {
projectParamList = listR.getData().getErrorMessageList(); projectParamList.addAll(listR.getData().getErrorMessageList());
} }
} }
if (!projectParamList.isEmpty()) { if (!projectParamList.isEmpty()) {
...@@ -1478,7 +1494,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1478,7 +1494,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
paramVoEmp.setListParam(tempEmp); paramVoEmp.setListParam(tempEmp);
R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceEmp(paramVoEmp); R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceEmp(paramVoEmp);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().getErrorMessageList().isEmpty()) { if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().getErrorMessageList().isEmpty()) {
empParamList = listR.getData().getErrorMessageList(); empParamList.addAll(listR.getData().getErrorMessageList());
} }
} }
if (!empParamList.isEmpty()) { if (!empParamList.isEmpty()) {
......
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