Jelajahi Sumber

泰康:解决泰乐途驾意险报错问题

wangrq 2 bulan lalu
induk
melakukan
01a57259d3

+ 6 - 1
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/build/TkCrawlerQuoteResultsBuild.java

@@ -24,6 +24,7 @@ import com.jzg.quotation.taikang.crawler.model.entity.TKPremium;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -127,7 +128,11 @@ public class TkCrawlerQuoteResultsBuild {
         BigDecimal bi = premium.getSyPremium() == null ? BigDecimal.ZERO : premium.getSyPremium();
         BigDecimal jyx = premium.getJyxPremium() == null ? BigDecimal.ZERO : premium.getJyxPremium();
         BigDecimal vv = preciseInitResult.getCarTax().getSumPayment() == null ? BigDecimal.ZERO : preciseInitResult.getCarTax().getSumPayment();
-        BigDecimal total = ci.add(bi).add(jyx).add(vv);
+        BigDecimal tlt = new BigDecimal(0);
+        if (CollectionUtils.isNotEmpty(preciseInitResult.getNonCarProductList())) {
+            tlt = preciseInitResult.getNonCarProductList().get(0).getPremium() == null ? BigDecimal.ZERO : new BigDecimal(preciseInitResult.getNonCarProductList().get(0).getPremium());
+        }
+        BigDecimal total = ci.add(bi).add(jyx).add(vv).add(tlt);
         quoteResultsVo.getCosts().setSumPremium(total.toPlainString());
         // 折扣
         quoteResultsVo.getScoreVo().setJqAdjustRate(preciseInitResult.getCiDisCount() != null ? preciseInitResult.getCiDisCount().toString() : null);

+ 45 - 6
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/TKSimpleService.java

@@ -1027,11 +1027,20 @@ public class TKSimpleService {
                     continue;
                 }
                 TKCarPlanInfo tkCarPlanInfo = carPlanInfoMap.get(accidentalDriving.getProductCode());
-                driverAccidentVo.setIsSelect("1");
-                driverAccidentVo.setQuantity(accidentalDriving.getQuantity());
-                driverAccidentVo.setSelectPlanCode(tkCarPlanInfo.getPlanCode());
-                driverAccidentVo.setQuoteAmountCN(tkCarPlanInfo.getPlanName());
-                driverAccidentVo.setPremium(new BigDecimal(tkCarPlanInfo.getSumPremium()));
+                if (tkCarPlanInfo != null) {
+                    driverAccidentVo.setIsSelect("1");
+                    driverAccidentVo.setQuantity(accidentalDriving.getQuantity());
+                    driverAccidentVo.setSelectPlanCode(tkCarPlanInfo.getPlanCode());
+                    driverAccidentVo.setQuoteAmountCN(tkCarPlanInfo.getPlanName());
+                    driverAccidentVo.setPremium(new BigDecimal(tkCarPlanInfo.getSumPremium()));
+                } else {
+                    driverAccidentVo.setIsSelect("0");
+                    driverAccidentVo.setQuantity(0);
+                    driverAccidentVo.setQuantityCname("不投保");
+                    driverAccidentVo.setPremium(BigDecimal.ZERO);
+                    driverAccidentVo.setNonCarStartDate(null);
+                    driverAccidentVo.setNonCarEndDate(null);
+                }
             }
         } else {
             driverAccidentVo.setIsSelect("0");
@@ -1042,9 +1051,39 @@ public class TKSimpleService {
             driverAccidentVo.setNonCarEndDate(null);
         }
 
-        // 泰乐途, 默认不投保
+        // 泰康系统默认的泰乐途
+        Map<String, PreciseInitResult.ProductInfoListDTO> productInfoListMap = new HashMap<>();
         List<PreciseInitResult.NonCarProductListDTO> nonCarProductList = preciseInitParam.getNonCarProductList();
         if (CollectionUtils.isNotEmpty(nonCarProductList)) {
+            for (PreciseInitResult.NonCarProductListDTO nonCarProductListDTO : nonCarProductList) {
+                for (PreciseInitResult.ProductInfoListDTO productInfoListDTO : nonCarProductListDTO.getProductInfoList()) {
+                    productInfoListMap.put(productInfoListDTO.getProductCode(), productInfoListDTO);
+                }
+            }
+        }
+        // 泰乐途
+        if (CollectionUtils.isNotEmpty(accidentalDrivings)) {
+            for (AccidentalDrivingVo accidentalDriving : accidentalDrivings) {
+                if (productInfoListMap.isEmpty() || accidentalDriving.getProductCode() == null) {
+                    continue;
+                }
+                PreciseInitResult.ProductInfoListDTO productInfoListDTO = productInfoListMap.get(accidentalDriving.getProductCode());
+                PreciseInitResult.NonCarProductListDTO nonCarProductListDTO = nonCarProductList.get(0);
+                if (productInfoListDTO != null) {
+                    nonCarProductListDTO.setIsSelect("1");
+                    nonCarProductListDTO.setPremium(productInfoListDTO.getPremium());
+                    nonCarProductListDTO.setSelectProductCode(accidentalDriving.getProductCode());
+                    nonCarProductListDTO.setSelectProductName(productInfoListDTO.getProductName());
+                    nonCarProductListDTO.setStartDate(commonCiRiskInfoVo != null ? commonCiRiskInfoVo.getStartDate() : null);
+                    nonCarProductListDTO.setEndDate(commonCiRiskInfoVo != null ? commonCiRiskInfoVo.getEndDate() : null);
+                } else {
+                    nonCarProductListDTO.setIsSelect("0");
+                    nonCarProductListDTO.setPremium("0");
+                    nonCarProductListDTO.setStartDate(null);
+                    nonCarProductListDTO.setEndDate(null);
+                }
+            }
+        } else {
             nonCarProductList.forEach(nonCarProductListDTO -> {
                 nonCarProductListDTO.setIsSelect("0");
                 nonCarProductListDTO.setPremium("0");

File diff ditekan karena terlalu besar
+ 0 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/impl/TKQuotationBaseServiceImpl.java


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini