From d45b68047aed3e9ffbf00ba42686958860eaf074 Mon Sep 17 00:00:00 2001 From: xce Date: Sun, 18 Jan 2026 17:19:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=C2=B7=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/agri/framework/interceptor/MqttMessageHandler.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/agri-framework/src/main/java/com/agri/framework/interceptor/MqttMessageHandler.java b/agri-framework/src/main/java/com/agri/framework/interceptor/MqttMessageHandler.java index d4b65bc..81ac89b 100644 --- a/agri-framework/src/main/java/com/agri/framework/interceptor/MqttMessageHandler.java +++ b/agri-framework/src/main/java/com/agri/framework/interceptor/MqttMessageHandler.java @@ -289,7 +289,6 @@ public class MqttMessageHandler implements SmartLifecycle { Integer funcValue = null; boolean isAck = false; // 新增:标记是否需要执行自动关任务(全局可用) - boolean needAutoOffTask = false; // 第二步:设备回执处理逻辑(完全移除Redis写入) if (payloadObj.containsKey("suc") && payloadObj.containsKey("prop")) { @@ -323,8 +322,7 @@ public class MqttMessageHandler implements SmartLifecycle { autoOffSeconds = LIMIT_MAP.getOrDefault(funcType, k -> 0).apply(agriLimit); } // 新增:判断是否真的需要执行自动关任务(延迟秒数>0才是有效任务) - needAutoOffTask = autoOffSeconds > 0; - if (needAutoOffTask) { + if (autoOffSeconds > 0) { scheduleAutoOff(deviceId, funcType, autoOffSeconds); log.debug("【自动关任务】标记需要执行,deviceId={}, funcType={}, delay={}s", deviceId, funcType, autoOffSeconds); }