fix(mqtt): 解决设备在线状态检查和数据处理逻辑问题
- 注释掉MQTT客户端在线状态检查逻辑以避免设备访问阻塞 - 修复日志消息中APF模块信息显示错误的问题 - 添加PQ-COM设备特殊处理逻辑以正确查询设备注册信息 - 优化实时数据服务中的设备注册查询条件判断
This commit is contained in:
@@ -504,7 +504,7 @@ public class MqttMessageHandler {
|
||||
logMessageTemplate.sendMember(logDto);
|
||||
break;
|
||||
case 15:
|
||||
logDto.setOperate("系统端收到装置端"+nDid+"更新设备软件信息报文,code = " + res.getCode());
|
||||
logDto.setOperate("系统端收到装置端"+nDid+"APF模块报文,code = " + res.getCode());
|
||||
logDto.setResult(1);
|
||||
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(res));
|
||||
AppAutoDataMessage appAutoDataMessage = JSONObject.toJavaObject(jsonObject, AppAutoDataMessage.class);
|
||||
|
||||
@@ -1092,11 +1092,11 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
||||
public boolean autoAccess(String nDid,String version,Integer mid) {
|
||||
boolean result = false;
|
||||
try {
|
||||
String clientName = "NJCN-" + nDid.substring(nDid.length() - 6);
|
||||
boolean mqttClient = mqttUtil.judgeClientOnline(clientName);
|
||||
if (!mqttClient) {
|
||||
return result;
|
||||
}
|
||||
// String clientName = "NJCN-" + nDid.substring(nDid.length() - 6);
|
||||
// boolean mqttClient = mqttUtil.judgeClientOnline(clientName);
|
||||
// if (!mqttClient) {
|
||||
// return result;
|
||||
// }
|
||||
Map<Integer,String> modelMap = new HashMap<>();
|
||||
//删除缓存数据
|
||||
redisUtil.delete(AppRedisKey.MODEL + nDid);
|
||||
|
||||
@@ -148,7 +148,13 @@ public class RtServiceImpl implements IRtService {
|
||||
List<CsDataArray> dataArrayList;
|
||||
//监测点id
|
||||
String lineId;
|
||||
CsDeviceRegistry csDeviceRegistry = csDeviceRegistryFeignClient.queryByCurrentNdidAndClDid(appAutoDataMessage.getId(),appAutoDataMessage.getMsg().getClDid()).getData();
|
||||
CsDeviceRegistry csDeviceRegistry;
|
||||
//PQ-COM
|
||||
if (appAutoDataMessage.getDid() == 1) {
|
||||
csDeviceRegistry = csDeviceRegistryFeignClient.queryByCurrentNdidAndClDid(appAutoDataMessage.getId(),0).getData();
|
||||
} else {
|
||||
csDeviceRegistry = csDeviceRegistryFeignClient.queryByCurrentNdidAndClDid(appAutoDataMessage.getId(),appAutoDataMessage.getMsg().getClDid()).getData();
|
||||
}
|
||||
if (Objects.isNull(csDeviceRegistry)) {
|
||||
if (appAutoDataMessage.getDid() == 1){
|
||||
lineId = appAutoDataMessage.getId() + "0";
|
||||
|
||||
Reference in New Issue
Block a user