去掉·多余赋值

feasure
xce 2026-01-18 17:19:05 +08:00
parent 3e4ee7b4b2
commit d45b68047a
1 changed files with 1 additions and 3 deletions

View File

@ -289,7 +289,6 @@ public class MqttMessageHandler implements SmartLifecycle {
Integer funcValue = null; Integer funcValue = null;
boolean isAck = false; boolean isAck = false;
// 新增:标记是否需要执行自动关任务(全局可用) // 新增:标记是否需要执行自动关任务(全局可用)
boolean needAutoOffTask = false;
// 第二步设备回执处理逻辑完全移除Redis写入 // 第二步设备回执处理逻辑完全移除Redis写入
if (payloadObj.containsKey("suc") && payloadObj.containsKey("prop")) { 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); autoOffSeconds = LIMIT_MAP.getOrDefault(funcType, k -> 0).apply(agriLimit);
} }
// 新增:判断是否真的需要执行自动关任务(延迟秒数>0才是有效任务 // 新增:判断是否真的需要执行自动关任务(延迟秒数>0才是有效任务
needAutoOffTask = autoOffSeconds > 0; if (autoOffSeconds > 0) {
if (needAutoOffTask) {
scheduleAutoOff(deviceId, funcType, autoOffSeconds); scheduleAutoOff(deviceId, funcType, autoOffSeconds);
log.debug("【自动关任务】标记需要执行deviceId={}, funcType={}, delay={}s", deviceId, funcType, autoOffSeconds); log.debug("【自动关任务】标记需要执行deviceId={}, funcType={}, delay={}s", deviceId, funcType, autoOffSeconds);
} }