Commit 0cd380c59a3d06bc5e5d2f5b27bca590e19c64e9
1 parent
acee92a1
fix: 修复任务中心,按设备执行,选择多个设备时,其中有设备不允许执行该任务,但实际执行了的BUG
Showing
1 changed file
with
12 additions
and
0 deletions
... | ... | @@ -91,7 +91,19 @@ public class RpcCommandTask { |
91 | 91 | key, |
92 | 92 | LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli()); |
93 | 93 | if (targetType.equals(TargetTypeEnum.DEVICES)) { |
94 | + // 过滤取消执行的设备 | |
95 | + Map<String, List<String>> map = targetContent.getCancelExecuteDevices(); | |
96 | + List<String> cancelExecuteDevices = new ArrayList<>(); | |
97 | + if (null != map && !map.isEmpty()) { | |
98 | + for (String deviceProfileId : map.keySet()) { | |
99 | + cancelExecuteDevices.addAll(map.get(deviceProfileId)); | |
100 | + } | |
101 | + } | |
94 | 102 | for (String deviceId : data) { |
103 | + if (!cancelExecuteDevices.isEmpty() | |
104 | + && cancelExecuteDevices.contains(deviceId)) { | |
105 | + continue; | |
106 | + } | |
95 | 107 | sendRpcCommand(cmdJsonNode, tenantId, deviceId, securityUser, taskCenterId); |
96 | 108 | } |
97 | 109 | } else { | ... | ... |