|
|
@@ -3,6 +3,8 @@ import com.google.common.collect.Lists;
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
+import com.jzg.ansheng.crawler.entity.response.AnShengCrawlerSearchVehicleByVinResponse;
|
|
|
+import com.jzg.commons.entity.quote.vo.CarInfoVo;
|
|
|
import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
|
|
|
import com.jzg.commons.entity.quote.vo.KindInfoVo;
|
|
|
import com.jzg.quotation.commons.entity.vo.aggregated.QuoteVo;
|
|
|
@@ -24,23 +26,23 @@ public class AnShengCrawlerCalculatePremiumApplyMessage {
|
|
|
@JsonProperty("contracts")
|
|
|
private List<ContractsDTO> contracts;
|
|
|
|
|
|
- public AnShengCrawlerCalculatePremiumApplyMessage(QuoteVo quoteVo) {
|
|
|
+ public AnShengCrawlerCalculatePremiumApplyMessage(QuoteVo quoteVo, AnShengCrawlerSearchVehicleByVinResponse.DataDTO dataDTO) {
|
|
|
this.isTryCal = false;
|
|
|
this.contracts = new ArrayList<>();
|
|
|
if (!ObjectUtils.isEmpty(quoteVo.getBiRiskInfoVo())) {
|
|
|
- ContractsDTO baseContracts = getBaseContracts(quoteVo);
|
|
|
+ ContractsDTO baseContracts = getBaseContracts(quoteVo, dataDTO, "");
|
|
|
baseContracts.addCompulsoryInsurance(baseContracts);
|
|
|
this.contracts.add(baseContracts);
|
|
|
}
|
|
|
if (!ObjectUtils.isEmpty(quoteVo.getCiRiskInfoVo())) {
|
|
|
- ContractsDTO baseContracts = getBaseContracts(quoteVo);
|
|
|
+ ContractsDTO baseContracts = getBaseContracts(quoteVo, dataDTO, "");
|
|
|
baseContracts.addBusinessInsurance(baseContracts, quoteVo.getKindInfoVo());
|
|
|
this.contracts.add(baseContracts);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public ContractsDTO getBaseContracts(QuoteVo quoteVo) {
|
|
|
- return new ContractsDTO(quoteVo);
|
|
|
+ public ContractsDTO getBaseContracts(QuoteVo quoteVo, AnShengCrawlerSearchVehicleByVinResponse.DataDTO dataDTO, String departmentCode) {
|
|
|
+ return new ContractsDTO(quoteVo, dataDTO, departmentCode);
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor
|
|
|
@@ -117,7 +119,7 @@ public class AnShengCrawlerCalculatePremiumApplyMessage {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public ContractsDTO(QuoteVo quoteVo) {
|
|
|
+ public ContractsDTO(QuoteVo quoteVo, AnShengCrawlerSearchVehicleByVinResponse.DataDTO dataDTO, String departmentCode) {
|
|
|
this.policyExtend = new PolicyExtendDTO("", "", "", "", "", "");
|
|
|
this.noVehicleNo = false;
|
|
|
this.noCarowner = false;
|
|
|
@@ -127,7 +129,9 @@ public class AnShengCrawlerCalculatePremiumApplyMessage {
|
|
|
this.departmentDefine = new DepartmentDefineDTO();
|
|
|
this.saleBusinessSource = new SaleBusinessSourceDTO();
|
|
|
this.policyAttachments = new ArrayList<>();
|
|
|
- this.targetList = new ArrayList<>();
|
|
|
+ TargetListDTO targetListDTO = new TargetListDTO(dataDTO, quoteVo.getCarInfoVo(), departmentCode);
|
|
|
+ this.targetList = List.of(targetListDTO);
|
|
|
+
|
|
|
this.policyCoverages = new ArrayList<>();
|
|
|
this.policyPersons = buildPolicyPersons(quoteVo.getOwnersInfo(), quoteVo.getPolicyHolderInfo(), quoteVo.getInsuredPersonInfo());
|
|
|
this.policyRatios = new ArrayList<>();
|
|
|
@@ -482,7 +486,124 @@ public class AnShengCrawlerCalculatePremiumApplyMessage {
|
|
|
@JsonProperty("vehicleTax")
|
|
|
private VehicleTaxDTO vehicleTax;
|
|
|
|
|
|
- @NoArgsConstructor
|
|
|
+ public TargetListDTO(AnShengCrawlerSearchVehicleByVinResponse.DataDTO dataDTO, CarInfoVo carInfoVo, String departmentCode) {
|
|
|
+ AnShengCrawlerSearchVehicleByVinResponse.DataDTO.BrandAutoModelDTO brandAutoModel = dataDTO.getBrandAutoModel();
|
|
|
+ this.linkId = "";
|
|
|
+ this.targetId = "";
|
|
|
+ this.ymIsbuyOrnot = "";
|
|
|
+ this.ymBirthDate = "";
|
|
|
+ this.ymElecBatteryType = "";
|
|
|
+ this.marketDate = "";
|
|
|
+ this.vehicleCertificateNo = "";
|
|
|
+ this.vehicleCertificateType = "";
|
|
|
+ this.vehiclePurchasePrice = "";
|
|
|
+ this.modelsListedYear = dataDTO.getMadeDate();
|
|
|
+ this.platformId = "";
|
|
|
+ this.vehicleColor = "";
|
|
|
+ this.theftproofEquipmentCode = "5";
|
|
|
+ this.isMortgage = "";
|
|
|
+ this.isSpecialInsuranceVehicle = "0";
|
|
|
+ this.vehicleVer = "";
|
|
|
+ this.groupCode = "";
|
|
|
+ this.standardName = brandAutoModel.getStandardName();
|
|
|
+ this.tradeName = brandAutoModel.getTradeName();
|
|
|
+ this.tradeCode = brandAutoModel.getTradeCode();
|
|
|
+ this.totalVehicleWeight = "0";
|
|
|
+ this.seriesCode = brandAutoModel.getSeriesCode();
|
|
|
+ this.modelIdCode = brandAutoModel.getModelIdCode();
|
|
|
+ this.seats = carInfoVo.getSeatCount();
|
|
|
+ this.rbCode = brandAutoModel.getRbCode();
|
|
|
+ this.otherEnergyTypeDesc = "";
|
|
|
+ this.madeDate = brandAutoModel.getMakeDate();
|
|
|
+ this.exhaustCapability = brandAutoModel.getExhaustCapabilityString();
|
|
|
+ this.noDamageYears = "";
|
|
|
+ this.specialVehicleFlag = "";
|
|
|
+ this.overseasVehicleFlag = "";
|
|
|
+ this.brand = brandAutoModel.getBrand();
|
|
|
+ this.modelCodeAlien = "";
|
|
|
+ this.carNameAlien = "";
|
|
|
+ this.tradeNameAlien = "";
|
|
|
+ this.brandAlien = "";
|
|
|
+ this.deptNameAlien = "";
|
|
|
+ this.checkVehicleInfo = new CheckVehicleInfoDTO();
|
|
|
+ this.departmentCode = departmentCode;
|
|
|
+ this.dbVehicleType = brandAutoModel.getInsuranceCode();
|
|
|
+ this.vehicleLicenceCode = carInfoVo.getLicenseNo();
|
|
|
+ this.vehicleFrameNo = carInfoVo.getVinNo();
|
|
|
+ this.engineNo = carInfoVo.getEngineNo();
|
|
|
+ this.firstRegisterDate = carInfoVo.getRegisterDate();
|
|
|
+ this.firstRegisterDateStr = carInfoVo.getRegisterDate();
|
|
|
+ this.vehicleCertificateDate = "";
|
|
|
+ this.weigth = brandAutoModel.getCurbWeightMin();
|
|
|
+ this.totalMass = "";
|
|
|
+ this.priceType = "04";
|
|
|
+ this.purchasePrice = brandAutoModel.getPurchasePrice();
|
|
|
+ this.vehicleLossInsuredValue = dataDTO.getVehicleLossInsuredValue();
|
|
|
+ this.importFlag = brandAutoModel.getImportFlag();
|
|
|
+ this.modelCode = brandAutoModel.getModelCode();
|
|
|
+ this.carName = brandAutoModel.getCarName();
|
|
|
+ this.theftProof = brandAutoModel.getTheftProof();
|
|
|
+ this.vehicleType = brandAutoModel.getVehicleType();
|
|
|
+ this.pureRange = "";
|
|
|
+ this.vehicleClass = brandAutoModel.getVehicleClass();
|
|
|
+ this.vehicleStyle = carInfoVo.getCarTypeCode();
|
|
|
+ this.autoModelCode = brandAutoModel.getAutoModelCode();
|
|
|
+ this.vehicleBrand = brandAutoModel.getBrandChnName();
|
|
|
+ this.brandChnName = brandAutoModel.getAutoModelChnName();
|
|
|
+ this.averageMile = "";
|
|
|
+ this.csTradeName = brandAutoModel.getTradeName();
|
|
|
+ this.csTradeCode = brandAutoModel.getTradeCode();
|
|
|
+ this.brandCode = brandAutoModel.getBrandCode();
|
|
|
+ this.series = brandAutoModel.getSeries();
|
|
|
+ this.noticeType = brandAutoModel.getNoticeType();
|
|
|
+ this.categoryName = brandAutoModel.getCategoryName();
|
|
|
+ this.categoryCode = brandAutoModel.getCategoryCode();
|
|
|
+ this.configType = brandAutoModel.getConfigType();
|
|
|
+ this.partInfo = brandAutoModel.getAirbagCountString();
|
|
|
+ this.powerType = brandAutoModel.getPowerType();
|
|
|
+ this.vehicleFgwCode = brandAutoModel.getAutoModelChnName();
|
|
|
+ this.vehicleFgwName = brandAutoModel.getBrandChnName();
|
|
|
+ this.vehicleModelType = brandAutoModel.getVehicleModelType();
|
|
|
+ this.vehicleStyleDesc = "";
|
|
|
+ this.vehicleTypeName = brandAutoModel.getVehicleTypeName();
|
|
|
+ this.makeDate = Integer.valueOf(brandAutoModel.getMakeDate());
|
|
|
+ this.stopFlag = stopFlag;
|
|
|
+ this.detailDesc = detailDesc;
|
|
|
+ this.vehicleCategory = vehicleCategory;
|
|
|
+ this.personnelName = personnelName;
|
|
|
+ this.refitDesc = refitDesc;
|
|
|
+ this.basicRateCode = basicRateCode;
|
|
|
+ this.deptName = deptName;
|
|
|
+ this.deptCode = deptCode;
|
|
|
+ this.vehicleSeats = vehicleSeats;
|
|
|
+ this.fuelType = fuelType;
|
|
|
+ this.autoModelChnName = autoModelChnName;
|
|
|
+ this.licenceTypeCode = licenceTypeCode;
|
|
|
+ this.ecdemicVehicleFlag = ecdemicVehicleFlag;
|
|
|
+ this.vehicleTonnages = vehicleTonnages;
|
|
|
+ this.power = power;
|
|
|
+ this.maxDesignSpeed = 0;
|
|
|
+ this.runCardCertificateDate = runCardCertificateDate;
|
|
|
+ this.customerNegotiatePrice = customerNegotiatePrice;
|
|
|
+ this.originalCustomerNegotiatePrice = originalCustomerNegotiatePrice;
|
|
|
+ this.fleetNo = fleetNo;
|
|
|
+ this.maker = maker;
|
|
|
+ this.approvedCapacity = approvedCapacity;
|
|
|
+ this.ineffectualDate = ineffectualDate;
|
|
|
+ this.lastCheckDate = lastCheckDate;
|
|
|
+ this.rejectDate = rejectDate;
|
|
|
+ this.riskFlag = riskFlag;
|
|
|
+ this.targetType = targetType;
|
|
|
+ this.fleetRate = fleetRate;
|
|
|
+ this.usageAttributeCode = usageAttributeCode;
|
|
|
+ this.usageAttributeCodePM = usageAttributeCodePM;
|
|
|
+ this.ownershipAttributeCode = ownershipAttributeCode;
|
|
|
+ this.beneficiaryList = beneficiaryList;
|
|
|
+ this.checkVehicleCodeSecret = checkVehicleCodeSecret;
|
|
|
+ this.policyPricing = new PolicyPricingDTO(dataDTO);
|
|
|
+ this.vehicleTax = new VehicleTaxDTO();
|
|
|
+ }
|
|
|
+
|
|
|
@Data
|
|
|
public static class CheckVehicleInfoDTO {
|
|
|
@JsonProperty("usageAttributeCode")
|
|
|
@@ -503,6 +624,18 @@ public class AnShengCrawlerCalculatePremiumApplyMessage {
|
|
|
private String checkRecord;
|
|
|
@JsonProperty("checkTime")
|
|
|
private String checkTime;
|
|
|
+
|
|
|
+ public CheckVehicleInfoDTO() {
|
|
|
+ this.usageAttributeCode = "1";
|
|
|
+ this.usageAttributeCodePM = "";
|
|
|
+ this.runRegionCode = "";
|
|
|
+ this.checkVehicleFlag = "";
|
|
|
+ this.uploadCheckVehicleInfo = "1";
|
|
|
+ this.checkVehicleSituation = "";
|
|
|
+ this.vehicleChecker = "";
|
|
|
+ this.checkRecord = "";
|
|
|
+ this.checkTime = "";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor
|
|
|
@@ -658,6 +791,84 @@ public class AnShengCrawlerCalculatePremiumApplyMessage {
|
|
|
private String vehicleAlias;
|
|
|
@JsonProperty("customerSource")
|
|
|
private String customerSource;
|
|
|
+
|
|
|
+ public PolicyPricingDTO(AnShengCrawlerSearchVehicleByVinResponse.DataDTO dataDTO) {
|
|
|
+ this.usageAttributeCode = "";
|
|
|
+ this.usageAttributeCodePM = "";
|
|
|
+ this.ownershipAttributeCode = "";
|
|
|
+ this.nonclaimAdjust = "";
|
|
|
+ this.claimAdjustLevel = "";
|
|
|
+ this.lastyearStartDate = "";
|
|
|
+ this.lastyearEndDate = "";
|
|
|
+ this.partInfo = "";
|
|
|
+ this.isMortgage = "";
|
|
|
+ this.isSpecialInsuranceVehicle = "";
|
|
|
+ this.claimRecordBizScoreSize = "";
|
|
|
+ this.loanVehicleFlag = "";
|
|
|
+ this.injurySite = "";
|
|
|
+ this.transferFlag = "";
|
|
|
+ this.searchSequenceNo = "";
|
|
|
+ this.dbVehicleAutoModelChnName = "";
|
|
|
+ this.refitDesc = "";
|
|
|
+ this.lastYearIsTel = "";
|
|
|
+ this.reinsureFlag = "";
|
|
|
+ this.rateFloatFlag = "";
|
|
|
+ this.ratioFluctuateType = "";
|
|
|
+ this.repairFactory = "";
|
|
|
+ this.dbVehicleWeigth = "";
|
|
|
+ this.riskScore = "";
|
|
|
+ this.riskScoreTwenty = "";
|
|
|
+ this.algrId = "";
|
|
|
+ this.riskScoreColor = "";
|
|
|
+ this.scoreReason = "";
|
|
|
+ this.scoreReasonLevel = "";
|
|
|
+ this.scoreReasonLevel2 = "";
|
|
|
+ this.scoreReasonLevel3 = "";
|
|
|
+ this.highRiskFlag = "";
|
|
|
+ this.effectReason = "";
|
|
|
+ this.dbVehicleVeiw = "";
|
|
|
+ this.lastYearCompanyId = "";
|
|
|
+ this.chargeRateFinal = "";
|
|
|
+ this.rateType = "";
|
|
|
+ this.priceRises = "";
|
|
|
+ this.underWriteRate = "";
|
|
|
+ this.autoRuleRatioOD = "";
|
|
|
+ this.autoRuleRatioTP = autoRuleRatioTP;
|
|
|
+ this.autoRuleRatioTHEFT = autoRuleRatioTHEFT;
|
|
|
+ this.autoRuleRatioOTHER = autoRuleRatioOTHER;
|
|
|
+ this.underwriteRuleRatioOD = underwriteRuleRatioOD;
|
|
|
+ this.underwriteRuleRatioTP = underwriteRuleRatioTP;
|
|
|
+ this.underwriteRuleRatioTHEFT = underwriteRuleRatioTHEFT;
|
|
|
+ this.underwriteRuleRatioOTHER = underwriteRuleRatioOTHER;
|
|
|
+ this.tlType = tlType;
|
|
|
+ this.autoFloatRatioOD = autoFloatRatioOD;
|
|
|
+ this.autoFloatRatioTp = autoFloatRatioTp;
|
|
|
+ this.autoFloatRatioTheft = autoFloatRatioTheft;
|
|
|
+ this.autoFloatRatioOther = autoFloatRatioOther;
|
|
|
+ this.appointAreaCode = appointAreaCode;
|
|
|
+ this.fdConfigId = fdConfigId;
|
|
|
+ this.modelDiscount = modelDiscount;
|
|
|
+ this.autoFloatHandingCost = autoFloatHandingCost;
|
|
|
+ this.modelrate = modelrate;
|
|
|
+ this.advicediscount = advicediscount;
|
|
|
+ this.dbVehicleBrand = dbVehicleBrand;
|
|
|
+ this.dbVehicleTypeName = dbVehicleTypeName;
|
|
|
+ this.usageLicenceName = usageLicenceName;
|
|
|
+ this.vehicleTypeChiName = vehicleTypeChiName;
|
|
|
+ this.autoFloatTargetRebate = autoFloatTargetRebate;
|
|
|
+ this.riskFlag = "";
|
|
|
+ this.dbExhaustCapability = "";
|
|
|
+ this.dbVehicleSeats = "";
|
|
|
+ this.dbVehicleTonnages = "";
|
|
|
+ this.dbVehicleValue = "";
|
|
|
+ this.ifModelRate = "";
|
|
|
+ this.isMotorcade = "";
|
|
|
+ this.scoreRunId = "";
|
|
|
+ this.specialCarFlag = "";
|
|
|
+ this.transferDate = "";
|
|
|
+ this.vehicleAlias = "";
|
|
|
+ this.customerSource = "";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor
|