|
|
@@ -64,7 +64,7 @@ public class ChengTaiCrawlerRequestService implements QuotationApiBaseService {
|
|
|
if (session == null) {
|
|
|
String token = chengTaiAPIService.login(username, password, captcha); // todo
|
|
|
|
|
|
- session = new ChengTaiSession();
|
|
|
+ session = new ChengTaiSession();
|
|
|
session.setToken(token);
|
|
|
session.setUsername(username);
|
|
|
|
|
|
@@ -132,7 +132,6 @@ public class ChengTaiCrawlerRequestService implements QuotationApiBaseService {
|
|
|
ChengTaiSubmitReqBody chengTaiSubmitReqBody = buildChengTaiSubmitReqBody();
|
|
|
|
|
|
|
|
|
-
|
|
|
ChengTaiQueryVehicleListResult queryVehicleListResult = chengTaiAPIService.queryVehicleList(token);
|
|
|
|
|
|
List<ChengTaiUseNature> useNatUreNameList = queryVehicleListResult.getUseNatUreNameList();
|
|
|
@@ -184,7 +183,6 @@ public class ChengTaiCrawlerRequestService implements QuotationApiBaseService {
|
|
|
param = save.getModel();
|
|
|
|
|
|
|
|
|
-
|
|
|
ChengTaiPremiumcalResult premiumcalResult = chengTaiAPIService.premiumcal(token, param);
|
|
|
|
|
|
param.setSunlightId(premiumcalResult.getSunlightId());
|
|
|
@@ -199,7 +197,6 @@ public class ChengTaiCrawlerRequestService implements QuotationApiBaseService {
|
|
|
BigDecimal discount = contractMain.getDiscount();
|
|
|
|
|
|
|
|
|
-
|
|
|
// 保存到 mongo
|
|
|
|
|
|
ChengTaiBiContract saveBiContract = param.getBiContract();
|
|
|
@@ -527,90 +524,62 @@ public class ChengTaiCrawlerRequestService implements QuotationApiBaseService {
|
|
|
|
|
|
for (KindInfoVo kindInfoVo : kindInfoVos) {
|
|
|
|
|
|
- String kindCode = kindInfoVo.getKindCode();
|
|
|
-
|
|
|
- if (kindCode.equals("A")) {
|
|
|
- ChengTaiCoverage chengTaiCoverage = new ChengTaiCoverage();
|
|
|
-
|
|
|
- chengTaiCoverage.setAmount(kindInfoVo.getAmount());
|
|
|
- chengTaiCoverage.setUnitAmount(kindInfoVo.getUnitAmount());
|
|
|
- String quantity = kindInfoVo.getQuantity();
|
|
|
- String serviceTimes = kindInfoVo.getServiceTimes();
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(quantity)) {
|
|
|
- chengTaiCoverage.setQuantity(quantity);
|
|
|
- } else if (StringUtils.isNotBlank(serviceTimes)) {
|
|
|
- chengTaiCoverage.setQuantity(serviceTimes);
|
|
|
- }
|
|
|
-
|
|
|
- chengTaiCoverage.setBasePremium("0");
|
|
|
- chengTaiCoverage.setCoveragePremium("0");
|
|
|
- chengTaiCoverage.setCalculateFlag("1 ");
|
|
|
- chengTaiCoverage.setDeductible("0");
|
|
|
- chengTaiCoverage.setDeductibleRate("0");
|
|
|
- chengTaiCoverage.setIfMainKind("1");
|
|
|
- chengTaiCoverage.setKindCode("A");
|
|
|
- chengTaiCoverage.setKindFlag(true);
|
|
|
- chengTaiCoverage.setKindName("车损险");
|
|
|
- chengTaiCoverage.setKindName(kindInfoVo.getKindName());
|
|
|
- chengTaiCoverage.setNotDeductibleCalculateFlag("0");
|
|
|
- chengTaiCoverage.setNotDeductibleIfMainKind("0");
|
|
|
- chengTaiCoverage.setNotDeductibleKindFlag(false);
|
|
|
- chengTaiCoverage.setRate("0");
|
|
|
- chengTaiCoverage.setRelatedInd("1");
|
|
|
- chengTaiCoverage.setCurrency("CNY");
|
|
|
- chengTaiCoverage.setShortRate("100");
|
|
|
- chengTaiCoverage.setShortRateType("2");
|
|
|
- chengTaiCoverage.setShow(true);
|
|
|
- chengTaiCoverage.setValidDate(biRiskInfoVo.getStartDate());
|
|
|
- chengTaiCoverage.setExpiryDate(biRiskInfoVo.getEndDate());
|
|
|
-
|
|
|
- chengTaiCoverageList.add(chengTaiCoverage);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- List<ChengTaiCoverage> coverage = new ArrayList<>();
|
|
|
+ ChengTaiCoverage chengTaiCoverage = new ChengTaiCoverage();
|
|
|
|
|
|
- /*
|
|
|
- "amount":140182.4,
|
|
|
- "basePremium":"0",
|
|
|
- "coveragePremium":"0",
|
|
|
- "calculateFlag":"1",
|
|
|
- "deductible":0,
|
|
|
- "deductibleRate":"0",
|
|
|
- "ifMainKind":"1",
|
|
|
- "kindCode":"A",
|
|
|
- "kindFlag":true,
|
|
|
- "kindName":"车损险",
|
|
|
- "notDeductibleCalculateFlag":"0",
|
|
|
- "notDeductibleIfMainKind":"0",
|
|
|
- "notDeductibleKindFlag":true,
|
|
|
- "relatedInd":"1",
|
|
|
- "validDate":"2025-04-11 00:00:00",
|
|
|
- "expiryDate":"2026-04-11 00:00:00",
|
|
|
- "currency":"CNY",
|
|
|
- "shortRate":100,
|
|
|
- "shortRateType":"2"
|
|
|
- */
|
|
|
+ chengTaiCoverage.setAmount(kindInfoVo.getAmount());
|
|
|
+ chengTaiCoverage.setUnitAmount(kindInfoVo.getUnitAmount());
|
|
|
+ String quantity = kindInfoVo.getQuantity();
|
|
|
+ String serviceTimes = kindInfoVo.getServiceTimes();
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(quantity)) {
|
|
|
+ chengTaiCoverage.setQuantity(quantity);
|
|
|
+ } else if (StringUtils.isNotBlank(serviceTimes)) {
|
|
|
+ chengTaiCoverage.setQuantity(serviceTimes);
|
|
|
+ }
|
|
|
|
|
|
+ chengTaiCoverage.setBasePremium("0");
|
|
|
+ chengTaiCoverage.setCoveragePremium("0");
|
|
|
+ chengTaiCoverage.setCalculateFlag("1 ");
|
|
|
+ chengTaiCoverage.setDeductible("0");
|
|
|
+ chengTaiCoverage.setDeductibleRate("0");
|
|
|
+ chengTaiCoverage.setIfMainKind("1");
|
|
|
+ chengTaiCoverage.setKindCode(kindInfoVo.getKindCode());
|
|
|
+ chengTaiCoverage.setKindFlag(true);
|
|
|
+ chengTaiCoverage.setKindName(kindInfoVo.getKindName());
|
|
|
+ chengTaiCoverage.setNotDeductibleCalculateFlag("0");
|
|
|
+ chengTaiCoverage.setNotDeductibleIfMainKind("0");
|
|
|
+ chengTaiCoverage.setNotDeductibleKindFlag(false);
|
|
|
+ chengTaiCoverage.setRate("0");
|
|
|
+ chengTaiCoverage.setRelatedInd("1");
|
|
|
+ chengTaiCoverage.setCurrency("CNY");
|
|
|
+ chengTaiCoverage.setShortRate("100");
|
|
|
+ chengTaiCoverage.setShortRateType("2");
|
|
|
+ chengTaiCoverage.setShow(true);
|
|
|
+ chengTaiCoverage.setValidDate(biRiskInfoVo.getStartDate());
|
|
|
+ chengTaiCoverage.setExpiryDate(biRiskInfoVo.getEndDate());
|
|
|
+
|
|
|
+ chengTaiCoverageList.add(chengTaiCoverage);
|
|
|
+ }
|
|
|
|
|
|
ChengTaiContractMain contractMain = new ChengTaiContractMain();
|
|
|
contractMain.setCurrency("CNY");
|
|
|
- contractMain.setExpiryDate("2026-04-04 00:00:00");
|
|
|
+ contractMain.setValidDate(biRiskInfoVo.getStartDate());
|
|
|
+ contractMain.setExpiryDate(biRiskInfoVo.getEndDate());
|
|
|
contractMain.setRenewalFlag("0");
|
|
|
+ contractMain.setSignStatus("2");
|
|
|
contractMain.setRiskCode("0821");
|
|
|
- contractMain.setRiskName("");
|
|
|
- contractMain.setUnderWriteInd("z1");
|
|
|
- contractMain.setValidAtOnce("0");
|
|
|
- contractMain.setValidDate("2026-04-04 00:00:00");
|
|
|
+ contractMain.setRiskName("机动车商业保险(2020版)");
|
|
|
+ contractMain.setUnderWriteInd("z1"); // z1:暂存
|
|
|
+
|
|
|
+ if (biRiskInfoVo.isInstantFlag()) {
|
|
|
+ contractMain.setValidAtOnce("1");
|
|
|
+ } else {
|
|
|
+ contractMain.setValidAtOnce("0");
|
|
|
+ }
|
|
|
|
|
|
ChengTaiBiContract chengTaiBiContract = new ChengTaiBiContract();
|
|
|
chengTaiBiContract.setContractMain(contractMain);
|
|
|
-
|
|
|
-
|
|
|
+ chengTaiBiContract.setCoverage(chengTaiCoverageList);
|
|
|
|
|
|
|
|
|
return chengTaiBiContract;
|