فهرست منبع

添加泰康 添加 initQuotation 接口

wlq 1 سال پیش
والد
کامیت
8920a19bf3

+ 16 - 5
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/service/TaiKangHttpService.java

@@ -543,19 +543,30 @@ public class TaiKangHttpService {
      *
      * @return
      */
-    public AgentTaxResult initQuotation(String tplatformId, String orderId) {
-        AgentTaxParam param = new AgentTaxParam();
+    public InitQuotationResult initQuotation(String tplatformId, String orderId) {
+        InitQuotationParam param = new InitQuotationParam();
         param.setChannelCode("OffWeb");
         param.setOrderID(orderId);
-        param.setTplatformId(tplatformId);
+        param.setInitFlag("1");
 
         HttpHeaders httpHeaders = new HttpHeaders();
         httpHeaders.add("tkCarRequestToken", token());
 
-        AgentTaxResult.Response response = client.request(HttpURL.initQuotation, param, httpHeaders, AgentTaxResult.Response.class);
+        StringResponse response = client.request(HttpURL.initQuotation, param, httpHeaders, StringResponse.class);
 
         checkResponseUnknownField(response);
 
-        return response.getData();
+        // 解密
+        String json = AESDecryptor.decrypt(response.getData());
+
+        if (logger.isInfoEnabled()) {
+            logger.info("TaiKangHttpClient initQuotation decrypt body: {}", json);
+        }
+
+        InitQuotationResult.Response response1 = JsonUtil.readObjcet(json, InitQuotationResult.Response.class);
+
+        checkResponseUnknownField(response1);
+
+        return response1.getData();
     }
 }

+ 1 - 1
tenant/insurance/quotation-taikang/src/test/java/com/jzg/quotation/taikang/service/TaiKangHttpServiceTest1.java

@@ -946,7 +946,7 @@ public class TaiKangHttpServiceTest1 {
 
 
 
-        AgentTaxResult result = taiKangHttpService.initQuotation(tplatformId, "WBPC202503061106595800000");
+        InitQuotationResult result = taiKangHttpService.initQuotation(tplatformId, "WBPC202503071419220680000");
 
         assertNotNull(result);