Commit 49bc5ae1 authored by huyuchen's avatar huyuchen

优化修改

parent 14489e65
...@@ -725,30 +725,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -725,30 +725,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeInfoMapper.updateById(tEmployeeInfo); tEmployeeInfoMapper.updateById(tEmployeeInfo);
} }
} else { } else {
//先停用项目内的其他的员工合同————不要这个逻辑了
// 2022-7-22 16:54:12 产品倩倩与测试说,作废终止审核通过,仅将原先选择的合同不在用即可
//baseMapper.updateInUseStatusById(contractInfo.getEmpId(), contractInfo.getSettleDomain(), contractInfo.getId(), CommonConstants.ONE_STRING)
if (Common.isNotNull(contractInfo.getOldContractId())) {
TEmployeeContractInfo old = this.getById(contractInfo.getOldContractId());
if (old != null && Common.isNotNull(old.getId())) {
if (!CommonConstants.ZERO_STRING.equals(old.getInUse())) {
return R.failed("关联的原合同已不在用");
} else {
old.setInUse(CommonConstants.ONE_STRING);
this.updateById(old);
}
} else {
return R.failed("未找到关联的原合同");
}
} else {
return R.failed("未找到关联的原合同");
}
//同步任务处理清单执行详情
StringBuilder workInfo = new StringBuilder();
StringBuilder failueInfo = new StringBuilder();
//是否同步终止合同、减项、减档为是的时候 单独写逻辑 //是否同步终止合同、减项、减档为是的时候 单独写逻辑
if (EmployeeConstants.SITUATION_SIX.equals(contractInfo.getSituation()) if (EmployeeConstants.SITUATION_SEVEN.equals(contractInfo.getSituation())
&& CommonConstants.ONE_STRING.equals(contractInfo.getChangeContractAndEmployee())) { && CommonConstants.ZERO_STRING.equals(contractInfo.getChangeContractAndEmployee())) {
//同步任务处理清单执行详情
StringBuilder workInfo = new StringBuilder();
StringBuilder failueInfo = new StringBuilder();
workInfo.append("合同终止成功,"); workInfo.append("合同终止成功,");
//该项目下其他在用的合同统一更新成不在用 //该项目下其他在用的合同统一更新成不在用
List<TEmployeeContractInfo> contractInfoList = baseMapper.selectList(Wrappers.<TEmployeeContractInfo>query() List<TEmployeeContractInfo> contractInfoList = baseMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
...@@ -837,6 +819,24 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -837,6 +819,24 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
handlerInfo.setOperTime(LocalDateTime.now()); handlerInfo.setOperTime(LocalDateTime.now());
workHandlerInfoService.save(handlerInfo); workHandlerInfoService.save(handlerInfo);
} else { } else {
//先停用项目内的其他的员工合同————不要这个逻辑了
// 2022-7-22 16:54:12 产品倩倩与测试说,作废终止审核通过,仅将原先选择的合同不在用即可
//baseMapper.updateInUseStatusById(contractInfo.getEmpId(), contractInfo.getSettleDomain(), contractInfo.getId(), CommonConstants.ONE_STRING)
if (Common.isNotNull(contractInfo.getOldContractId())) {
TEmployeeContractInfo old = this.getById(contractInfo.getOldContractId());
if (old != null && Common.isNotNull(old.getId())) {
if (!CommonConstants.ZERO_STRING.equals(old.getInUse())) {
return R.failed("关联的原合同已不在用");
} else {
old.setInUse(CommonConstants.ONE_STRING);
this.updateById(old);
}
} else {
return R.failed("未找到关联的原合同");
}
} else {
return R.failed("未找到关联的原合同");
}
// 作废、终止审核通过: // 作废、终止审核通过:
// 更新项目合同状态为(2不在用),档案状态要判断 // 更新项目合同状态为(2不在用),档案状态要判断
TEmployeeProject tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query() TEmployeeProject tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query()
...@@ -1632,36 +1632,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1632,36 +1632,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeInfoMapper.updateById(tEmployeeInfo); tEmployeeInfoMapper.updateById(tEmployeeInfo);
} }
} else { } else {
//先停用项目内的其他的员工合同————不要这个逻辑了
// 2022-7-22 16:54:12 产品倩倩与测试说,作废终止审核通过,仅将原先选择的合同不在用即可
if (Common.isNotNull(contract.getOldContractId())) {
TEmployeeContractInfo old = this.getById(contract.getOldContractId());
if (old != null && Common.isNotNull(old.getId())) {
if (!CommonConstants.ZERO_STRING.equals(old.getInUse())) {
errorMessages.add(new ErrorMessage(i, "关联的原合同已不在用!", CommonConstants.RED, contract.getApplyNo()));
errorCount++;
continue;
} else {
old.setInUse(CommonConstants.ONE_STRING);
this.updateById(old);
}
} else {
errorMessages.add(new ErrorMessage(i, "未找到关联的原合同!", CommonConstants.RED, contract.getApplyNo()));
errorCount++;
continue;
}
} else {
errorMessages.add(new ErrorMessage(i, "未找到关联的原合同!", CommonConstants.RED, contract.getApplyNo()));
errorCount++;
continue;
}
//同步任务处理清单执行详情
StringBuilder workInfo = new StringBuilder();
StringBuilder failueInfo = new StringBuilder();
//是否同步终止合同、减项、减档为是的时候 单独写逻辑 //是否同步终止合同、减项、减档为是的时候 单独写逻辑
if (EmployeeConstants.SITUATION_SIX.equals(contract.getSituation()) if (EmployeeConstants.SITUATION_SEVEN.equals(contract.getSituation())
&& CommonConstants.ONE_STRING.equals(contract.getChangeContractAndEmployee())) { && CommonConstants.ZERO_STRING.equals(contract.getChangeContractAndEmployee())) {
//同步任务处理清单执行详情
StringBuilder workInfo = new StringBuilder();
StringBuilder failueInfo = new StringBuilder();
workInfo.append("合同终止成功,"); workInfo.append("合同终止成功,");
//该项目下其他在用的合同统一更新成不在用 //该项目下其他在用的合同统一更新成不在用
contractInfoList = baseMapper.selectList(Wrappers.<TEmployeeContractInfo>query() contractInfoList = baseMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
...@@ -1750,39 +1726,62 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1750,39 +1726,62 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
handlerInfo.setOperTime(LocalDateTime.now()); handlerInfo.setOperTime(LocalDateTime.now());
workHandlerInfoService.save(handlerInfo); workHandlerInfoService.save(handlerInfo);
} else{ } else{
// 作废、终止审核通过: //先停用项目内的其他的员工合同————不要这个逻辑了
// 更新项目合同状态为(2不在用),档案状态要判断 // 2022-7-22 16:54:12 产品倩倩与测试说,作废终止审核通过,仅将原先选择的合同不在用即可
tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query() if (Common.isNotNull(contract.getOldContractId())) {
.lambda().eq(TEmployeeProject::getEmpId, contract.getEmpId()) TEmployeeContractInfo old = this.getById(contract.getOldContractId());
.eq(TEmployeeProject::getDeptId, contract.getSettleDomain()) if (old != null && Common.isNotNull(old.getId())) {
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT) if (!CommonConstants.ZERO_STRING.equals(old.getInUse())) {
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL) errorMessages.add(new ErrorMessage(i, "关联的原合同已不在用!", CommonConstants.RED, contract.getApplyNo()));
.last(CommonConstants.LAST_ONE_SQL)); errorCount++;
if (tEmployeeProject != null) { continue;
tEmployeeProject.setContractStatus(CommonConstants.TWO_INT);
tEmployeeProjectService.updateById(tEmployeeProject);
}
// 更新档案、项目合同状态为(0无合同 1在用 2不在用)
tEmployeeInfo = tEmployeeInfoMapper.selectById(contract.getEmpId());
if (tEmployeeInfo != null) {
// 判断人员有无审核通过的其他合同
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 { } else {
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT); old.setInUse(CommonConstants.ONE_STRING);
this.updateById(old);
} }
tEmployeeInfoMapper.updateById(tEmployeeInfo); } else {
errorMessages.add(new ErrorMessage(i, "未找到关联的原合同!", CommonConstants.RED, contract.getApplyNo()));
errorCount++;
continue;
} }
} else {
errorMessages.add(new ErrorMessage(i, "未找到关联的原合同!", CommonConstants.RED, contract.getApplyNo()));
errorCount++;
continue;
}
// 作废、终止审核通过:
// 更新项目合同状态为(2不在用),档案状态要判断
tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query()
.lambda().eq(TEmployeeProject::getEmpId, contract.getEmpId())
.eq(TEmployeeProject::getDeptId, contract.getSettleDomain())
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.last(CommonConstants.LAST_ONE_SQL));
if (tEmployeeProject != null) {
tEmployeeProject.setContractStatus(CommonConstants.TWO_INT);
tEmployeeProjectService.updateById(tEmployeeProject);
}
// 更新档案、项目合同状态为(0无合同 1在用 2不在用)
tEmployeeInfo = tEmployeeInfoMapper.selectById(contract.getEmpId());
if (tEmployeeInfo != null) {
// 判断人员有无审核通过的其他合同
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);
}
tEmployeeInfoMapper.updateById(tEmployeeInfo);
} }
} }
}
} }
// 不是待提交,记录审核记录 // 不是待提交,记录审核记录
this.setAuditInfo(tEmployeeContractInfo); this.setAuditInfo(tEmployeeContractInfo);
......
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