Commit b8f79b33 authored by huyuchen's avatar huyuchen

huych-派单更新档案合同信息修改修改

parent fe970ef6
......@@ -2549,7 +2549,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(p)) {
p.setStatus(CommonConstants.ONE_INT);
tEmployeeProjectService.updateById(p);
}
}
}
......@@ -2588,9 +2587,31 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
contractAuditMapper.insert(contractAudit);
contractServicer.updateById(c);
if (Common.isNotNull(p)) {
//审核通过更新项目档案合同信息
if (Common.isEmpty(p.getContractType())) {
p.setContractType(excelUtil.getDicValueByDataType(c.getContractName(), ExcelAttributeConstants.PERSONNEL_TYPE));
}
if (Common.isEmpty(p.getPost())) {
p.setPost(c.getPost());
}
if (Common.isEmpty(p.getWorkingHours())) {
p.setWorkingHours(c.getWorkingHours());
}
if (Common.isEmpty(p.getTryPeriod())) {
p.setTryPeriod(null == c.getTryPeriod() ? "无" : c.getTryPeriod());
}
if (Common.isEmpty(p.getEnjoinDate())) {
p.setEnjoinDate(null != c.getContractStart() ? c.getContractStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null);
}
}
}
}
if (Common.isNotNull(p)) {
tEmployeeProjectService.updateById(p);
}
}
}
return true;
......@@ -2632,7 +2653,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
EmpAddDispatchVo emp;
EmpProjectDispatchVo project;
TEmployeeContractAudit audit;
TEmployeeProject projectUpd;
for (Map.Entry<String, EmpContractDispatchVo> entry : contractsMap.entrySet()) {
contractAdd = entry.getValue();
try {
......@@ -2666,30 +2686,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
contractAdd.setId(contract.getId());
contractAdd.setEmpNo(contract.getEmpNo());
contractsMap.put(contractAdd.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + contractAdd.getDeptNo(), contractAdd);
//新增合同和同步更新项目档案中的合同信息
projectUpd = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getDeptNo, contract.getDeptNo())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(projectUpd)) {
if (Common.isEmpty(projectUpd.getContractType())) {
projectUpd.setContractType(excelUtil.getDicValueByDataType(contract.getContractName(), ExcelAttributeConstants.PERSONNEL_TYPE));
}
if (Common.isEmpty(projectUpd.getPost())) {
projectUpd.setPost(contract.getPost());
}
if (Common.isEmpty(projectUpd.getWorkingHours())) {
projectUpd.setWorkingHours(contract.getWorkingHours());
}
if (Common.isEmpty(projectUpd.getTryPeriod())) {
projectUpd.setTryPeriod(contract.getTryPeriod());
}
if (Common.isEmpty(projectUpd.getEnjoinDate())) {
projectUpd.setEnjoinDate(null != contract.getContractStart() ? contract.getContractStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null);
}
tEmployeeProjectService.updateById(projectUpd);
}
}
} catch (Exception e) {
log.error(contractAdd.getEmpIdcard() + CommonConstants.COLON_STRING + "派单新增合同失败", e);
......
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