From 7222254629129493fa0635ad2861b81663ebdf49 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期四, 13 二月 2025 18:30:50 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/utils/NotifyUtils.java | 37 +++++++++++++------------------------ 1 files changed, 13 insertions(+), 24 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..431bf18 100644 --- a/src/main/java/com/zy/asrs/utils/NotifyUtils.java +++ b/src/main/java/com/zy/asrs/utils/NotifyUtils.java @@ -35,8 +35,8 @@ return append(notifyType, device, taskNo, 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, NotifyMsgType msgType, String data) { + String key = getKey(notifyType, device); + if(key == null){ return false; } -- Gitblit v1.9.1