From eaa43b12bfe9185b4f0b8f09d9ca081895a4d185 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期四, 12 三月 2026 21:27:44 +0800
Subject: [PATCH] 1.任务下发失败提醒 2.针对订单出库循环堵塞问题优化

---
 src/main/java/com/zy/api/service/impl/WcsApiServiceImpl.java |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/zy/api/service/impl/WcsApiServiceImpl.java b/src/main/java/com/zy/api/service/impl/WcsApiServiceImpl.java
index 37283b4..07d0aec 100644
--- a/src/main/java/com/zy/api/service/impl/WcsApiServiceImpl.java
+++ b/src/main/java/com/zy/api/service/impl/WcsApiServiceImpl.java
@@ -153,7 +153,7 @@
         }else if (!Objects.isNull(params.getType()) && params.getType().equals("move")) {
             url = createLocMoveTask;
         }
-        String response;
+        String response = null;
         R r = R.ok();
         try {
             log.info("涓嬪彂鎼繍浠诲姟缁檞cs="+JSON.toJSONString(params));
@@ -233,15 +233,21 @@
                 }
                 //TODO 涓婃姤鏄惁鎴愬姛
             }else {
-                r =R.error();
+                String msg = jsonObject.getString("msg");
+                if (Cools.isEmpty(msg)) {
+                    msg = jsonObject.getString("message");
+                }
+                r = R.error(Cools.isEmpty(msg) ? "涓嬪彂浠诲姟澶辫触" : msg);
             }
         } catch (IOException e) {
-            throw new RuntimeException(e);
+            log.error("涓嬪彂浠诲姟缁檞cs寮傚父, request={}", JSON.toJSONString(params), e);
+            return R.error("璋冪敤WCS鎺ュ彛澶辫触锛�" + e.getMessage());
+        } catch (Exception e) {
+            log.error("瑙f瀽WCS涓嬪彂缁撴灉寮傚父, request={}, response={}", JSON.toJSONString(params), response, e);
+            return R.error("WCS杩斿洖缁撴灉寮傚父锛�" + e.getMessage());
         }
         return r;
     }
-
-
     /**
      * 涓婃姤閿佸畾/閲婃斁搴撲綅淇℃伅
      *
@@ -258,7 +264,7 @@
                 url = MesConstant.RELEASE_LOCS_URL;
             }
         }
-        String response;
+        String response = null;
         try {
             response = new HttpHandler.Builder()
                     .setUri(MesConstant.URL)
@@ -520,3 +526,5 @@
         return locAround;
     }
 }
+
+

--
Gitblit v1.9.1