Commit 47748a80 by jianan

来佣率分隔符拆分读取佣率

parent f22d7605
......@@ -247,13 +247,20 @@ public class ApiCommissionExpectedController {
if (policy == null) {
return Result.fail(ErrorCode.PARAMS_ERROR.getCode(), "保单不存在");
}
PolicyFollow policyFollow = policyFollowService.lambdaQuery().eq(PolicyFollow::getPolicyNo, request.getPolicyNo()).one();
if (policyFollow == null) {
return Result.fail(ErrorCode.PARAMS_ERROR.getCode(), "新单跟进不存在");
}
commissionExpectedService.getExpectedCommissionByProductlaunchId(
policy,
request.getProductLaunchBizId(),
request.getInsuranceCompanyBizId(),
request.getReconciliationCompany(),
request.getReconciliationCompanyCode(),
request.getReconciliationCompanyBizId());
request.getReconciliationCompanyBizId(),
policyFollow.getProfessionalInvestor());
return Result.success(true);
}
......
......@@ -239,4 +239,7 @@ public class PolicyFollowDto implements Serializable {
@Schema(description = "保单类型: 1-电子, 2-纸质")
private String policyType;
@Schema(description = "专业投资者: Yes/No")
private String professionalInvestor;
}
package com.yd.csf.service.helper;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
/**
* 规格条件匹配器
*/
public class SpeciesConditionMatcher {
/**
* 判断条件是否匹配
* @param typeCode 条件类型代码
* @param conditionValue 配置的条件值
* @param actualValue 实际值
* @return true-匹配,false-不匹配
*/
public static boolean matches(String typeCode, String conditionValue, Object actualValue) {
if (StringUtils.isBlank(conditionValue) || actualValue == null) {
return false;
}
String actualValueStr = String.valueOf(actualValue);
// 范围匹配类型
if ("AGE".equals(typeCode) || "PREMIUM".equals(typeCode)) {
return matchesRange(conditionValue, actualValue);
}
// 精确匹配类型(包括专业投资者,不区分大小写)
if ("PI".equals(typeCode)) {
return conditionValue.equalsIgnoreCase(actualValueStr);
}
// 其他类型精确匹配
return conditionValue.equals(actualValueStr);
}
/**
* 范围匹配
* 支持格式:
* - "0-10" 表示 [0, 10] 闭区间
* - "10-" 表示 >= 10
* - "-10" 表示 <= 10
* - "10" 表示等于 10
* - "0-64岁" 表示 [0, 64] 闭区间
*/
private static boolean matchesRange(String conditionValue, Object actualValue) {
try {
BigDecimal actual = toBigDecimal(actualValue);
// 解析范围表达式
String expression = conditionValue.replace("岁", "").trim();
if (!expression.contains("-")) {
// 单个值 "10"
BigDecimal value = new BigDecimal(expression);
return actual.compareTo(value) == 0;
}
String[] parts = expression.split("-");
if (parts.length != 2) {
return false;
}
String left = parts[0].trim();
String right = parts[1].trim();
if (left.isEmpty() && right.isEmpty()) {
// "-" 无效
return false;
} else if (left.isEmpty()) {
// "-10" 表示 <= 10
BigDecimal max = new BigDecimal(right);
return actual.compareTo(max) <= 0;
} else if (right.isEmpty()) {
// "10-" 表示 >= 10
BigDecimal min = new BigDecimal(left);
return actual.compareTo(min) >= 0;
} else {
// "0-10" 表示 [0, 10]
BigDecimal min = new BigDecimal(left);
BigDecimal max = new BigDecimal(right);
return actual.compareTo(min) >= 0 && actual.compareTo(max) <= 0;
}
} catch (Exception e) {
return false;
}
}
/**
* 将对象转换为 BigDecimal
*/
private static BigDecimal toBigDecimal(Object value) {
if (value instanceof BigDecimal) {
return (BigDecimal) value;
}
if (value instanceof Number) {
return new BigDecimal(value.toString());
}
// 处理 "0-64岁" 格式,提取第一个数字
String str = String.valueOf(value).replace("岁", "").trim();
if (str.contains("-")) {
str = str.split("-")[0];
}
return new BigDecimal(str);
}
/**
* 获取条件名称
*/
public static String getConditionName(String typeCode) {
switch (typeCode) {
case "PAYMENT_TERM":
return "供款年期";
case "RECONCILIATION_COMPANY":
return "出单经纪公司";
case "AGE":
return "投保年龄";
case "PREMIUM":
return "期缴保费";
case "PROFESSIONAL_INVESTOR":
return "专业投资者";
case "POLICY_CURRENCY":
return "保单币种";
case "PROTECTION_PERIOD":
return "保障年期";
default:
return typeCode;
}
}
}
......@@ -355,6 +355,11 @@ public class PolicyFollow implements Serializable {
private String deliveryNo;
/**
* 专业投资者: Yes/No
*/
private String professionalInvestor;
/**
* 邮寄物品
*/
private String mailingItem;
......
package com.yd.csf.service.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
* 规格条件模型
*/
@Data
public class SpeciesCondition {
/**
* 规格类型业务ID
*/
@JsonProperty("speciesTypeBizId")
private String speciesTypeBizId;
/**
* 条件类型编码
*/
@JsonProperty("typeCode")
private String typeCode;
/**
* 条件类型名称
*/
@JsonProperty("typeName")
private String typeName;
/**
* 条件值
*/
@JsonProperty("value")
private String value;
/**
* 是否为演示
*/
@JsonProperty("isIllustration")
private String isIllustration;
/**
* 演示URL
*/
@JsonProperty("illustrationUrl")
private String illustrationUrl;
}
......@@ -59,7 +59,7 @@ public interface CommissionExpectedService extends IService<CommissionExpected>
CommissionExpected getByBizId(String commissionExpectedBizId);
void getExpectedCommissionByProductlaunchId(Policy policy, String productLaunchBizId, String insuranceCompanyBizId, String reconciliationCompany, String reconciliationCompanyCode, String reconciliationCompanyBizId);
void getExpectedCommissionByProductlaunchId(Policy policy, String productLaunchBizId, String insuranceCompanyBizId, String reconciliationCompany, String reconciliationCompanyCode, String reconciliationCompanyBizId, String professionalInvestor);
List<ApiExpectedSpeciesListResponse> queryExpectedSpeciesByFeign(String productLaunchBizId);
......
......@@ -527,25 +527,6 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
//冷静期结束日期
policy.setCoolingOffEndDate(changePolicyFollowStatusRequest.getCoolingOffEndDate() != null ? changePolicyFollowStatusRequest.getCoolingOffEndDate() : policy.getCoolingOffEndDate());
// if (ObjectUtils.isEmpty(policy.getInsuranceCompany()) || ObjectUtils.isEmpty(policy.getInsuranceCompanyBizId())) {
// // 获取保单产品信息,填充对账公司相关字段
// PolicyProductInfo productInfo = getPolicyProductInfo(policyFollow.getProductLaunchBizId());
// if (productInfo != null) {
// if (ObjectUtils.isNotEmpty(productInfo.getInsuranceCompany())) {
// policy.setInsuranceCompany(productInfo.getInsuranceCompany());
// }
// if (ObjectUtils.isNotEmpty(productInfo.getInsuranceCompanyBizId())) {
// policy.setInsuranceCompanyBizId(productInfo.getInsuranceCompanyBizId());
// }
// if (ObjectUtils.isNotEmpty(productInfo.getReconciliationCompanyBizId())) {
// policy.setReconciliationCompany(productInfo.getReconciliationCompany());
// }
// if (ObjectUtils.isNotEmpty(productInfo.getReconciliationCompanyBizId())) {
// policy.setReconciliationCompanyBizId(productInfo.getReconciliationCompanyBizId());
// }
// }
// }
// 保存保单
policyService.updateById(policy);
......@@ -1013,7 +994,8 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
insuranceCompanyBizId,
reconciliationCompany,
reconciliationCompanyCode,
reconciliationCompanyBizId
reconciliationCompanyBizId,
policyFollow.getProfessionalInvestor()
);
}
......
......@@ -514,6 +514,12 @@ public class PolicyFollowDetailVO implements Serializable {
@Schema(description = "保单类型: 1-电子, 2-纸质")
private String policyType;
/**
* 专业投资者: Yes/No
*/
@Schema(description = "专业投资者: Yes/No")
private String professionalInvestor;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
......
......@@ -141,6 +141,12 @@ public class PolicyFollowVO implements Serializable {
private String policyType;
/**
* 专业投资者: Yes/No
*/
@Schema(description = "专业投资者: Yes/No")
private String professionalInvestor;
/**
* 邮寄物品
*/
@Schema(description = "邮寄物品")
......
......@@ -75,6 +75,7 @@
<result property="brokerSignDate" column="broker_sign_date" />
<result property="insurerMailingDate" column="insurer_mailing_date" />
<result property="customerSignDate" column="customer_sign_date" />
<result property="professionalInvestor" column="professional_investor" />
<result property="attachments" column="attachments" />
<result property="remark" column="remark" />
<result property="isDeleted" column="is_deleted" />
......@@ -99,8 +100,8 @@
initial_premium,initial_premium_total,initial_payment_status,initial_premium_discount,
mailing_method,renewal_payment_method,dividend_distribution_method,delivery_no,
policy_levy,initial_premium_paid,initial_premium_due,latest_payment_date,broker_sign_date,
insurer_mailing_date,customer_sign_date,attachments,remark,is_deleted,
creator_id,updater_id,create_time,update_time,policy_type
insurer_mailing_date,customer_sign_date,professional_investor,attachments,remark,is_deleted,
creator_id,updater_id,create_time,update_time,policy_type,is_join
</sql>
<select id="queryPolicyReportData" resultType="com.yd.csf.service.dto.PolicyReportData">
......
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