Browse Source

升级 jackson 版本修复 ccnet 接口接受响应数据为 xml 问题,OMS 清关回调处理新增打印日志

lvjian 2 months ago
parent
commit
e06ef26ae0

+ 1 - 1
build.gradle

@@ -54,7 +54,7 @@ ext {
 
     logback_ext_spring = '0.1.4'
 
-    jackson = '2.9.4'
+    jackson = '2.15.2'
     google_guava = '23.3-jre'
     okhttp = '3.10.0'
 

+ 14 - 18
src/main/java/com/emato/ccnet/wx/biz/req/waybill/oms/Ceb511Response.java

@@ -1,22 +1,21 @@
 package com.emato.ccnet.wx.biz.req.waybill.oms;
 
-import com.emato.ccnet.wx.biz.CebCustomsResponse;
 import com.emato.ccnet.wx.contants.CcnetContants;
 import com.emato.ccnet.wx.contants.Contants;
 import com.emato.ccnet.wx.contants.SysContants;
 import com.emato.ccnet.wx.contants.WmContants;
-import com.emato.ccnet.wx.dao.entity.ccnet.*;
+import com.emato.ccnet.wx.dao.entity.ccnet.CusWaybill;
+import com.emato.ccnet.wx.dao.entity.ccnet.CusWaybillResp;
+import com.emato.ccnet.wx.dao.entity.ccnet.CusWaybillStatus;
+import com.emato.ccnet.wx.dao.entity.ccnet.WxOrder;
 import com.emato.ccnet.wx.dto.ccnetdto.CbecOrderMerchantNotiReturnOrder;
-import com.emato.ccnet.wx.dto.ccnetdto.PlayResponse;
 import com.emato.ccnet.wx.dto.ccnetdto.WayBillResponse;
 import com.emato.ccnet.wx.manager.result.Result;
 import com.emato.ccnet.wx.manager.snow.SnowflakeUtil;
 import com.emato.ccnet.wx.service.*;
 import com.emato.ccnet.wx.support.msg.resp.ResponseMessage;
-import com.emato.ccnet.wx.util.MapBeanUtil;
 import com.emato.ccnet.wx.util.jackson.JacksonUtil;
 import com.google.common.collect.ImmutableMap;
-import com.google.gson.Gson;
 import net.sf.json.JSONArray;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,20 +47,17 @@ public class Ceb511Response {
     public ResponseMessage biz(Result result) {
         //解析数据
         WayBillResponse wayBillResponse = analysisResponse(result);
+        if(wayBillResponse == null){
+            LOGGER.error("解析 OMS 响应数据失败");
+            return ResponseMessage.error("解析 OMS 响应数据失败");
+        }
 
         CbecOrderMerchantNotiReturnOrder cbecOrderMerchantNotiReturnOrder = new CbecOrderMerchantNotiReturnOrder();
         cbecOrderMerchantNotiReturnOrder.setNotiId(wayBillResponse.getNotiId());
         List<CbecOrderMerchantNotiReturnOrder> cbecOrderMerchantNotiReturnOrderList = new ArrayList<>();
         cbecOrderMerchantNotiReturnOrderList.add(cbecOrderMerchantNotiReturnOrder);
-        if(wayBillResponse == null){
-            LOGGER.info("解析响应数据失败");
-            return ResponseMessage.error("解析响应数据失败",cbecOrderMerchantNotiReturnOrderList);
-        }
 
         CusWaybillResp cusOrderResp = InitWxCuspayRespData(wayBillResponse);
-        if(cusOrderResp == null){
-            return ResponseMessage.error("初始化数据失败",cbecOrderMerchantNotiReturnOrderList);
-        }
         cusOrderResp.setBizInfoCode(result.getCode());
         cusOrderResp.setBizInfoDesc(result.getMsg());
 
@@ -73,7 +69,7 @@ public class Ceb511Response {
 
         CusWaybill cusWaybill = cusWaybillService.getCusWaybillByMerchOrderSn(wayBillResponse.getMerchOrderSn());
         if(cusWaybill == null){
-            String info = "查找运单数据失败";
+            String info = "查找运单数据失败, 订单号【" + wayBillResponse.getMerchOrderSn() + "】";
             LOGGER.error("--- {}", info);
             return ResponseMessage.error(info,cbecOrderMerchantNotiReturnOrderList);
         }
@@ -82,15 +78,14 @@ public class Ceb511Response {
         Map<String, Object> reqParam = ImmutableMap.of("cusWaybillSn", cusWaybill.getCusWaybillSn(),"sendStatus", Contants.DECLARATION_SUCCESS_STATUS);
         CusWaybillStatus cusWaybillStatus = cusWaybillStatusService.findCusWaybillStatus(reqParam);
         if(cusWaybillStatus == null){
-            String info = "查找运单状态表失败";
+            String info = "查找运单状态表失败,运单号【" + cusWaybill.getCusWaybillSn() + "】发送状态【" + Contants.DECLARATION_SUCCESS_STATUS + "】";
             LOGGER.error("--- {}", info);
             return ResponseMessage.error(info,cbecOrderMerchantNotiReturnOrderList);
         }
 
-
         WxOrder wxOrder = wxOrderService.getWxOrderByOrderSn(cusWaybill.getMerchOrderId());
         if(wxOrder == null){
-            String info = "查找运单数据失败";
+            String info = "查找微信订单数据失败, 订单号【" + cusWaybill.getMerchOrderId() + "】";
             LOGGER.error("--- {}", info);
             return ResponseMessage.error(info,cbecOrderMerchantNotiReturnOrderList);
         }
@@ -207,10 +202,11 @@ public class Ceb511Response {
         try {
             wayBillResponse =  JacksonUtil.fromStringJson(json.getString(0),WayBillResponse.class);
         } catch (Exception e) {
-            e.printStackTrace();
+            LOGGER.error("解析响应数据失败 => ", e);
+            return null;
         }
-        return wayBillResponse;
 
+        return wayBillResponse;
     }
 
     /**