Commit a19bc946 authored by zhaji's avatar zhaji

"feature-zhaJi:优化变更项目的预估保费逻辑"

parent dfa007d9
...@@ -2805,6 +2805,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2805,6 +2805,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setCreateUesr(user.getId()); cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now()); cancel.setCreateTime(LocalDateTime.now());
tInsuranceSettleCancelService.save(cancel); tInsuranceSettleCancelService.save(cancel);
//查询旧的结算信息
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//推送EKP // TODO: 2022/8/2 //推送EKP // TODO: 2022/8/2
//新增新的结算信息 //新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle(); TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
...@@ -2867,6 +2869,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2867,6 +2869,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setCreateUesr(user.getId()); cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now()); cancel.setCreateTime(LocalDateTime.now());
tInsuranceSettleCancelService.save(cancel); tInsuranceSettleCancelService.save(cancel);
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//旧的结算信息推送作废至EKP
//新增新的结算信息 //新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle(); TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId); newInsuranceSettle.setInsDetailId(insuranceDetailId);
...@@ -2881,7 +2885,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2881,7 +2885,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00")); updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId()); updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper); update(updateWrapper);
//推送新的结算信息 //推送新的结算信息至EKP
} }
//变更为合并结算 //变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){ if (CommonConstants.ZERO_INT == newSettleType){
...@@ -2893,6 +2897,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2893,6 +2897,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setCreateUesr(user.getId()); cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now()); cancel.setCreateTime(LocalDateTime.now());
tInsuranceSettleCancelService.save(cancel); tInsuranceSettleCancelService.save(cancel);
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//新增新的结算信息 //新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle(); TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId); newInsuranceSettle.setInsDetailId(insuranceDetailId);
...@@ -2902,6 +2907,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2902,6 +2907,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING); newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now()); newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium()); newInsuranceSettle.setActualPremium(success.getActualPremium());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettleService.save(newInsuranceSettle); tInsuranceSettleService.save(newInsuranceSettle);
//更新预估费用为新的预估费用 //更新预估费用为新的预估费用
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium()); updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
...@@ -2923,6 +2929,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2923,6 +2929,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setCreateTime(LocalDateTime.now()); cancel.setCreateTime(LocalDateTime.now());
tInsuranceSettleCancelService.save(cancel); tInsuranceSettleCancelService.save(cancel);
//推送至EKP // TODO: 2022/8/2 //推送至EKP // TODO: 2022/8/2
//删除预估费用和结算id
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00")); updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,null); updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,null);
update(updateWrapper); update(updateWrapper);
...@@ -2937,7 +2944,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2937,7 +2944,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setCreateUesr(user.getId()); cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now()); cancel.setCreateTime(LocalDateTime.now());
tInsuranceSettleCancelService.save(cancel); tInsuranceSettleCancelService.save(cancel);
//推送至EKP // TODO: 2022/8/2 TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//推送至EKP作废 // TODO: 2022/8/2
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle(); TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId); newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType); newInsuranceSettle.setSettleType(newSettleType);
...@@ -2945,16 +2954,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2945,16 +2954,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT); newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING); newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now()); newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium()); newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettleService.save(newInsuranceSettle); tInsuranceSettleService.save(newInsuranceSettle);
//更新预估费用为新的预估费用 //更新预估费用
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium()); updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId()); updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper); update(updateWrapper);
//推送新的结算信息 // TODO: 2022/8/2 //推送新的结算信息至EKP // TODO: 2022/8/2
} }
} }
} }
//新增操作信息
TInsuranceOperate insuranceOperate = new TInsuranceOperate(); TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(success.getId()); insuranceOperate.setInsuranceDetailId(success.getId());
insuranceOperate.setCreateBy(user.getId()); insuranceOperate.setCreateBy(user.getId());
......
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