Просмотр исходного кода

1、永诚请求代码优化。
2、增加自述。

ligang134 2 лет назад
Родитель
Сommit
d047e28640

+ 22 - 4
README.md

@@ -301,14 +301,31 @@
 
 
 
+**《掌柜鼎PC平台》系统维护公告**
+
+* 版本号:v0.0.5.3
+* 访问地址:http://sxzgkj.baoxianzhanggui.com/
+* 需求bug收集表:https://kdocs.cn/l/cloAn4eaINVw
+* APP安卓APK包:http://sxzgkj.baoxianzhanggui.com/web-api/upload/app/2023/10/11/83c6c7bce9fefde9f0e5fb6fcecf0f44.apk
+* 更新日期:2023-10-17
+* 更新时间:10:40  ~  11:30
+* 更新内容:
+  1. 解决订单丢失问题。
+  2. 永诚优化请求代码。
+  3. 解决费用匹配和组件展示不全的问题。
+
+
+
+
 --------未发布
-**《掌柜鼎PC平台》临时更新公告**
+**《掌柜鼎PC平台》系统维护公告**
 
-* 版本号:v0.0.4.2
+* 版本号:v0.0.5.2
 * 访问地址:http://sxzgkj.baoxianzhanggui.com/
 * 需求bug收集表:https://kdocs.cn/l/cloAn4eaINVw
-* 更新日期:2023-00-00
-* 更新时间:00:00  ~  00:00
+* APP安卓APK包:http://sxzgkj.baoxianzhanggui.com/web-api/upload/app/2023/10/11/83c6c7bce9fefde9f0e5fb6fcecf0f44.apk
+* 更新日期:2023-10-16
+* 更新时间:08:30  ~  09:30
 * 更新内容:
   1. 
 
@@ -320,6 +337,7 @@
 
 
 
+
 ## 规则说明
 * 版本号:v0.0.1
 ```

+ 11 - 10
src/main/java/com/ydtech/modules/ins/service/impl/InsAlltrustApiServiceImpl.java

@@ -217,7 +217,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
         log.info("===永诚--车型查询接口请求开始--" + carInfo.getLicenseNo() + "===");
 //        InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
-        String responseData = httpPostResultLog(gainXmlMapper(), m, YcBuildData.API_MODEL, "永诚API方式 - 车型查询(vin:"+carInfo.getVinNo()+") - ");
+        String responseData = httpPostResultLog(m, YcBuildData.API_MODEL, "永诚API方式 - 车型查询(vin:"+carInfo.getVinNo()+") - ");
         AssertionUtils.isEmpty(responseData,"永诚 车型查询接口响应返回空!");
 //        String responseData = apiLog.getResponseData();
         log.info("===永诚--车型查询接口请求结束--" + carInfo.getLicenseNo() + "===");
@@ -610,7 +610,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 //            findRegion()
 
             //接口请求
-            String responseData = httpPostResultLog(gainXmlMapper(), m, YcBuildData.API_AUDIT, "永诚API方式 - 核保(车牌号:"+order.getLicenseno()+") - ");
+            String responseData = httpPostResultLog(m, YcBuildData.API_AUDIT, "永诚API方式 - 核保(车牌号:"+order.getLicenseno()+") - ");
+            AssertionUtils.isEmpty(responseData,"(日志号"+logNo+")核保请求超时请重试。");
 
             String cleanStr = YcBuildData.cleanResponseStr(responseData);
             AuditResponse rd = gainXmlMapper().readValue(cleanStr, AuditResponse.class);
@@ -697,7 +698,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             ObjectMapper xmlMapper = gainXmlMapper();
             //接口请求
 //            apiLog = httpPost(xmlMapper, iUp, YcBuildData.API_UPLOAD);
-            String responseData = httpPostResultLog(xmlMapper, iUp, YcBuildData.API_UPLOAD, "永诚API方式 - 影像上传 - ");
+            String responseData = httpPostResultLog(iUp, YcBuildData.API_UPLOAD, "永诚API方式 - 影像上传 - ");
             verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_2);
             try {
 //                String responseData = apiLog.getResponseData();
@@ -732,7 +733,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             ObjectMapper xmlMapper = gainXmlMapper();
             //接口请求
             log.debug("=========永诚API方式 - xml请求 - 获取缴费链接开始======");
-            String responseData = httpPostResultLog(xmlMapper, pay, YcBuildData.API_PAY, "永诚API方式 - 获取缴费链接 - ");
+            String responseData = httpPostResultLog( pay, YcBuildData.API_PAY, "永诚API方式 - 获取缴费链接 - ");
 //            InsApiLog apiLog = httpPost(xmlMapper, pay, YcBuildData.API_PAY);
             log.debug("=========永诚API方式 - xml请求 - 获取缴费链接结束!======");
 //            verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_3);
@@ -784,7 +785,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             ObjectMapper xmlMapper = gainXmlMapper();
             //接口请求
 //            InsApiLog apiLog = httpPostResultLog(xmlMapper, o, YcBuildData.API_ORDER_QUERY);
-            String respData = httpPostResultLog(xmlMapper, o, YcBuildData.API_ORDER_QUERY, "永诚API方式 - 补传回调 - ");
+            String respData = httpPostResultLog( o, YcBuildData.API_ORDER_QUERY, "永诚API方式 - 补传回调 - ");
 
 
             String cleanStr = YcBuildData.cleanResponseStr(respData);
@@ -936,7 +937,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
 
             //接口请求
-            String responseData = httpPostResultLog(xmlMapper, p, YcBuildData.API_GUARANTEE_SLIP, "车牌号:" + order.getLicenseno() + ",永诚API方式 - 获取保单 - ");
+            String responseData = httpPostResultLog( p, YcBuildData.API_GUARANTEE_SLIP, "车牌号:" + order.getLicenseno() + ",永诚API方式 - 获取保单 - ");
 
             String cleanStr = YcBuildData.cleanResponseStr(responseData);
             PolicyResponse pResp = xmlMapper.readValue(cleanStr, PolicyResponse.class);
@@ -1002,7 +1003,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             ObjectMapper xmlMapper = gainXmlMapper();
             //接口请求
             log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
-            String responseData = httpPostResultLog(xmlMapper, accident, YcBuildData.API_ACCIDENT, "永诚API方式 - 获取意健险方案及险种 - ");
+            String responseData = httpPostResultLog( accident, YcBuildData.API_ACCIDENT, "永诚API方式 - 获取意健险方案及险种 - ");
 //            InsApiLog apiLog = httpPost(xmlMapper, accident, YcBuildData.API_ACCIDENT);
             log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
 //            verifyRequest(apiLog, iac,InsQuoteFlow.);
@@ -1153,7 +1154,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         ObjectMapper xmlMapper = gainXmlMapper();
         //接口请求
         log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
-        String responseData = httpPostResultLog(xmlMapper, accident, YcBuildData.API_ACCIDENT, "永诚API方式 - 获取意健险方案及险种 - ");
+        String responseData = httpPostResultLog( accident, YcBuildData.API_ACCIDENT, "永诚API方式 - 获取意健险方案及险种 - ");
 //        InsApiLog apiLog = httpPost(xmlMapper, accident, YcBuildData.API_ACCIDENT);
         log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
 //            verifyRequest(apiLog, iac,InsQuoteFlow.);
@@ -1327,7 +1328,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
      * @author: lig
      * @date: 2023年09月02日 0002
      */
-    private <T> String httpPostResultLog(ObjectMapper mapper, T requestData, String apiName, String textHead) {
+    private <T> String httpPostResultLog(T requestData, String apiName, String textHead) {
 
         String xmlString = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tns=\"http://newWS.front.app.echannel.ebiz.alltrust.com/\">";
         xmlString += "<soapenv:Body>";
@@ -2181,7 +2182,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
      * @date: 2023年05月18日 0018
      */
     private <T> T requestApi(Object m, T response, InsAreaCompany iac, String reqUrl, InsQuoteFlow iqf, String textHead) {
-        String responseData = httpPostResultLog(gainXmlMapper(), m, reqUrl, textHead);
+        String responseData = httpPostResultLog(m, reqUrl, textHead);
         if (responseData.contains("报价返回信息异常")) {
             throw new SystemException("永诚报价请求负荷,请稍后重试。");
         }

+ 2 - 2
src/main/java/com/ydtech/utils/HttpXmlUtil.java

@@ -189,6 +189,7 @@ public class HttpXmlUtil {
                     .post(body)
                     .addHeader("Content-Type", "text/xml")
                     .addHeader("cache-control", "no-cache")
+                    .addHeader("Connection", "close")
                     .build();
 
             call = client.newCall(request);
@@ -202,8 +203,7 @@ public class HttpXmlUtil {
             log.error(textHead + "请求异常:" + e.getMessage() + ",原始返回:" + response);
             throw new SystemException("远程接口请求失败,请联系管理员。");
         } finally {
-            if (null != log)
-                textHead = StringUtils.toString(textHead, "123456789");
+            if (null != log) textHead = StringUtils.toString(textHead, "123456789");
             url = StringUtils.toString(url, "");
             String responseStringMsg = StringUtils.isNotEmpty(responseString) ? responseString.replaceAll("\n", "").replaceAll("&lt;", "<").replaceAll("&gt;", ">") : "";
             log.debug(textHead + "XML返回url:{},\n响应参数:{}", url, responseStringMsg);