Commit e052cc84 authored by hongguangwu's avatar hongguangwu

合同优化-归档

parent ab1ac225
...@@ -316,17 +316,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -316,17 +316,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
baseMapper.insert(tEmployeeContractInfo); baseMapper.insert(tEmployeeContractInfo);
if (Common.isNotNull(tEmployeeContractInfo.getAttaList()) && Common.isNotNull(tEmployeeContractInfo.getId())) { if (Common.isNotNull(tEmployeeContractInfo.getAttaList()) && Common.isNotNull(tEmployeeContractInfo.getId())) {
List<String> attaList = tEmployeeContractInfo.getAttaList(); this.updateFileMainId(tEmployeeContractInfo);
if (null != attaList && !attaList.isEmpty()) {
TAttaInfo contractAtta;
for (String attaId : attaList) {
contractAtta = tAttaInfoService.getById(attaId);
if (contractAtta != null && Common.isEmpty(contractAtta.getDomainId())) {
contractAtta.setDomainId(tEmployeeContractInfo.getId());
tAttaInfoService.updateById(contractAtta);
}
}
}
} }
} else { } else {
baseMapper.updateById(tEmployeeContractInfo); baseMapper.updateById(tEmployeeContractInfo);
...@@ -339,6 +329,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -339,6 +329,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
return R.ok(null, CommonConstants.SAVE_SUCCESS); return R.ok(null, CommonConstants.SAVE_SUCCESS);
} }
/**
* @param tEmployeeContractInfo
* @Description: 更新附件的合同id
* @Author: hgw
* @Date: 2022/7/20 10:07
* @return: void
**/
private void updateFileMainId(TEmployeeContractInfo tEmployeeContractInfo) {
List<String> attaList = tEmployeeContractInfo.getAttaList();
if (null != attaList && !attaList.isEmpty()) {
TAttaInfo contractAtta;
for (String attaId : attaList) {
contractAtta = tAttaInfoService.getById(attaId);
if (contractAtta != null && Common.isEmpty(contractAtta.getDomainId())) {
contractAtta.setDomainId(tEmployeeContractInfo.getId());
tAttaInfoService.updateById(contractAtta);
}
}
}
}
/** /**
* @param tEmployeeContractInfo * @param tEmployeeContractInfo
* @Description: 保存审核操作记录 * @Description: 保存审核操作记录
...@@ -498,6 +509,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -498,6 +509,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
//档案柜存在就自动归档 //档案柜存在就自动归档
if (Common.isNotNull(tEmployeeContractInfo.getAttaList())) { if (Common.isNotNull(tEmployeeContractInfo.getAttaList())) {
this.updateFileMainId(tEmployeeContractInfo);
this.setFileInfo(tEmployeeContractInfo.getId(), "添加附件"); this.setFileInfo(tEmployeeContractInfo.getId(), "添加附件");
tEmployeeContractInfo.setIsFile(CommonConstants.ZERO_STRING); tEmployeeContractInfo.setIsFile(CommonConstants.ZERO_STRING);
} else { } else {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package com.yifu.cloud.plus.v1.yifu.common.core.constant; package com.yifu.cloud.plus.v1.yifu.common.core.constant;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -130,6 +131,8 @@ public interface CommonConstants { ...@@ -130,6 +131,8 @@ public interface CommonConstants {
* number 0 * number 0
*/ */
int ZERO_INT = 0; int ZERO_INT = 0;
int ONE_INT = 1;
int TWO_INT = 2;
/** /**
* number 1 * number 1
...@@ -359,4 +362,11 @@ public interface CommonConstants { ...@@ -359,4 +362,11 @@ public interface CommonConstants {
public static final int SIXTEEN_INT = 16; public static final int SIXTEEN_INT = 16;
public static final String FIFTEEN = "15"; public static final String FIFTEEN = "15";
public static final String NINETEEN = "19"; public static final String NINETEEN = "19";
//百分之一 1/100
public static final BigDecimal ONE_OF_PERCENT = new BigDecimal("0.01");
// 1/2
public static final BigDecimal HALF_OF_ONE = new BigDecimal("0.5");
public static final BigDecimal TWO_BIG = new BigDecimal("2");
} }
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