Commit 9b58c4ca authored by huyuchen's avatar huyuchen

商险优化修改

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