|
|
@@ -10,18 +10,17 @@ import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.KindInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.RiskInfoVo;
|
|
|
import com.ydtech.modules.order.constants.InsuranceTypeCorrespondence;
|
|
|
+import com.ydtech.modules.order.entity.api.zhongmei.constants.TimeConstants;
|
|
|
import com.ydtech.modules.order.entity.api.zijin.constants.DateTimeConstants;
|
|
|
-import com.ydtech.modules.order.entity.api.zijin.constants.enums.CalculateFlagEnum;
|
|
|
-import com.ydtech.modules.order.entity.api.zijin.constants.enums.CarKindDetailIdEnum;
|
|
|
-import com.ydtech.modules.order.entity.api.zijin.constants.enums.MotorVehicleInsuranceEnum;
|
|
|
-import com.ydtech.modules.order.entity.api.zijin.constants.enums.RiskCodeEnum;
|
|
|
+import com.ydtech.modules.order.entity.api.zijin.constants.enums.*;
|
|
|
import com.ydtech.modules.order.entity.api.zijin.response.ModelQueryResponse;
|
|
|
-import com.ydtech.modules.order.entity.api.zhongmei.constants.TimeConstants;
|
|
|
import com.ydtech.modules.order.entity.config.ZjConfigureParameters;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
|
|
|
import com.ydtech.modules.order.entity.vo.VehicleAndVesselTax;
|
|
|
import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
|
|
|
import com.ydtech.modules.order.utils.InsuranceTimeProcessing;
|
|
|
+import com.ydtech.utils.StringUtils;
|
|
|
import io.swagger.annotations.ApiModel;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
@@ -32,6 +31,7 @@ import lombok.NoArgsConstructor;
|
|
|
import java.io.Serializable;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -66,6 +66,12 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
@JsonProperty("itemKindList")
|
|
|
private List<ItemKindListDTO> itemKindList;
|
|
|
|
|
|
+ /**
|
|
|
+ * 浮动因子信息
|
|
|
+ */
|
|
|
+ @JsonProperty("profitDataList")
|
|
|
+ private List<ProfitDataListDTO> profitDataList;
|
|
|
+
|
|
|
/**
|
|
|
* 意健险险种代码
|
|
|
*/
|
|
|
@@ -114,7 +120,10 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
@JsonProperty("demandNoCheckFlag")
|
|
|
private String demandNoCheckFlag = "1";
|
|
|
|
|
|
- public CalculatePremiumRequest(BaseQuoteInfoVo quoteInfoVo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO, String actualValue, List<ZjQuoteAccidentVo> zjQuoteAccidentVos, ZjConfigureParameters zjConfigureParameters, ModelQueryResponse modelQueryResponse) {
|
|
|
+ public CalculatePremiumRequest(BaseQuoteInfoVo quoteInfoVo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO,
|
|
|
+ String actualValue, BaseQuoteVo<List<ZjQuoteAccidentVo>> quoteVo,
|
|
|
+ ZjConfigureParameters zjConfigureParameters, ModelQueryResponse modelQueryResponse) {
|
|
|
+ List<ZjQuoteAccidentVo> accidentalDrivingVo = quoteVo.getAccidentalDrivingVo();
|
|
|
// 基本信息
|
|
|
this.baseInfo = new BaseInfoDTO(quoteInfoVo.getRiskList());
|
|
|
// 车主信息
|
|
|
@@ -122,9 +131,12 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
// 投被保人信息
|
|
|
this.insuredList = InsuredListDTO.toInsuredListDTOList(quoteInfoVo.getPolicyHolderInfo(), quoteInfoVo.getInsuredPersonInfo());
|
|
|
// 险别信息
|
|
|
- this.itemKindList = ItemKindListDTO.toItemKindListDTOList(actualValue, quoteInfoVo.getKindList(), Integer.parseInt(quoteInfoVo.getCarInfo().getSeatCount()) - 1, vehicleModelInfosDTO);
|
|
|
+ this.itemKindList = ItemKindListDTO.toItemKindListDTOList(actualValue, quoteInfoVo.getKindList(),
|
|
|
+ Integer.parseInt(quoteInfoVo.getCarInfo().getSeatCount()) - 1, vehicleModelInfosDTO);
|
|
|
+ // 浮动因子信息
|
|
|
+ this.profitDataList = ProfitDataListDTO.toCoefficient(quoteVo.getCoefficient());
|
|
|
// 驾意险
|
|
|
- this.carPolicySubInfoList = CarPolicySubInfoListDTO.toCarPolicySubInfoListDTO(zjQuoteAccidentVos);
|
|
|
+ this.carPolicySubInfoList = CarPolicySubInfoListDTO.toCarPolicySubInfoListDTO(accidentalDrivingVo);
|
|
|
// 交强险
|
|
|
if (!"1".equals(this.baseInfo.calculateFlag)) {
|
|
|
itemKindList.add(ItemKindListDTO.getCompulsoryInsurance());
|
|
|
@@ -839,7 +851,7 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
@JsonProperty("isInvokeJingYou")
|
|
|
private String isInvokeJingYou;
|
|
|
/**
|
|
|
- *新能源车标志
|
|
|
+ * 新能源车标志
|
|
|
*/
|
|
|
@JsonProperty("newEnergyFlag")
|
|
|
private String newEnergyFlag;
|
|
|
@@ -902,14 +914,14 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
this.oriModelName = vehicleModelInfosDTO.getModelName();
|
|
|
this.vehicleStyleUniqueId = vehicleModelInfosDTO.getVehicleId();
|
|
|
this.isInvokeJingYou = "1";
|
|
|
- if("D6,D8,D12,".contains(vehicleModelInfosDTO.getPowerTypeCode()+",")) {//纯电动 燃料电池 插电式混合动力 归属为新能源产品
|
|
|
+ if ("D6,D8,D12,".contains(vehicleModelInfosDTO.getPowerTypeCode() + ",")) {//纯电动 燃料电池 插电式混合动力 归属为新能源产品
|
|
|
this.newEnergyFlag = "1";
|
|
|
this.pureRange = "";
|
|
|
- if("D6".equals(vehicleModelInfosDTO.getPowerTypeCode())){
|
|
|
+ if ("D6".equals(vehicleModelInfosDTO.getPowerTypeCode())) {
|
|
|
this.fuelType = "1";
|
|
|
- }else if("D8".equals(vehicleModelInfosDTO.getPowerTypeCode())){
|
|
|
+ } else if ("D8".equals(vehicleModelInfosDTO.getPowerTypeCode())) {
|
|
|
this.fuelType = "2";
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.fuelType = "3";
|
|
|
}
|
|
|
}
|
|
|
@@ -1096,7 +1108,7 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
* 服务次数
|
|
|
*/
|
|
|
@JsonProperty("serviceTimes")
|
|
|
- private String serviceTimes;
|
|
|
+ private String serviceTimes;
|
|
|
|
|
|
|
|
|
public static ItemKindListDTO getCompulsoryInsurance() {
|
|
|
@@ -1108,10 +1120,11 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
return insuredListDTO;
|
|
|
}
|
|
|
|
|
|
- public static List<ItemKindListDTO> toItemKindListDTOList(String actualValue, List<KindInfoVo> kindList, int quantity, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO) {
|
|
|
+ public static List<ItemKindListDTO> toItemKindListDTOList(String actualValue, List<KindInfoVo> kindList, int quantity,
|
|
|
+ ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO) {
|
|
|
List<ItemKindListDTO> list = new ArrayList<>();
|
|
|
String[] insuranceType = InsuranceTypeCorrespondence.getZjConnectInsuranceType();
|
|
|
- if("D6,D8,D12,".contains(vehicleModelInfosDTO.getPowerTypeCode()+",")) {//纯电动 燃料电池 插电式混合动力 归属为新能源产品
|
|
|
+ if ("D6,D8,D12,".contains(vehicleModelInfosDTO.getPowerTypeCode() + ",")) {//纯电动 燃料电池 插电式混合动力 归属为新能源产品
|
|
|
insuranceType = InsuranceTypeCorrespondence.getZjConnectInsuranceTypeNewEnergy();
|
|
|
}
|
|
|
for (KindInfoVo kindInfoVo : kindList) {
|
|
|
@@ -1134,12 +1147,13 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
else if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getPassenger(), code) >= 0) {
|
|
|
itemKindListDTO.quantity = String.valueOf(quantity);
|
|
|
itemKindListDTO.unitAmount = String.valueOf(kindInfoVo.getUnitAmount());
|
|
|
- itemKindListDTO.amount = BigDecimal.valueOf(kindInfoVo.getUnitAmount()).multiply(BigDecimal.valueOf(quantity)).toString();
|
|
|
+ itemKindListDTO.amount =
|
|
|
+ BigDecimal.valueOf(kindInfoVo.getUnitAmount()).multiply(BigDecimal.valueOf(quantity)).toString();
|
|
|
}
|
|
|
// 绝对免赔
|
|
|
else if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getAbsoluteDeductible(), code) >= 0) {
|
|
|
itemKindListDTO.deductibleRate = kindInfoVo.getDeductibleRate();
|
|
|
- }else if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getSpecialContractClause(), code) >= 0) {
|
|
|
+ } else if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getSpecialContractClause(), code) >= 0) {
|
|
|
itemKindListDTO.serviceTimes = String.valueOf(kindInfoVo.getServiceTimes());
|
|
|
} else if (InsurKind.A.getCode().equals(code)) {
|
|
|
itemKindListDTO.amount = actualValue;
|
|
|
@@ -1153,6 +1167,48 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 浮动因子信息
|
|
|
+ */
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class ProfitDataListDTO implements Serializable {
|
|
|
+
|
|
|
+ private static final long serialVersionUID = 7236883928075142401L;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 费率因子代码 C31(自主定价系数)C32(传1,兼容非费改)
|
|
|
+ */
|
|
|
+ @JsonProperty("profitCode")
|
|
|
+ private String profitCode;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 费率因子值
|
|
|
+ */
|
|
|
+ @JsonProperty("profitRate")
|
|
|
+ private String profitRate;
|
|
|
+
|
|
|
+ public static List<ProfitDataListDTO> toCoefficient(String coefficient) {
|
|
|
+ if (!StringUtils.isEmpty(coefficient)) {
|
|
|
+ ArrayList<ProfitDataListDTO> list = new ArrayList<>();
|
|
|
+
|
|
|
+ ProfitDataListDTO profitDataListDTO1 = new ProfitDataListDTO();
|
|
|
+ profitDataListDTO1.setProfitCode(ProfitCode.C31.getCode());
|
|
|
+ profitDataListDTO1.setProfitRate(coefficient);
|
|
|
+ list.add(profitDataListDTO1);
|
|
|
+
|
|
|
+ ProfitDataListDTO profitDataListDTO2 = new ProfitDataListDTO();
|
|
|
+ profitDataListDTO2.setProfitCode(ProfitCode.C32.getCode());
|
|
|
+ profitDataListDTO2.setProfitRate("1");
|
|
|
+ list.add(profitDataListDTO2);
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@NoArgsConstructor
|
|
|
@AllArgsConstructor
|
|
|
@Data
|