From ddc462832f99c124fbcc9653a0878e18768224cd Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期三, 11 六月 2025 16:19:13 +0800
Subject: [PATCH] #修复bug,检索该排全部空库位进行判断

---
 src/main/java/com/zy/asrs/task/handler/MesPakinHandler.java |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/zy/asrs/task/handler/MesPakinHandler.java b/src/main/java/com/zy/asrs/task/handler/MesPakinHandler.java
index e8465b3..ba98510 100644
--- a/src/main/java/com/zy/asrs/task/handler/MesPakinHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/MesPakinHandler.java
@@ -1,6 +1,7 @@
 package com.zy.asrs.task.handler;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.core.common.Cools;
@@ -32,7 +33,7 @@
 @Slf4j
 @Service
 public class MesPakinHandler extends AbstractHandler<String> {
-    @Value("${mes.pakin.uri}")
+    @Value("${mes.pakin.url}")
     private String uri;
 
     @Value("${mes.pakin.path}")
@@ -60,6 +61,7 @@
         JSONObject jsonObject = null;
         try {
             jsonObject = doPostJsonData();
+            log.info("MesPakinHandler jsonObject:" + jsonObject);
         } catch (IOException e) {
             success = false;
             e.printStackTrace();
@@ -68,11 +70,17 @@
         int code = jsonObject.getInteger("code");
 
         if(code == 200){
-            JSONObject jsonData = jsonObject.getJSONObject("data");
-            String orderNo = jsonData.getString("orderNo");
-            Order o = insertOrder(jsonData,orderNo);
-            insertOrUpdateOrderDetl(jsonData, o);
+            if(!Cools.isEmpty(jsonObject.getString("data")) && jsonObject.getString("data").length()>2){
 
+                JSONArray jsonArray = jsonObject.getJSONArray("data");
+                List<JSONObject> jsonDataList = jsonArray.toJavaList(JSONObject.class);
+
+                jsonDataList.forEach(data -> {
+                    String orderNo = data.getString("orderNo");
+                    Order o = insertOrder(data,orderNo);
+                    insertOrUpdateOrderDetl(data, o);
+                });
+            }
         }else {
             success = false;
             log.error("璇锋眰mes鎺ュ彛鍝嶅簲閿欒锛屽搷搴旂爜涓�: " + code);

--
Gitblit v1.9.1