Commit bd985407 authored by zhenbin wang's avatar zhenbin wang

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

parents a3834b96 3e17ff28
......@@ -366,7 +366,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
if (Common.isEmpty(vo.getChangeItems())){
return R.failed("划转项不可为空!");
}
StringBuilder resStr = new StringBuilder();
//待划转员工已在目标项目下不可划转
TEmployeeProject newEmpProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, vo.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,vo.getNewDeptNo())
......@@ -429,48 +429,65 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updatesf.setSettleDomainName(updateTEmployeeProject.getDeptName());
updatesf.setUnitId(updateTEmployeeProject.getUnitId());
updatesf.setUnitName(updateTEmployeeProject.getUnitName());
// 处理社保
if (vo.getChangeItems().indexOf(CommonConstants.ONE_STRING) >= CommonConstants.ZERO_INT
&& CommonConstants.ZERO_INT != updateTEmployeeProject.getSocialStatus()) {
if (Common.isNotNull(newEmpProject.getId())){
// 处理社保 目标项目档案已有项目档案不做处理
if (vo.getChangeItems().indexOf(CommonConstants.ONE_STRING) >= CommonConstants.ZERO_INT) {
if (CommonConstants.ZERO_INT != updateTEmployeeProject.getSocialStatus()
&& (Common.isEmpty(newEmpProject.getSocialStatus())
|| CommonConstants.ZERO_INT == newEmpProject.getSocialStatus())){
newEmpProject.setSocialStatus(oldEmpProject.getSocialStatus());
newEmpProject.setSocialProvince(oldEmpProject.getSocialProvince());
newEmpProject.setSocialCity(oldEmpProject.getSocialCity());
newEmpProject.setSocialTown(oldEmpProject.getSocialTown());
updatesf.setFlag(CommonConstants.ZERO_STRING);
socialDaprUtils.updateSocialAndFoundInfo(updatesf);
oldEmpProject.setSocialStatus(CommonConstants.ZERO_INT);
oldEmpProject.setSocialProvince(null);
oldEmpProject.setSocialCity(null);
oldEmpProject.setSocialTown(null);
resStr.append("社保划转成功! <br>");
}else {
resStr.append("目标项目档案存在社保数据,社保划转失败! <br>");
}
updatesf.setFlag(CommonConstants.ZERO_STRING);
socialDaprUtils.updateSocialAndFoundInfo(updatesf);
oldEmpProject.setSocialStatus(CommonConstants.ZERO_INT);
oldEmpProject.setSocialProvince(null);
oldEmpProject.setSocialCity(null);
oldEmpProject.setSocialTown(null);
}
// 处理公积金
if (vo.getChangeItems().indexOf(CommonConstants.TWO_STRING) >= CommonConstants.ZERO_INT
&& CommonConstants.ZERO_INT != updateTEmployeeProject.getFundStatus()) {
if (Common.isNotNull(newEmpProject.getId())){
// 处理公积金 如果目标项目档案已存在公积金 不划转
if (vo.getChangeItems().indexOf(CommonConstants.TWO_STRING) >= CommonConstants.ZERO_INT) {
if (CommonConstants.ZERO_INT != updateTEmployeeProject.getFundStatus()
&& (Common.isEmpty(newEmpProject.getFundStatus())
|| CommonConstants.ZERO_INT == newEmpProject.getFundStatus())){
newEmpProject.setFundStatus(oldEmpProject.getFundStatus());
updatesf.setFlag(CommonConstants.ONE_STRING);
socialDaprUtils.updateSocialAndFoundInfo(updatesf);
oldEmpProject.setFundStatus(CommonConstants.ZERO_INT);
resStr.append("公积金划转成功! <br>");
}else {
resStr.append("目标项目档案存在公积金数据,公积金划转失败! <br>");
}
updatesf.setFlag(CommonConstants.ONE_STRING);
socialDaprUtils.updateSocialAndFoundInfo(updatesf);
oldEmpProject.setFundStatus(CommonConstants.ZERO_INT);
}
// 处理員工合同
// 处理員工合同 目标 已有合同状态 不在处理合同划转
if (vo.getChangeItems().indexOf(CommonConstants.ZERO_STRING) >= CommonConstants.ZERO_INT){
if (Common.isNotNull(newEmpProject.getId())){
if ((Common.isEmpty(newEmpProject.getContractStatus())
|| CommonConstants.ZERO_INT != newEmpProject.getContractStatus())){
newEmpProject.setContractStatus(oldEmpProject.getContractStatus());
newEmpProject.setContractType(oldEmpProject.getContractType());
// 合同同步划转---只划转在用合同 fxj 2023-03-06
contractInfoMapper.updateContractChange(updateTEmployeeProject.getEmpIdcard(),updateTEmployeeProject.getDeptNo(),updateTEmployeeProject.getOldDeptNo());
oldEmpProject.setContractStatus(CommonConstants.ZERO_INT);
oldEmpProject.setContractType(null);
resStr.append("员工合同划转成功! <br>");
}else {
resStr.append("目标项目档案存在员工合同数据,员工合同划转失败! <br>");
}
// 合同同步划转---只划转在用合同 fxj 2023-03-06
contractInfoMapper.updateContractChange(updateTEmployeeProject.getEmpIdcard(),updateTEmployeeProject.getDeptNo(),updateTEmployeeProject.getOldDeptNo());
oldEmpProject.setContractStatus(CommonConstants.ZERO_INT);
oldEmpProject.setContractType(null);
}
//同步减项老项目档案
if (CommonConstants.ONE_STRING.equals(vo.getChangeType())){
R res = tEmployeeProjectService.deleteEmpPro(oldEmpProject);
resStr.append(res.getMsg());
}
}
TEmpChangeInfo tEmpChangeInfo= new TEmpChangeInfo();
tEmpChangeInfo.setProId(updateTEmployeeProject.getId());
//保存档案划转记录
this.save(tEmpChangeInfo);
return R.ok();
return R.ok(null,resStr.toString());
}
}
......@@ -1089,6 +1089,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
for (TEmployeeProject delProject : list) {
++i;
try {
if (delProject.getContractStatus() == CommonConstants.dingleDigitIntArray[1] ||
delProject.getInsuranceStatus() != CommonConstants.dingleDigitIntArray[0] ||
delProject.getSocialStatus() != CommonConstants.dingleDigitIntArray[0] ||
delProject.getFundStatus() != CommonConstants.dingleDigitIntArray[0]) {
errorList.add(new ErrorMessage(i, delProject.getEmpName() + ";" +
delProject.getEmpIdcard() + ";" + delProject.getDeptNo() + ";" + "人员在该项目下存在进行中/未完结的服务,禁止删除"));
continue;
}
if (CommonConstants.dingleDigitIntArray[0] == delProject.getStatus()) {
delProject.setDeleteFlag(CommonConstants.ONE_STRING);
updList.add(delProject);
......
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