|
@@ -41,7 +41,7 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
|
|
|
request.setCompulsoryInsurance(toCompulsoryInsuranceDto(quoteVo,modelsDTO));
|
|
request.setCompulsoryInsurance(toCompulsoryInsuranceDto(quoteVo,modelsDTO));
|
|
|
|
|
|
|
|
// 商业险信息
|
|
// 商业险信息
|
|
|
- request.setBusinessInsurance(toBusinessInsuranceDto(quoteVo, modelsDTO));
|
|
|
|
|
|
|
+ request.setBusinessInsurance(toBusinessInsuranceDto(quoteVo, modelsDTO, currentValue));
|
|
|
|
|
|
|
|
// NPC 信息
|
|
// NPC 信息
|
|
|
request.setProposalInfo(toProposalInfoDto(quoteVo, parameters,taiShanCrawlerDeptResponse,attributionInformationVo));
|
|
request.setProposalInfo(toProposalInfoDto(quoteVo, parameters,taiShanCrawlerDeptResponse,attributionInformationVo));
|
|
@@ -49,11 +49,6 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
|
|
|
// 系数信息
|
|
// 系数信息
|
|
|
request.setCoefficientInfo(toCoefficientInfoDto(quoteVo));
|
|
request.setCoefficientInfo(toCoefficientInfoDto(quoteVo));
|
|
|
|
|
|
|
|
-// request.getProposalInfo().setSaleChannel("10"); // 个人代理人渠道 SaleChannel
|
|
|
|
|
-// request.getProposalInfo().setSaleCode("581222");
|
|
|
|
|
-// request.getProposalInfo().setSaleName("张堃");
|
|
|
|
|
-// request.getProposalInfo().setSaleNo("140107199402270639");
|
|
|
|
|
-
|
|
|
|
|
request.setHouseholdInsurance(new Object());
|
|
request.setHouseholdInsurance(new Object());
|
|
|
request.setHouseholdBInsurance(new Object());
|
|
request.setHouseholdBInsurance(new Object());
|
|
|
request.setHouseholdCInsurance(new Object());
|
|
request.setHouseholdCInsurance(new Object());
|
|
@@ -191,7 +186,7 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
|
|
|
return proposalInfo;
|
|
return proposalInfo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static TaiShanCrawlerQuotationRequest.BusinessInsurance toBusinessInsuranceDto(QuoteVo quoteVo, TaiShanCrawlerCarResponse.CarModelInfo modelsDTO) {
|
|
|
|
|
|
|
+ private static TaiShanCrawlerQuotationRequest.BusinessInsurance toBusinessInsuranceDto(QuoteVo quoteVo, TaiShanCrawlerCarResponse.CarModelInfo modelsDTO, String currentValue) {
|
|
|
TaiShanCrawlerQuotationRequest.BusinessInsurance businessInsurance = new TaiShanCrawlerQuotationRequest.BusinessInsurance();
|
|
TaiShanCrawlerQuotationRequest.BusinessInsurance businessInsurance = new TaiShanCrawlerQuotationRequest.BusinessInsurance();
|
|
|
if(Objects.isNull(quoteVo.getBiRiskInfoVo())){
|
|
if(Objects.isNull(quoteVo.getBiRiskInfoVo())){
|
|
|
businessInsurance.setItemKinds(new ArrayList<>());
|
|
businessInsurance.setItemKinds(new ArrayList<>());
|
|
@@ -200,7 +195,7 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
|
|
|
return businessInsurance;
|
|
return businessInsurance;
|
|
|
}
|
|
}
|
|
|
// 险别信息
|
|
// 险别信息
|
|
|
- businessInsurance.setItemKinds(toBusinessItemKindListDTOList(quoteVo,modelsDTO));
|
|
|
|
|
|
|
+ businessInsurance.setItemKinds(toBusinessItemKindListDTOList(quoteVo, modelsDTO, currentValue));
|
|
|
RiskInfoVo biRiskInfoVo = quoteVo.getBiRiskInfoVo();
|
|
RiskInfoVo biRiskInfoVo = quoteVo.getBiRiskInfoVo();
|
|
|
businessInsurance.setProductInfo(toBusinessProductInfoDto(biRiskInfoVo));
|
|
businessInsurance.setProductInfo(toBusinessProductInfoDto(biRiskInfoVo));
|
|
|
businessInsurance.setSpecialInfos(new ArrayList<>());
|
|
businessInsurance.setSpecialInfos(new ArrayList<>());
|
|
@@ -239,60 +234,404 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static List<TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind> toBusinessItemKindListDTOList(QuoteVo quoteVo, TaiShanCrawlerCarResponse.CarModelInfo modelsDTO) {
|
|
|
|
|
- List<KindInfoVo> kindInfoVo = quoteVo.getKindInfoVo();
|
|
|
|
|
|
|
+ private static List<TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind> toBusinessItemKindListDTOList(QuoteVo quoteVo, TaiShanCrawlerCarResponse.CarModelInfo modelsDTO, String actualValue) {
|
|
|
|
|
+ List<KindInfoVo> kindInfoVoList = quoteVo.getKindInfoVo();
|
|
|
List<TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind> kindList = new ArrayList<>();
|
|
List<TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind> kindList = new ArrayList<>();
|
|
|
- int index = 0;
|
|
|
|
|
- for (KindInfoVo infoVo : kindInfoVo) {
|
|
|
|
|
- TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind itemKind = new TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind();
|
|
|
|
|
- itemKind.setDisabled(false);
|
|
|
|
|
- itemKind.setNoDeductibleFlag(false);
|
|
|
|
|
- itemKind.setKindCode(infoVo.getKindCode());
|
|
|
|
|
- itemKind.setKindName(infoVo.getKindName());
|
|
|
|
|
- itemKind.setKindSort(index);
|
|
|
|
|
- itemKind.setMainRiskFlag("");
|
|
|
|
|
- itemKind.setDeductibleFlag(false);
|
|
|
|
|
- itemKind.setAmount(infoVo.getAmount());
|
|
|
|
|
- itemKind.setRate("0.0");
|
|
|
|
|
- itemKind.setBefPremium("0.0");//"0.0"
|
|
|
|
|
- itemKind.setPremium("0.0");//"0.0"
|
|
|
|
|
- itemKind.setDisCoef("0.0");//"0.0"
|
|
|
|
|
- itemKind.setDeductible(""); // 免额档次
|
|
|
|
|
- itemKind.setDuctDiscount("");
|
|
|
|
|
- itemKind.setIndemLmtLvl("");
|
|
|
|
|
- itemKind.setIndemLmt(infoVo.getAmount());
|
|
|
|
|
- itemKind.setLiabDaysLmt("");
|
|
|
|
|
- //itemKind.setPerAmt(infoVo.getUnitAmount());
|
|
|
|
|
- itemKind.setPerAmt("");
|
|
|
|
|
- itemKind.setGlassType("");
|
|
|
|
|
- itemKind.setSpecialGlassFloat("");
|
|
|
|
|
- itemKind.setVhlDamageFloat("");
|
|
|
|
|
- itemKind.setCompenPerAmt("");
|
|
|
|
|
- itemKind.setCompenPerDay("");
|
|
|
|
|
- itemKind.setDeductibleRatio("");
|
|
|
|
|
- itemKind.setBefAnnPrm("0.0");//"0.0"
|
|
|
|
|
- itemKind.setPureRiskPremium("0.0");
|
|
|
|
|
- itemKind.setBasePrm("0.0");//"0.0"
|
|
|
|
|
- itemKind.setAfterPremiumYear("0.0");//"0.0"
|
|
|
|
|
- itemKind.setCalcPrm("0.0");//"0.0"
|
|
|
|
|
- itemKind.setResvNumberRoad("");
|
|
|
|
|
- itemKind.setResvNumberDriver("");
|
|
|
|
|
- itemKind.setAbsoluteDeductible("");
|
|
|
|
|
- itemKind.setResvNumAutonomy("0.0");//"0.0"
|
|
|
|
|
- itemKind.setAmtVar("0.0");
|
|
|
|
|
- itemKind.setPrmVar("0.0");
|
|
|
|
|
- itemKind.setRowId("");
|
|
|
|
|
- itemKind.setAddCvrgFlag("");
|
|
|
|
|
- itemKind.setCancelMrk("");
|
|
|
|
|
- itemKind.setSeqNo("");
|
|
|
|
|
- itemKind.setPkId("");
|
|
|
|
|
- kindList.add(itemKind);
|
|
|
|
|
- index ++;
|
|
|
|
|
|
|
+ int seatNumber = Integer.parseInt(modelsDTO.getNewSeatNumber());
|
|
|
|
|
+
|
|
|
|
|
+ for (KindInfoVo infoVo : kindInfoVoList) {
|
|
|
|
|
+ String kindCode = infoVo.getKindCode();
|
|
|
|
|
+ TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind itemKind;
|
|
|
|
|
+
|
|
|
|
|
+ // 获取对应险种的模板默认值(与Python insurance_Map对应)
|
|
|
|
|
+ switch (kindCode) {
|
|
|
|
|
+ // A: 机动车损失保险
|
|
|
|
|
+ case "A":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("030006", "机动车损失保险", 1);
|
|
|
|
|
+ itemKind.setAmount(actualValue);
|
|
|
|
|
+ itemKind.setDeductible("375001");
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // B: 第三者责任保险
|
|
|
|
|
+ case "B":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("030018", "第三者责任险", 2);
|
|
|
|
|
+ itemKind.setAmount(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setIndemLmt(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setIndemLmtLvl("306006018"); // 默认200万以上
|
|
|
|
|
+ for (String[] limit : THIRD_LIMIT_AMT) {
|
|
|
|
|
+ double cnameVal = extractNumberFromWan(limit[0]);
|
|
|
|
|
+ if (cnameVal == Double.parseDouble(infoVo.getAmount())) {
|
|
|
|
|
+ itemKind.setIndemLmtLvl(limit[1]);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // D3: 车上人员责任险(驾驶人)
|
|
|
|
|
+ case "D3":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("030001", "车上人员责任险(驾驶人)", 3);
|
|
|
|
|
+ itemKind.setAmount(Integer.parseInt(infoVo.getAmount()));
|
|
|
|
|
+ itemKind.setLiabDaysLmt(1);
|
|
|
|
|
+ // 匹配医保外医疗费用档次以获取indemLmtLvl(与Python一致)
|
|
|
|
|
+ for (String[] med : MEDICAL_EXPENSES_OUTSIDE) {
|
|
|
|
|
+ if (!"保额共享".equals(med[0]) && Float.parseFloat(med[0]) == Float.parseFloat(infoVo.getAmount())) {
|
|
|
|
|
+ itemKind.setAmount(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setIndemLmt(actualValue);
|
|
|
|
|
+ itemKind.setIndemLmtLvl(med[1]);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // D4: 车上人员责任险(乘客)
|
|
|
|
|
+ case "D4":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("030009", "车上人员责任险(乘客)", 4);
|
|
|
|
|
+ int d4Amount = Integer.parseInt(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setAmount(d4Amount * (seatNumber - 1));
|
|
|
|
|
+ itemKind.setPerAmt(d4Amount);
|
|
|
|
|
+ itemKind.setLiabDaysLmt(seatNumber - 1);
|
|
|
|
|
+ for (String[] med : MEDICAL_EXPENSES_OUTSIDE) {
|
|
|
|
|
+ if (!"保额共享".equals(med[0]) && Float.parseFloat(med[0]) == Float.parseFloat(infoVo.getAmount())) {
|
|
|
|
|
+ itemKind.setIndemLmt(actualValue);
|
|
|
|
|
+ itemKind.setIndemLmtLvl(med[1]);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // L: 附加车身划痕损失险
|
|
|
|
|
+ case "L":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("032601", "附加车身划痕损失险", 1);
|
|
|
|
|
+ itemKind.setAmount(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setIndemLmt(infoVo.getAmount());
|
|
|
|
|
+ for (String[] scratch : CAR_SCRATCH_LEVELS) {
|
|
|
|
|
+ if (Float.parseFloat(scratch[0]) == Float.parseFloat(infoVo.getAmount())) {
|
|
|
|
|
+ itemKind.setIndemLmtLvl(scratch[1]);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // BD: 附加法定节假日限额翻倍险
|
|
|
|
|
+ case "BD":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033605", "附加法定节假日限额翻倍险", 8);
|
|
|
|
|
+ itemKind.setAmount(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setIndemLmt(infoVo.getAmount());
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // SY_FJ_YBW1: 附加医保外用药责任险(三者险)
|
|
|
|
|
+ case "SY_FJ_YBW1":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033630", "附加医保外用药责任险(三者险)", 14);
|
|
|
|
|
+ itemKind.setAmount("500000");
|
|
|
|
|
+ itemKind.setIndemLmt("500000");
|
|
|
|
|
+ itemKind.setIndemLmtLvl("390N27"); // 默认50万
|
|
|
|
|
+ for (String[] med : MEDICAL_EXPENSES_OUTSIDE) {
|
|
|
|
|
+ if (!"保额共享".equals(med[0]) && Float.parseFloat(med[0]) == Float.parseFloat(infoVo.getAmount())) {
|
|
|
|
|
+ itemKind.setAmount(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setIndemLmt(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setIndemLmtLvl(med[1]);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // SY_FJ_YBW3: 附加医保外用药责任险(司机)
|
|
|
|
|
+ case "SY_FJ_YBW3":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033623", "附加医保外用药责任险(司机)", 15);
|
|
|
|
|
+ itemKind.setAmount("500000");
|
|
|
|
|
+ itemKind.setIndemLmt("500000");
|
|
|
|
|
+ itemKind.setIndemLmtLvl("390N27"); // 默认50万
|
|
|
|
|
+ for (String[] med : MEDICAL_EXPENSES_OUTSIDE) {
|
|
|
|
|
+ if (!"保额共享".equals(med[0]) && Float.parseFloat(med[0]) == Float.parseFloat(infoVo.getAmount())) {
|
|
|
|
|
+ itemKind.setIndemLmtLvl(med[1]);
|
|
|
|
|
+ itemKind.setAmount(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setIndemLmt(infoVo.getAmount());
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // SY_FJ_YBW2: 附加医保外用药责任险(乘客)
|
|
|
|
|
+ case "SY_FJ_YBW2":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033624", "附加医保外用药责任险(乘客)", 16);
|
|
|
|
|
+ itemKind.setAmount(500000 * (seatNumber - 1));
|
|
|
|
|
+ itemKind.setIndemLmt("500000");
|
|
|
|
|
+ itemKind.setLiabDaysLmt(seatNumber - 1);
|
|
|
|
|
+ itemKind.setPerAmt("500000");
|
|
|
|
|
+ itemKind.setIndemLmtLvl("390N27"); // 默认50万
|
|
|
|
|
+ for (String[] med : MEDICAL_EXPENSES_OUTSIDE) {
|
|
|
|
|
+ if (!"保额共享".equals(med[0]) && Float.parseFloat(med[0]) == Float.parseFloat(infoVo.getAmount())) {
|
|
|
|
|
+ itemKind.setAmount(Integer.parseInt(infoVo.getAmount()) * (seatNumber - 1));
|
|
|
|
|
+ itemKind.setIndemLmt(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setLiabDaysLmt(seatNumber - 1);
|
|
|
|
|
+ itemKind.setPerAmt(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setIndemLmtLvl(med[1]);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // TY1: 道路救援服务特约条款
|
|
|
|
|
+ case "TY1":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033615", "道路救援服务特约条款", 13);
|
|
|
|
|
+ for (String[] rescue : ROAD_RESCUE_SERVICES) {
|
|
|
|
|
+ // 提取"X次"中的数字部分进行比较
|
|
|
|
|
+ String rescueCount = rescue[0].replace("次", "");
|
|
|
|
|
+ if (rescueCount.equals(infoVo.getAmount())) {
|
|
|
|
|
+ itemKind.setResvNumberRoad(rescue[1]);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // TY2: 车辆安全检测特约条款
|
|
|
|
|
+ case "TY2":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033616", "车辆安全检测特约条款", 22);
|
|
|
|
|
+ for (String[] safety : VEHICLE_SAFETY_CHECK) {
|
|
|
|
|
+ // 提取"X次"中的数字部分进行比较
|
|
|
|
|
+ String safetyCount = safety[0].replace("次", "");
|
|
|
|
|
+ if (safetyCount.equals(infoVo.getAmount())) {
|
|
|
|
|
+ itemKind.setResvNumberRoad(safety[1]);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // TY3: 代为驾驶服务特约条款
|
|
|
|
|
+ case "TY3":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033617", "代为驾驶服务特约条款", 23);
|
|
|
|
|
+ itemKind.setResvNumberDriver(infoVo.getAmount());
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // TY4: 代为送检服务特约条款
|
|
|
|
|
+ case "TY4":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033618", "代为送检服务特约条款", 24);
|
|
|
|
|
+ itemKind.setResvNumberDriver(infoVo.getAmount());
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
|
|
+ // MJ1: 附加绝对免赔率特约险(车损险)
|
|
|
|
|
+ case "MJ1":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033611", "附加绝对免赔率特约险(车损险)", 17);
|
|
|
|
|
+ itemKind.setAbsoluteDeductible(resolveDeductibleCode(infoVo.getDeductibleRate()));
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // MJ2: 附加绝对免赔率特约条款(三者险)
|
|
|
|
|
+ case "MJ2":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033612", "附加绝对免赔率特约条款(三者险)", 18);
|
|
|
|
|
+ itemKind.setAbsoluteDeductible(resolveDeductibleCode(infoVo.getDeductibleRate()));
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // MJ3: 附加绝对免赔率特约险(司机)
|
|
|
|
|
+ case "MJ3":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033613", "附加绝对免赔率特约险(司机)", 19);
|
|
|
|
|
+ itemKind.setAbsoluteDeductible(resolveDeductibleCode(infoVo.getDeductibleRate()));
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ // MJ4: 附加绝对免赔率特约险(乘客)
|
|
|
|
|
+ case "MJ4":
|
|
|
|
|
+ itemKind = buildDefaultItemKind("033614", "附加绝对免赔率特约险(乘客)", 20);
|
|
|
|
|
+ itemKind.setAbsoluteDeductible(resolveDeductibleCode(infoVo.getDeductibleRate()));
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ // 未识别的险种,回退原有逻辑填充
|
|
|
|
|
+ itemKind = fallbackBuildItemKind(infoVo, kindList.size());
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ kindList.add(itemKind);
|
|
|
}
|
|
}
|
|
|
return kindList;
|
|
return kindList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 按Python insurance_Map模板创建默认的ItemKind对象(仅设置通用默认值)
|
|
|
|
|
+ */
|
|
|
|
|
+ private static TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind buildDefaultItemKind(String kindCode, String kindName, int kindSort) {
|
|
|
|
|
+ TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind ik = new TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind();
|
|
|
|
|
+ ik.setDisabled(false);
|
|
|
|
|
+ ik.setNoDeductibleFlag(false);
|
|
|
|
|
+ ik.setKindName(kindName);
|
|
|
|
|
+ ik.setKindSort(kindSort);
|
|
|
|
|
+ ik.setMainRiskFlag("");
|
|
|
|
|
+ ik.setDeductibleFlag(false);
|
|
|
|
|
+ ik.setAmount(0);
|
|
|
|
|
+ ik.setRate("");
|
|
|
|
|
+ ik.setBefPremium(0);
|
|
|
|
|
+ ik.setPremium(0);
|
|
|
|
|
+ ik.setDisCoef(0);
|
|
|
|
|
+ ik.setDeductible("");
|
|
|
|
|
+ ik.setDuctDiscount("");
|
|
|
|
|
+ ik.setIndemLmtLvl("");
|
|
|
|
|
+ ik.setIndemLmt(0);
|
|
|
|
|
+ ik.setLiabDaysLmt("");
|
|
|
|
|
+ ik.setPerAmt("");
|
|
|
|
|
+ ik.setGlassType("");
|
|
|
|
|
+ ik.setSpecialGlassFloat("");
|
|
|
|
|
+ ik.setVhlDamageFloat("");
|
|
|
|
|
+ ik.setCompenPerAmt("");
|
|
|
|
|
+ ik.setCompenPerDay("");
|
|
|
|
|
+ ik.setKindCode(kindCode);
|
|
|
|
|
+ ik.setDeductibleRatio("");
|
|
|
|
|
+ ik.setBefAnnPrm(0);
|
|
|
|
|
+ ik.setPureRiskPremium(0);
|
|
|
|
|
+ ik.setBasePrm(0);
|
|
|
|
|
+ ik.setAfterPremiumYear(0);
|
|
|
|
|
+ ik.setCalcPrm("0");
|
|
|
|
|
+ ik.setResvNumberRoad("");
|
|
|
|
|
+ ik.setResvNumberDriver("");
|
|
|
|
|
+ ik.setAbsoluteDeductible("");
|
|
|
|
|
+ ik.setResvNumAutonomy("");
|
|
|
|
|
+ ik.setAmtVar("0.0");
|
|
|
|
|
+ ik.setPrmVar("0.0");
|
|
|
|
|
+ ik.setRowId("");
|
|
|
|
|
+ ik.setAddCvrgFlag("");
|
|
|
|
|
+ ik.setCancelMrk("");
|
|
|
|
|
+ ik.setSeqNo("");
|
|
|
|
|
+ ik.setPkId("");
|
|
|
|
|
+ return ik;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 未匹配到已知险种时的回退填充(保留旧逻辑兜底)
|
|
|
|
|
+ */
|
|
|
|
|
+ private static TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind fallbackBuildItemKind(KindInfoVo infoVo, int sortIndex) {
|
|
|
|
|
+ TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind itemKind = new TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind();
|
|
|
|
|
+ itemKind.setDisabled(false);
|
|
|
|
|
+ itemKind.setNoDeductibleFlag(false);
|
|
|
|
|
+ itemKind.setKindCode(infoVo.getKindCode());
|
|
|
|
|
+ itemKind.setKindName(infoVo.getKindName());
|
|
|
|
|
+ itemKind.setKindSort(sortIndex);
|
|
|
|
|
+ itemKind.setMainRiskFlag("");
|
|
|
|
|
+ itemKind.setDeductibleFlag(false);
|
|
|
|
|
+ itemKind.setAmount(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setRate("0.0");
|
|
|
|
|
+ itemKind.setBefPremium("0.0");
|
|
|
|
|
+ itemKind.setPremium("0.0");
|
|
|
|
|
+ itemKind.setDisCoef("0.0");
|
|
|
|
|
+ itemKind.setDeductible("");
|
|
|
|
|
+ itemKind.setDuctDiscount("");
|
|
|
|
|
+ itemKind.setIndemLmtLvl("");
|
|
|
|
|
+ itemKind.setIndemLmt(infoVo.getAmount());
|
|
|
|
|
+ itemKind.setLiabDaysLmt("");
|
|
|
|
|
+ itemKind.setPerAmt("");
|
|
|
|
|
+ itemKind.setGlassType("");
|
|
|
|
|
+ itemKind.setSpecialGlassFloat("");
|
|
|
|
|
+ itemKind.setVhlDamageFloat("");
|
|
|
|
|
+ itemKind.setCompenPerAmt("");
|
|
|
|
|
+ itemKind.setCompenPerDay("");
|
|
|
|
|
+ itemKind.setDeductibleRatio("");
|
|
|
|
|
+ itemKind.setBefAnnPrm("0.0");
|
|
|
|
|
+ itemKind.setPureRiskPremium("0.0");
|
|
|
|
|
+ itemKind.setBasePrm("0.0");
|
|
|
|
|
+ itemKind.setAfterPremiumYear("0.0");
|
|
|
|
|
+ itemKind.setCalcPrm("0.0");
|
|
|
|
|
+ itemKind.setResvNumberRoad("");
|
|
|
|
|
+ itemKind.setResvNumberDriver("");
|
|
|
|
|
+ itemKind.setAbsoluteDeductible("");
|
|
|
|
|
+ itemKind.setResvNumAutonomy("0.0");
|
|
|
|
|
+ itemKind.setAmtVar("0.0");
|
|
|
|
|
+ itemKind.setPrmVar("0.0");
|
|
|
|
|
+ itemKind.setRowId("");
|
|
|
|
|
+ itemKind.setAddCvrgFlag("");
|
|
|
|
|
+ itemKind.setCancelMrk("");
|
|
|
|
|
+ itemKind.setSeqNo("");
|
|
|
|
|
+ itemKind.setPkId("");
|
|
|
|
|
+ return itemKind;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 从"XX万元"格式字符串中提取数字(与Python extract_number 一致)
|
|
|
|
|
+ */
|
|
|
|
|
+ private static double extractNumberFromWan(String text) {
|
|
|
|
|
+ if (text == null) return 0;
|
|
|
|
|
+ java.util.regex.Matcher m = java.util.regex.Pattern.compile("(\\d+\\.?\\d*)(?=万)").matcher(text);
|
|
|
|
|
+ return m.find() ? Double.parseDouble(m.group(1)) * 10000 : 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据免赔率字符串解析对应的绝对免赔率代码(与Python absolute_deductible 匹配一致)
|
|
|
|
|
+ */
|
|
|
|
|
+ private static String resolveDeductibleCode(String deductibleRateStr) {
|
|
|
|
|
+ if (deductibleRateStr == null || deductibleRateStr.isEmpty()) return "";
|
|
|
|
|
+ // 提取数字部分,例如"20%" -> "20%"
|
|
|
|
|
+ java.util.regex.Matcher m = java.util.regex.Pattern.compile("\\d+").matcher(deductibleRateStr);
|
|
|
|
|
+ if (m.find()) {
|
|
|
|
|
+ String percentKey = m.group() + "%";
|
|
|
|
|
+ return ABSOLUTE_DEDUCTIBLE_MAP.getOrDefault(percentKey, "");
|
|
|
|
|
+ }
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== Python 档位静态常量(与 tsbxitem.py 保持一致) ====================
|
|
|
|
|
+
|
|
|
|
|
+ /** 【第三者责任险】限额档次 */
|
|
|
|
|
+ private static final List<String[]> THIRD_LIMIT_AMT = Arrays.asList(
|
|
|
|
|
+ new String[]{"10万元", "306006005"},
|
|
|
|
|
+ new String[]{"15万元", "306006010"},
|
|
|
|
|
+ new String[]{"20万元", "306006006"},
|
|
|
|
|
+ new String[]{"30万元", "306006007"},
|
|
|
|
|
+ new String[]{"50万元", "306006009"},
|
|
|
|
|
+ new String[]{"100万元", "306006014"},
|
|
|
|
|
+ new String[]{"150万元", "306006016"},
|
|
|
|
|
+ new String[]{"200万元", "306006017"},
|
|
|
|
|
+ new String[]{"200万以上", "306006018"}
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ /** 车身划痕损失险/附加自用充电桩损失保险 档次 */
|
|
|
|
|
+ private static final List<String[]> CAR_SCRATCH_LEVELS = Arrays.asList(
|
|
|
|
|
+ new String[]{"2000", "N03001001"},
|
|
|
|
|
+ new String[]{"5000", "N03001002"},
|
|
|
|
|
+ new String[]{"10000", "N03001003"},
|
|
|
|
|
+ new String[]{"20000", "N03001004"}
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ /** 道路救援服务次数 */
|
|
|
|
|
+ private static final List<String[]> ROAD_RESCUE_SERVICES = Arrays.asList(
|
|
|
|
|
+ new String[]{"2", "390005"},
|
|
|
|
|
+ new String[]{"7", "390001"},
|
|
|
|
|
+ new String[]{"12", "390002"},
|
|
|
|
|
+ new String[]{"17", "390003"},
|
|
|
|
|
+ new String[]{"22", "390004"}
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ /** 车辆安全检测特约条款 */
|
|
|
|
|
+ private static final List<String[]> VEHICLE_SAFETY_CHECK = Arrays.asList(
|
|
|
|
|
+ new String[]{"2", "390N01"},
|
|
|
|
|
+ new String[]{"5", "390N02"}
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ /** 附加医保外医疗费用责任险 档次 */
|
|
|
|
|
+ private static final List<String[]> MEDICAL_EXPENSES_OUTSIDE = Arrays.asList(
|
|
|
|
|
+ new String[]{"保额共享", "390N16"},
|
|
|
|
|
+ new String[]{"5000", "390N17"},
|
|
|
|
|
+ new String[]{"10000", "390N18"},
|
|
|
|
|
+ new String[]{"20000", "390N19"},
|
|
|
|
|
+ new String[]{"30000", "390N20"},
|
|
|
|
|
+ new String[]{"40000", "390N21"},
|
|
|
|
|
+ new String[]{"50000", "390N22"},
|
|
|
|
|
+ new String[]{"100000", "390N23"},
|
|
|
|
|
+ new String[]{"150000", "390N24"},
|
|
|
|
|
+ new String[]{"200000", "390N25"},
|
|
|
|
|
+ new String[]{"300000", "390N26"},
|
|
|
|
|
+ new String[]{"500000", "390N27"},
|
|
|
|
|
+ new String[]{"1000000", "390N28"},
|
|
|
|
|
+ new String[]{"1500000", "390N29"},
|
|
|
|
|
+ new String[]{"2000000", "390N30"},
|
|
|
|
|
+ new String[]{"3000000", "390N31"},
|
|
|
|
|
+ new String[]{"4000000", "390N32"},
|
|
|
|
|
+ new String[]{"5000000", "390N33"}
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ /** 绝对免赔率 */
|
|
|
|
|
+ private static final java.util.Map<String, String> ABSOLUTE_DEDUCTIBLE_MAP;
|
|
|
|
|
+ static {
|
|
|
|
|
+ ABSOLUTE_DEDUCTIBLE_MAP = new HashMap<>();
|
|
|
|
|
+ ABSOLUTE_DEDUCTIBLE_MAP.put("5%", "379001");
|
|
|
|
|
+ ABSOLUTE_DEDUCTIBLE_MAP.put("10%", "379002");
|
|
|
|
|
+ ABSOLUTE_DEDUCTIBLE_MAP.put("15%", "379003");
|
|
|
|
|
+ ABSOLUTE_DEDUCTIBLE_MAP.put("20%", "379004");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public static TaiShanCrawlerQuotationRequest.CompulsoryInsurance toCompulsoryInsuranceDto(QuoteVo quoteVo, TaiShanCrawlerCarResponse.CarModelInfo modelsDTO) {
|
|
public static TaiShanCrawlerQuotationRequest.CompulsoryInsurance toCompulsoryInsuranceDto(QuoteVo quoteVo, TaiShanCrawlerCarResponse.CarModelInfo modelsDTO) {
|
|
|
TaiShanCrawlerQuotationRequest.CompulsoryInsurance compulsoryInsurance = new TaiShanCrawlerQuotationRequest.CompulsoryInsurance();
|
|
TaiShanCrawlerQuotationRequest.CompulsoryInsurance compulsoryInsurance = new TaiShanCrawlerQuotationRequest.CompulsoryInsurance();
|
|
|
if(Objects.isNull(quoteVo.getCiRiskInfoVo())){
|
|
if(Objects.isNull(quoteVo.getCiRiskInfoVo())){
|