Commit b8db5af9 authored by huyuchen's avatar huyuchen

优化修改

parent 708cb2e6
......@@ -613,11 +613,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
* @Date: 2023/6/16 10:16
* @return: void
**/
private void setAuditInfoNew(TEmployeeContractInfo tEmployeeContractInfo,String flag) {
private void setAuditInfoNew(TEmployeeContractInfo tEmployeeContractInfo) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("合同审核");
audit.setAuditStatus(CommonConstants.ZERO_STRING.equals(flag) ? "审核通过" : "审核不通过");
audit.setRemark("终止合同联动");
audit.setRootName("终止合同联动");
audit.setLinkId(tEmployeeContractInfo.getId());
audit.setLinkType(CommonConstants.ONE_INT);
tEmployeeContractAuditService.save(audit);
......@@ -761,7 +759,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
contractInfo1.setAuditUserName(user.getNickname());
baseMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1,CommonConstants.ZERO_STRING);
this.setAuditInfoNew(contractInfo1);
}
}
//在途的合同更新为审核不通过
......@@ -777,7 +775,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
contractInfo1.setAuditUserName(user.getNickname());
baseMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1,CommonConstants.ONE_STRING);
this.setAuditInfoNew(contractInfo1);
}
}
//项目档案处理
......@@ -810,7 +808,19 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT && Common.isNotNull(tEmployeeInfo)) {
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
// 判断人员有无审核通过的其他合同
TEmployeeContractInfo contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpId, contractInfo.getEmpId())
.and(obj -> obj.ge(TEmployeeContractInfo::getContractEnd, DateUtil.getThisDayByPatten("yyyy-MM-dd"))
.or().isNull(TEmployeeContractInfo::getContractEnd))
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfoInUse != null) {
tEmployeeInfo.setContractStatus(CommonConstants.ONE_INT);
} else {
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
}
//减项成功把人员档案现存项目数减一
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
//减档
......@@ -1688,7 +1698,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
contractInfo1.setInUse(CommonConstants.ONE_STRING);
baseMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1, CommonConstants.ZERO_STRING);
this.setAuditInfoNew(contractInfo1);
}
}
//在途的合同更新为审核不通过
......@@ -1703,7 +1713,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
contractInfo1.setAuditStatus(CommonConstants.THREE_INT);
baseMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1, CommonConstants.ONE_STRING);
this.setAuditInfoNew(contractInfo1);
}
}
//项目档案处理
......@@ -1736,7 +1746,19 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT && Common.isNotNull(tEmployeeInfo)) {
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
// 判断人员有无审核通过的其他合同
contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpId, contract.getEmpId())
.and(obj -> obj.ge(TEmployeeContractInfo::getContractEnd, DateUtil.getThisDayByPatten("yyyy-MM-dd"))
.or().isNull(TEmployeeContractInfo::getContractEnd))
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfoInUse != null) {
tEmployeeInfo.setContractStatus(CommonConstants.ONE_INT);
} else {
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
}
//减项成功把人员档案现存项目数减一
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
//减档
......
......@@ -1406,7 +1406,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
contractInfo1.setAuditUserName(vo.getUserName());
contractInfoMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1, CommonConstants.ZERO_STRING);
this.setAuditInfoNew(contractInfo1);
}
}
//在途的合同更新为审核不通过
......@@ -1422,7 +1422,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
contractInfo1.setAuditUserName(vo.getUserName());
contractInfoMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1, CommonConstants.ONE_STRING);
this.setAuditInfoNew(contractInfo1);
}
}
//项目档案处理
......@@ -1834,11 +1834,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
* @Date: 2023/6/16 10:16
* @return: void
**/
private void setAuditInfoNew(TEmployeeContractInfo tEmployeeContractInfo,String flag) {
private void setAuditInfoNew(TEmployeeContractInfo tEmployeeContractInfo) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("合同审核");
audit.setAuditStatus(CommonConstants.ZERO_STRING.equals(flag) ? "审核通过" : "审核不通过");
audit.setRemark("终止合同联动");
audit.setRootName("社保派减联动减合同");
audit.setLinkId(tEmployeeContractInfo.getId());
audit.setLinkType(CommonConstants.ONE_INT);
tEmployeeContractAuditService.save(audit);
......
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