更新心跳逻辑
This commit is contained in:
parent
70b723a15d
commit
59ad680b0e
@ -8,11 +8,13 @@ import com.das.modules.cache.service.CacheService;
|
||||
import com.das.modules.node.constant.NodeConstant;
|
||||
import com.das.modules.node.domain.bo.TerminalMessage;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
@Slf4j
|
||||
@Service(value = NodeConstant.HEARTBEAT)
|
||||
public class HeartbeatCommand implements BaseCommand{
|
||||
|
||||
@ -55,9 +57,11 @@ public class HeartbeatCommand implements BaseCommand{
|
||||
continue;
|
||||
}
|
||||
//判断是不是风机
|
||||
|
||||
String keyPLCDeviceStatus = String.format("RT:%d:iturbineoperationmode", deviceId);
|
||||
String keyCommFaultState = String.format("RT:%d:commfaultstate",deviceId);
|
||||
Integer plcDeviceStatus = adminRedisTemplate.get(keyPLCDeviceStatus);
|
||||
log.debug("设备ID:{},在线状态:{},通讯状态: {}", deviceId, online, plcDeviceStatus);
|
||||
if (plcDeviceStatus == null){
|
||||
adminRedisTemplate.set(keyCommFaultState, (online == 1) ? 0 : 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user