Commit 927974ed authored by fangxinjiang's avatar fangxinjiang

优化-fxj

parent 8046a484
...@@ -446,12 +446,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -446,12 +446,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setId(RandomStringUtils.randomNumeric(19)); detail.setId(RandomStringUtils.randomNumeric(19));
//是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算 //是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算
initJfcdInfo(preDispatchDate, detail,settleList); initJfcdInfo(preDispatchDate, detail,settleList);
//生成收入数据
createInsuranceInfo(detail,mapSelectVo.get(detail.getDeptNo()));
detailList.add(detail); detailList.add(detail);
sourceIdCardList.add(detail.getEmpIdcardNo()); sourceIdCardList.add(detail.getEmpIdcardNo());
baseMapper.insert(detail); baseMapper.insert(detail);
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){ if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
//生成收入数据
createInsuranceInfo(detail,mapSelectVo.get(detail.getDeptNo()));
updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.SEVEN_STRING); updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.SEVEN_STRING);
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.SEVEN_STRING); updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.SEVEN_STRING);
//异步任务推送 //异步任务推送
...@@ -663,10 +663,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -663,10 +663,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
replaceIdList.add(detail.getId()); replaceIdList.add(detail.getId());
//是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算 //是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算
initJfcdInfo(preDispatchDate, detail,settleList); initJfcdInfo(preDispatchDate, detail,settleList);
//生成收入数据
createInsuranceInfo(detail,mapSelectVo.get(detail.getDeptNo()));
baseMapper.insert(detail); baseMapper.insert(detail);
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){ if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
//生成收入数据
createInsuranceInfo(detail,mapSelectVo.get(detail.getDeptNo()));
updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.SEVEN_STRING); updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.SEVEN_STRING);
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.SEVEN_STRING); updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.SEVEN_STRING);
//异步任务推送 //异步任务推送
...@@ -1199,6 +1199,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1199,6 +1199,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceDetailVO.setPremiumType(CommonConstants.ONE_INT); insuranceDetailVO.setPremiumType(CommonConstants.ONE_INT);
} }
} }
if (null != insuranceDetailVO.getPremiumType() && CommonConstants.ONE_INT == insuranceDetailVO.getPremiumType().intValue()){
insuranceDetailVO.setEstimatePremium(BigDecimal.ZERO);
}
long day = LocalDateUtil.betweenDay(insuranceDetailVO.getPolicyStart().toString(),insuranceDetailVO.getPolicyEnd().toString()); long day = LocalDateUtil.betweenDay(insuranceDetailVO.getPolicyStart().toString(),insuranceDetailVO.getPolicyEnd().toString());
long month = LocalDateUtil.betweenMonth(insuranceDetailVO.getPolicyStart().toString(),insuranceDetailVO.getPolicyEnd().toString()); long month = LocalDateUtil.betweenMonth(insuranceDetailVO.getPolicyStart().toString(),insuranceDetailVO.getPolicyEnd().toString());
String defaultSettleId = insuranceDetailVO.getDefaultSettleId(); String defaultSettleId = insuranceDetailVO.getDefaultSettleId();
...@@ -1779,7 +1782,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1779,7 +1782,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//添加日志 //添加日志
newDetail.setPaymentTime(CommonConstants.EMPTY_STRING); newDetail.setPaymentTime(CommonConstants.EMPTY_STRING);
newDetail.setPaymentStatus(CommonConstants.ZERO_STRING); newDetail.setPaymentStatus(CommonConstants.ZERO_STRING);
tBusinessOperateService.saveModificationRecord(detail.getId(),oldDetail,newDetail,"投保退回更新缴费状态、缴费时间","EKP系统"); tBusinessOperateService.saveModificationRecord(detail.getId(),oldDetail,newDetail,"投保退回更新缴费状态、缴费时间",user.getNickname());
//投保成功后再次投保退回,需要将保单生效日期、是否有效、是否过期置为空 //投保成功后再次投保退回,需要将保单生效日期、是否有效、是否过期置为空
if (detail.getSignFlag() == CommonConstants.ONE_INT){ if (detail.getSignFlag() == CommonConstants.ONE_INT){
detail.setHandledTime(null); detail.setHandledTime(null);
...@@ -2202,29 +2205,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2202,29 +2205,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
successOne.add(detail); successOne.add(detail);
updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING); updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING);
updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false); updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false);
//如果是见费出单,生成差额数据 //如果是见费出单,不重复生成预估,具体差额在登记保单保费处处理
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){ if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
//保费存储
TInsuranceSettle settle = new TInsuranceSettle();
settle.setInsDetailId(detail.getId());
settle.setSettleType(CommonConstants.TWO_INT);
settle.setSettleHandleStatus(CommonConstants.ONE_STRING);
settle.setEstimatePremium(BigDecimalUtils.safeAdd(detail.getActualPremium(),detail.getEstimatePremium()));
settle.setActualPremium(BigDecimal.ZERO);
//调完ekp接口才会是1
settle.setIsEstimatePush(CommonConstants.ONE_INT);
settle.setEstimatePushTime(LocalDateTime.now());
settle.setCreateTime(LocalDateTime.now());
settle.setId(RandomStringUtils.randomNumeric(19));
settleList.add(settle);
TInsuranceDetail detailTemp = new TInsuranceDetail();
BeanCopyUtils.copyProperties(detail,detailTemp);
detailTemp.setDefaultSettleId(settle.getId());
detailTemp.setEstimatePremium(BigDecimalUtils.safeAdd(detail.getActualPremium(),detail.getEstimatePremium()));
detailTemp.setActualPremium(BigDecimal.ZERO);
//差额结算
detailTemp.setSettleType(CommonConstants.TWO_INT);
successBanlance.add(detailTemp);
successThree.add(detail); successThree.add(detail);
} }
} }
...@@ -8055,8 +8037,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -8055,8 +8037,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// 预估保费 = 费率 * 购买标准 // 预估保费 = 费率 * 购买标准
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()) BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard())
.multiply(insuranceDetail.getRate()) .multiply(insuranceDetail.getRate())
.setScale(2,BigDecimal.ROUND_HALF_UP) .setScale(2,BigDecimal.ROUND_HALF_UP);
.add(BigDecimal.valueOf(5.00));
param.setEstimatePremium(estimatePremium); param.setEstimatePremium(estimatePremium);
}else { }else {
//按天 //按天
...@@ -8065,8 +8046,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -8065,8 +8046,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//预估保费 = (购买标准 / 365) * 天数 //预估保费 = (购买标准 / 365) * 天数
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()) BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard())
.multiply(new BigDecimal(day)) .multiply(new BigDecimal(day))
.divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP) .divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP);
.add(BigDecimal.valueOf(5.00));
param.setEstimatePremium(estimatePremium); param.setEstimatePremium(estimatePremium);
} }
} }
......
...@@ -639,6 +639,10 @@ public class DoJointInsuranceTask { ...@@ -639,6 +639,10 @@ public class DoJointInsuranceTask {
if (InsurancesConstants.ACTUAL_SETTLE_BILL.equals(param.getSettleType())){ if (InsurancesConstants.ACTUAL_SETTLE_BILL.equals(param.getSettleType())){
ys = 0L; ys = 0L;
} }
//针对启用BPO结算模式的,无论是否为预估模式是否需提前缴费,都不会产生商险的预估数据
if (InsurancesConstants.ESTIMATE_SETTLE_BILL.equals(param.getSettleType())){
return null;
}
}else { }else {
if (!"0".equals(param.getIsJfcd())){ if (!"0".equals(param.getIsJfcd())){
//1、针对非提前缴费也非预估模式也未启用BPO结算模式的项目下,商险只存在实缴费用,实缴费用中应收等于应支——此类费用“实缴费用”需已收才能支出 //1、针对非提前缴费也非预估模式也未启用BPO结算模式的项目下,商险只存在实缴费用,实缴费用中应收等于应支——此类费用“实缴费用”需已收才能支出
......
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