Browse Source

Merge remote-tracking branch 'origin/master'

wanghao 1 month ago
parent
commit
ac3884941c

+ 2 - 2
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/entity/dto/GuoRenBiDTO.java

@@ -127,7 +127,7 @@ public class GuoRenBiDTO {
             prpTmain.setEndDate(TimeUtils.extractDate(biRiskInfoVo.getEndDate()));
             prpTmain.setEndHour(24);
             prpTmain.setEndMinute(0);
-            this.prptitemkindList = GuoRenCrawlerCalculationPremiumRequest.PrptitemkindListDTO.getBiPrptitemkindList(kindInfoVo, prpTmain);
+            this.prptitemkindList = GuoRenCrawlerCalculationPremiumRequest.PrptitemkindListDTO.getBiPrptitemkindList(kindInfoVo, prpTmain, prpTitemCar.getNewEnergyFlag());
 
         }
         this.prpTitemCar = prpTitemCar;
@@ -160,7 +160,7 @@ public class GuoRenBiDTO {
         this.inputRisk0530 = 0;
         this.shortRate = 100;
         this.calculateFlagBI = "1";
-        this.termsSystem = "04";
+        this.termsSystem = "1".equals(prpTitemCar.getNewEnergyFlag()) ? "05" : "04";
     }
 
     @NoArgsConstructor

+ 17 - 8
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/entity/request/GuoRenCrawlerCalculationPremiumRequest.java

@@ -2,7 +2,8 @@ package com.jzg.quotation.guoren.crawler.entity.request;
 
 import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.jzg.commons.entity.quote.vo.*;
+import com.jzg.commons.entity.quote.vo.KindInfoVo;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.StringUtils;
 import com.jzg.quotation.commons.utils.TimeProcessing;
@@ -14,7 +15,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 import org.springframework.util.ObjectUtils;
 
-import java.util.*;
+import java.util.List;
 
 /**
  * @author wks
@@ -265,14 +266,22 @@ public class GuoRenCrawlerCalculationPremiumRequest {
         private Integer shareSumLimitSign;
 
 
-        public PrptitemkindListDTO(KindInfoVo kindInfoVo, GuoRenPrpTmainDTO prpTmain) {
-            InsuranceItem insuranceItem = InsuranceMap.INSURANCE_MAP.get(kindInfoVo.getKindCode());
+        public PrptitemkindListDTO(KindInfoVo kindInfoVo, GuoRenPrpTmainDTO prpTmain, String newEnergyFlag) {
+            String kindCode = kindInfoVo.getKindCode();
+            // 新能源汽车:普通条款险种(20X)切换为新能源条款险种(21X)
+            if ("1".equals(newEnergyFlag) && kindCode.startsWith("20")) {
+                String newEnergyCode = "21" + kindCode.substring(2);
+                if (InsuranceMap.INSURANCE_MAP.containsKey(newEnergyCode)) {
+                    kindCode = newEnergyCode;
+                }
+            }
+            InsuranceItem insuranceItem = InsuranceMap.INSURANCE_MAP.get(kindCode);
             if (ObjectUtils.isEmpty(insuranceItem)) {
                 throw new SystemException("未知险种");
             }
             this.checked = 1;
-            this.kindCode = kindInfoVo.getKindCode();
-            this.kindName = kindInfoVo.getKindName();
+            this.kindCode = kindCode;
+            this.kindName = kindCode.equals(kindInfoVo.getKindCode()) ? kindInfoVo.getKindName() : insuranceItem.getName();
             this.itemKindNo = Integer.parseInt(insuranceItem.getItemKindNo());
             this.shortRateFlag = "2";
             this.shortRate = "100.0000";
@@ -359,8 +368,8 @@ public class GuoRenCrawlerCalculationPremiumRequest {
             return List.of(prptitemkindListDTO);
         }
 
-        public static List<PrptitemkindListDTO> getBiPrptitemkindList(List<KindInfoVo> kindInfoVo, GuoRenPrpTmainDTO prpTmain) {
-            return kindInfoVo.stream().map(x -> new PrptitemkindListDTO(x, prpTmain)).toList();
+        public static List<PrptitemkindListDTO> getBiPrptitemkindList(List<KindInfoVo> kindInfoVo, GuoRenPrpTmainDTO prpTmain, String newEnergyFlag) {
+            return kindInfoVo.stream().map(x -> new PrptitemkindListDTO(x, prpTmain, newEnergyFlag)).toList();
         }