更新心跳逻辑
This commit is contained in:
parent
6d1dd1ae26
commit
70b723a15d
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user