Commit d9a351e8 authored by hongguangwu's avatar hongguangwu

薪资审核优化

parent d263a2e1
......@@ -134,12 +134,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// 过期同步档案逻辑:
List<String> sourceIdCardList = new ArrayList<>();
List<String> replaceIdList = new ArrayList<>();
List<TInsuranceDetail> changeList = new ArrayList<>();
list.stream().forEach(e -> {
if (!LocalDateUtil.isOverdueDate(e.getPolicyEnd().toString())){
e.setIsOverdue(CommonConstants.ONE_INT);
e.setUpdateTime(LocalDateTime.now());
sourceIdCardList.add(e.getEmpIdcardNo());
replaceIdList.add(e.getId());
if (Common.isEmpty(e.getBuyHandleStatus()) || e.getBuyHandleStatus() != CommonConstants.FOUR_INT) {
changeList.add(e);
sourceIdCardList.add(e.getEmpIdcardNo());
replaceIdList.add(e.getId());
}
}
});
......@@ -148,7 +152,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
log.info("定时任务扫描到的已过期数据是:{}条",collect.size());
this.updateBatchById(collect);
}
this.doFailInfo(collect, sourceIdCardList, replaceIdList, CommonConstants.THREE_STRING);
this.doFailInfo(changeList, sourceIdCardList, replaceIdList, CommonConstants.THREE_STRING);
}
}
......@@ -1660,15 +1664,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// (0无2正常3失效4处理中)
if (detail.getBuyHandleStatus() == CommonConstants.FOUR_INT) {
return CommonConstants.ZERO_INT;
} else if (detail.getIsEffect() == CommonConstants.ZERO_INT
&& detail.getIsOverdue() == CommonConstants.ZERO_INT
&& (detail.getBuyHandleStatus() == CommonConstants.THREE_INT
} else if ((Common.isEmpty(detail.getIsEffect()) || detail.getIsEffect() == CommonConstants.ZERO_INT)
&& (Common.isEmpty(detail.getIsOverdue()) || detail.getIsOverdue() == CommonConstants.ZERO_INT)
&& ((Common.isEmpty(detail.getBuyHandleStatus()) || detail.getBuyHandleStatus() == CommonConstants.THREE_INT)
&& (Common.isEmpty(detail.getReduceHandleStatus()) || detail.getReduceHandleStatus() != CommonConstants.FOUR_INT))) {
return CommonConstants.TWO_INT;
} else if (detail.getIsOverdue() == CommonConstants.ONE_INT
|| detail.getIsEffect() == CommonConstants.ONE_INT
|| detail.getReduceHandleStatus() == CommonConstants.FOUR_INT
|| detail.getBuyHandleStatus() == CommonConstants.FIVE_INT) {
} else if ((Common.isNotNull(detail.getIsOverdue()) && detail.getIsOverdue() == CommonConstants.ONE_INT)
|| (Common.isNotNull(detail.getIsEffect()) && detail.getIsEffect() == CommonConstants.ONE_INT)
|| (Common.isNotNull(detail.getReduceHandleStatus()) && detail.getReduceHandleStatus() == CommonConstants.FOUR_INT)
|| (Common.isNotNull(detail.getBuyHandleStatus()) && detail.getBuyHandleStatus() == CommonConstants.FIVE_INT)) {
return CommonConstants.THREE_INT;
} else {
return CommonConstants.FOUR_INT;
......@@ -3912,6 +3916,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceDetail> successList = new ArrayList<>();
List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList);
List<TInsuranceRefund> refundList = new ArrayList<>();
//被替换人的档案要处理状态
List<String> sourceIdCardList = new ArrayList<>();
// 被替换的id
List<String> replaceIdList = new ArrayList<>();
for (TInsuranceDetail tInsuranceDetail : tInsuranceDetails) {
TInsuranceRefund refund = new TInsuranceRefund();
RefundErrorVo refundErrorVo = new RefundErrorVo();
......@@ -3938,6 +3946,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail.setUpdateBy(user.getId());
tInsuranceDetail.setUpdateTime(LocalDateTime.now());
successList.add(tInsuranceDetail);
sourceIdCardList.add(tInsuranceDetail.getEmpIdcardNo());
replaceIdList.add(tInsuranceDetail.getId());
//更新减员记录
refund.setId(tInsuranceDetail.getRefundId());
refund.setUpdateBy(user.getId());
......@@ -3954,6 +3964,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceRefundService.updateByInsDetailId(refund);
}
updateBatchById(successList);
// 减员失效
this.doFailInfo(successList, sourceIdCardList, replaceIdList, CommonConstants.THREE_STRING);
//操作记录
if(CommonConstants.FOUR_INT == refundType){
addOperate(successList,user,InsurancesConstants.INSURANCE_REFUND_SUCCESS,remark,CommonConstants.ONE_INT);
......@@ -3985,27 +3997,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceHandleImportParam> errorList = map.get(InsurancesConstants.ERROR_LIST);
//减员退回
List<TInsuranceOperate> operateList =new ArrayList<>(16);
List<TInsuranceDetail> sourceList = new ArrayList<>();
//被替换人的档案要处理状态
List<String> sourceIdCardList = new ArrayList<>();
// 被替换的id
List<String> replaceIdList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(successList)) {
TInsuranceOperate operate;
TInsuranceDetail detail;
for (InsuranceHandleImportParam param : successList) {
TInsuranceOperate operate = new TInsuranceOperate();
operate = new TInsuranceOperate();
LambdaUpdateWrapper<TInsuranceRefund> refund = new LambdaUpdateWrapper<>();
refund.eq(TInsuranceRefund :: getInsDetailId ,param.getId())
//.set(TInsuranceRefund :: getRemark,param.getRemark())
.set(TInsuranceRefund :: getUpdateTime,LocalDateTime.now())
.set(TInsuranceRefund :: getUpdateBy,user.getId());
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail::getId, param.getId())
.set(TInsuranceDetail::getUpdateBy, user.getId())
.set(TInsuranceDetail::getUpdateTime, LocalDateTime.now());
detail = this.getById(param.getId());
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
if(InsurancesConstants.SUCCESS.equals(param.getHandType())){
updateWrapper.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.FOUR_INT);
updateWrapper.set(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
detail.setReduceHandleStatus(CommonConstants.FOUR_INT);
detail.setBuyHandleStatus(CommonConstants.FIVE_INT);
refund.set(TInsuranceRefund :: getReduceHandleStatus,CommonConstants.FOUR_INT);
}else{
updateWrapper.set(TInsuranceDetail:: getReduceHandleStatus,CommonConstants.THREE_INT);
detail.setReduceHandleStatus(CommonConstants.THREE_INT);
refund.set(TInsuranceRefund :: getReduceHandleStatus,CommonConstants.THREE_INT);
}
update(updateWrapper);
this.updateById(detail);
sourceList.add(detail);
tInsuranceRefundService.update(refund);
operate.setInsuranceDetailId(param.getId());
operate.setRemark(param.getRemark());
......@@ -4019,9 +4038,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
operate.setOperateDesc(InsurancesConstants.INSURANCE_REFUND_FAILED);
}
operateList.add(operate);
sourceIdCardList.add(detail.getEmpIdcardNo());
replaceIdList.add(detail.getId());
}
}
tInsuranceOperateService.saveBatch(operateList);
// 减员失效
this.doFailInfo(sourceList, sourceIdCardList, replaceIdList, CommonConstants.THREE_STRING);
return R.ok(errorList, InsurancesConstants.IMPORT_SUCCESS);
}
......
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