From 855ae16895a43bf56ecb22436204c18fbe466980 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期五, 18 四月 2025 16:27:49 +0800
Subject: [PATCH] 999

---
 src/main/java/com/zy/asrs/utils/NotifyUtils.java |   46 ++++++++++++++++++----------------------------
 1 files changed, 18 insertions(+), 28 deletions(-)

diff --git a/src/main/java/com/zy/asrs/utils/NotifyUtils.java b/src/main/java/com/zy/asrs/utils/NotifyUtils.java
index 18dc8ab..ba4e618 100644
--- a/src/main/java/com/zy/asrs/utils/NotifyUtils.java
+++ b/src/main/java/com/zy/asrs/utils/NotifyUtils.java
@@ -27,16 +27,16 @@
     @Autowired
     private ConfigService configService;
 
-    public synchronized boolean notify(String notifyType, Integer device, String taskNo, NotifyMsgType msgType) {
-        return append(notifyType, device, taskNo, msgType, null);
+    public synchronized boolean notify(String notifyType, Integer device, String taskNo, String superTaskNo, NotifyMsgType msgType) {
+        return append(notifyType, device, taskNo, superTaskNo, msgType, null);
     }
 
-    public synchronized boolean notify(String notifyType, Integer device, String taskNo, NotifyMsgType msgType, String data) {
-        return append(notifyType, device, taskNo, msgType, data);
+    public synchronized boolean notify(String notifyType, Integer device, String taskNo, String superTaskNo, NotifyMsgType msgType, String data) {
+        return append(notifyType, device, taskNo, superTaskNo, msgType, data);
     }
 
-    public synchronized List<String> takeKeys(String deviceType, Integer device) {
-        String key = getKey(deviceType, device);
+    public synchronized List<String> takeKeys(String notifyType, Integer device) {
+        String key = getKey(notifyType, device);
         if(key == null){
             return null;
         }
@@ -53,35 +53,24 @@
         return list;
     }
 
-    public String getKey(String deviceType, Integer device) {
-        SlaveType type = SlaveType.findInstance(deviceType);
-        if (type == null) {
-            return null;
-        }
-        String key = null;
-        switch (type) {
-            case Shuttle:
-                key = RedisKeyType.QUEUE_SHUTTLE.key + device;
-                break;
-            case ForkLift:
-                key = RedisKeyType.QUEUE_FORK_LIFT.key + device;
-                break;
-            default:
-                return null;
-        }
-
-        return key;
-    }
-
-    private boolean append(String notifyType, Integer device, String taskNo, NotifyMsgType msgType, String data) {
+    public String getKey(String notifyType, Integer device) {
         String key = null;
         if (notifyType.equals(String.valueOf(SlaveType.Shuttle))) {
             key = RedisKeyType.QUEUE_SHUTTLE.key + device;
         } else if (notifyType.equals(String.valueOf(SlaveType.ForkLift))) {
             key = RedisKeyType.QUEUE_FORK_LIFT.key + device;
         } else if (notifyType.equals("task")) {
-            key = RedisKeyType.QUEUE_FORK_LIFT.key + device;
+            key = RedisKeyType.QUEUE_TASK.key + device;
         } else {
+            return null;
+        }
+
+        return key;
+    }
+
+    private boolean append(String notifyType, Integer device, String taskNo, String superTaskNo, NotifyMsgType msgType, String data) {
+        String key = getKey(notifyType, device);
+        if (key == null) {
             return false;
         }
 
@@ -93,6 +82,7 @@
         dto.setMsgDesc(msgType.desc);
         dto.setData(data);
         dto.setTaskNo(taskNo);
+        dto.setSuperTaskNo(superTaskNo);
 
         //閲嶈瘯娆℃暟
         Config notifyFailTimesConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyFailTimes"));

--
Gitblit v1.9.1