Commit 9b58c4ca authored by huyuchen's avatar huyuchen

商险优化修改

parent 099726a9
...@@ -17,6 +17,7 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.ChangeDeptVo; ...@@ -17,6 +17,7 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.ChangeDeptVo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -42,6 +42,7 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo; ...@@ -42,6 +42,7 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
...@@ -1217,6 +1218,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1217,6 +1218,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
if (CollectionUtils.isNotEmpty(successList)){ if (CollectionUtils.isNotEmpty(successList)){
TInsuranceSettle settle; TInsuranceSettle settle;
SettleVo settleVo;
for (TInsuranceDetail detail : successList) { for (TInsuranceDetail detail : successList) {
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){ if (StringUtils.isNotBlank(detail.getDefaultSettleId())){
settle = tInsuranceSettleService.getById(detail.getDefaultSettleId()); settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
...@@ -1237,7 +1239,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1237,7 +1239,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setEstimatePremium(new BigDecimal("0.00")); detail.setEstimatePremium(new BigDecimal("0.00"));
} }
tInsuranceSettleService.save(burden); tInsuranceSettleService.save(burden);
SettleVo settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId()); settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId());
if(!Common.isEmpty(settleVo) ){ if(!Common.isEmpty(settleVo) ){
//预估推送标识 //预估推送标识
Integer isEstimatePush = settle.getIsEstimatePush(); Integer isEstimatePush = settle.getIsEstimatePush();
...@@ -1393,6 +1395,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1393,6 +1395,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<String> sourceIdCardList = new ArrayList<>(); List<String> sourceIdCardList = new ArrayList<>();
// 被替换的id // 被替换的id
List<String> replaceIdList = new ArrayList<>(); List<String> replaceIdList = new ArrayList<>();
List<TInsuranceSettle> settleList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(detailList)){ if (CollectionUtils.isNotEmpty(detailList)){
TInsuranceReplace one; TInsuranceReplace one;
//项目信息 //项目信息
...@@ -1468,11 +1471,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1468,11 +1471,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle.setSettleType(detail.getSettleType()); settle.setSettleType(detail.getSettleType());
settle.setSettleHandleStatus(CommonConstants.ONE_STRING); settle.setSettleHandleStatus(CommonConstants.ONE_STRING);
settle.setCreateTime(LocalDateTime.now()); settle.setCreateTime(LocalDateTime.now());
settle.setEstimatePushTime(LocalDateTime.now());
settle.setEstimatePremium(estimatePremium); settle.setEstimatePremium(estimatePremium);
//调完ekp接口才会是1 //调完ekp接口才会是1
settle.setIsEstimatePush(CommonConstants.ZERO_INT); settle.setIsEstimatePush(CommonConstants.ZERO_INT);
tInsuranceSettleService.save(settle); String settleId = RandomStringUtils.randomNumeric(19);
detail.setDefaultSettleId(settle.getId()); settle.setId(settleId);
settleList.add(settle);
detail.setDefaultSettleId(settleId);
successTwo.add(detail); successTwo.add(detail);
//生成收入数据 //生成收入数据
createInsuranceInfo(detail,settleDomain); createInsuranceInfo(detail,settleDomain);
...@@ -1506,8 +1512,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1506,8 +1512,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle.setIsEstimatePush(CommonConstants.ONE_INT); settle.setIsEstimatePush(CommonConstants.ONE_INT);
settle.setEstimatePushTime(LocalDateTime.now()); settle.setEstimatePushTime(LocalDateTime.now());
settle.setCreateTime(LocalDateTime.now()); settle.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(settle); String settleId = RandomStringUtils.randomNumeric(19);
detail.setDefaultSettleId(settle.getId()); settle.setId(settleId);
settleList.add(settle);
detail.setDefaultSettleId(settleId);
successTwo.add(detail); successTwo.add(detail);
//生成收入数据 //生成收入数据
createInsuranceInfo(detail,settleDomain); createInsuranceInfo(detail,settleDomain);
...@@ -1540,6 +1548,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1540,6 +1548,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
successList.addAll(successTwo); successList.addAll(successTwo);
successOne.clear(); successOne.clear();
successTwo.clear(); successTwo.clear();
//插入结算数据
if (!settleList.isEmpty()) {
tInsuranceSettleService.saveBatch(settleList);
settleList.clear();
}
// 被替换的老商险,要处理档案状态 // 被替换的老商险,要处理档案状态
if (CollectionUtils.isNotEmpty(sourceIdCardList)) { if (CollectionUtils.isNotEmpty(sourceIdCardList)) {
this.doFailInfo(sourceList, sourceIdCardList, replaceIdList, CommonConstants.THREE_STRING); this.doFailInfo(sourceList, sourceIdCardList, replaceIdList, CommonConstants.THREE_STRING);
...@@ -1804,6 +1817,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1804,6 +1817,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
policy.setPolicyEnd(detail.getPolicyEnd()); policy.setPolicyEnd(detail.getPolicyEnd());
policy.setInsuranceCompanyName(detail.getInsuranceCompanyName()); policy.setInsuranceCompanyName(detail.getInsuranceCompanyName());
policy.setInsuranceTypeName(detail.getInsuranceTypeName()); policy.setInsuranceTypeName(detail.getInsuranceTypeName());
policy.setId(RandomStringUtils.randomNumeric(19));
policyList.add(policy); policyList.add(policy);
//第一次新增插入变更记录表为insert,前端会将insert渲染为批量导入 //第一次新增插入变更记录表为insert,前端会将insert渲染为批量导入
......
...@@ -105,6 +105,22 @@ public class DoJointInsuranceTask { ...@@ -105,6 +105,22 @@ public class DoJointInsuranceTask {
log.info("推送商险明细到EKP结束"); log.info("推送商险明细到EKP结束");
} }
/**
* 保存失败信息
*
* @author zhaji
* @param
* @return {@link String}
*/
private void saveInsuranceEkp(EkpInteractiveParam param, Integer pushType){
TInsuranceEkp ekp = new TInsuranceEkp();
BeanCopyUtils.copyProperties(param,ekp);
ekp.setId(null);
ekp.setCreateTime(LocalDateTime.now());
ekp.setPushType(pushType);
tInsuranceEkpService.save(ekp);
}
/** /**
* 推送EKP * 推送EKP
* *
...@@ -197,22 +213,6 @@ public class DoJointInsuranceTask { ...@@ -197,22 +213,6 @@ public class DoJointInsuranceTask {
} }
} }
/**
* 保存失败信息
*
* @author zhaji
* @param
* @return {@link String}
*/
private void saveInsuranceEkp(EkpInteractiveParam param, Integer pushType){
TInsuranceEkp ekp = new TInsuranceEkp();
BeanCopyUtils.copyProperties(param,ekp);
ekp.setId(null);
ekp.setCreateTime(LocalDateTime.now());
ekp.setPushType(pushType);
tInsuranceEkpService.save(ekp);
}
@Async @Async
public void updateInsuranceSettleStatus(EkpStatusParamVo vo) { public void updateInsuranceSettleStatus(EkpStatusParamVo vo) {
try { try {
......
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