From 29b24b9f230e230bb9a394c8301484070d7de1a6 Mon Sep 17 00:00:00 2001 From: zwl <1051256694@qq.com> Date: 星期五, 27 六月 2025 08:28:47 +0800 Subject: [PATCH] 新增中库位 --- src/main/java/com/zy/core/cache/MessageQueue.java | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zy/core/cache/MessageQueue.java b/src/main/java/com/zy/core/cache/MessageQueue.java index cf6e475..5ffad0b 100644 --- a/src/main/java/com/zy/core/cache/MessageQueue.java +++ b/src/main/java/com/zy/core/cache/MessageQueue.java @@ -1,6 +1,5 @@ package com.zy.core.cache; -import com.zy.asrs.utils.CommandUtils; import com.zy.core.Slave; import com.zy.core.enums.SlaveType; import com.zy.core.model.Task; @@ -62,7 +61,6 @@ * 濡傛灉鍙戠幇闃熷垪宸叉弧鏃犳硶娣诲姞鐨勮瘽锛屼細鐩存帴杩斿洖false銆� */ public static boolean offer(SlaveType type, Integer id, Task task) { - CommandUtils.offer(type, id, task); switch (type) { case Crn: return CRN_EXCHANGE.get(id).offer(task); @@ -151,5 +149,20 @@ break; } } + public static boolean offer(SlaveType type, Integer devpId, Task task, Runnable callback) { + boolean result = offer(type, devpId, task); // 鍏堟墽琛屽師鏈変换鍔¢�昏緫 + if (result && callback != null) { + new Thread(() -> { + try { + Thread.sleep(200); // 妯℃嫙浠诲姟鎵ц鏃堕棿 + callback.run(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + }).start(); + } + return result; + } + } -- Gitblit v1.9.1