Commit 27b05f6e authored by huyuchen's avatar huyuchen

优化修改

parent 3cc0796a
......@@ -46,4 +46,6 @@ public class UpProjectSocialFundVo implements Serializable {
String mobile;
//是否同步终止合同、减项、减档 0 是 1 否
String changeContractAndEmployee;
String userName;
String userId;
}
......@@ -771,10 +771,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.FOUR_INT)) {
tEmployeeProject.setProjectStatus(CommonConstants.ONE_INT);
tEmployeeProject.setLeaveRemark("终止合同联动减项");
tEmployeeProject.setLeaveTime(LocalDateTime.now());
......
......@@ -37,10 +37,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpEducationMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TBusinessEmployeeExtendInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.utils.DoJointTask;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
......@@ -108,6 +105,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Lazy
private DoJointTask doJointTask;
@Autowired
private TWorkHandlerInfoService workHandlerInfoService;
@Autowired
private TEmployeeContractAuditService tEmployeeContractAuditService;
@Override
public R addCheck(TEmployeeProject tEmployeeProject) {
......@@ -1382,48 +1385,144 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (Common.isEmpty(vo) || Common.isEmpty(vo.getEmpIdCard()) || Common.isEmpty(vo.getDepartNo())){
return false;
}
//是否同步终止合同、减项、减档为是的时候 单独写逻辑
if (Common.isNotNull(vo.getChangeContractAndEmployee())) {
List<TEmployeeContractInfo> contractInfoList;
List<TEmployeeContractInfo> contractInfoListZt;
//同步任务处理清单执行详情
StringBuilder workInfo = new StringBuilder();
StringBuilder failueInfo = new StringBuilder();
workInfo.append("合同终止成功,");
//该项目下其他在用的合同统一更新成不在用
contractInfoList = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getDeptNo, vo.getDepartNo())
.eq(TEmployeeContractInfo::getEmpIdcard, vo.getEmpIdCard())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT));
if (Common.isNotNull(contractInfoList)) {
for (TEmployeeContractInfo contractInfo1 : contractInfoList) {
contractInfo1.setInUse(CommonConstants.ONE_STRING);
contractInfoMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1, CommonConstants.ZERO_STRING);
}
}
//在途的合同更新为审核不通过
contractInfoListZt = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpIdcard, vo.getEmpIdCard())
.eq(TEmployeeContractInfo::getDeptNo, vo.getDepartNo())
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT));
if (Common.isNotNull(contractInfoListZt)) {
for (TEmployeeContractInfo contractInfo1 : contractInfoListZt) {
contractInfo1.setAuditStatus(CommonConstants.THREE_INT);
contractInfoMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1, CommonConstants.ONE_STRING);
}
}
//项目档案处理
TEmployeeProject tEmployeeProject = baseMapper.selectOne(Wrappers.<TEmployeeProject>query()
.lambda().eq(TEmployeeProject::getEmpIdcard, vo.getEmpIdCard())
.eq(TEmployeeProject::getDeptNo, vo.getDepartNo())
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.last(CommonConstants.LAST_ONE_SQL));
if (null != tEmployeeProject) {
TEmployeeProject tEmployeeProjectOld = baseMapper.selectById(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);
baseMapper.updateById(tEmployeeProject);
//如果项目档案已减项,如果人员存在多个项目不处理,反之则减档
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT) {
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
if (Common.isNotNull(tEmployeeInfo) && tEmployeeInfo.getProjectNum() == CommonConstants.ONE_INT) {
//减档
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
tEmployeeInfo.setLeaveUser(vo.getUserId());
tEmployeeInfo.setLeaveUserName(vo.getUserName());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(),
"", tEmployeeInfoOld, tEmployeeInfo);
workInfo.append("减档成功,");
tEmployeeInfoMapper.updateById(tEmployeeInfo);
} else {
failueInfo.append("存在其他项目,无法减档");
}
}
}
//增加任务处理情况查询表数据
TWorkHandlerInfo handlerInfo = new TWorkHandlerInfo();
handlerInfo.setEmpIdcard(vo.getEmpIdCard());
handlerInfo.setEmpName(null == tEmployeeProject.getEmpName() ? "" : tEmployeeProject.getEmpName());
handlerInfo.setDepartName(null == tEmployeeProject.getDeptName() ? "" : tEmployeeProject.getDeptName());
handlerInfo.setDepartNo(vo.getDepartNo());
handlerInfo.setInfoFrom("合同终止");
handlerInfo.setOperInfo(workInfo.substring(0, workInfo.length() - 1));
handlerInfo.setReason(failueInfo.length() > 1 ? failueInfo.toString() : "");
handlerInfo.setOperResult(failueInfo.length() > 1 ? "1" : "2");
handlerInfo.setOperUser(vo.getUserName());
handlerInfo.setOperTime(LocalDateTime.now());
workHandlerInfoService.save(handlerInfo);
}else {
TEmployeeInfo employee = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard,vo.getEmpIdCard())
.eq(TEmployeeInfo::getDeleteFlag,CommonConstants.ZERO_STRING).last(CommonConstants.LAST_ONE_SQL));
.eq(TEmployeeInfo::getEmpIdcard, vo.getEmpIdCard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING).last(CommonConstants.LAST_ONE_SQL));
// : 0 无社保|无公积金 1 处理中 2.部分购买 3.正常 4.已派减
if (Common.isNotNull(employee)){
if (Common.isNotNull(vo.getSocialStatus())){
if (Common.isNotNull(employee)) {
if (Common.isNotNull(vo.getSocialStatus())) {
employee.setSocialStatus(Integer.parseInt(vo.getSocialStatus()));
}
if (Common.isNotNull(vo.getFundStatus())){
if (Common.isNotNull(vo.getFundStatus())) {
employee.setFundStatus(Integer.parseInt(vo.getFundStatus()));
}
if (Common.isNotNull(vo.getFileProvince())){
if (Common.isNotNull(vo.getFileProvince())) {
employee.setFileProvince(Integer.parseInt(vo.getFileProvince()));
}
if (Common.isNotNull(vo.getFileCity())){
if (Common.isNotNull(vo.getFileCity())) {
employee.setFileCity(Integer.parseInt(vo.getFileCity()));
if (Common.isNotNull(vo.getFileTown())){
if (Common.isNotNull(vo.getFileTown())) {
employee.setFileTown(Integer.parseInt(vo.getFileTown()));
}else {
} else {
employee.setFileTown(null);
}
}
if (Common.isNotNull(vo.getMobile())){
if (Common.isNotNull(vo.getMobile())) {
employee.setEmpPhone(vo.getMobile());
}
tEmployeeInfoMapper.updateSocialInfoById(employee);
}
TEmployeeProject project = baseMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getDeptNo,vo.getDepartNo())
.eq(TEmployeeProject::getEmpIdcard,vo.getEmpIdCard())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.ZERO_STRING)
.eq(TEmployeeProject::getDeptNo, vo.getDepartNo())
.eq(TEmployeeProject::getEmpIdcard, vo.getEmpIdCard())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
// : 0 无社保|无公积金 1 处理中 2.部分购买 3.正常 4.已派减
if (Common.isNotNull(project)){
if (Common.isNotNull(vo.getSocialStatus())){
if (Common.isNotNull(project)) {
if (Common.isNotNull(vo.getSocialStatus())) {
project.setSocialStatus(Integer.parseInt(vo.getSocialStatus()));
}
if (Common.isNotNull(vo.getFundStatus())){
if (Common.isNotNull(vo.getFundStatus())) {
project.setFundStatus(Integer.parseInt(vo.getFundStatus()));
}
baseMapper.updateSocialAndFundStatusById(project);
}
}
return true;
}
......@@ -1725,4 +1824,21 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
public void updateContractStatus(String empId, int status) {
baseMapper.updateContractStatus(empId,status);
}
/**
* @param tEmployeeContractInfo
* @Description: 保存审核操作记录
* @Author: huyc
* @Date: 2023/6/16 10:16
* @return: void
**/
private void setAuditInfoNew(TEmployeeContractInfo tEmployeeContractInfo,String flag) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("合同审核");
audit.setAuditStatus(CommonConstants.ZERO_STRING.equals(flag) ? "审核通过" : "审核不通过");
audit.setRemark("终止合同联动");
audit.setLinkId(tEmployeeContractInfo.getId());
audit.setLinkType(CommonConstants.ONE_INT);
tEmployeeContractAuditService.save(audit);
}
}
......@@ -3929,6 +3929,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//派减审核通过才会处理合同档案状态
if (CommonConstants.ONE_INT == flag) {
vo.setChangeContractAndEmployee(dis.getChangeContractAndEmployee());
vo.setUserId(user.getId());
vo.setUserName(user.getNickname());
}
R<Boolean> resUp = archivesDaprUtil.updateProjectSocialFund(vo);
if (Common.isEmpty(resUp) || !(CommonConstants.SUCCESS.intValue() == resUp.getCode()) || !resUp.getData().booleanValue()){
......
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