wks %!s(int64=2) %!d(string=hai) anos
pai
achega
9c63421f8a

+ 33 - 7
src/main/java/com/ydtech/modules/ins/model/guoren/PremiumReq.java

@@ -68,7 +68,9 @@ public class PremiumReq {
     @JsonIgnore
     public static PremiumReq buildQuoteParam(BaseQuoteInfoVo yaQuoteInfoVo, CarPriceResp.DataDTO carPriceResult,
                                              VinQueryResp.DataDTO vinQ, boolean isNoCar,
-                                             List<GuoRenSpecialAgreementVo> specialAgreementVo) {
+                                             List<GuoRenSpecialAgreementVo> specialAgreementVo,
+                                             String noCarPremium,
+                                             String goodsCode) {
 
         CustomerInfoVo ownerInfo = yaQuoteInfoVo.getOwnerInfo();
 
@@ -82,13 +84,13 @@ public class PremiumReq {
             if (a.getRiskCode().equals(InsuranceRisk.TRAFFIC_CODE)) {
                 List<GuoRenSpecialAgreementVo> trafficSpecialAgreement =
                         specialAgreementVo.stream().filter(x -> InsuranceRisk.TRAFFIC_CODE.equals(x.getRiskCode())).collect(Collectors.toList());
-                CiDTO ciDto = buildCiDto(vehicleAndVesselTax, ownerInfo, a, isNoCar, trafficSpecialAgreement);
+                CiDTO ciDto = buildCiDto(vehicleAndVesselTax, ownerInfo, a, isNoCar, trafficSpecialAgreement, noCarPremium, goodsCode);
                 ciDto.setTrafficTime(a.getStartDate());
                 quoteReq.setCi(ciDto);
             } else if (a.getRiskCode().equals(InsuranceRisk.BUSINESS_CODE)) {
                 List<GuoRenSpecialAgreementVo> businessSpecialAgreement =
                         specialAgreementVo.stream().filter(x -> InsuranceRisk.BUSINESS_CODE.equals(x.getRiskCode())).collect(Collectors.toList());
-                BiDTO biDto = buildBiDto(ownerInfo, a, kindInfoVList, carPriceResult, vinQ, isNoCar, businessSpecialAgreement);
+                BiDTO biDto = buildBiDto(ownerInfo, a, kindInfoVList, carPriceResult, vinQ, isNoCar, businessSpecialAgreement, noCarPremium, goodsCode);
                 biDto.setBusinessTime(a.getStartDate());
                 quoteReq.setBi(biDto);
             }
@@ -96,12 +98,12 @@ public class PremiumReq {
 
         //未投保交强
         if (null == quoteReq.getCi()) {
-            CiDTO ciDto = buildCiDto(null, ownerInfo, null, false, new ArrayList<>());
+            CiDTO ciDto = buildCiDto(null, ownerInfo, null, false, new ArrayList<>(), "", "");
             quoteReq.setCi(ciDto);
         }
         //未投保商业
         if (null == quoteReq.getBi()) {
-            BiDTO biDto = buildBiDto(ownerInfo, null, null, null, vinQ, false, new ArrayList<>());
+            BiDTO biDto = buildBiDto(ownerInfo, null, null, null, vinQ, false, new ArrayList<>(), "", "");
             quoteReq.setBi(biDto);
         }
 
@@ -122,7 +124,8 @@ public class PremiumReq {
      */
     @JsonIgnore
     public static CiDTO buildCiDto(VehicleAndVesselTax vehicleAndVesselTax, CustomerInfoVo ownerInfo, RiskInfoVo ciRiskInfo,
-                                   boolean isNoCar, List<GuoRenSpecialAgreementVo> specialAgreementVo) {
+                                   boolean isNoCar, List<GuoRenSpecialAgreementVo> specialAgreementVo, String noCarPremium,
+                                   String goodsCode) {
         CiDTO ciDto = new CiDTO();
         ciDto.setPrpTrenewal(new ArrayList<>());
         ciDto.setPrpTmainRate(new CiDTO.PrpTmainRateDTO());
@@ -157,6 +160,9 @@ public class PremiumReq {
                 ciPrpTmain.setNoCarFlag("1");
                 //车+非车标识    车加非车必传:N
                 ciPrpTmain.setOrderFlag("N");
+
+                ciPrpTmain.setNoCarCodes(goodsCode);
+                ciPrpTmain.setNoCarPremium(noCarPremium);
             }
             prpTcarshipTax = new CiDTO.PrpTcarshipTaxDTO(vehicleAndVesselTax);
             /**
@@ -206,7 +212,8 @@ public class PremiumReq {
     @JsonIgnore
     public static BiDTO buildBiDto(CustomerInfoVo ownerInfo, RiskInfoVo biRiskInfo, List<KindInfoVo> kindInfoVList,
                                    CarPriceResp.DataDTO carPriceResult, VinQueryResp.DataDTO vinQ, boolean isNoCar,
-                                   List<GuoRenSpecialAgreementVo> specialAgreementVo) {
+                                   List<GuoRenSpecialAgreementVo> specialAgreementVo,String noCarPremium,
+                                   String goodsCode) {
 
         BiDTO biDto = new BiDTO();
         biDto.setPrpTmainRate(new BiDTO.PrpTmainRateDTO());
@@ -267,6 +274,9 @@ public class PremiumReq {
                 biPrpTmain.setNoCarFlag("1");
                 //车+非车标识    车加非车必传:N
                 biPrpTmain.setOrderFlag("N");
+
+                biPrpTmain.setNoCarCodes(goodsCode);
+                biPrpTmain.setNoCarPremium(noCarPremium);
             }
 
             List<BiDTO.PrptitemkindListDTO> prptitemkindList = buildBiKindList(kindInfoVList, carPriceResult, biRiskInfo, vinQ);
@@ -767,6 +777,14 @@ public class PremiumReq {
             @JSONField(name = "startDate")
             private String startDate;
 
+            @JsonProperty(value = "noCarCodes")
+            @JSONField(name = "noCarCodes")
+            private String noCarCodes;
+
+            @JsonProperty(value = "noCarPremium")
+            @JSONField(name = "noCarPremium")
+            private String noCarPremium;
+
         }
 
         @NoArgsConstructor
@@ -1231,6 +1249,14 @@ public class PremiumReq {
             @JSONField(name = "startDate")
             private String startDate;
 
+            @JsonProperty(value = "noCarCodes")
+            @JSONField(name = "noCarCodes")
+            private String noCarCodes;
+
+            @JsonProperty(value = "noCarPremium")
+            @JSONField(name = "noCarPremium")
+            private String noCarPremium;
+
         }
 
         @NoArgsConstructor

+ 6 - 0
src/main/java/com/ydtech/modules/order/entity/api/guoren/response/NonAutoInsOrderResponse.java

@@ -31,5 +31,11 @@ public class NonAutoInsOrderResponse  implements Serializable {
     public static class DataDTO {
         @JsonProperty("orderCode")
         private String orderCode;
+
+        /**
+         * 非车总保费
+         */
+        @JsonProperty("noCarPremium")
+        private String noCarPremium;
     }
 }

+ 14 - 5
src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java

@@ -201,10 +201,13 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         //  2、车价查询
         CarPriceResp.DataDTO carPriceResult = carPriceQuery(yaQuoteInfoVo, vinQ, channelInfo);
         AssertionUtils.isEmpty(carPriceResult, "车价获取失败");
+
         //  3、 创建非车订单
         boolean isNoCar = false;
         String jsPremium = "0";
         String orderCode = null;
+        String noCarPremium = "";
+        String goodsCode = "";
         GuorenAccidentalDrivingVo accidentalDrivingVo = quoteVo.getAccidentalDrivingVo();
         if (accidentalDrivingVo != null && GoodsClassifyList.verificationGoodsCode(accidentalDrivingVo.getGoodsCode())) {
             NonAutoInsOrderResponse nonAutoInsOrderResponse = nonAutoInsOrder(yaQuoteInfoVo, accidentalDrivingVo,
@@ -213,12 +216,14 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
             orderCode = nonAutoInsOrderResponse.getData().getOrderCode();
             isNoCar = true;
             jsPremium = accidentalDrivingVo.getPremium();
+            noCarPremium = nonAutoInsOrderResponse.getData().getNoCarPremium();
+            goodsCode = accidentalDrivingVo.getGoodsCode();
         }
         // 特别约定
         List<GuoRenSpecialAgreementVo> specialAgreementVo = quoteVo.getGuoRenSpecialAgreementVo();
         // 4、保费计算
         PremiumResp.DataDTO premiumResult = premiumQuery(yaQuoteInfoVo, carPriceResult, vinQ, isNoCar,
-                specialAgreementVo);
+                specialAgreementVo, noCarPremium, goodsCode);
         AssertionUtils.isEmpty(premiumResult, "保费计算失败");
 
         // 5、 生成订单
@@ -989,15 +994,19 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
     /**
      * 保费计算
      */
-    public PremiumResp.DataDTO premiumQuery(BaseQuoteInfoVo yaQuoteInfoVo, CarPriceResp.DataDTO carPriceResult,
-                                            VinQueryResp.DataDTO vinQ
-            , boolean isNoCar, List<GuoRenSpecialAgreementVo> specialAgreementVo) {
+    public PremiumResp.DataDTO premiumQuery(BaseQuoteInfoVo yaQuoteInfoVo,
+                                            CarPriceResp.DataDTO carPriceResult,
+                                            VinQueryResp.DataDTO vinQ,
+                                            boolean isNoCar,
+                                            List<GuoRenSpecialAgreementVo> specialAgreementVo,
+                                            String noCarPremium,
+                                            String goodsCode) {
 
         //请求信息列表
         List<String> requestInfoList = new ArrayList<>();
         boolean boo;
         //构造请求参数
-        PremiumReq req = PremiumReq.buildQuoteParam(yaQuoteInfoVo, carPriceResult, vinQ, isNoCar, specialAgreementVo);
+        PremiumReq req = PremiumReq.buildQuoteParam(yaQuoteInfoVo, carPriceResult, vinQ, isNoCar, specialAgreementVo, noCarPremium, goodsCode);
         PremiumResp resp;
 
         for (; ; ) {