Commit 8c6f9cc7 authored by hongguangwu's avatar hongguangwu

1.5.7-划转,减项的可划转

parent c4441c0b
...@@ -172,6 +172,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -172,6 +172,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
errorMessageList.forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(),errorMessage)); errorMessageList.forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(),errorMessage));
} }
// 老项目已减项,划转后将删除 hgw 2023-8-22 10:47:41
List<TEmployeeProject> oldUpdateList = new ArrayList<>();
List<TEmployeeProject> updateList = new ArrayList<>(); List<TEmployeeProject> updateList = new ArrayList<>();
Set<String> errorMsg; Set<String> errorMsg;
//对象声明 //对象声明
...@@ -216,10 +218,14 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -216,10 +218,14 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
//待划转员工已在目标项目下不可划转 //待划转员工已在目标项目下不可划转
employeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda() employeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,excel.getNewSettleCode()) .eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,excel.getNewSettleCode())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL) .eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL));
.eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_INT));
if (Common.isNotNull(employeeProject)) { if (Common.isNotNull(employeeProject)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.CHECKS_CHANGE_EMP_PROJECT, excel.getNewSettleCode())); if (CommonConstants.ZERO_INT == employeeProject.getProjectStatus()) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.CHECKS_CHANGE_EMP_PROJECT, excel.getNewSettleCode()));
} else {
employeeProject.setDeleteFlag(CommonConstants.STATUS_DEL);
oldUpdateList.add(employeeProject);
}
} }
// 数据合法情况 // 数据合法情况
if (CollUtil.isEmpty(errorMsg)) { if (CollUtil.isEmpty(errorMsg)) {
...@@ -265,9 +271,15 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -265,9 +271,15 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
if (CollUtil.isNotEmpty(errorMessageList)) { if (CollUtil.isNotEmpty(errorMessageList)) {
return R.failed(errorMessageList); return R.failed(errorMessageList);
} else { } else {
// 将已减项的目标项目删除,免得出现两条同项目在项
if (!oldUpdateList.isEmpty()) {
tEmployeeProjectService.updateBatchById(oldUpdateList);
}
tEmployeeProjectService.updateBatchById(updateList); tEmployeeProjectService.updateBatchById(updateList);
// 循环里的申明
UpdateSocialFoundVo updateSocialFoundVo;
for (TEmployeeProject tEmployeeProject: updateList) { for (TEmployeeProject tEmployeeProject: updateList) {
UpdateSocialFoundVo updateSocialFoundVo = new UpdateSocialFoundVo(); updateSocialFoundVo = new UpdateSocialFoundVo();
updateSocialFoundVo.setOldDeptId(tEmployeeProject.getOdlDeptId()); updateSocialFoundVo.setOldDeptId(tEmployeeProject.getOdlDeptId());
updateSocialFoundVo.setEmpIdcard(tEmployeeProject.getEmpIdcard()); updateSocialFoundVo.setEmpIdcard(tEmployeeProject.getEmpIdcard());
updateSocialFoundVo.setSettleDomainCode(tEmployeeProject.getDeptNo()); updateSocialFoundVo.setSettleDomainCode(tEmployeeProject.getDeptNo());
...@@ -423,10 +435,13 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -423,10 +435,13 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
TEmployeeProject newEmpProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda() TEmployeeProject newEmpProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, vo.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,vo.getNewDeptNo()) .eq(TEmployeeProject::getEmpIdcard, vo.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,vo.getNewDeptNo())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL)); .eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL));
// hgw 2023-8-21 16:31:18 目标项目是否已减项false:否
boolean isSubtraction = false;
if (Common.isNotNull(newEmpProject) if (Common.isNotNull(newEmpProject)
&& Common.isNotNull(newEmpProject.getProjectStatus()) && Common.isNotNull(newEmpProject.getProjectStatus())
&& newEmpProject.getProjectStatus().intValue() == CommonConstants.ONE_INT){ && newEmpProject.getProjectStatus().intValue() == CommonConstants.ONE_INT){
return R.failed("目标项目档案已减项,请复项后重新划转!"); isSubtraction = true;
//return R.failed("目标项目档案已减项,请复项后重新划转!")
} }
//社保公积金派单处需要直接修改为最新的项目 //社保公积金派单处需要直接修改为最新的项目
//社保预估库、缴费库、对比库、代理差额库,需要同步修改未结算(并且满足这个条件:数据 生成月≥此处划转起始月)的数据,已结算数据不变更; //社保预估库、缴费库、对比库、代理差额库,需要同步修改未结算(并且满足这个条件:数据 生成月≥此处划转起始月)的数据,已结算数据不变更;
...@@ -558,6 +573,10 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -558,6 +573,10 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
} }
} }
} }
if (isSubtraction) {
oldEmpProject.setProjectStatus(CommonConstants.ONE_INT);
newEmpProject.setProjectStatus(CommonConstants.ZERO_INT);
}
// 变更老的项目档案 // 变更老的项目档案
tEmployeeProjectService.updateChangeById(oldEmpProject); tEmployeeProjectService.updateChangeById(oldEmpProject);
//新增或变更新的项目档案 //新增或变更新的项目档案
......
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