Commit 9eb89bf7 authored by huyuchen's avatar huyuchen

优化修改

parent f947a376
......@@ -105,15 +105,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeInfo::getEmpIdcard, tEmployeeProject.getEmpIdcard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL));
//项目编码校验
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, tEmployeeProject.getDeptNo())
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(tSettleDomain)) {
return R.failed("未找到对应的项目或者项目已停止合作,请核实");
}
//项目下已有身份证信息
TEmployeeProject employeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, tEmployeeProject.getEmpIdcard())
......@@ -137,6 +128,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return new R<>(CommonConstants.dingleDigitIntArray[2], "该人员已减档减项,是否“复档复项”", map);
}
}
//项目编码校验
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, tEmployeeProject.getDeptNo())
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(tSettleDomain)) {
return R.failed("未找到对应的项目或者项目已停止合作,请核实");
}
//状态为草稿、已审核
if (CommonConstants.dingleDigitIntArray[0] == employeeProject.getStatus() ||
CommonConstants.dingleDigitIntArray[1] == employeeProject.getStatus()) {
......@@ -755,15 +754,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
idCardMap.put(idCard.concat(deptNo), i + 2);
}
//项目编码校验
tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, excel.getDeptNo())
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(tSettleDomain)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.PROJECT_SEARCH_NOT_EXIST)));
}
//根据身份证获取人员档案
tEmployeeInfo= tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, excel.getEmpIdcard())
......@@ -785,6 +775,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//档案有(在档人员),项目无
} else if (Common.isNotNull(tEmployeeInfo) && Common.isEmpty(tEmployeeProject)
&& CommonConstants.ZERO_INT == tEmployeeInfo.getFileStatus()) {
//项目编码校验
tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, excel.getDeptNo())
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(tSettleDomain)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.PROJECT_SEARCH_NOT_EXIST)));
}
updateExcelPost(updateList, tEmployeeInfo);
insertExcelPro(excel, proInsList, tEmployeeInfo,tSettleDomain);
//档案有(在档人员),项目有(草稿/已审核);
......@@ -804,6 +802,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//档案有(离职库),项目无;
} else if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()
&& Common.isEmpty(tEmployeeProject)) {
//项目编码校验
tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, excel.getDeptNo())
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(tSettleDomain)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.PROJECT_SEARCH_NOT_EXIST)));
}
insertExcelPro(excel, proInsList, tEmployeeInfo, tSettleDomain);
//档案有(在档人员),项目(已减档)
} else if (CommonConstants.ZERO_INT == tEmployeeInfo.getFileStatus() && Common.isNotNull(
......
......@@ -211,8 +211,11 @@
<if test="tSettleDomain.deleteFlag != null and tSettleDomain.deleteFlag.trim() != ''">
and a.DELETE_FLAG = #{tSettleDomain.deleteFlag}
</if>
<if test="tSettleDomain.stopFlag != null and tSettleDomain.stopFlag.trim() != ''">
and a.STOP_FLAG = #{tSettleDomain.stopFlag}
<if test="tSettleDomain.stopFlag != null and tSettleDomain.stopFlag.trim() != '' and tSettleDomain.stopFlag == '0'">
and a.STOP_FLAG = '0'
</if>
<if test="tSettleDomain.stopFlag != null and tSettleDomain.stopFlag.trim() != '' and tSettleDomain.stopFlag == '1'">
and (a.STOP_FLAG = '1' or a.STOP_FLAG = '2')
</if>
</if>
order by CREATE_TIME desc
......
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