判断是否有当前imei的功能任务

master
lld 2026-03-29 17:51:32 +08:00
parent 76469decc5
commit 28e02814bc
1 changed files with 15 additions and 0 deletions

View File

@ -350,6 +350,21 @@ public class MqttAutoOffManager {
}
}
/**
* imei
*
* 105300
*
* @param deviceId
* @param funcType
* @return
*/
public boolean isHaveTask(String deviceId, String funcType) {
String taskKey = "autooff:" + deviceId + ":" + funcType;
// 同设备同功能只保留最后一次任务:只有旧任务还没开始时才替换
ScheduledFuture<?> oldFuture = autoOffFutureMap.get(taskKey);
return oldFuture != null;
}
// 自动关是否启用(你可以先写死 true / false
public boolean isEnabled() {
return true; // 之后可接配置