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); } } }