Commit 414fd33a authored by zhenbin wang's avatar zhenbin wang

feature-wzb:合同重复添加bug修复

parent 8fb96f8a
...@@ -191,7 +191,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -191,7 +191,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
return R.failed(validity.getErrorInfo(), ResultConstants.VALIDITY_FAIL); return R.failed(validity.getErrorInfo(), ResultConstants.VALIDITY_FAIL);
} }
return this.saveContractAndAtta(tEmployeeContractInfo,user); return this.saveContractAndAtta(tEmployeeContractInfo, user);
} }
/** /**
...@@ -223,7 +223,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -223,7 +223,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (contractInfo == null) { if (contractInfo == null) {
return R.failed("无在用合同,无法续签"); return R.failed("无在用合同,无法续签");
} else if (contractInfo.getContractEnd() == null } else if (contractInfo.getContractEnd() == null
|| !(DateUtil.formatDate(DateUtil.addDayByDate(contractInfo.getContractEnd(),1)).equals(DateUtil.formatDate(tEmployeeContractInfo.getContractStart()))) || !(DateUtil.formatDate(DateUtil.addDayByDate(contractInfo.getContractEnd(), 1)).equals(DateUtil.formatDate(tEmployeeContractInfo.getContractStart())))
) { ) {
return R.failed("续签请注意上一份合同的截止日期!"); return R.failed("续签请注意上一份合同的截止日期!");
} }
...@@ -246,39 +246,39 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -246,39 +246,39 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
} }
} }
if(!EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()) &&!EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())){ if (!EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()) && !EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())) {
if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType())){ if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType()) || CommonConstants.ZERO_STRING.equals(tEmployeeContractInfo.getContractType())) {
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda() TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart()) .eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT) .and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT) .or()
.or() .eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT) .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
) )
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) { if (contractInfo != null) {
return R.failed("该员工已存在相同起始日期的合同,禁止重复添加"); return R.failed("该员工已存在相同起始日期的合同,禁止重复添加");
}
} }
} TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart()) .eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, tEmployeeContractInfo.getContractEnd()) .eq(TEmployeeContractInfo::getContractEnd, tEmployeeContractInfo.getContractEnd())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT) .and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or() .or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT) .eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
) )
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) { if (contractInfo != null) {
return R.failed("该员工已存在相同起始和截止日期的合同,禁止重复添加"); return R.failed("该员工已存在相同起始和截止日期的合同,禁止重复添加");
} }
}
} }
}
return null; return null;
} }
...@@ -307,16 +307,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -307,16 +307,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (null != validity.getErrorInfo() && !validity.getErrorInfo().isEmpty()) { if (null != validity.getErrorInfo() && !validity.getErrorInfo().isEmpty()) {
return R.failed(validity.getErrorInfo(), ResultConstants.VALIDITY_FAIL); return R.failed(validity.getErrorInfo(), ResultConstants.VALIDITY_FAIL);
} }
if(!EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()) &&!EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())){ if (!EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()) && !EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())) {
if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType())){ if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType()) || CommonConstants.ZERO_STRING.equals(tEmployeeContractInfo.getContractType())) {
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda() TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart()) .eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT) .and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or() .or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT) .eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
) )
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) { if (contractInfo != null) {
...@@ -327,11 +327,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -327,11 +327,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart()) .eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, tEmployeeContractInfo.getContractEnd()) .eq(TEmployeeContractInfo::getContractEnd, tEmployeeContractInfo.getContractEnd())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT) .and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or() .or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT) .eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
) )
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) { if (contractInfo != null) {
...@@ -468,7 +468,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -468,7 +468,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
initType(tEmployeeContractInfo); initType(tEmployeeContractInfo);
// 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过 // 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过
this.judgeAuditStatus(tEmployeeContractInfo,user); this.judgeAuditStatus(tEmployeeContractInfo, user);
if (Common.isEmpty(tEmployeeContractInfo.getId())) { if (Common.isEmpty(tEmployeeContractInfo.getId())) {
// 针对编码再做一次重复性校验 // 针对编码再做一次重复性校验
...@@ -496,27 +496,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -496,27 +496,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
/** /**
* @Author fxj * @Author fxj
* @Description 初始化审核类型 审核类型:0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止 * @Description 初始化审核类型 审核类型:0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止
* @Date 15:28 2022/11/7 * @Date 15:28 2022/11/7
**/ **/
private void initType(TEmployeeContractInfo tEmployeeContractInfo) { private void initType(TEmployeeContractInfo tEmployeeContractInfo) {
// 初始化审核类型 审核类型:0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止 // 初始化审核类型 审核类型:0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止
if (ArchivesConstants.contractSituation[0].equals(tEmployeeContractInfo.getSituation())){ if (ArchivesConstants.contractSituation[0].equals(tEmployeeContractInfo.getSituation())) {
// 作废 // 作废
tEmployeeContractInfo.setType(CommonConstants.THREE_STRING); tEmployeeContractInfo.setType(CommonConstants.THREE_STRING);
} }
if (ArchivesConstants.contractSituation[6].equals(tEmployeeContractInfo.getSituation())){ if (ArchivesConstants.contractSituation[6].equals(tEmployeeContractInfo.getSituation())) {
// 终止 // 终止
tEmployeeContractInfo.setType(CommonConstants.FOUR_STRING); tEmployeeContractInfo.setType(CommonConstants.FOUR_STRING);
} }
if (ArchivesConstants.contractSituation[1].equals(tEmployeeContractInfo.getSituation()) if (ArchivesConstants.contractSituation[1].equals(tEmployeeContractInfo.getSituation())
|| ArchivesConstants.contractSituation[2].equals(tEmployeeContractInfo.getSituation()) || ArchivesConstants.contractSituation[2].equals(tEmployeeContractInfo.getSituation())
|| ArchivesConstants.contractSituation[4].equals(tEmployeeContractInfo.getSituation()) || ArchivesConstants.contractSituation[4].equals(tEmployeeContractInfo.getSituation())
|| ArchivesConstants.contractSituation[5].equals(tEmployeeContractInfo.getSituation())){ || ArchivesConstants.contractSituation[5].equals(tEmployeeContractInfo.getSituation())) {
// 离职再入职 合同未到期重新签订 商务合同更改 正常续签 // 离职再入职 合同未到期重新签订 商务合同更改 正常续签
tEmployeeContractInfo.setType(CommonConstants.TWO_STRING); tEmployeeContractInfo.setType(CommonConstants.TWO_STRING);
} }
if (ArchivesConstants.contractSituation[3].equals(tEmployeeContractInfo.getSituation())){ if (ArchivesConstants.contractSituation[3].equals(tEmployeeContractInfo.getSituation())) {
//正常签订 //正常签订
tEmployeeContractInfo.setType(CommonConstants.ONE_STRING); tEmployeeContractInfo.setType(CommonConstants.ONE_STRING);
} }
...@@ -647,10 +647,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -647,10 +647,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeProjectService.updateById(tEmployeeProject); tEmployeeProjectService.updateById(tEmployeeProject);
} }
} }
@Override @Override
public boolean updateInUseStatusById(String empId,String deptNo,String ContractId){ public boolean updateInUseStatusById(String empId, String deptNo, String ContractId) {
return baseMapper.updateInUseStatusById(empId, deptNo, ContractId, CommonConstants.ONE_STRING) >0; return baseMapper.updateInUseStatusById(empId, deptNo, ContractId, CommonConstants.ONE_STRING) > 0;
} }
@Override @Override
public R<String> auditContract(TEmployeeContractInfo tEmployeeContractInfo, YifuUser user) { public R<String> auditContract(TEmployeeContractInfo tEmployeeContractInfo, YifuUser user) {
if (tEmployeeContractInfo != null) { if (tEmployeeContractInfo != null) {
...@@ -727,7 +729,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -727,7 +729,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 判断人员有无审核通过的其他合同 // 判断人员有无审核通过的其他合同
TEmployeeContractInfo contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query() TEmployeeContractInfo contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpId, contractInfo.getEmpId()) .lambda().eq(TEmployeeContractInfo::getEmpId, contractInfo.getEmpId())
.and(obj->obj.ge(TEmployeeContractInfo::getContractEnd,DateUtil.getThisDayByPatten("yyyy-MM-dd")) .and(obj -> obj.ge(TEmployeeContractInfo::getContractEnd, DateUtil.getThisDayByPatten("yyyy-MM-dd"))
.or().isNull(TEmployeeContractInfo::getContractEnd)) .or().isNull(TEmployeeContractInfo::getContractEnd))
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
...@@ -1132,16 +1134,17 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1132,16 +1134,17 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
errorInfo.append(EmployeeConstants.WORKING_HOURS_EMPTY); errorInfo.append(EmployeeConstants.WORKING_HOURS_EMPTY);
} }
} }
if(!EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation()) &&!EmployeeConstants.SITUATION_SIX.equals(insert.getSituation())){ if (!EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation()) && !EmployeeConstants.SITUATION_SIX.equals(insert.getSituation())) {
if (CommonConstants.TWO_STRING.equals(insert.getContractType())){ if (CommonConstants.TWO_STRING.equals(insert.getContractType()) || CommonConstants.ZERO_STRING.equals(insert.getContractType())) {
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda() TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, insert.getContractStart()) .eq(TEmployeeContractInfo::getContractStart, insert.getContractStart())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT) .and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or() .or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT) .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
) )
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) { if (contractInfo != null) {
...@@ -1153,11 +1156,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1153,11 +1156,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, insert.getContractStart()) .eq(TEmployeeContractInfo::getContractStart, insert.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, insert.getContractEnd()) .eq(TEmployeeContractInfo::getContractEnd, insert.getContractEnd())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT) .and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or() .or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT) .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
) )
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) { if (contractInfo != null) {
...@@ -1204,7 +1208,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1204,7 +1208,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
/** /**
* @Description: 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过, * @Description: 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过,
* 判断同项目的社保公积金都已派减,则无需审核 * 判断同项目的社保公积金都已派减,则无需审核
* @Author: hgw * @Author: hgw
* @Date: 2022/11/28 10:05 * @Date: 2022/11/28 10:05
* @return: void * @return: void
...@@ -1214,14 +1218,14 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1214,14 +1218,14 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private void judgeAuditStatus(TEmployeeContractInfo insert, YifuUser user) { private void judgeAuditStatus(TEmployeeContractInfo insert, YifuUser user) {
if (insert.getAuditStatus() == CommonConstants.ONE_INT if (insert.getAuditStatus() == CommonConstants.ONE_INT
&& (EmployeeConstants.CONTRACT_NAME[0].equals(insert.getContractName()) && (EmployeeConstants.CONTRACT_NAME[0].equals(insert.getContractName())
|| EmployeeConstants.CONTRACT_NAME[1].equals(insert.getContractName()) || EmployeeConstants.CONTRACT_NAME[1].equals(insert.getContractName())
|| EmployeeConstants.CONTRACT_NAME[2].equals(insert.getContractName()))) { || EmployeeConstants.CONTRACT_NAME[2].equals(insert.getContractName()))) {
TSocialFundInfo sf = new TSocialFundInfo(); TSocialFundInfo sf = new TSocialFundInfo();
sf.setEmpIdcard(insert.getEmpIdcard()); sf.setEmpIdcard(insert.getEmpIdcard());
sf.setSettleDomain(insert.getSettleDomain()); sf.setSettleDomain(insert.getSettleDomain());
R<Integer> socialFundR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId() R<Integer> socialFundR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tsocialfundinfo/inner/selectSocialFoundByContract", sf, Integer.class, SecurityConstants.FROM_IN); , "/tsocialfundinfo/inner/selectSocialFoundByContract", sf, Integer.class, SecurityConstants.FROM_IN);
if(CommonConstants.ONE_STRING.equals(insert.getSituation()) || CommonConstants.TWO_STRING.equals(insert.getSituation()) || CommonConstants.THREE_STRING.equals(insert.getSituation()) || CommonConstants.FOUR_STRING.equals(insert.getSituation())){ if (CommonConstants.ONE_STRING.equals(insert.getSituation()) || CommonConstants.TWO_STRING.equals(insert.getSituation()) || CommonConstants.THREE_STRING.equals(insert.getSituation()) || CommonConstants.FOUR_STRING.equals(insert.getSituation())) {
if (socialFundR != null && socialFundR.getData() != null && socialFundR.getData() > 0) { if (socialFundR != null && socialFundR.getData() != null && socialFundR.getData() > 0) {
insert.setAuditStatus(CommonConstants.TWO_INT); insert.setAuditStatus(CommonConstants.TWO_INT);
insert.setAuditUserName(user.getNickname()); insert.setAuditUserName(user.getNickname());
...@@ -1249,12 +1253,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1249,12 +1253,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
response.setCharacterEncoding(CommonConstants.UTF8); response.setCharacterEncoding(CommonConstants.UTF8);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 获取所有字典type // 获取所有字典type
Map<String,String> nameAndDicTypeMap = util.getConverterDicType(); Map<String, String> nameAndDicTypeMap = util.getConverterDicType();
// 获取所有字典对应的值 // 获取所有字典对应的值
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE); Map<String, String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeContractExportVO.class) ExcelWriter excelWriter = EasyExcel.write(out, EmployeeContractExportVO.class)
.registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap)) .registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap))
.includeColumnFieldNames(contractInfo.getExportFields()).build(); .includeColumnFieldNames(contractInfo.getExportFields()).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
...@@ -1311,12 +1315,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1311,12 +1315,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
response.setCharacterEncoding(CommonConstants.UTF8); response.setCharacterEncoding(CommonConstants.UTF8);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 获取所有字典type // 获取所有字典type
Map<String,String> nameAndDicTypeMap = util.getConverterDicType(); Map<String, String> nameAndDicTypeMap = util.getConverterDicType();
// 获取所有字典对应的值 // 获取所有字典对应的值
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE); Map<String, String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeContractExportVO.class) ExcelWriter excelWriter = EasyExcel.write(out, EmployeeContractExportVO.class)
.registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap)) .registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap))
.includeColumnFieldNames(contractInfo.getExportFields()).build(); .includeColumnFieldNames(contractInfo.getExportFields()).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
...@@ -1370,12 +1374,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1370,12 +1374,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8")); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list); //EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeContractExportAuditVO.class).build(); ExcelWriter excelWriter = EasyExcel.write(out, EmployeeContractExportAuditVO.class).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT){ if (count > CommonConstants.ZERO_INT) {
Field[] allFields = EmployeeContractExportAuditVO.class.getDeclaredFields(); Field[] allFields = EmployeeContractExportAuditVO.class.getDeclaredFields();
WriteSheet writeSheet; WriteSheet writeSheet;
ExcelUtil<EmployeeContractExportAuditVO> util; ExcelUtil<EmployeeContractExportAuditVO> util;
...@@ -1384,34 +1388,34 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1384,34 +1388,34 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo); list = noPageDiy(searchVo);
if (Common.isNotNull(list)){ if (Common.isNotNull(list)) {
util = new ExcelUtil<>(EmployeeContractExportAuditVO.class); util = new ExcelUtil<>(EmployeeContractExportAuditVO.class);
for (EmployeeContractExportAuditVO vo:list){ for (EmployeeContractExportAuditVO vo : list) {
util.convertEntityAsso(vo,null,null,null,allFields); util.convertEntityAsso(vo, null, null, null, allFields);
} }
} }
if (Common.isNotNull(list)){ if (Common.isNotNull(list)) {
writeSheet = EasyExcel.writerSheet("合同审核批量导出"+index).build(); writeSheet = EasyExcel.writerSheet("合同审核批量导出" + index).build();
excelWriter.write(list,writeSheet); excelWriter.write(list, writeSheet);
index++; index++;
} }
i = i + CommonConstants.EXCEL_EXPORT_LIMIT; i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)){ if (Common.isNotNull(list)) {
list.clear(); list.clear();
} }
} }
}else { } else {
WriteSheet writeSheet = EasyExcel.writerSheet("合同审核批量导出"+index).build(); WriteSheet writeSheet = EasyExcel.writerSheet("合同审核批量导出" + index).build();
excelWriter.write(list,writeSheet); excelWriter.write(list, writeSheet);
} }
if (Common.isNotNull(list)){ if (Common.isNotNull(list)) {
list.clear(); list.clear();
} }
out.flush(); out.flush();
excelWriter.finish(); excelWriter.finish();
}catch (Exception e){ } catch (Exception e) {
log.error("执行异常" ,e); log.error("执行异常", e);
}finally { } finally {
try { try {
if (null != out) { if (null != out) {
out.close(); out.close();
...@@ -1432,13 +1436,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1432,13 +1436,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
/** /**
* @Author fxj * @Author fxj
* @Description 批量审核合同 * @Description 批量审核合同
* @Date 16:45 2022/12/12 * @Date 16:45 2022/12/12
**/ **/
@Override @Override
public R<List<ErrorMessage>> auditContractBatch(EmpContractAuditVo contractAuditVo, YifuUser user) { public R<List<ErrorMessage>> auditContractBatch(EmpContractAuditVo contractAuditVo, YifuUser user) {
List<TEmployeeContractInfo> contractInfos = baseMapper.selectBatchIds(contractAuditVo.getIds()); List<TEmployeeContractInfo> contractInfos = baseMapper.selectBatchIds(contractAuditVo.getIds());
if (Common.isEmpty(contractInfos)){ if (Common.isEmpty(contractInfos)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE); return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
} }
...@@ -1447,12 +1451,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1447,12 +1451,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TEmployeeContractInfo contractInfoInUse; TEmployeeContractInfo contractInfoInUse;
TEmployeeProject tEmployeeProject; TEmployeeProject tEmployeeProject;
TEmployeeInfo tEmployeeInfo; TEmployeeInfo tEmployeeInfo;
int i =1; int i = 1;
int errorCount=0; int errorCount = 0;
for (TEmployeeContractInfo contract:contractInfos){ for (TEmployeeContractInfo contract : contractInfos) {
i++; i++;
if (contract.getAuditStatus() != CommonConstants.ONE_INT) { if (contract.getAuditStatus() != CommonConstants.ONE_INT) {
errorMessages.add(new ErrorMessage(i,"不是待审核状态!",CommonConstants.RED,contract.getApplyNo())); errorMessages.add(new ErrorMessage(i, "不是待审核状态!", CommonConstants.RED, contract.getApplyNo()));
errorCount++; errorCount++;
continue; continue;
} }
...@@ -1496,7 +1500,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1496,7 +1500,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TEmployeeContractInfo old = this.getById(contract.getOldContractId()); TEmployeeContractInfo old = this.getById(contract.getOldContractId());
if (old != null && Common.isNotNull(old.getId())) { if (old != null && Common.isNotNull(old.getId())) {
if (!CommonConstants.ZERO_STRING.equals(old.getInUse())) { if (!CommonConstants.ZERO_STRING.equals(old.getInUse())) {
errorMessages.add(new ErrorMessage(i,"关联的原合同已不在用!",CommonConstants.RED,contract.getApplyNo())); errorMessages.add(new ErrorMessage(i, "关联的原合同已不在用!", CommonConstants.RED, contract.getApplyNo()));
errorCount++; errorCount++;
continue; continue;
} else { } else {
...@@ -1504,12 +1508,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1504,12 +1508,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
this.updateById(old); this.updateById(old);
} }
} else { } else {
errorMessages.add(new ErrorMessage(i,"未找到关联的原合同!",CommonConstants.RED,contract.getApplyNo())); errorMessages.add(new ErrorMessage(i, "未找到关联的原合同!", CommonConstants.RED, contract.getApplyNo()));
errorCount++; errorCount++;
continue; continue;
} }
} else { } else {
errorMessages.add(new ErrorMessage(i,"未找到关联的原合同!",CommonConstants.RED,contract.getApplyNo())); errorMessages.add(new ErrorMessage(i, "未找到关联的原合同!", CommonConstants.RED, contract.getApplyNo()));
errorCount++; errorCount++;
continue; continue;
} }
...@@ -1533,7 +1537,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1533,7 +1537,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 判断人员有无审核通过的其他合同 // 判断人员有无审核通过的其他合同
contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query() contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpId, contract.getEmpId()) .lambda().eq(TEmployeeContractInfo::getEmpId, contract.getEmpId())
.and(obj->obj.ge(TEmployeeContractInfo::getContractEnd,DateUtil.getThisDayByPatten("yyyy-MM-dd")) .and(obj -> obj.ge(TEmployeeContractInfo::getContractEnd, DateUtil.getThisDayByPatten("yyyy-MM-dd"))
.or().isNull(TEmployeeContractInfo::getContractEnd)) .or().isNull(TEmployeeContractInfo::getContractEnd))
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
...@@ -1550,9 +1554,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1550,9 +1554,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 不是待提交,记录审核记录 // 不是待提交,记录审核记录
this.setAuditInfo(tEmployeeContractInfo); this.setAuditInfo(tEmployeeContractInfo);
this.updateById(tEmployeeContractInfo); this.updateById(tEmployeeContractInfo);
errorMessages.add(new ErrorMessage(i,"审核成功!",CommonConstants.GREEN,contract.getApplyNo())); errorMessages.add(new ErrorMessage(i, "审核成功!", CommonConstants.GREEN, contract.getApplyNo()));
} }
if (errorCount == CommonConstants.ZERO_INT){ if (errorCount == CommonConstants.ZERO_INT) {
return R.ok(); return R.ok();
} }
return R.ok(errorMessages); return R.ok(errorMessages);
...@@ -1560,40 +1564,41 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1560,40 +1564,41 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
/** /**
* B端合同列表查询接口 * B端合同列表查询接口
* @Author fxj *
* @Date 2020-08-25
* @param page * @param page
* @param contractBusinessPageVo * @param contractBusinessPageVo
* @param flag 0 按3个月内到期提醒 1 不安提醒查询 * @param flag 0 按3个月内到期提醒 1 不安提醒查询
* @return * @return
* @Author fxj
* @Date 2020-08-25
**/ **/
@Override @Override
public IPage<EmpContractBusinessPageVo> getContractBusinessPage(Page<EmpContractBusinessPageVo> page, EmpContractBusinessPageVo contractBusinessPageVo, List<String> settleDomainIds, Integer flag) { public IPage<EmpContractBusinessPageVo> getContractBusinessPage(Page<EmpContractBusinessPageVo> page, EmpContractBusinessPageVo contractBusinessPageVo, List<String> settleDomainIds, Integer flag) {
IPage<EmpContractBusinessPageVo> pageVoList = baseMapper.getContractBusinessPage(page, contractBusinessPageVo, settleDomainIds,flag); IPage<EmpContractBusinessPageVo> pageVoList = baseMapper.getContractBusinessPage(page, contractBusinessPageVo, settleDomainIds, flag);
List<EmpContractBusinessPageVo> voList = pageVoList.getRecords(); List<EmpContractBusinessPageVo> voList = pageVoList.getRecords();
List<TEmployeeContractInfo> contractInfoList = null; List<TEmployeeContractInfo> contractInfoList = null;
List<String> empIds = new ArrayList<>(); List<String> empIds = new ArrayList<>();
if (Common.isNotNull(voList)){ if (Common.isNotNull(voList)) {
for (EmpContractBusinessPageVo vo:voList){ for (EmpContractBusinessPageVo vo : voList) {
empIds.add(vo.getEmpId()); empIds.add(vo.getEmpId());
} }
} }
if (Common.isNotNull(empIds)){ if (Common.isNotNull(empIds)) {
contractInfoList = baseMapper.selectList(Wrappers.<TEmployeeContractInfo>query().lambda() contractInfoList = baseMapper.selectList(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getIsObsolete,CommonConstants.ZERO_STRING) .eq(TEmployeeContractInfo::getIsObsolete, CommonConstants.ZERO_STRING)
.in(TEmployeeContractInfo::getEmpId,empIds)); .in(TEmployeeContractInfo::getEmpId, empIds));
} }
HashMap<String,Integer> countMap = new HashMap<>(); HashMap<String, Integer> countMap = new HashMap<>();
if (Common.isNotNull(contractInfoList)){ if (Common.isNotNull(contractInfoList)) {
Integer count; Integer count;
for (TEmployeeContractInfo contractInfo:contractInfoList){ for (TEmployeeContractInfo contractInfo : contractInfoList) {
count = countMap.get(contractInfo.getEmpId()); count = countMap.get(contractInfo.getEmpId());
count = null ==count?1:(count+1); count = null == count ? 1 : (count + 1);
countMap.put(contractInfo.getEmpId(),count); countMap.put(contractInfo.getEmpId(), count);
} }
} }
if (Common.isNotNull(voList)){ if (Common.isNotNull(voList)) {
for (EmpContractBusinessPageVo pageVo:voList){ for (EmpContractBusinessPageVo pageVo : voList) {
pageVo.setRenewCount(countMap.get(pageVo.getEmpId())); pageVo.setRenewCount(countMap.get(pageVo.getEmpId()));
} }
} }
...@@ -1603,30 +1608,32 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1603,30 +1608,32 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
/** /**
* B端查询合同到期提醒数(查询3个月内到期的合同) * B端查询合同到期提醒数(查询3个月内到期的合同)
* @Author fxj *
* @Date 2020-08-25
* @param * @param
* @return * @return
* @Author fxj
* @Date 2020-08-25
**/ **/
@Override @Override
public Integer getContractBusinessAlertCount(List<String> settleDomainIds) { public Integer getContractBusinessAlertCount(List<String> settleDomainIds) {
EmpContractBusinessPageVo contractBusinessPageVo = new EmpContractBusinessPageVo(); EmpContractBusinessPageVo contractBusinessPageVo = new EmpContractBusinessPageVo();
contractBusinessPageVo.setInUse(CommonConstants.ZERO_STRING); contractBusinessPageVo.setInUse(CommonConstants.ZERO_STRING);
contractBusinessPageVo.setIsObsolete(CommonConstants.ZERO_STRING); contractBusinessPageVo.setIsObsolete(CommonConstants.ZERO_STRING);
return baseMapper.getContractBusinessAlertCount(contractBusinessPageVo,settleDomainIds,CommonConstants.THREE_INT); return baseMapper.getContractBusinessAlertCount(contractBusinessPageVo, settleDomainIds, CommonConstants.THREE_INT);
} }
/** /**
* B端查询对应员工指定合同ID之外的其他合同信息 * B端查询对应员工指定合同ID之外的其他合同信息
* @Author fxj *
* @Date 2020-08-25
* @param empId * @param empId
* @param contractId * @param contractId
* @return * @return
* @Author fxj
* @Date 2020-08-25
**/ **/
@Override @Override
public List<EmpContractBusinessPageVo> getOtherContractBusinessInfo(String empId, String contractId) { public List<EmpContractBusinessPageVo> getOtherContractBusinessInfo(String empId, String contractId) {
return baseMapper.getOtherContractBusinessInfo(empId,contractId); return baseMapper.getOtherContractBusinessInfo(empId, contractId);
} }
@Override @Override
......
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