Commit 72c73c8d by jianan

新单跟进同步预约信息15-预计来佣月、预计发佣月

parent 3861cafc
......@@ -762,7 +762,7 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
// 同步转介人
savePolicyBroker(appointment.getFnaBizId(), policyBizId);
// 同步保存保单(产品计划)
savePolicy(productPlan, apiPolicyholderInfoDto, apiInsurantInfoDto, apiProductPlanMainInfoDto, policyBizId, policyTransfer);
savePolicy(productPlan, apiPolicyholderInfoDto, apiInsurantInfoDto, policyBizId, policyTransfer);
// 同步保存保单投保人
savePolicyPolicyholder(apiPolicyholderInfoDto, policyBizId);
// 同步保存保单受保人
......@@ -958,12 +958,9 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
private boolean savePolicy(ProductPlan productPlan,
ApiPolicyholderInfoDto apiPolicyholderInfoDto,
ApiInsurantInfoDto apiInsurantInfoDto,
ApiProductPlanMainInfoDto apiProductPlanMainInfoDto,
String policyBizId,
String policyTransfer
) {
// String appointmentBizId = apiProductPlanMainInfoDto.getAppointmentBizId();
String planBizId = apiProductPlanMainInfoDto.getPlanBizId();
if (productPlan == null) {
return false;
}
......@@ -973,7 +970,7 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
policy.setId(null);
policy.setPolicyBizId(policyBizId);
policy.setProductLaunchBizId(planBizId);
policy.setProductLaunchBizId(productPlan.getProductLaunchBizId());
policy.setStatus(PolicyStatusEnum.INFORCE.getItemValue());
// 投保人姓名
if (Objects.nonNull(apiPolicyholderInfoDto)) {
......
......@@ -520,8 +520,8 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
return Result.success();
}
private static LocalDate calculateExpectedPayoutDate(LocalDate coolingOffEndDate, Integer issueNumber) {
return coolingOffEndDate.plusMonths(2).plusYears(issueNumber - 1);
private static LocalDate calculateExpectedPayoutDate(LocalDate effectiveDate, Integer issueNumber) {
return effectiveDate.plusMonths(2).plusYears(issueNumber - 1);
}
/**
......@@ -573,7 +573,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
//发佣类型 TODO
// .fortuneType()
//发佣日期
.payoutDate(calculateExpectedPayoutDate(brokerDto.getCoolingOffEndDate(), dto.getIssueNumber()))
.payoutDate(calculateExpectedPayoutDate(brokerDto.getEffectiveDate(), dto.getIssueNumber()))
//保单号
.policyNo(brokerDto.getPolicyNo())
//佣金发放状态 0=待出账 1=可出账 2=已出账
......
......@@ -93,6 +93,11 @@ public class Policy implements Serializable {
private String insured;
/**
* 保障年期
*/
private String guaranteePeriod;
/**
* 保额
*/
private Object sumInsured;
......@@ -147,7 +152,7 @@ public class Policy implements Serializable {
*/
private Date underwritingDate;
/**
/**
* 冷却期结束日期
*/
private Date coolingOffEndDate;
......
......@@ -787,20 +787,20 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
}
/**
* 根据保单冷静期到期日和佣金期数计算预计来佣日期,首期为冷静期到期日的2个月,后续期数为首期的次年
* 根据保单生效日和佣金期数计算预计来佣日期,首期为生效日的1个月,后续期数为首期的次年
* @param endPeriod 佣金期数
* @param coolingOffEndDate 保单冷静期到期
* @param effectiveDate 保单生效
* @return 预计来佣日期
*/
private Date calculateCommissionDate(String endPeriod, Date coolingOffEndDate) {
if (coolingOffEndDate == null || StringUtils.isBlank(endPeriod)) {
private Date calculateCommissionDate(String endPeriod, Date effectiveDate) {
if (effectiveDate == null || StringUtils.isBlank(endPeriod)) {
return null;
}
Calendar cal = Calendar.getInstance();
cal.setTime(coolingOffEndDate);
// 首期:保单冷静期到期日的2个月
cal.add(Calendar.MONTH, 2);
cal.setTime(effectiveDate);
// 首期:保单生效日的1个月
cal.add(Calendar.MONTH, 1);
Integer period = Convert.toInt(endPeriod);
if (period == null || period <= 0) {
......
......@@ -509,7 +509,6 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
policy.setPaymentTerm(policyFollow.getIssueNumber());
policy.setUnderwritingDate(changePolicyFollowStatusRequest.getUnderwritingDate());
policy.setEffectiveDate(changePolicyFollowStatusRequest.getEffectiveDate());
policy.setPolicyHolderAge(calculatePolicyHolderAge(policyFollow.getCustomerBizId()));
if (ObjectUtils.isEmpty(policy.getInsuranceCompany()) || ObjectUtils.isEmpty(policy.getInsuranceCompany())) {
// 获取保单产品信息,填充对账公司相关字段
......
......@@ -19,6 +19,7 @@
<result property="policyHolder" column="policy_holder" />
<result property="policyHolderAge" column="policy_holder_age" />
<result property="insured" column="insured" />
<result property="guaranteePeriod" column="guarantee_period" />
<result property="sumInsured" column="sum_insured" />
<result property="paymentTerm" column="payment_term" />
<result property="paymentFrequency" column="payment_frequency" />
......@@ -56,7 +57,7 @@
<sql id="Base_Column_List">
id,policy_biz_id,policy_no,user_biz_id,product_launch_biz_id,product_code,
product_name,product_cate,insurance_company,insurance_company_biz_id,region,
policy_holder,policy_holder_age,insured,sum_insured,payment_term,payment_frequency,payment_premium,
policy_holder,policy_holder_age,insured,guarantee_period,sum_insured,payment_term,payment_frequency,payment_premium,
status,currency,initial_premium,sign_date,issue_date,
effective_date,cooling_off_end_date,cooling_off_days,renewal_date,is_prepaid,deductibles,prepaid_term,
initial_payment_method,renewal_payment_method,dividend_distribution_method,is_backtrack,is_join,
......
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