From aa33e56e37cd19b88ae8eea69c5ebc7c6da8b1d2 Mon Sep 17 00:00:00 2001
From: Administrator <pjb>
Date: 星期四, 05 六月 2025 17:59:47 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/glccwcs' into glccwcs

---
 src/main/java/com/zy/asrs/task/TaskReportScheduler.java      |   51 +++++++++++++++++++++++++
 src/main/webapp/views/taskWrk/taskWrk.html                   |    2 +
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java  |    9 ++++
 src/main/java/com/zy/asrs/service/impl/ToWmsServiceImpl.java |    1 
 src/main/java/com/zy/asrs/entity/wms/WmsFeedback.java        |    2 
 src/main/java/com/zy/core/thread/SiemensDevpThread.java      |    3 +
 6 files changed, 66 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/asrs/entity/wms/WmsFeedback.java b/src/main/java/com/zy/asrs/entity/wms/WmsFeedback.java
index bdaf83e..2c0e0c1 100644
--- a/src/main/java/com/zy/asrs/entity/wms/WmsFeedback.java
+++ b/src/main/java/com/zy/asrs/entity/wms/WmsFeedback.java
@@ -8,7 +8,7 @@
      * 鍒嗛厤鐨勮揣浣嶆墍灞炰换鍔D
      */
     private String taskNo;
-    /**
+    /** -1锛氬簱浣嶅垎閰嶅紓甯�
      * 2锛氭淳鍙�
      * 4锛氬彇娑�
      * 5锛氬畬缁�
diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index 72f2178..fd462e2 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -348,6 +348,15 @@
                     continue;
                 }
 
+                LocMast locMast = locMastService.selectByLocNo(taskWrk.getTargetPoint());
+                if(!locMast.getLocSts().equals("O") && taskWrk.getWrkSts() == 2) {
+                    log.error("鍏ュ簱WMS鍒嗛厤搴撲綅{}鏈夎锛屽簱浣嶇姸鎬佷负{}",locMast.getLocNo(),locMast.getLocSts());
+                    taskWrk.setWrkSts(5);
+                    taskWrk.setMemo("WMS鍒嗛厤搴撲綅鏈夎");
+                    taskWrkService.updateById(taskWrk);
+                    continue;
+                }
+
                 // 鍫嗗灈鏈烘帶鍒惰繃婊�
                 if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) {
                     continue;
diff --git a/src/main/java/com/zy/asrs/service/impl/ToWmsServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/ToWmsServiceImpl.java
index 03ffbb3..de2b4cd 100644
--- a/src/main/java/com/zy/asrs/service/impl/ToWmsServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/ToWmsServiceImpl.java
@@ -178,7 +178,6 @@
         taskWrk.setCrnNo(locMast.getCrnNo());
         taskWrk.setTargetPoint(locNo);
         taskWrk.setStartPoint(startPoint + "");
-        taskWrk.setCrnNo(locMast.getCrnNo());
         if (taskWrk.getIoType() == 1) {
             taskWrk.setWrkSts(2);
             if (!Cools.isEmpty(taskWrk.getTargetPoint())) {
diff --git a/src/main/java/com/zy/asrs/task/TaskReportScheduler.java b/src/main/java/com/zy/asrs/task/TaskReportScheduler.java
index e6f44f2..7cffabb 100644
--- a/src/main/java/com/zy/asrs/task/TaskReportScheduler.java
+++ b/src/main/java/com/zy/asrs/task/TaskReportScheduler.java
@@ -36,6 +36,7 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 瀹氭椂灏嗕换鍔�(瀹屾垚銆佸彇娑�)杞垚鏃ュ織
@@ -80,6 +81,56 @@
         add(301);add(302);add(303);add(304);add(305);add(306);add(307);add(308);
     }};
 
+    // WMS鍒嗛厤鍏ュ簱搴撲綅寮傚父涓婃姤
+    @Scheduled(cron = "0/5 * * * * ? ")
+    public synchronized void locationAssignmentExceptionEscalation() {
+        List<TaskWrk> taskWrkList = taskWrkMapper.selectList(new EntityWrapper<TaskWrk>().eq("wrk_sts", 5));
+
+        for(TaskWrk taskWrk : taskWrkList) {
+            Date now = new Date();
+            WmsFeedback wmsFeedback = new WmsFeedback();
+            wmsFeedback.setTaskNo(taskWrk.getTaskNo());
+            wmsFeedback.setIoType(taskWrk.getIoType());
+            wmsFeedback.setBarcode(taskWrk.getBarcode());
+            wmsFeedback.setStatus(-1); // 鍏ュ簱搴撲綅鍒嗛厤寮傚父
+            wmsFeedback.setReportTime(DateUtils.convert(now));
+
+            String response = "";
+            boolean bool = false;
+            try {
+                log.info("鍏ュ簱wms鍒嗛厤搴撲綅鏈夎涓婃姤wms={}", taskWrk);
+                response = new HttpHandler.Builder()
+                        // .setHeaders(headParam)
+                        .setUri(wmsUrl)
+                        .setPath(TaskExecCallback)
+                        .setJson(JSON.toJSONString(wmsFeedback))
+                        .build()
+                        .doPost();
+                if (!Cools.isEmpty(response)) {
+                    JSONObject jsonObject = JSON.parseObject(response);
+                    if (Integer.parseInt(String.valueOf(jsonObject.get("code"))) == 200) {
+                        bool = true;
+                        taskWrk.setWrkSts(6);
+                        taskWrk.setModiTime(now);
+                        taskWrkMapper.updateById(taskWrk);
+                    }
+                }
+
+            } catch (Exception e) {
+                log.error("鍏ュ簱wms鍒嗛厤搴撲綅鏈夎涓婃姤wms澶辫触{},杩斿洖鍊�={}", taskWrk, response);
+            } finally {
+                apiLogService.save("wms鍒嗛厤搴撲綅鏈夎涓婃姤"
+                        , wmsUrl + TaskExecCallback
+                        , null
+                        , "127.0.0.1"
+                        , JSON.toJSONString(wmsFeedback)
+                        , response
+                        , bool
+                );
+            }
+        }
+    }
+
     @Scheduled(cron = "0/5 * * * * ? ")
     public synchronized void execute() throws IOException {
         Page<TaskWrkReport> taskWrkReportPage = taskWrkReportService.selectPage(new Page<>(0, 100), new EntityWrapper<TaskWrkReport>().orderBy("create_time", true));
diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index fc659f1..066b51e 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -481,9 +481,12 @@
         String workNoAddress;
         // 鐩爣绔欏湴鍧�
         String staNoAddress;
+        // 楂樺害绫诲瀷鍦板潃
+        String heightAddress;
         if (index < 16) {
             workNoAddress = "DB100." + index * 4;
             staNoAddress = "DB100." + (index * 4 + 2);
+            heightAddress = "DB104." + (index * 4 + 2);
         } else {
             workNoAddress = "DB100." + (400 + (index-16) * 4);
             staNoAddress = "DB100." + (400 + (index-16) * 4 + 2);
diff --git a/src/main/webapp/views/taskWrk/taskWrk.html b/src/main/webapp/views/taskWrk/taskWrk.html
index 1fa0044..0fe0b23 100644
--- a/src/main/webapp/views/taskWrk/taskWrk.html
+++ b/src/main/webapp/views/taskWrk/taskWrk.html
@@ -86,6 +86,8 @@
 						</el-table-column>
 						<el-table-column property="ioPri" label="浼樺厛绾�">
 						</el-table-column>
+						<el-table-column property="memo" label="澶囨敞">
+						</el-table-column>
 					</el-table>
 
 					<div style="margin-top: 10px;">

--
Gitblit v1.9.1