From 70b723a15d0d3a6e29b5f773440b913a3bb860a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=B7=E6=88=90=E4=BC=9F?= Date: Wed, 11 Dec 2024 09:50:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BF=83=E8=B7=B3=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/das/modules/node/command/HeartbeatCommand.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/das/src/main/java/com/das/modules/node/command/HeartbeatCommand.java b/das/src/main/java/com/das/modules/node/command/HeartbeatCommand.java index 3f0b1fa8..8eb2aefe 100644 --- a/das/src/main/java/com/das/modules/node/command/HeartbeatCommand.java +++ b/das/src/main/java/com/das/modules/node/command/HeartbeatCommand.java @@ -49,7 +49,7 @@ public class HeartbeatCommand implements BaseCommand{ if (devices != null && devices.isArray()) { for (JsonNode device : devices) { Long deviceId = device.get("deviceId").asLong(); - Boolean online = device.get("online").asBoolean(); + int online = device.get("online").asInt(); DeviceInfoCache deviceInfoCacheById = cacheService.getEquipmentCache().getDeviceInfoCacheById(deviceId); if (deviceInfoCacheById == null || !deviceInfoCacheById.getObjectType().equals(EquipmentTypeIds.EQUIPMENT_TYPE_STATION_WTG)) { continue; @@ -59,10 +59,10 @@ public class HeartbeatCommand implements BaseCommand{ String keyCommFaultState = String.format("RT:%d:commfaultstate",deviceId); Integer plcDeviceStatus = adminRedisTemplate.get(keyPLCDeviceStatus); if (plcDeviceStatus == null){ - adminRedisTemplate.set(keyCommFaultState, online ? 0 : 1); + adminRedisTemplate.set(keyCommFaultState, (online == 1) ? 0 : 1); } else{ - adminRedisTemplate.set(keyCommFaultState, online && (plcDeviceStatus != 0) ? 0 : 1); + adminRedisTemplate.set(keyCommFaultState, (online == 1) && (plcDeviceStatus != 0) ? 0 : 1); } } }