|
|
@@ -6,10 +6,9 @@ import com.jzg.commons.constants.InsuranceRisk;
|
|
|
import com.jzg.commons.util.AssertionUtils;
|
|
|
import com.jzg.commons.util.StringUtils;
|
|
|
import com.jzg.quotation.commons.constant.InsuranceTypeCorrespondence;
|
|
|
+import com.jzg.quotation.commons.entity.vo.aggregated.QuoteVo;
|
|
|
+import com.jzg.quotation.commons.entity.vo.quote.*;
|
|
|
import com.jzg.quote.zhongmei.api.constant.enums.ContractEnum;
|
|
|
-import com.jzg.quotation.commons.entity.vo.quote.AccidentalDrivingVo;
|
|
|
-import com.jzg.quotation.commons.entity.vo.quote.CarInfoVo;
|
|
|
-import com.jzg.quotation.commons.entity.vo.quote.KindInfoVo;
|
|
|
import com.jzg.quote.zhongmei.api.constant.enums.CarUseTypeEnum;
|
|
|
import com.jzg.quote.zhongmei.api.constant.enums.MotorMainTypeEnum;
|
|
|
import com.jzg.quote.zhongmei.api.constant.TimeConstants;
|
|
|
@@ -18,9 +17,6 @@ import com.jzg.quote.zhongmei.api.constant.enums.MotorSubTypeEnum;
|
|
|
import com.jzg.quote.zhongmei.api.entity.BaseRequestHead;
|
|
|
import com.jzg.quote.zhongmei.api.entity.ZmApiConfigureParameters;
|
|
|
import com.jzg.quote.zhongmei.api.entity.response.ModelsQueryResponse;
|
|
|
-import com.jzg.quote.zhongmei.api.entity.vo.BaseQuoteInfoVo;
|
|
|
-import com.jzg.quote.zhongmei.api.entity.vo.CustomerInfoVo;
|
|
|
-import com.jzg.quote.zhongmei.api.entity.vo.RiskInfoVo;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.Data;
|
|
|
import lombok.EqualsAndHashCode;
|
|
|
@@ -51,12 +47,13 @@ public class QuotedPriceRequest extends BaseRequest {
|
|
|
@JsonProperty("businessData")
|
|
|
private BusinessDataDTO businessData;
|
|
|
|
|
|
- public QuotedPriceRequest(BaseQuoteInfoVo baseQuoteInfoVo, ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCarDTO,
|
|
|
- AccidentalDrivingVo accidentalDrivingVo, ZmApiConfigureParameters zmConfigureParameters) {
|
|
|
+ public QuotedPriceRequest(QuoteVo quoteVo, ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCarDTO, AccidentalDrivingVo accidentalDrivingVo, ZmApiConfigureParameters zmConfigureParameters) {
|
|
|
//调整非车出单流程是后台写死的非车产品,后续可删除
|
|
|
/*accidentalDrivingVo.setQuantity(1);
|
|
|
accidentalDrivingVo.setRideRiskCode("52");*/
|
|
|
- this.businessData = new BusinessDataDTO(baseQuoteInfoVo, simpleStadarCarDTO, accidentalDrivingVo, zmConfigureParameters);
|
|
|
+ // 将查询的车辆信息(simpleStadarCarDTO)设置到quotevo的CarInfoVo对象中
|
|
|
+
|
|
|
+ this.businessData = new BusinessDataDTO(quoteVo, accidentalDrivingVo, zmConfigureParameters);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -96,23 +93,24 @@ public class QuotedPriceRequest extends BaseRequest {
|
|
|
@JsonProperty("productPlan")
|
|
|
private String productPlan;
|
|
|
|
|
|
- public BusinessDataDTO(BaseQuoteInfoVo baseQuoteInfoVo, ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCarDTO,
|
|
|
- AccidentalDrivingVo accidentalDrivingVo, ZmApiConfigureParameters zmConfigureParameters) {
|
|
|
- CarInfoVo carInfo = baseQuoteInfoVo.getCarInfo();
|
|
|
- List<RiskInfoVo> riskList = baseQuoteInfoVo.getRiskList();
|
|
|
- List<KindInfoVo> kindList = baseQuoteInfoVo.getKindList();
|
|
|
- CustomerInfoVo ownerInfo = baseQuoteInfoVo.getOwnerInfo();
|
|
|
- CustomerInfoVo policyHolderInfo = baseQuoteInfoVo.getPolicyHolderInfo();
|
|
|
- CustomerInfoVo insuredPersonInfo = baseQuoteInfoVo.getInsuredPersonInfo();
|
|
|
- int i = Integer.parseInt(carInfo.getSeatCount());
|
|
|
+ public BusinessDataDTO(QuoteVo quoteVo, AccidentalDrivingVo accidentalDrivingVo, ZmApiConfigureParameters zmConfigureParameters) {
|
|
|
+ CarInfoVo carInfoVo = quoteVo.getCarInfoVo();
|
|
|
+ List<RiskInfoVo> riskList = new ArrayList<>();
|
|
|
+ riskList.add(quoteVo.getCiRiskInfoVo());
|
|
|
+ riskList.add(quoteVo.getBiRiskInfoVo());
|
|
|
+ List<KindInfoVo> kindList = quoteVo.getKindInfoVo();
|
|
|
+ CustomerInfoVo ownerInfo = quoteVo.getOwnersInfo();
|
|
|
+ CustomerInfoVo policyHolderInfo = quoteVo.getPolicyHolderInfo();
|
|
|
+ CustomerInfoVo insuredPersonInfo = quoteVo.getInsuredPersonInfo();
|
|
|
+ int i = Integer.parseInt(carInfoVo.getSeatCount());
|
|
|
//产品编码
|
|
|
- this.productPlan = InsuranceTypeCorrespondence.getZhongMei_PRODUCT().get(simpleStadarCarDTO.getEnergyTypes());
|
|
|
+ this.productPlan = carInfoVo.getEnergyTypeCode();
|
|
|
// 保单归属地
|
|
|
this.policyLocation = new PolicyLocationDTO(zmConfigureParameters);
|
|
|
// 车辆信息
|
|
|
- this.insuredObject = new InsuredObjectDTO(carInfo, simpleStadarCarDTO);
|
|
|
+ this.insuredObject = new InsuredObjectDTO(carInfoVo);
|
|
|
// 保险信息
|
|
|
- this.contract = new ContractDTO().getContract(riskList, kindList, i - 1, carInfo.getEnergyTypeCode());
|
|
|
+ this.contract = new ContractDTO().getContract(riskList, kindList, i - 1, carInfoVo.getEnergyTypeCode());
|
|
|
// 客户信息
|
|
|
this.customer = new CustomerDTO().getCustomers(ownerInfo, policyHolderInfo, insuredPersonInfo);
|
|
|
// 驾意险
|
|
|
@@ -182,9 +180,9 @@ public class QuotedPriceRequest extends BaseRequest {
|
|
|
@JsonProperty("simpleStadarCar")
|
|
|
private ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCar;
|
|
|
|
|
|
- public InsuredObjectDTO(CarInfoVo carInfo, ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCarDTO) {
|
|
|
+ public InsuredObjectDTO(CarInfoVo carInfo) {
|
|
|
this.policyCar = new PolicyCarDTO(carInfo);
|
|
|
- this.simpleStadarCar = simpleStadarCarDTO;
|
|
|
+ //this.simpleStadarCar = simpleStadarCarDTO;
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor
|
|
|
@@ -303,7 +301,7 @@ public class QuotedPriceRequest extends BaseRequest {
|
|
|
AssertionUtils.isEmpty(carUseTypeEnum, "车辆用途输入错误");
|
|
|
this.carUseType = carUseTypeEnum.getCode();
|
|
|
|
|
|
- this.motorUsageTypeCode = InsuranceTypeCorrespondence.getZM_CAR_MotorUsageTypeCode().get(carInfoVo.getCarNatureCode());
|
|
|
+ this.motorUsageTypeCode = carInfoVo.getCarNatureCode();
|
|
|
|
|
|
|
|
|
}
|
|
|
@@ -424,10 +422,10 @@ public class QuotedPriceRequest extends BaseRequest {
|
|
|
for (KindInfoVo kindInfoVo : kindInfoVos) {
|
|
|
CoverageDTO coverageDTO = new CoverageDTO();
|
|
|
String code = kindInfoVo.getKindCode();
|
|
|
- //后续根据调整映射修改
|
|
|
- int i = ArrayUtil.indexOf(InsuranceTypeCorrespondence.getJinZhangGuiType(), code);
|
|
|
- String s = InsuranceTypeCorrespondence.getZmConnectInsuranceType()[i];
|
|
|
- ContractEnum contractEnum = Enum.valueOf(ContractEnum.class, "C_" + s);
|
|
|
+ //报价入参已转换过,直接拼接编码即可
|
|
|
+ /*int i = ArrayUtil.indexOf(InsuranceTypeCorrespondence.getJinZhangGuiType(), code);
|
|
|
+ String s = InsuranceTypeCorrespondence.getZmConnectInsuranceType()[i];*/
|
|
|
+ ContractEnum contractEnum = Enum.valueOf(ContractEnum.class, "C_" + code);
|
|
|
coverageDTO.kindName = contractEnum.getKindName();
|
|
|
coverageDTO.kindCode = contractEnum.getKindCode();
|
|
|
coverageDTO.amount = Integer.parseInt(kindInfoVo.getAmount());
|
|
|
@@ -439,21 +437,21 @@ public class QuotedPriceRequest extends BaseRequest {
|
|
|
coverageDTO.amount = 0;
|
|
|
}
|
|
|
// 司机
|
|
|
- if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getDriver(), code) >= 0) {
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getZmbxDriver(), code) >= 0) {
|
|
|
coverageDTO.quantity = 1;
|
|
|
coverageDTO.unitAmount = Integer.parseInt(kindInfoVo.getAmount());
|
|
|
}
|
|
|
// 乘客
|
|
|
- if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getPassenger(), code) >= 0) {
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getZmbxPassenger(), code) >= 0) {
|
|
|
coverageDTO.quantity = quantity;
|
|
|
coverageDTO.amount = Integer.parseInt(kindInfoVo.getUnitAmount()) * quantity;
|
|
|
}
|
|
|
// 绝对免赔
|
|
|
- if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getAbsoluteDeductible(), code) >= 0) {
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getZmbxAbsoluteDeductible(), code) >= 0) {
|
|
|
coverageDTO.deductible = "-" + kindInfoVo.getDeductibleRate();
|
|
|
}
|
|
|
// 增值服务
|
|
|
- if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getSpecialContractClause(), code) >= 0) {
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getZmbxSpecialContractClause(), code) >= 0) {
|
|
|
coverageDTO.quantity = Integer.parseInt(kindInfoVo.getServiceTimes());
|
|
|
}
|
|
|
list.add(coverageDTO);
|