refactor(access): 重构设备接入任务和优化线程管理
- 移除废弃的日志消息相关依赖和代码 - 优化 AccessApplicationRunner 和 AutoAccessTimer 的线程池使用 - 采用共享线程池和信号量控制并发访问设备 - 批量处理设备接入任务并添加批次间隔控制 - 重构 autoAccess2 方法移除事务注解并改用异步处理 - 修复更新线路ID时参数传递错误的问题 - 统一错误处理和异常捕获机制 - 添加更详细的日志记录和错误追踪功能
This commit is contained in:
@@ -168,16 +168,16 @@ public class StatServiceImpl implements IStatService {
|
||||
csLineLatestDataFeignClient.addData(csLineLatestData);
|
||||
}
|
||||
//判断设备运行状态
|
||||
// if (!Objects.isNull(po.getRunStatus()) && po.getRunStatus() == 1) {
|
||||
// csDeviceFeignClient.updateRunStatus(appAutoDataMessage.getId(), AccessEnum.ONLINE.getCode());
|
||||
// //记录设备上线
|
||||
// PqsCommunicateDto dto = new PqsCommunicateDto();
|
||||
// dto.setTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
||||
// dto.setDevId(appAutoDataMessage.getId());
|
||||
// dto.setType(1);
|
||||
// dto.setDescription("通讯正常");
|
||||
// csCommunicateFeignClient.insertion(dto);
|
||||
// }
|
||||
if (!Objects.isNull(po.getRunStatus()) && po.getRunStatus() == 1) {
|
||||
csDeviceFeignClient.updateRunStatus(appAutoDataMessage.getId(), AccessEnum.ONLINE.getCode());
|
||||
//记录设备上线
|
||||
PqsCommunicateDto dto = new PqsCommunicateDto();
|
||||
dto.setTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
||||
dto.setDevId(appAutoDataMessage.getId());
|
||||
dto.setType(1);
|
||||
dto.setDescription("通讯正常");
|
||||
csCommunicateFeignClient.insertion(dto);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -437,7 +437,7 @@ public class EventServiceImpl implements IEventService {
|
||||
//前置告警
|
||||
if (Objects.equals(cldLogMessage.getLevel(),"process")) {
|
||||
//这边将前置服务器id当作设备id
|
||||
po.setDeviceId(cldLogMessage.getNodeId());
|
||||
po.setDeviceId(cldLogMessage.getNodeId());
|
||||
po.setClDid(Integer.valueOf(cldLogMessage.getProcessNo()));
|
||||
po.setType(4);
|
||||
}
|
||||
@@ -446,9 +446,11 @@ public class EventServiceImpl implements IEventService {
|
||||
if (Objects.equals(cldLogMessage.getLevel(),"terminal")) {
|
||||
po.setDeviceId(cldLogMessage.getBusinessId());
|
||||
} else {
|
||||
CsLinePO line = csLineFeignClient.getById(cldLogMessage.getBusinessId()).getData();
|
||||
po.setDeviceId(line.getDeviceId());
|
||||
po.setLineId(cldLogMessage.getBusinessId());
|
||||
if (!Objects.isNull(cldLogMessage.getBusinessId()) && !Objects.equals(cldLogMessage.getBusinessId(),"")) {
|
||||
CsLinePO line = csLineFeignClient.getById(cldLogMessage.getBusinessId()).getData();
|
||||
po.setDeviceId(line.getDeviceId());
|
||||
po.setLineId(cldLogMessage.getBusinessId());
|
||||
}
|
||||
}
|
||||
po.setType(3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user