|
|
@@ -0,0 +1,441 @@
|
|
|
+package com.ydtech.modules.protocol.entity.po;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.annotation.IdType;
|
|
|
+import com.baomidou.mybatisplus.annotation.TableField;
|
|
|
+import com.baomidou.mybatisplus.annotation.TableId;
|
|
|
+import com.baomidou.mybatisplus.annotation.TableName;
|
|
|
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementUnderwritingRulesSaveDto;
|
|
|
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementUndwrtRulesSaveDto;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import lombok.Data;
|
|
|
+import lombok.NoArgsConstructor;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+
|
|
|
+import java.io.Serializable;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 协议承保规则
|
|
|
+ *
|
|
|
+ * @TableName ptl_agreement_undwrt_rules
|
|
|
+ */
|
|
|
+@TableName(value = "ptl_agreement_undwrt_rules", autoResultMap = true)
|
|
|
+@Data
|
|
|
+@NoArgsConstructor
|
|
|
+@AllArgsConstructor
|
|
|
+public class PtlAgreementUndwrtRules implements Serializable {
|
|
|
+
|
|
|
+
|
|
|
+ private static final long serialVersionUID = -2096076927159362790L;
|
|
|
+ /**
|
|
|
+ * 主键/自增
|
|
|
+ */
|
|
|
+ @TableId(value = "id", type = IdType.AUTO)
|
|
|
+ private String id;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 协议id
|
|
|
+ */
|
|
|
+ @TableField(value = "agreement_id")
|
|
|
+ private String agreementId;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 规则类型(0满足拒保 1满足承包)
|
|
|
+ */
|
|
|
+ @TableField(value = "rules_type")
|
|
|
+ private Integer rulesType;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 产品id
|
|
|
+ */
|
|
|
+ @TableField(value = "product_id")
|
|
|
+ private String productId;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 产品名称
|
|
|
+ */
|
|
|
+ @TableField(value = "product_name")
|
|
|
+ private String productName;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 规则描述
|
|
|
+ */
|
|
|
+ @TableField(value = "rule_description")
|
|
|
+ private String ruleDescription;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否有效(0 否 1 是 )
|
|
|
+ */
|
|
|
+ @TableField(value = "valid_ind")
|
|
|
+ private Integer validInd;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 过户车(0 否 1 是 )
|
|
|
+ */
|
|
|
+ @TableField(value = "transfer")
|
|
|
+ private Integer transfer;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新旧车(0 否 1 是 )
|
|
|
+ */
|
|
|
+ @TableField(value = "old_and_new")
|
|
|
+ private Integer oldAndNew;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 过户车(0 否 1 是 )
|
|
|
+ */
|
|
|
+ @TableField(value = "new_energy")
|
|
|
+ private Integer newEnergy;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 续保车(0 否 1 是 )
|
|
|
+ */
|
|
|
+ @TableField(value = "renewal")
|
|
|
+ private Integer renewal;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 车辆大类
|
|
|
+ */
|
|
|
+ @TableField(value = "vehicle_category")
|
|
|
+ private String vehicleCategory;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 使用性质
|
|
|
+ */
|
|
|
+ @TableField(value = "nature_of_use")
|
|
|
+ private String natureOfUse;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 客车座位数(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_seats")
|
|
|
+ private Integer minSeats;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 客车座位数(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_seats")
|
|
|
+ private Integer maxSeats;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 货车吨位数(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_truck_tonnage")
|
|
|
+ private Double minTruckTonnage;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 货车吨位数(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_truck_tonnage")
|
|
|
+ private Double maxTruckTonnage;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新车购置价(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_purchase_price")
|
|
|
+ private Integer minPurchasePrice;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新车购置价(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_purchase_price")
|
|
|
+ private Integer maxPurchasePrice;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 核定载质量(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_approved_load_capacity")
|
|
|
+ private Double minApprovedLoadCapacity;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 核定载质量(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_approved_load_capacity")
|
|
|
+ private Double maxApprovedLoadCapacity;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 交强险保费(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_compulsory_insurance_premium")
|
|
|
+ private Integer minCompulsoryInsurancePremium;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 交强险保费(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_compulsory_insurance_premium")
|
|
|
+ private Integer maxCompulsoryInsurancePremium;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 车船税金额(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_tax_amount")
|
|
|
+ private Integer minTaxAmount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 车船税金额(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_tax_amount")
|
|
|
+ private Integer maxTaxAmount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 三者险保额(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_the_three_premium")
|
|
|
+ private Integer minTheThreePremium;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 三者险保额(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_the_three_premium")
|
|
|
+ private Integer maxTheThreePremium;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 随车产品保费(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_onboard_products_premium")
|
|
|
+ private Integer minOnboardProductsPremium;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 随车产品保费(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_onboard_products_premium")
|
|
|
+ private Integer maxOnboardProductsPremium;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 商业险折扣(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_commercial_insurance_discount")
|
|
|
+ private Double minCommercialInsuranceDiscount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 商业险折扣(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_commercial_insurance_discount")
|
|
|
+ private Double maxCommercialInsuranceDiscount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 交强险折扣(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_compulsory_insurance_discount")
|
|
|
+ private Double minCompulsoryInsuranceDiscount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 交强险折扣(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_compulsory_insurance_discount")
|
|
|
+ private Double maxCompulsoryInsuranceDiscount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保司评分(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_score")
|
|
|
+ private Double minScore;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保司评分(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_score")
|
|
|
+ private Double maxScore;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 预期赔付率(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_loss_ration")
|
|
|
+ private Double minLossRation;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 预期赔付率(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_loss_ration")
|
|
|
+ private Double maxLossRation;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 车牌号
|
|
|
+ */
|
|
|
+ @TableField(value = "license_number")
|
|
|
+ private String licenseNumber;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 车牌因子是否含暂未上牌
|
|
|
+ */
|
|
|
+ @TableField(value = "contain_noLicense")
|
|
|
+ private String containNoLicense;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 司机险保额(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_driver_amount")
|
|
|
+ private Integer minDriverAmount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 司机险保额(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_driver_amount")
|
|
|
+ private Integer maxDriverAmount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 乘客险保额(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_passenger_amount")
|
|
|
+ private Integer minPassengerAmount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 乘客险保额(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_passenger_amount")
|
|
|
+ private Integer maxPassengerAmount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 司机乘客关联关系
|
|
|
+ */
|
|
|
+ @TableField(value = "driver_passenger_relation")
|
|
|
+ private String driverPassengerRelation;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 方案优先级别
|
|
|
+ */
|
|
|
+ @TableField(value = "priority_level")
|
|
|
+ private Integer priorityLevel;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 被保人年龄(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_insure_age")
|
|
|
+ private Integer minInsureAge;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 被保人年龄(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_insure_age")
|
|
|
+ private Integer maxInsureAge;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 车主年龄(最小)
|
|
|
+ */
|
|
|
+ @TableField(value = "min_car_owner_age")
|
|
|
+ private Integer minCarOwnerAge;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 车主年龄(最大)
|
|
|
+ */
|
|
|
+ @TableField(value = "max_car_owner_age")
|
|
|
+ private Integer maxCarOwnerAge;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 医保外用任意险别
|
|
|
+ */
|
|
|
+ @TableField(value = "any_medical_amount")
|
|
|
+ private Integer anyMedicalAmount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 医保外用三者
|
|
|
+ */
|
|
|
+ @TableField(value = "third_medical_amount")
|
|
|
+ private Integer thirdMedicalAmount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 医保外用司机
|
|
|
+ */
|
|
|
+ @TableField(value = "driver_medical_amount")
|
|
|
+ private Integer driverMedicalAmount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 医保外用乘客
|
|
|
+ */
|
|
|
+ @TableField(value = "passenger_medical_amount")
|
|
|
+ private Integer passengerMedicalAmount;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param agreementId 协议id
|
|
|
+ * @param productId 产品id
|
|
|
+ * @param productName 产品名称
|
|
|
+ * @param ptlAgreementUndwrtRulesSaveDtoList 协议费用 Dto list
|
|
|
+ * @return List<PtlAgreementProductCosts>
|
|
|
+ */
|
|
|
+ public static List<PtlAgreementUndwrtRules> toPtlAgreementUndwrtRulesSaveDtoList(String agreementId, String productId, String productName, List<PtlAgreementUndwrtRulesSaveDto> ptlAgreementUndwrtRulesSaveDtoList) {
|
|
|
+ return ptlAgreementUndwrtRulesSaveDtoList.stream().map(ptlAgreementUndwrtRulesSaveDto -> new PtlAgreementUndwrtRules(agreementId, productId, productName, ptlAgreementUndwrtRulesSaveDto)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
+ public PtlAgreementUndwrtRules(String agreementId, String productId, String productName, PtlAgreementUndwrtRulesSaveDto ptlAgreementUndwrtRulesSaveDto) {
|
|
|
+ this.agreementId = agreementId;
|
|
|
+ this.productId = productId;
|
|
|
+ this.productName = productName;
|
|
|
+ BeanUtils.copyProperties(ptlAgreementUndwrtRulesSaveDto, this);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static int getObjectHashCode(Object o, int result) {
|
|
|
+ return 31 * result + (o != null ? o.hashCode() : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getHashCode() {
|
|
|
+ int result = 0;
|
|
|
+ result = getObjectHashCode(this.agreementId, result);
|
|
|
+ result = getObjectHashCode(this.productId, result);
|
|
|
+ result = getObjectHashCode(this.productName, result);
|
|
|
+ result = getObjectHashCode(this.transfer, result);
|
|
|
+ result = getObjectHashCode(this.oldAndNew, result);
|
|
|
+ result = getObjectHashCode(this.newEnergy, result);
|
|
|
+ result = getObjectHashCode(this.renewal, result);
|
|
|
+ result = getObjectHashCode(this.vehicleCategory, result);
|
|
|
+ result = getObjectHashCode(this.natureOfUse, result);
|
|
|
+ result = getObjectHashCode(this.minSeats, result);
|
|
|
+ result = getObjectHashCode(this.maxSeats, result);
|
|
|
+ result = getObjectHashCode(this.minTruckTonnage, result);
|
|
|
+ result = getObjectHashCode(this.maxTruckTonnage, result);
|
|
|
+ result = getObjectHashCode(this.minPurchasePrice, result);
|
|
|
+ result = getObjectHashCode(this.maxPurchasePrice, result);
|
|
|
+ result = getObjectHashCode(this.minApprovedLoadCapacity, result);
|
|
|
+ result = getObjectHashCode(this.maxApprovedLoadCapacity, result);
|
|
|
+ result = getObjectHashCode(this.minCompulsoryInsurancePremium, result);
|
|
|
+ result = getObjectHashCode(this.maxCompulsoryInsurancePremium, result);
|
|
|
+ result = getObjectHashCode(this.minTaxAmount, result);
|
|
|
+ result = getObjectHashCode(this.maxTaxAmount, result);
|
|
|
+ result = getObjectHashCode(this.minTheThreePremium, result);
|
|
|
+ result = getObjectHashCode(this.maxTheThreePremium, result);
|
|
|
+ result = getObjectHashCode(this.minOnboardProductsPremium, result);
|
|
|
+ result = getObjectHashCode(this.maxOnboardProductsPremium, result);
|
|
|
+ result = getObjectHashCode(this.minCommercialInsuranceDiscount, result);
|
|
|
+ result = getObjectHashCode(this.maxCommercialInsuranceDiscount, result);
|
|
|
+ result = getObjectHashCode(this.minCompulsoryInsuranceDiscount, result);
|
|
|
+ result = getObjectHashCode(this.maxCompulsoryInsuranceDiscount, result);
|
|
|
+ result = getObjectHashCode(this.minScore, result);
|
|
|
+ result = getObjectHashCode(this.maxScore, result);
|
|
|
+ result = getObjectHashCode(this.minLossRation, result);
|
|
|
+ result = getObjectHashCode(this.maxLossRation, result);
|
|
|
+ result = getObjectHashCode(this.licenseNumber, result);
|
|
|
+ result = getObjectHashCode(this.ruleDescription, result);
|
|
|
+ result = getObjectHashCode(this.containNoLicense, result);
|
|
|
+ result = getObjectHashCode(this.minDriverAmount, result);
|
|
|
+ result = getObjectHashCode(this.maxDriverAmount, result);
|
|
|
+ result = getObjectHashCode(this.minPassengerAmount, result);
|
|
|
+ result = getObjectHashCode(this.maxPassengerAmount, result);
|
|
|
+ result = getObjectHashCode(this.driverPassengerRelation, result);
|
|
|
+ result = getObjectHashCode(this.priorityLevel,result);
|
|
|
+ result = getObjectHashCode(this.minInsureAge,result);
|
|
|
+ result = getObjectHashCode(this.maxInsureAge,result);
|
|
|
+ result = getObjectHashCode(this.minCarOwnerAge,result);
|
|
|
+ result = getObjectHashCode(this.maxCarOwnerAge,result);
|
|
|
+ result = getObjectHashCode(this.anyMedicalAmount,result);
|
|
|
+ result = getObjectHashCode(this.thirdMedicalAmount,result);
|
|
|
+ result = getObjectHashCode(this.driverMedicalAmount,result);
|
|
|
+ result = getObjectHashCode(this.passengerMedicalAmount,result);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static Map<Integer, PtlAgreementUndwrtRules> getIntegerMap(List<PtlAgreementUndwrtRules> ptlAgreementUndwrtRulesList) {
|
|
|
+ Map<Integer, PtlAgreementUndwrtRules> map = new HashMap<>();
|
|
|
+ ptlAgreementUndwrtRulesList.forEach(x -> {
|
|
|
+ int hashCode = x.getHashCode();
|
|
|
+ map.put(hashCode, x);
|
|
|
+ });
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|