Prechádzať zdrojové kódy

1、永诚API报价增加匹配车型。

ligang134 3 rokov pred
rodič
commit
e38855701b

+ 6 - 0
src/main/java/com/ydtech/modules/ins/model/yc/ruote/Ruote.java

@@ -171,6 +171,12 @@ public class Ruote {
         CustomerInfoVo ownerInfo = yaQuoteInfoVo.getOwnerInfo();
 
         CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
+
+
+
+
+
+
         /**
          * 基本信息 base
          */

+ 6 - 0
src/main/java/com/ydtech/modules/ins/service/InsAlltrustApiService.java

@@ -1,12 +1,14 @@
 package com.ydtech.modules.ins.service;
 
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.ins.model.ya.CarModelDTO;
 import com.ydtech.modules.ins.model.ya.CarModel_Req;
 import com.ydtech.modules.ins.model.yc.CallBackRequest;
 import com.ydtech.modules.ins.model.yc.pay.response.AccidentResponse;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.vo.*;
 
+import java.util.List;
 import java.util.Map;
 
 public interface InsAlltrustApiService {
@@ -18,6 +20,10 @@ public interface InsAlltrustApiService {
      * 1 车型查询接口
      */
     HttpResult modelsQueryApi(CarModel_Req carModelReq);
+    /**
+     * 车型查询接口
+     */
+    List<CarModelDTO> modelsQuery(CarModel_Req carModelReq);
 
     /**
      * 2 报价

+ 75 - 1
src/main/java/com/ydtech/modules/ins/service/impl/InsAlltrustApiServiceImpl.java

@@ -22,6 +22,7 @@ import com.ydtech.modules.esm.model.*;
 import com.ydtech.modules.esm.service.*;
 import com.ydtech.modules.ins.dao.InsAlltrustRegionMapper;
 import com.ydtech.modules.ins.model.InsApiLog;
+import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
@@ -211,6 +212,73 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
+    }
+
+    @Override
+    public List<CarModelDTO> modelsQuery(CarModel_Req carModelReq) {
+        // 获取协议配置信息
+        YcConfigureParameters ycConfigureParameters = gainYcConfigParams(carModelReq.getAgreementId());
+
+
+        ModelsQueryXml m = buildModelsQueryParam(carModelReq, ycConfigureParameters);
+        ObjectMapper xmlMapper = this.gainXmlMapper();
+
+        log.info("===永诚--车型查询接口请求开始===");
+        InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
+        String responseData = apiLog.getResponseData();
+        log.info("===永诚--车型查询接口请求结束===");
+        try {
+            String cleanStr = YcBuildData.cleanResponseStr(responseData);
+            ModelsQueryResponse rd = xmlMapper.readValue(cleanStr, ModelsQueryResponse.class);
+            return buildCarModel(rd);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+    public void gainVehicleModel(YcConfigureParameters ycConfigureParameters, CarInfoVo carInfo) {
+
+        CarModel_Req carModelReq = new CarModel_Req();
+        carModelReq.setFrameNo(carInfo.getFrameNo());
+        carModelReq.setEngineNo(carInfo.getEngineNo());
+        carModelReq.setEnrollDate(carInfo.getRegisterDate().replaceAll("-",""));
+
+        ModelsQueryXml m = buildModelsQueryParam(carModelReq, ycConfigureParameters);
+        ObjectMapper xmlMapper = this.gainXmlMapper();
+
+        log.info("===永诚--车型查询接口请求开始===");
+        InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
+        String responseData = apiLog.getResponseData();
+        log.info("===永诚--车型查询接口请求结束===");
+        try {
+            String cleanStr = YcBuildData.cleanResponseStr(responseData);
+            ModelsQueryResponse rd = xmlMapper.readValue(cleanStr, ModelsQueryResponse.class);
+            List<CarModelDTO> dtoList = buildCarModel(rd);
+
+            long count = dtoList.stream().filter(x -> x.getModelCode().equals(carInfo.getModelCode())).count();
+
+            if(count < 1 ){
+                //匹配车辆信息
+                dtoList.stream().forEach(a ->{
+                    //购置价匹配
+                    if(a.getReplacementValue().equals(carInfo.getPurchasePrice())){
+                        carInfo.setModelCode(a.getModelCode());
+                    }
+                });
+            }
+
+
+        } catch (IOException e) {
+            throw new SystemException("车型查询接口异常,请联系管理。");
+        }
+
+
+
+
+
+
+
     }
 
 
@@ -225,8 +293,14 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         YcConfigureParameters ycConfigureParameters = gainYcConfigParams(quoteVo.getAgreementId());
 
 
+
+
+
+
+
+
 //    public HttpResult quoteApi(BaseQuoteInfoVo yaQuoteInfoVo) {
-        BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo(), quoteVo.getAgreementId());
+        BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
         HttpResult httpResult = new HttpResult();
         ObjectMapper xmlMapper = this.gainXmlMapper();
 

+ 29 - 28
src/main/resources/application-test.yml

@@ -225,34 +225,35 @@ ya:
 yc:
   #api方式
   api:
-    #正式渠道信息(测试一下)
-    agent:
-      # 机构代码(dptCde)
-      dptCde: 14B8
-      # 渠道编码(agentCode)
-      agentCode: 14B800P00008
-      # 协议编码(conferCode)
-      conferCode: 14B800P0000801
-      # 渠道分类(agentType)
-      agentType: 191010
-      # 代理人名称(agentNme)
-      agentNme: 太原天勤保险代理有限公司
-      # 代理人资格证号(qlftNo)
-      qlftNo: 202930000000800
-      # 录入人(operatorCode)
-      operatorCode: 114000117
-      # 业务员代码(salesmanNo)
-      salesmanNo: 11401714B
-      # 新业务来源(CChaType)
-      CChaType: 191010
-      # 客户性质(custNature)
-      custNature: 192099
-      # 操作人员代码(cOprcde)
-      cOprcde: 114000117
-      # 业务来源(cBsnsTyp)
-      cBsnsTyp: 19002
-    userName: tianqin
-    password: tianqin2023@
+#    #正式渠道信息(测试一下)
+#    agent:
+#      # 机构代码(dptCde)
+#      dptCde: 14B8
+#      # 渠道编码(agentCode)
+#      agentCode: 14B800P00008
+#      # 协议编码(conferCode)
+#      conferCode: 14B800P0000801
+#      # 渠道分类(agentType)
+#      agentType: 191010
+#      # 代理人名称(agentNme)
+#      agentNme: 太原天勤保险代理有限公司
+#      # 代理人资格证号(qlftNo)
+#      qlftNo: 202930000000800
+#      # 录入人(operatorCode)
+#      operatorCode: 114000117
+#      # 业务员代码(salesmanNo)
+#      salesmanNo: 11401714B
+#      # 新业务来源(CChaType)
+#      CChaType: 191010
+#      # 客户性质(custNature)
+#      custNature: 192099
+#      # 操作人员代码(cOprcde)
+#      cOprcde: 114000117
+#      # 业务来源(cBsnsTyp)
+#      cBsnsTyp: 19002
+#    userName: tianqin
+#    password: tianqin2023@
+    #测试道信息
 #    agent:
 #      # 机构代码(dptCde)
 #      dptCde: 14A4