Commit 82334943 authored by wangzb's avatar wangzb

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

parents 71837951 0fd3f163
......@@ -478,8 +478,6 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
//初始化审核类型 审核类型:0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止
initType(tEmployeeContractInfo);
// 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过
this.judgeAuditStatus(tEmployeeContractInfo, user);
if (Common.isEmpty(tEmployeeContractInfo.getId())) {
// 针对编码再做一次重复性校验
String isCur = baseMapper.getContractByApplyNo(tEmployeeContractInfo.getApplyNo());
......@@ -488,26 +486,37 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeContractInfo.setApplyNo(code);
}
baseMapper.insert(tEmployeeContractInfo);
// 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过
this.judgeAuditStatus(tEmployeeContractInfo, user);
//如果是否同步终止合同、减项、减档为是则生成同步任务处理清单
//增加任务处理情况查询表数据
if (Common.isNotNull(tEmployeeContractInfo.getChangeContractAndEmployee())
&& CommonConstants.ZERO_STRING.equals(tEmployeeContractInfo.getChangeContractAndEmployee())) {
TWorkHandlerInfo handlerInfo = new TWorkHandlerInfo();
handlerInfo.setEmpIdcard(tEmployeeContractInfo.getEmpIdcard());
handlerInfo.setEmpName(tEmployeeContractInfo.getEmpName());
handlerInfo.setDepartName(tEmployeeContractInfo.getSubjectDepart());
handlerInfo.setDepartNo(tEmployeeContractInfo.getDeptNo());
handlerInfo.setInfoFrom("合同终止");
handlerInfo.setOperUser(user.getNickname());
handlerInfo.setOperTime(LocalDateTime.now());
handlerInfo.setDetailId(tEmployeeContractInfo.getId());
handlerInfo.setOperResult(CommonConstants.ZERO_STRING);
workHandlerInfoService.save(handlerInfo);
TWorkHandlerInfo handlerInfo1 = workHandlerInfoService.getOne(Wrappers.<TWorkHandlerInfo>query()
.lambda().eq(TWorkHandlerInfo::getDetailId, tEmployeeContractInfo.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(handlerInfo1)) {
TWorkHandlerInfo handlerInfo = new TWorkHandlerInfo();
handlerInfo.setEmpIdcard(tEmployeeContractInfo.getEmpIdcard());
handlerInfo.setEmpName(tEmployeeContractInfo.getEmpName());
handlerInfo.setDepartName(tEmployeeContractInfo.getSubjectDepart());
handlerInfo.setDepartNo(tEmployeeContractInfo.getDeptNo());
handlerInfo.setInfoFrom("合同终止");
handlerInfo.setOperUser(user.getNickname());
handlerInfo.setOperTime(LocalDateTime.now());
handlerInfo.setDetailId(tEmployeeContractInfo.getId());
handlerInfo.setOperResult(CommonConstants.ZERO_STRING);
workHandlerInfoService.save(handlerInfo);
}
}
if (Common.isNotNull(tEmployeeContractInfo.getAttaList()) && Common.isNotNull(tEmployeeContractInfo.getId())) {
this.updateFileMainId(tEmployeeContractInfo);
}
} else {
// 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过
this.judgeAuditStatus(tEmployeeContractInfo, user);
baseMapper.updateById(tEmployeeContractInfo);
}
......@@ -743,113 +752,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (EmployeeConstants.SITUATION_SEVEN.equals(contractInfo.getSituation())
&& Common.isNotNull(contractInfo.getChangeContractAndEmployee())
&& CommonConstants.ZERO_STRING.equals(contractInfo.getChangeContractAndEmployee())) {
//同步任务处理清单执行详情
StringBuilder workInfo = new StringBuilder();
StringBuilder failueInfo = new StringBuilder();
workInfo.append("合同终止成功,");
//该项目下其他在用的合同统一更新成不在用
List<TEmployeeContractInfo> contractInfoList = baseMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpId, contractInfo.getEmpId())
.eq(TEmployeeContractInfo::getSettleDomain, contractInfo.getSettleDomain())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.ne(TEmployeeContractInfo::getId, tEmployeeContractInfo.getId()));
if (Common.isNotNull(contractInfoList)) {
for (TEmployeeContractInfo contractInfo1:contractInfoList) {
contractInfo1.setInUse(CommonConstants.ONE_STRING);
contractInfo1.setAuditUserName(user.getNickname());
baseMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1);
}
}
//在途的合同更新为审核不通过
List<TEmployeeContractInfo> contractInfoListZt = baseMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpId, contractInfo.getEmpId())
.eq(TEmployeeContractInfo::getSettleDomain, contractInfo.getSettleDomain())
.and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.or().eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ZERO_INT))
.ne(TEmployeeContractInfo::getId, contractInfo.getId())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT));
if (Common.isNotNull(contractInfoListZt)) {
for (TEmployeeContractInfo contractInfo1:contractInfoListZt) {
contractInfo1.setAuditStatus(CommonConstants.THREE_INT);
contractInfo1.setAuditUserName(user.getNickname());
baseMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1);
}
}
//项目档案处理
TEmployeeProject tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query()
.lambda().eq(TEmployeeProject::getEmpId, contractInfo.getEmpId())
.eq(TEmployeeProject::getDeptId, contractInfo.getSettleDomain())
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.last(CommonConstants.LAST_ONE_SQL));
if (tEmployeeProject != null) {
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(tEmployeeProject.getId());
tEmployeeProject.setContractStatus(CommonConstants.TWO_INT);
//如果该项目仍有社保、公积金的数据不同步减项,如正常减项,记录项目档案操作记录
if ((tEmployeeProject.getSocialStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getSocialStatus() == CommonConstants.FOUR_INT)
&& (tEmployeeProject.getFundStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getFundStatus() == CommonConstants.FOUR_INT)) {
tEmployeeProject.setProjectStatus(CommonConstants.ONE_INT);
tEmployeeProject.setLeaveRemark("终止合同联动减项");
tEmployeeProject.setLeaveTime(LocalDateTime.now());
workInfo.append("减项成功,");
} else {
failueInfo.append("存在社保/公积金,无法减项");
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "",
tEmployeeProject.getId(), tEmployeeProjectOld, tEmployeeProject);
tEmployeeProjectService.updateById(tEmployeeProject);
//如果项目档案已减项,如果人员存在多个项目不处理,反之则减档
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT && Common.isNotNull(tEmployeeInfo)) {
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_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) {
//减档
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
tEmployeeInfo.setLeaveUser(user.getId());
tEmployeeInfo.setLeaveUserName(user.getNickname());
workInfo.append("减档成功,");
} else {
failueInfo.append("存在其他项目,无法减档");
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(),
"", tEmployeeInfoOld, tEmployeeInfo);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
}
}
//更新任务处理情况数据
TWorkHandlerInfo handlerInfo = workHandlerInfoService.getOne(Wrappers.<TWorkHandlerInfo>query()
.lambda().eq(TWorkHandlerInfo::getDetailId, contractInfo.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(handlerInfo)) {
handlerInfo.setOperInfo(workInfo.substring(0, workInfo.length() - 1));
handlerInfo.setReason(failueInfo.length() > 1 ? failueInfo.toString() : "");
handlerInfo.setOperResult(failueInfo.length() > 1 ? "1" : "2");
workHandlerInfoService.updateById(handlerInfo);
}
changeStatus(contractInfo,user);
} else {
//先停用项目内的其他的员工合同————不要这个逻辑了
// 2022-7-22 16:54:12 产品倩倩与测试说,作废终止审核通过,仅将原先选择的合同不在用即可
......@@ -1399,11 +1302,15 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (socialFundR != null && socialFundR.getData() != null && socialFundR.getData() > 0) {
insert.setAuditStatus(CommonConstants.TWO_INT);
insert.setAuditUserName(user.getNickname());
if (EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation())
&& Common.isNotNull(insert.getChangeContractAndEmployee())
&& CommonConstants.ZERO_STRING.equals(insert.getChangeContractAndEmployee())) {
changeStatus(insert, user);
baseMapper.updateById(insert);
}
}
}
}
}
}
/**
......@@ -1710,6 +1617,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(contractInfoList)) {
for (TEmployeeContractInfo contractInfo1 : contractInfoList) {
contractInfo1.setInUse(CommonConstants.ONE_STRING);
contractInfo1.setAuditUserName(user.getNickname());
baseMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1);
......@@ -1726,6 +1634,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(contractInfoListZt)) {
for (TEmployeeContractInfo contractInfo1 : contractInfoListZt) {
contractInfo1.setAuditStatus(CommonConstants.THREE_INT);
contractInfo1.setAuditUserName(user.getNickname());
baseMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1);
......@@ -1742,10 +1651,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(tEmployeeProject.getId());
tEmployeeProject.setContractStatus(CommonConstants.TWO_INT);
//如果该项目仍有社保、公积金的数据不同步减项,如正常减项,记录项目档案操作记录
if (tEmployeeProject.getSocialStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getSocialStatus() == CommonConstants.FOUR_INT
|| tEmployeeProject.getFundStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getFundStatus() == CommonConstants.FOUR_INT) {
if ((tEmployeeProject.getSocialStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getSocialStatus() == CommonConstants.FOUR_INT) &&
( tEmployeeProject.getFundStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getFundStatus() == CommonConstants.THREE_INT)) {
tEmployeeProject.setProjectStatus(CommonConstants.ONE_INT);
tEmployeeProject.setLeaveRemark("终止合同联动减项");
tEmployeeProject.setLeaveTime(LocalDateTime.now());
......@@ -1758,9 +1667,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeProjectService.updateById(tEmployeeProject);
//如果项目档案已减项,如果人员存在多个项目不处理,反之则减档
tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT && Common.isNotNull(tEmployeeInfo)) {
if (Common.isNotNull(tEmployeeInfo)) {
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
// 判断人员有无审核通过的其他合同
contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpId, contract.getEmpId())
......@@ -1774,18 +1682,20 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} else {
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
}
//减项成功把人员档案现存项目数减一
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
//减档
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
tEmployeeInfo.setLeaveUser(user.getId());
tEmployeeInfo.setLeaveUserName(user.getNickname());
workInfo.append("减档成功,");
tEmployeeInfoMapper.updateById(tEmployeeInfo);
} else {
failueInfo.append("存在其他项目,无法减档");
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT) {
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
//减项成功把人员档案现存项目数减一
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
//减档
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
tEmployeeInfo.setLeaveUser(user.getId());
tEmployeeInfo.setLeaveUserName(user.getNickname());
workInfo.append("减档成功,");
} else {
failueInfo.append("存在其他项目,无法减档");
}
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(),
"", tEmployeeInfoOld, tEmployeeInfo);
......@@ -1955,4 +1865,131 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
//是否同步终止合同、减项、减档为是的时候 单独写逻辑
public void changeStatus(TEmployeeContractInfo contractInfo,YifuUser user) {
//同步任务处理清单执行详情
StringBuilder workInfo = new StringBuilder();
StringBuilder failueInfo = new StringBuilder();
workInfo.append("合同终止成功,");
//该项目下其他在用的合同统一更新成不在用
List<TEmployeeContractInfo> contractInfoList = baseMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpId, contractInfo.getEmpId())
.eq(TEmployeeContractInfo::getSettleDomain, contractInfo.getSettleDomain())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.ne(TEmployeeContractInfo::getId, contractInfo.getId()));
if (Common.isNotNull(contractInfoList)) {
for (TEmployeeContractInfo contractInfo1 : contractInfoList) {
contractInfo1.setInUse(CommonConstants.ONE_STRING);
contractInfo1.setAuditUserName(user.getNickname());
baseMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1);
}
}
//在途的合同更新为审核不通过
List<TEmployeeContractInfo> contractInfoListZt = baseMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpId, contractInfo.getEmpId())
.eq(TEmployeeContractInfo::getSettleDomain, contractInfo.getSettleDomain())
.and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.or().eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ZERO_INT))
.ne(TEmployeeContractInfo::getId, contractInfo.getId())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT));
if (Common.isNotNull(contractInfoListZt)) {
for (TEmployeeContractInfo contractInfo1 : contractInfoListZt) {
contractInfo1.setAuditStatus(CommonConstants.THREE_INT);
contractInfo1.setAuditUserName(user.getNickname());
baseMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1);
}
}
//项目档案处理
TEmployeeProject tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query()
.lambda().eq(TEmployeeProject::getEmpId, contractInfo.getEmpId())
.eq(TEmployeeProject::getDeptId, contractInfo.getSettleDomain())
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.last(CommonConstants.LAST_ONE_SQL));
if (tEmployeeProject != null) {
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(tEmployeeProject.getId());
tEmployeeProject.setContractStatus(CommonConstants.TWO_INT);
//如果该项目仍有社保、公积金的数据不同步减项,如正常减项,记录项目档案操作记录
if ((tEmployeeProject.getSocialStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getSocialStatus() == CommonConstants.FOUR_INT)
&& (tEmployeeProject.getFundStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getFundStatus() == CommonConstants.THREE_INT)) {
tEmployeeProject.setProjectStatus(CommonConstants.ONE_INT);
tEmployeeProject.setLeaveRemark("终止合同联动减项");
tEmployeeProject.setLeaveTime(LocalDateTime.now());
workInfo.append("减项成功,");
} else {
failueInfo.append("存在社保/公积金,无法减项");
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "",
tEmployeeProject.getId(), tEmployeeProjectOld, tEmployeeProject);
tEmployeeProjectService.updateById(tEmployeeProject);
//如果项目档案已减项,如果人员存在多个项目不处理,反之则减档
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
if (Common.isNotNull(tEmployeeInfo)) {
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
// 判断人员有无审核通过的其他合同
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 (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT) {
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
//减项成功把人员档案现存项目数减一
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
//减档
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
tEmployeeInfo.setLeaveUser(user.getId());
tEmployeeInfo.setLeaveUserName(user.getNickname());
workInfo.append("减档成功,");
} else {
failueInfo.append("存在其他项目,无法减档");
}
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(),
"", tEmployeeInfoOld, tEmployeeInfo);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
}
}
//更新任务处理情况数据
TWorkHandlerInfo handlerInfo1 = workHandlerInfoService.getOne(Wrappers.<TWorkHandlerInfo>query()
.lambda().eq(TWorkHandlerInfo::getDetailId, contractInfo.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(handlerInfo1)) {
handlerInfo1.setOperInfo(workInfo.substring(0, workInfo.length() - 1));
handlerInfo1.setReason(failueInfo.length() > 1 ? failueInfo.toString() : "");
handlerInfo1.setOperResult(failueInfo.length() > 1 ? "1" : "2");
workHandlerInfoService.updateById(handlerInfo1);
} else {
TWorkHandlerInfo handlerInfo = new TWorkHandlerInfo();
handlerInfo.setEmpIdcard(contractInfo.getEmpIdcard());
handlerInfo.setEmpName(contractInfo.getEmpName());
handlerInfo.setDepartName(contractInfo.getSubjectDepart());
handlerInfo.setDepartNo(contractInfo.getDeptNo());
handlerInfo.setInfoFrom("合同终止");
handlerInfo.setOperUser(user.getNickname());
handlerInfo.setOperTime(LocalDateTime.now());
handlerInfo.setDetailId(contractInfo.getId());
handlerInfo.setOperInfo(workInfo.substring(0, workInfo.length() - 1));
handlerInfo.setReason(failueInfo.length() > 1 ? failueInfo.toString() : "");
handlerInfo.setOperResult(failueInfo.length() > 1 ? "1" : "2");
workHandlerInfoService.save(handlerInfo);
}
}
}
......@@ -1439,7 +1439,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if ((tEmployeeProject.getSocialStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getSocialStatus() == CommonConstants.FOUR_INT) &&
(tEmployeeProject.getFundStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getFundStatus() == CommonConstants.FOUR_INT)) {
|| tEmployeeProject.getFundStatus() == CommonConstants.THREE_INT)) {
tEmployeeProject.setProjectStatus(CommonConstants.ONE_INT);
tEmployeeProject.setLeaveRemark("终止合同联动减项");
tEmployeeProject.setLeaveTime(LocalDateTime.now());
......@@ -1452,21 +1452,36 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
baseMapper.updateById(tEmployeeProject);
//如果项目档案已减项,如果人员存在多个项目不处理,反之则减档
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT && Common.isNotNull(tEmployeeInfo)) {
if (Common.isNotNull(tEmployeeInfo)) {
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
//减项成功把人员档案现存项目数减一
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
//减档
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
tEmployeeInfo.setLeaveUser(vo.getUserId());
tEmployeeInfo.setLeaveUserName(vo.getUserName());
workInfo.append("减档成功,");
// 判断人员有无审核通过的其他合同
TEmployeeContractInfo contractInfoInUse = contractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpIdcard, vo.getEmpIdCard())
.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 {
failueInfo.append("存在其他项目,无法减档");
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
}
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT) {
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
//减项成功把人员档案现存项目数减一
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
//减档
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
tEmployeeInfo.setLeaveUser(vo.getUserId());
tEmployeeInfo.setLeaveUserName(vo.getUserName());
workInfo.append("减档成功,");
} else {
failueInfo.append("存在其他项目,无法减档");
}
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(),
"", tEmployeeInfoOld, tEmployeeInfo);
......
......@@ -52,7 +52,7 @@ public class EkpOrderController {
@Schema(description = "接收处理ekp订单")
@PostMapping(value = "/receiveOrder")
public R receiveOrder(OrderAddVO vo) throws IOException {
return tOrderService.receiveOrder(vo);
return tOrderService.receiveOrder(vo,ekpOrderFileTask);
}
......
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrder;
import com.yifu.cloud.plus.v1.yifu.order.util.EkpOrderFileTask;
import com.yifu.cloud.plus.v1.yifu.order.vo.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -95,10 +96,11 @@ public interface TOrderService extends IService<TOrder> {
*
* @author licancan
* @param vo
* @param ekpOrderFileTask
* @return {@link R}
* @throws IOException
*/
R receiveOrder(OrderAddVO vo) throws IOException;
R receiveOrder(OrderAddVO vo, EkpOrderFileTask ekpOrderFileTask) throws IOException;
/**
* 接收处理ekp订单回复
......@@ -118,6 +120,8 @@ public interface TOrderService extends IService<TOrder> {
*/
void receiveOrderNew(InputStream inputStream, String file1, String orderNo, String fileName, String originalFileName) throws IOException;
void receiveOrderFileAsc(InputStream inputStream, String orderNo, String fileName, String originalFileName);
/**
* 订单作废
*
......
......@@ -31,6 +31,7 @@ import com.yifu.cloud.plus.v1.yifu.order.service.TOrderEnclosureService;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderHandlerService;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderReplyService;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService;
import com.yifu.cloud.plus.v1.yifu.order.util.EkpOrderFileTask;
import com.yifu.cloud.plus.v1.yifu.order.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.order.vo.*;
import lombok.extern.slf4j.Slf4j;
......@@ -466,12 +467,13 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
*
* @author licancan
* @param vo
* @param ekpOrderFileTask
* @return {@link R}
* @throws IOException
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R receiveOrder(OrderAddVO vo) throws IOException{
public R receiveOrder(OrderAddVO vo, EkpOrderFileTask ekpOrderFileTask) throws IOException{
if (Common.isEmpty(vo.getOrderNo())){
return R.failed(OrderConstants.ORDER_NO_IS_EMPTY);
......@@ -558,12 +560,10 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
fileName = System.currentTimeMillis() + "_" + multipartFile.getOriginalFilename();
//filePath不传默认存储空间的根目录
//支持的附件格式
getObjectR(multipartFile.getInputStream(),vo.getOrderNo(),fileName,multipartFile.getOriginalFilename(),CommonConstants.ZERO_INT);
ekpOrderFileTask.receiveOrderFileAsc(multipartFile.getInputStream(),vo.getOrderNo(),fileName,multipartFile.getOriginalFilename());
}
}
return R.ok(OrderConstants.OPERATE_SUCCESS);
}
......@@ -657,14 +657,15 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
}
/**
* @Author fxj
* @Description 附件上传
* @Date 9:38 2023/6/26
* @Param
* @return
**/
* 接收处理ekp订单回复
*
* @author licancan
* @return {@link R}
* @throws IOException
*/
@Override
public void receiveOrderNew(InputStream inputStream, String file1, String orderNo, String fileName, String originalFileName){
R<Object> e;
if (file1.equals("fileOne")) {
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.TWO_INTEGER);
}
......@@ -695,6 +696,18 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.ELEVEN_INTEGER);
}
}
/**
* 接收处理ekp订单回复
*
* @author licancan
* @return {@link R}
* @throws IOException
*/
@Override
public void receiveOrderFileAsc(InputStream inputStream, String orderNo, String fileName, String originalFileName){
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.ZERO_INT);
}
private R<Object> getObjectR(InputStream inputStream, String orderNo, String fileName, String originalFileName,Integer enclosureflag) {
//filePath不传默认存储空间的根目录
......
package com.yifu.cloud.plus.v1.yifu.order.util;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderAttVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
......@@ -38,4 +37,9 @@ public class EkpOrderFileTask {
}
}
}
@Async
public void receiveOrderFileAsc(InputStream inputStream,String orderNo, String fileName, String originalFileName){
orderService.receiveOrderFileAsc(inputStream,orderNo,fileName,originalFileName);
}
}
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