根据心跳更新风机通讯状态
This commit is contained in:
parent
68c15b469a
commit
e0542740f9
@ -56,13 +56,13 @@ public class HeartbeatCommand implements BaseCommand{
|
||||
}
|
||||
//判断是不是风机
|
||||
String keyPLCDeviceStatus = String.format("RT:%d:iturbineoperationmode", deviceId);
|
||||
String keyDeviceStatus = String.format("RT:%d:commfaultstate");
|
||||
String keyCommFaultState = String.format("RT:%d:commfaultstate");
|
||||
Integer plcDeviceStatus = adminRedisTemplate.get(keyPLCDeviceStatus);
|
||||
if (plcDeviceStatus == null){
|
||||
adminRedisTemplate.set(keyDeviceStatus, online ? 1 : 0);
|
||||
adminRedisTemplate.set(keyCommFaultState, online ? 0 : 1);
|
||||
}
|
||||
else{
|
||||
adminRedisTemplate.set(keyDeviceStatus, online && plcDeviceStatus == 1 ? 1 : 0);
|
||||
adminRedisTemplate.set(keyCommFaultState, online && plcDeviceStatus != 0 ? 0 : 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user