Explorar o código

Merge branch 'master' into test

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

+ 21 - 3
src/main/java/com/ydtech/modules/ins/model/guoren/InsuranceSlipReq.java

@@ -4,11 +4,14 @@ import com.alibaba.fastjson.annotation.JSONField;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
+import com.ydtech.modules.order.entity.api.guoren.constants.GuoRenRiskCode;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.guoren.GuoRenSpecialAgreementVo;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 投保单保存 入参
@@ -30,6 +33,7 @@ public class InsuranceSlipReq {
     @JsonProperty(value = "biPrptenages")
     @JSONField(name = "biPrptenages")
     private List<PremiumResp.DataDTO.BiPrptenagesDTO> biPrptenages;
+
     @JsonProperty(value = "ciPrptenages")
     @JSONField(name = "ciPrptenages")
     private List<PremiumResp.DataDTO.CiPrptenagesDTO> ciPrptenages;
@@ -41,7 +45,10 @@ public class InsuranceSlipReq {
      * 构造请求参数
      */
     @JsonIgnore
-    public static InsuranceSlipReq buildParam(BaseQuoteInfoVo yaQuoteInfoVo, String carPriceNum, String orderCode, PremiumResp.DataDTO premiumResult) {
+    public static InsuranceSlipReq buildParam(BaseQuoteInfoVo yaQuoteInfoVo,
+                                              String carPriceNum,
+                                              String orderCode,
+                                              List<GuoRenSpecialAgreementVo> specialAgreementVo) {
         //投保人
         CustomerInfoVo policyHolderInfo = yaQuoteInfoVo.getPolicyHolderInfo();
         //被保人
@@ -86,8 +93,19 @@ public class InsuranceSlipReq {
 
         req.setOrder(orderCode);
         req.setPrpTinsured(prpTinsured);
-        req.setBiPrptenages(premiumResult.getBiPrptenages());
-        req.setCiPrptenages(premiumResult.getCiPrptenages());
+
+        List<PremiumResp.DataDTO.CiPrptenagesDTO> ciPrptenages = specialAgreementVo.stream()
+                .filter(x -> GuoRenRiskCode.R_0507.getCode().equals(x.getRiskCode()))
+                .map(PremiumResp.DataDTO.CiPrptenagesDTO::new)
+                .collect(Collectors.toList());
+
+        List<PremiumResp.DataDTO.BiPrptenagesDTO> biPrptenages = specialAgreementVo.stream()
+                .filter(x -> GuoRenRiskCode.R_0518.getCode().equals(x.getRiskCode()))
+                .map(PremiumResp.DataDTO.BiPrptenagesDTO::new)
+                .collect(Collectors.toList());
+
+        req.setBiPrptenages(biPrptenages);
+        req.setCiPrptenages(ciPrptenages);
         return req;
 
     }

+ 17 - 0
src/main/java/com/ydtech/modules/ins/model/guoren/PremiumResp.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.ins.model.guoren;
 
 import com.alibaba.fastjson.annotation.JSONField;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.vo.guoren.GuoRenSpecialAgreementVo;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import net.minidev.json.annotate.JsonIgnore;
@@ -824,6 +825,15 @@ public class PremiumResp {
             @JsonProperty(value = "flag")
             @JSONField(name = "flag")
             private String flag;
+
+
+            public BiPrptenagesDTO(GuoRenSpecialAgreementVo guoRenSpecialAgreementVo) {
+                this.riskCode = guoRenSpecialAgreementVo.getRiskCode();
+                this.clauseCode = guoRenSpecialAgreementVo.getClauseCode();
+                this.clauses = guoRenSpecialAgreementVo.getClauses();
+                this.clausesContext = guoRenSpecialAgreementVo.getClausesContext();
+            }
+
         }
 
         @NoArgsConstructor
@@ -859,6 +869,13 @@ public class PremiumResp {
             @JsonProperty(value = "flag")
             @JSONField(name = "flag")
             private String flag;
+
+            public CiPrptenagesDTO(GuoRenSpecialAgreementVo guoRenSpecialAgreementVo) {
+                this.riskCode = guoRenSpecialAgreementVo.getRiskCode();
+                this.clauseCode = guoRenSpecialAgreementVo.getClauseCode();
+                this.clauses = guoRenSpecialAgreementVo.getClauses();
+                this.clausesContext = guoRenSpecialAgreementVo.getClausesContext();
+            }
         }
     }
 }

+ 3 - 2
src/main/java/com/ydtech/modules/order/components/gouren/GuorenRequestApiComponent.java

@@ -20,6 +20,7 @@ import com.ydtech.modules.order.entity.api.guoren.response.QueryNoCarPolicyNoRes
 import com.ydtech.modules.order.entity.api.guoren.response.SignatureResponse;
 import com.ydtech.modules.order.entity.dto.DrivingInsuranceDto;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.guoren.GuoRenSpecialAgreementVo;
 import com.ydtech.modules.order.utils.InsuranceLog;
 import com.ydtech.utils.StringUtils;
 import lombok.extern.slf4j.Slf4j;
@@ -99,9 +100,9 @@ public class GuorenRequestApiComponent {
     /**
      * 投保单保存
      */
-    public InsuranceSlipResp insuranceSlip(BaseQuoteInfoVo yaQuoteInfoVo, String carPriceNum, String orderCode, PremiumResp.DataDTO premiumResult) {
+    public InsuranceSlipResp insuranceSlip(BaseQuoteInfoVo yaQuoteInfoVo, String carPriceNum, String orderCode,  List<GuoRenSpecialAgreementVo> specialAgreementVo) {
         //构造请求参数
-        InsuranceSlipReq req = InsuranceSlipReq.buildParam(yaQuoteInfoVo, carPriceNum, orderCode, premiumResult);
+        InsuranceSlipReq req = InsuranceSlipReq.buildParam(yaQuoteInfoVo, carPriceNum, orderCode, specialAgreementVo);
         return request(req, PlatformInterfaceCode.API_IIRBT00006, InsuranceSlipResp.class);
     }
 

+ 1 - 3
src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java

@@ -215,13 +215,11 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         }
         // 特别约定
         List<GuoRenSpecialAgreementVo> specialAgreementVo = quoteVo.getGuoRenSpecialAgreementVo();
-
         // 4、保费计算
         PremiumResp.DataDTO premiumResult = premiumQuery(yaQuoteInfoVo, carPriceResult, vinQ, isNoCar,
                 specialAgreementVo);
         AssertionUtils.isEmpty(premiumResult, "保费计算失败");
 
-
         // 5、 生成订单
         QuoteRespVo quoteRespVo = buildQuoteRespVo(order, premiumResult, yaQuoteInfoVo, jsPremium);
         // 账号信息
@@ -231,7 +229,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         InsAreaCompany iac = responseOrder(order, quoteRespVo, quoteVo, ptlAgreementAttribution);
         //  6、 投保单保存
         InsuranceSlipResp insuranceSlip = guorenRequestApiComponent.insuranceSlip(yaQuoteInfoVo,
-                carPriceResult.getInputvo(), orderCode, premiumResult);
+                carPriceResult.getInputvo(), orderCode, specialAgreementVo);
         if (insuranceSlip.getResultCode() == 1) {
             return HttpResult.error(insuranceSlip.getResultMsg());
         }

+ 1 - 1
src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java

@@ -1006,7 +1006,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         redisKey.append(YC_AGREEMENT_INFO_KEY);
         redisKey.append(accidentalDrivingVo.getCompanyCode());
         redisKey.append(accidentalDrivingVo.getSeatNum());
-        redisKey.append(accidentalDrivingVo.getCompanyCode());
+        redisKey.append(accidentalDrivingVo.getCode());
 
         //查询redis
         if (!Objects.isNull(redisTemplate.opsForValue().get(redisKey.toString()))) {