Commit 7954c461 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.5.7' into MVP1.5.7

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