Commit 64b7a2bc by jianan

新单跟进39

parent 7072bfb2
......@@ -99,6 +99,8 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
private PolicySecondHolderService policySecondHolderService;
@Resource
private PolicyAdditionalService policyAdditionalService;
@Resource
private IProductPlanService iProductPlanService;
/**
* 预约分页查询
......@@ -504,7 +506,7 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
policyFollowService.saveOrUpdate(follow);
// 同步保存保单(产品计划)
savePolicy(follow, apiProductPlanMainInfoDto, policyBizId, policyTransfer);
savePolicy(apiPolicyholderInfoDto, apiInsurantInfoDto, apiProductPlanMainInfoDto, policyBizId, policyTransfer);
// 同步保存保单产品计划附加险
savePolicyAdditional(apiProductPlanAdditionalInfoDtoList, policyBizId);
// 同步保存保单投保人
......@@ -626,28 +628,52 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
return policyPolicyholderService.saveOrUpdate(policyPolicyholder);
}
private boolean savePolicy(PolicyFollow policyFollow, ApiProductPlanMainInfoDto apiProductPlanMainInfoDto, String policyBizId, String policyTransfer) {
if (policyFollow == null) {
private boolean savePolicy(ApiPolicyholderInfoDto apiPolicyholderInfoDto,
ApiInsurantInfoDto apiInsurantInfoDto,
ApiProductPlanMainInfoDto apiProductPlanMainInfoDto,
String policyBizId,
String policyTransfer
) {
String appointmentBizId = apiProductPlanMainInfoDto.getAppointmentBizId();
String planBizId = apiProductPlanMainInfoDto.getPlanBizId();
ProductPlan productPlan = iProductPlanService.queryOne(appointmentBizId, planBizId);
if (productPlan == null) {
return false;
}
// 同步保存保单(产品计划)
Policy policy = new Policy();
BeanUtils.copyProperties(policyFollow, policy);
BeanUtils.copyProperties(productPlan, policy);
policy.setId(null);
policy.setPolicyBizId(policyBizId);
policy.setPlanBizId(apiProductPlanMainInfoDto.getPlanBizId());
policy.setPlanBizId(planBizId);
policy.setStatus(PolicyStatusEnum.INFORCE.getItemValue());
policy.setSumInsured(apiProductPlanMainInfoDto.getSumInsured());
policy.setPaymentTerm(apiProductPlanMainInfoDto.getPaymentTerm());
//首期保费(不含徽费,预缴保费)每期保费
policy.setInitialPremium(apiProductPlanMainInfoDto.getEachIssuePremium());
//保险公司
policy.setInsurer(apiProductPlanMainInfoDto.getCompanyName());
//是否预缴
policy.setIsPrepaid(apiProductPlanMainInfoDto.getIsPrepay());
//转保声明选项(字典)
// 投保人姓名
if (Objects.nonNull(apiPolicyholderInfoDto)) {
policy.setPolicyHolder(apiPolicyholderInfoDto.getName());
}
// 被保人姓名
if (Objects.nonNull(apiInsurantInfoDto)) {
policy.setInsured(apiInsurantInfoDto.getName());
}
// 保额
policy.setSumInsured(productPlan.getSumInsured());
// 供款年期
policy.setPaymentTerm(productPlan.getPaymentTerm());
// 付款频率(字典)
policy.setPaymentFrequency(productPlan.getPaymentFrequency());
// 每期保费
policy.setPaymentPremium(productPlan.getEachIssuePremium());
// 首期保费(不含徽费,预缴保费)每期保费
policy.setInitialPremium(productPlan.getEachIssuePremium());
// 保险公司
policy.setInsurer(productPlan.getCompanyName());
// 是否预缴
policy.setIsPrepaid(productPlan.getIsPrepay());
// 转保声明选项(字典)
policy.setPolicyTransfer(policyTransfer);
policy.setInsurer(productPlan.getCompanyName());
policy.setCreateTime(new Date());
policy.setUpdateTime(new Date());
......
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