|
@@ -3,7 +3,6 @@ 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;
|
|
@@ -15,7 +14,6 @@ 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;
|
|
@@ -99,7 +97,9 @@ 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, ZjConfigureParameters zjConfigureParameters, ModelQueryResponse modelQueryResponse) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ public CalculatePremiumRequest(BaseQuoteInfoVo quoteInfoVo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO, String actualValue, List<CarPolicySubInfoListDTO> accidentalDrivingVo) {
|
|
|
// 基本信息
|
|
// 基本信息
|
|
|
this.baseInfo = new BaseInfoDTO(quoteInfoVo.getRiskList());
|
|
this.baseInfo = new BaseInfoDTO(quoteInfoVo.getRiskList());
|
|
|
// 车主信息
|
|
// 车主信息
|
|
@@ -107,21 +107,15 @@ 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(actualValue, quoteInfoVo.getKindList(), Integer.parseInt(quoteInfoVo.getCarInfo().getSeatCount()) - 1);
|
|
|
|
|
|
|
+ this.itemKindList = ItemKindListDTO.toItemKindListDTOList(quoteInfoVo.getKindList(), Integer.parseInt(quoteInfoVo.getCarInfo().getSeatCount()));
|
|
|
// 驾意险
|
|
// 驾意险
|
|
|
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();
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -253,9 +247,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())) {
|
|
|
- setStrengthTime(riskInfoVo.getStartDate());
|
|
|
|
|
- } else {
|
|
|
|
|
setCommerceTime(riskInfoVo.getStartDate());
|
|
setCommerceTime(riskInfoVo.getStartDate());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setStrengthTime(riskInfoVo.getStartDate());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -357,11 +351,6 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
*/
|
|
*/
|
|
|
@JsonProperty("actualValue")
|
|
@JsonProperty("actualValue")
|
|
|
private String actualValue;
|
|
private String actualValue;
|
|
|
- /**
|
|
|
|
|
- * 车辆实际价值
|
|
|
|
|
- */
|
|
|
|
|
- @JsonProperty("agreeActualValue")
|
|
|
|
|
- private String agreeActualValue;
|
|
|
|
|
/**
|
|
/**
|
|
|
* 是否过户车辆 1是0否
|
|
* 是否过户车辆 1是0否
|
|
|
*/
|
|
*/
|
|
@@ -446,7 +435,6 @@ 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 {
|
|
@@ -597,7 +585,7 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
/**
|
|
/**
|
|
|
* 免赔率 绝对免赔率险必录 5,10,15,20(单位%)
|
|
* 免赔率 绝对免赔率险必录 5,10,15,20(单位%)
|
|
|
*/
|
|
*/
|
|
|
- @JsonProperty("deductibleRate")
|
|
|
|
|
|
|
+ @JsonProperty("quantity")
|
|
|
private String deductibleRate;
|
|
private String deductibleRate;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -609,7 +597,7 @@ public class CalculatePremiumRequest implements Serializable {
|
|
|
return insuredListDTO;
|
|
return insuredListDTO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static List<ItemKindListDTO> toItemKindListDTOList(String actualValue, List<KindInfoVo> kindList, int quantity) {
|
|
|
|
|
|
|
+ public static List<ItemKindListDTO> toItemKindListDTOList(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();
|
|
@@ -618,26 +606,20 @@ 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.getName();
|
|
|
|
|
- itemKindListDTO.riskCode = "050A";
|
|
|
|
|
-
|
|
|
|
|
|
|
+ itemKindListDTO.kindName = contractEnum.getDesc();
|
|
|
|
|
+ itemKindListDTO.riskCode = "";
|
|
|
// 司机
|
|
// 司机
|
|
|
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());
|
|
|
|
|
}
|
|
}
|
|
|
// 乘客
|
|
// 乘客
|
|
|
- else if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getPassenger(), code) >= 0) {
|
|
|
|
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getPassenger(), code) >= 0) {
|
|
|
itemKindListDTO.quantity = String.valueOf(quantity);
|
|
itemKindListDTO.quantity = String.valueOf(quantity);
|
|
|
- itemKindListDTO.amount = String.valueOf(kindInfoVo.getUnitAmount());
|
|
|
|
|
|
|
+ itemKindListDTO.amount = String.valueOf((int) kindInfoVo.getUnitAmount() * quantity);
|
|
|
}
|
|
}
|
|
|
// 绝对免赔
|
|
// 绝对免赔
|
|
|
- else if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getAbsoluteDeductible(), code) >= 0) {
|
|
|
|
|
|
|
+ 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);
|
|
|
}
|
|
}
|