Commit 54d53db0 authored by fangxinjiang's avatar fangxinjiang

手动拉取商险缴费状态-fxj

parent 573d1f7f
...@@ -9682,7 +9682,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -9682,7 +9682,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
public R callBack(TInsuranceDetail detail) { public R callBack(TInsuranceDetail detail) {
String id = detail.getId()+CommonConstants.DOWN_LINE_STRING+detail.getDefaultSettleId(); String id = detail.getId()+CommonConstants.DOWN_LINE_STRING+detail.getDefaultSettleId();
EkpSettleStatusVo vo = ekpSettleService.getSettleStatusFromEkpInsuranceDetailAsso(id); EkpSettleStatusVo vo = ekpSettleService.getSettleStatusFromEkpInsuranceDetailAsso(id);
if (null != vo && "已结算".equals(vo.getSettleStatus()) || "结算中".equals(vo.getSettleStatus())){ if (null != vo && ("已结算".equals(vo.getSettleStatus()) || "结算中".equals(vo.getSettleStatus()))){
return R.failed("已结算或结算中的投保记录不可撤回"); return R.failed("已结算或结算中的投保记录不可撤回");
} }
try { try {
...@@ -9733,25 +9733,33 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -9733,25 +9733,33 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
if (Common.isNotNull(list)){ if (Common.isNotNull(list)){
List<String> idStrs = new ArrayList<>();
for (TInsuranceDetail detail:list){
idStrs.add(detail.getId()+CommonConstants.DOWN_LINE_STRING+detail.getDefaultSettleId());
}
//list转为MAP id 为 key //list转为MAP id 为 key
Map<String,TInsuranceDetail> map = list.stream().collect(Collectors.toMap(TInsuranceDetail::getId, v -> v)); Map<String,TInsuranceDetail> map = list.stream().collect(Collectors.toMap(TInsuranceDetail::getId, v -> v));
List<EkpSettleStatusVo> voList = ekpSettleService.getSettleStatusFromEkpAssoByIds(list.stream() List<EkpSettleStatusVo> voList = ekpSettleService.getSettleStatusFromEkpAssoByIds(idStrs);
.map(TInsuranceDetail::getId).distinct().collect(Collectors.toList()));
if (Common.isNotNull(voList)){ if (Common.isNotNull(voList)){
//如果EKP对应提前缴费的预估数据已结算或已垫付则HRO商险派单状态同步为待投保 //如果EKP对应提前缴费的预估数据已结算或已垫付则HRO商险派单状态同步为待投保
List<TInsuranceDetail> updateList = new ArrayList<>(); List<TInsuranceDetail> updateList = new ArrayList<>();
// 自动化测需要同步更新为待投保 // 自动化测需要同步更新为待投保
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
TInsuranceDetail detail = null; TInsuranceDetail detail = null;
String detailId = null;
for (EkpSettleStatusVo vo : voList){ for (EkpSettleStatusVo vo : voList){
if (("已收".equals(vo.getPaymentStatus()) if (null != vo.getDetailId() && vo.getDetailId().length() > 19){
|| "垫付".equals(vo.getPaymentStatus())) detailId = vo.getDetailId().substring(0,19);
&& map.containsKey(vo.getDetailId())){ if (("已收".equals(vo.getPaymentStatus())
detail = map.get(vo.getDetailId()); || "垫付".equals(vo.getPaymentStatus()))
detail.setPaymentTime(DateUtil.formatDatePatten(new Date(),DateUtil.DATETIME_PATTERN_SECOND)); && map.containsKey(detailId)){
detail.setPaymentStatus(CommonConstants.ONE_STRING); detail = map.get(detailId);
updateList.add(detail); detail.setPaymentTime(DateUtil.formatDatePatten(new Date(),DateUtil.DATETIME_PATTERN_SECOND));
ids.add(vo.getDetailId()); detail.setPaymentStatus(CommonConstants.ONE_STRING);
detail.setBuyHandleStatus(CommonConstants.ONE_INT);
updateList.add(detail);
ids.add(detailId);
}
} }
} }
if (Common.isNotNull(updateList)){ if (Common.isNotNull(updateList)){
...@@ -9761,7 +9769,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -9761,7 +9769,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//通过ids 更新自动化测状态processStatus为待投保 //通过ids 更新自动化测状态processStatus为待投保
LambdaUpdateWrapper<TEmployeeInsurancePre> updateDiyInfoWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TEmployeeInsurancePre> updateDiyInfoWrapper = new LambdaUpdateWrapper<>();
updateDiyInfoWrapper.in(TEmployeeInsurancePre::getInsurancesId, ids) updateDiyInfoWrapper.in(TEmployeeInsurancePre::getInsurancesId, ids)
.set(TEmployeeInsurancePre::getProcessStatus,CommonConstants.SEVEN_STRING); .set(TEmployeeInsurancePre::getProcessStatus,CommonConstants.THREE_STRING);
employeeInsurancePreMapper.update(null, updateDiyInfoWrapper); employeeInsurancePreMapper.update(null, updateDiyInfoWrapper);
} }
} }
......
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