|
@@ -3,6 +3,7 @@ package com.ydtech.modules.order.entity.api.zj.request;
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
import cn.hutool.core.util.IdcardUtil;
|
|
import cn.hutool.core.util.IdcardUtil;
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
|
+import com.ydtech.constants.enums.InsurKind;
|
|
|
import com.ydtech.constants.enums.InsuranceRisk;
|
|
import com.ydtech.constants.enums.InsuranceRisk;
|
|
|
import com.ydtech.modules.ins.model.vo.CarInfoVo;
|
|
import com.ydtech.modules.ins.model.vo.CarInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
|
|
import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
|
|
@@ -14,6 +15,7 @@ import com.ydtech.modules.order.entity.api.zj.constants.enums.MotorVehicleInsura
|
|
|
import com.ydtech.modules.order.entity.api.zj.constants.enums.RiskCodeEnum;
|
|
import com.ydtech.modules.order.entity.api.zj.constants.enums.RiskCodeEnum;
|
|
|
import com.ydtech.modules.order.entity.api.zj.response.ModelQueryResponse;
|
|
import com.ydtech.modules.order.entity.api.zj.response.ModelQueryResponse;
|
|
|
import com.ydtech.modules.order.entity.api.zm.constants.TimeConstants;
|
|
import com.ydtech.modules.order.entity.api.zm.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.BaseQuoteInfoVo;
|
|
|
import com.ydtech.modules.order.utils.InsuranceTimeProcessing;
|
|
import com.ydtech.modules.order.utils.InsuranceTimeProcessing;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
@@ -97,9 +99,7 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
@JsonProperty("vehicleInfo")
|
|
@JsonProperty("vehicleInfo")
|
|
|
private VehicleInfoDTO vehicleInfo;
|
|
private VehicleInfoDTO vehicleInfo;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- public CalculatePremiumRequest(BaseQuoteInfoVo quoteInfoVo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO, String actualValue, List<CarPolicySubInfoListDTO> accidentalDrivingVo) {
|
|
|
|
|
|
|
+ public CalculatePremiumRequest(BaseQuoteInfoVo quoteInfoVo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO, String actualValue, List<CarPolicySubInfoListDTO> accidentalDrivingVo, ZjConfigureParameters zjConfigureParameters, ModelQueryResponse modelQueryResponse) {
|
|
|
// 基本信息
|
|
// 基本信息
|
|
|
this.baseInfo = new BaseInfoDTO(quoteInfoVo.getRiskList());
|
|
this.baseInfo = new BaseInfoDTO(quoteInfoVo.getRiskList());
|
|
|
// 车主信息
|
|
// 车主信息
|
|
@@ -107,15 +107,21 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
// 投被保人信息
|
|
// 投被保人信息
|
|
|
this.insuredList = InsuredListDTO.toInsuredListDTOList(quoteInfoVo.getPolicyHolderInfo(), quoteInfoVo.getInsuredPersonInfo());
|
|
this.insuredList = InsuredListDTO.toInsuredListDTOList(quoteInfoVo.getPolicyHolderInfo(), quoteInfoVo.getInsuredPersonInfo());
|
|
|
// 险别信息
|
|
// 险别信息
|
|
|
- this.itemKindList = ItemKindListDTO.toItemKindListDTOList(quoteInfoVo.getKindList(), Integer.parseInt(quoteInfoVo.getCarInfo().getSeatCount()));
|
|
|
|
|
|
|
+ this.itemKindList = ItemKindListDTO.toItemKindListDTOList(actualValue, quoteInfoVo.getKindList(), Integer.parseInt(quoteInfoVo.getCarInfo().getSeatCount()) - 1);
|
|
|
// 驾意险
|
|
// 驾意险
|
|
|
this.carPolicySubInfoList = accidentalDrivingVo;
|
|
this.carPolicySubInfoList = accidentalDrivingVo;
|
|
|
// 交强险
|
|
// 交强险
|
|
|
- if ("1".equals(this.baseInfo.calculateFlag)) {
|
|
|
|
|
|
|
+ if (!"1".equals(this.baseInfo.calculateFlag)) {
|
|
|
itemKindList.add(ItemKindListDTO.getCompulsoryInsurance());
|
|
itemKindList.add(ItemKindListDTO.getCompulsoryInsurance());
|
|
|
}
|
|
}
|
|
|
// 车辆信息
|
|
// 车辆信息
|
|
|
this.vehicleInfo = new VehicleInfoDTO(quoteInfoVo.getCarInfo(), vehicleModelInfosDTO, actualValue);
|
|
this.vehicleInfo = new VehicleInfoDTO(quoteInfoVo.getCarInfo(), vehicleModelInfosDTO, actualValue);
|
|
|
|
|
+ this.orderId = modelQueryResponse.getOrderId();
|
|
|
|
|
+ this.orderNo = modelQueryResponse.getOrderNo();
|
|
|
|
|
+ this.orderOrigin = zjConfigureParameters.getAppKey();
|
|
|
|
|
+ this.proposalAreaCode = zjConfigureParameters.getProposalAreaCode();
|
|
|
|
|
+ this.proposalCityCode = zjConfigureParameters.getProposalCityCode();
|
|
|
|
|
+ this.taxRelifInfo = new TaxRelifInfoDTO();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -247,9 +253,9 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
|
|
|
|
|
for (RiskInfoVo riskInfoVo : riskInfoVoList) {
|
|
for (RiskInfoVo riskInfoVo : riskInfoVoList) {
|
|
|
if (InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())) {
|
|
if (InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())) {
|
|
|
- setCommerceTime(riskInfoVo.getStartDate());
|
|
|
|
|
- } else {
|
|
|
|
|
setStrengthTime(riskInfoVo.getStartDate());
|
|
setStrengthTime(riskInfoVo.getStartDate());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setCommerceTime(riskInfoVo.getStartDate());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -351,6 +357,11 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
*/
|
|
*/
|
|
|
@JsonProperty("actualValue")
|
|
@JsonProperty("actualValue")
|
|
|
private String actualValue;
|
|
private String actualValue;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 车辆实际价值
|
|
|
|
|
+ */
|
|
|
|
|
+ @JsonProperty("agreeActualValue")
|
|
|
|
|
+ private String agreeActualValue;
|
|
|
/**
|
|
/**
|
|
|
* 是否过户车辆 1是0否
|
|
* 是否过户车辆 1是0否
|
|
|
*/
|
|
*/
|
|
@@ -435,6 +446,7 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
|
|
|
|
|
public VehicleInfoDTO(CarInfoVo carInfo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO, String actualValue) {
|
|
public VehicleInfoDTO(CarInfoVo carInfo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO, String actualValue) {
|
|
|
this.actualValue = actualValue;
|
|
this.actualValue = actualValue;
|
|
|
|
|
+ this.agreeActualValue = actualValue;
|
|
|
if (carInfo.isTransferFlag()) {
|
|
if (carInfo.isTransferFlag()) {
|
|
|
this.chgOwnerFlag = "1";
|
|
this.chgOwnerFlag = "1";
|
|
|
} else {
|
|
} else {
|
|
@@ -585,7 +597,7 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
/**
|
|
/**
|
|
|
* 免赔率 绝对免赔率险必录 5,10,15,20(单位%)
|
|
* 免赔率 绝对免赔率险必录 5,10,15,20(单位%)
|
|
|
*/
|
|
*/
|
|
|
- @JsonProperty("quantity")
|
|
|
|
|
|
|
+ @JsonProperty("deductibleRate")
|
|
|
private String deductibleRate;
|
|
private String deductibleRate;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -597,7 +609,7 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
return insuredListDTO;
|
|
return insuredListDTO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static List<ItemKindListDTO> toItemKindListDTOList(List<KindInfoVo> kindList, int quantity) {
|
|
|
|
|
|
|
+ public static List<ItemKindListDTO> toItemKindListDTOList(String actualValue, List<KindInfoVo> kindList, int quantity) {
|
|
|
List<ItemKindListDTO> list = new ArrayList<>();
|
|
List<ItemKindListDTO> list = new ArrayList<>();
|
|
|
for (KindInfoVo kindInfoVo : kindList) {
|
|
for (KindInfoVo kindInfoVo : kindList) {
|
|
|
String code = kindInfoVo.getKindCode();
|
|
String code = kindInfoVo.getKindCode();
|
|
@@ -606,20 +618,26 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
String s = InsuranceTypeCorrespondence.getZjConnectInsuranceType()[i];
|
|
String s = InsuranceTypeCorrespondence.getZjConnectInsuranceType()[i];
|
|
|
MotorVehicleInsuranceEnum contractEnum = Enum.valueOf(MotorVehicleInsuranceEnum.class, "MVI_" + s);
|
|
MotorVehicleInsuranceEnum contractEnum = Enum.valueOf(MotorVehicleInsuranceEnum.class, "MVI_" + s);
|
|
|
itemKindListDTO.kindCode = contractEnum.getCode();
|
|
itemKindListDTO.kindCode = contractEnum.getCode();
|
|
|
- itemKindListDTO.kindName = contractEnum.getDesc();
|
|
|
|
|
- itemKindListDTO.riskCode = "";
|
|
|
|
|
|
|
+ itemKindListDTO.kindName = contractEnum.getName();
|
|
|
|
|
+ itemKindListDTO.riskCode = "050A";
|
|
|
|
|
+
|
|
|
// 司机
|
|
// 司机
|
|
|
if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getDriver(), code) >= 0) {
|
|
if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getDriver(), code) >= 0) {
|
|
|
itemKindListDTO.quantity = String.valueOf(1);
|
|
itemKindListDTO.quantity = String.valueOf(1);
|
|
|
|
|
+ itemKindListDTO.amount = String.valueOf(kindInfoVo.getAmount());
|
|
|
}
|
|
}
|
|
|
// 乘客
|
|
// 乘客
|
|
|
- if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getPassenger(), code) >= 0) {
|
|
|
|
|
|
|
+ else if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getPassenger(), code) >= 0) {
|
|
|
itemKindListDTO.quantity = String.valueOf(quantity);
|
|
itemKindListDTO.quantity = String.valueOf(quantity);
|
|
|
- itemKindListDTO.amount = String.valueOf((int) kindInfoVo.getUnitAmount() * quantity);
|
|
|
|
|
|
|
+ itemKindListDTO.amount = String.valueOf(kindInfoVo.getUnitAmount());
|
|
|
}
|
|
}
|
|
|
// 绝对免赔
|
|
// 绝对免赔
|
|
|
- if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getAbsoluteDeductible(), code) >= 0) {
|
|
|
|
|
|
|
+ else if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getAbsoluteDeductible(), code) >= 0) {
|
|
|
itemKindListDTO.deductibleRate = kindInfoVo.getDeductibleRate();
|
|
itemKindListDTO.deductibleRate = kindInfoVo.getDeductibleRate();
|
|
|
|
|
+ } else if (InsurKind.A.getCode().equals(code)) {
|
|
|
|
|
+ itemKindListDTO.amount = actualValue;
|
|
|
|
|
+ }else {
|
|
|
|
|
+ itemKindListDTO.amount = String.valueOf(kindInfoVo.getAmount());
|
|
|
}
|
|
}
|
|
|
list.add(itemKindListDTO);
|
|
list.add(itemKindListDTO);
|
|
|
}
|
|
}
|