Commit 64b7a2bc by jianan

新单跟进39

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