代码调整

This commit is contained in:
tiger_zhou 2023-09-06 17:32:35 +08:00
parent 1a560db6e9
commit 05da62da72
4 changed files with 7 additions and 4 deletions

View File

@ -52,6 +52,9 @@ public class OccTcpClientConnection {
* 是否是实时数据连接 * 是否是实时数据连接
*/ */
private boolean realDataConn; private boolean realDataConn;
/**
* 发送请求基础数据
*/
private AtomicBoolean requestBaseData = new AtomicBoolean(false); private AtomicBoolean requestBaseData = new AtomicBoolean(false);
public void write(MessageData messageData) { public void write(MessageData messageData) {
@ -98,7 +101,7 @@ public class OccTcpClientConnection {
this.connected = true; this.connected = true;
InUsedScheduleData scheduleData = DeviceDataRepository.findDataSouce(String.valueOf(this.client.getLineId()), DataTypeEnum.TRAIN_PLAN); InUsedScheduleData scheduleData = DeviceDataRepository.findDataSouce(String.valueOf(this.client.getLineId()), DataTypeEnum.TRAIN_PLAN);
if (Objects.equals(false, this.realDataConn) && requestBaseData.compareAndSet(false, true) && scheduleData.isEmpty()) { if (Objects.equals(false, this.realDataConn) && requestBaseData.compareAndSet(false, true) && scheduleData.isEmpty()) {
log.info("发送计划运行图请求 lingId[{}]", this.client.getLineId()); log.info("发送计划运行图请求 lineId[{}] host[{}] 端口[{}]", this.client.getLineId(), this.host, this.port);
LoadHistoryTGDataRequest dataRequest = new LoadHistoryTGDataRequest((short) this.client.getLineId(), LocalDateTime.now(), ApplyTypeEnum.PLAN_GRAPH); LoadHistoryTGDataRequest dataRequest = new LoadHistoryTGDataRequest((short) this.client.getLineId(), LocalDateTime.now(), ApplyTypeEnum.PLAN_GRAPH);
this.write(dataRequest); this.write(dataRequest);
} }

View File

@ -37,7 +37,7 @@ public class SwitchLostAlertMonitoringTask implements AlertMonitoringTask {
private final AlertManager alertManager = AlertManager.getDefault(); private final AlertManager alertManager = AlertManager.getDefault();
Map<String, Switch.Builder> deviceMap = new ConcurrentHashMap<>(); private final Map<String, Switch.Builder> deviceMap = new ConcurrentHashMap<>();
public void putSwitchIfNotExist(Switch.Builder switchBuilder) { public void putSwitchIfNotExist(Switch.Builder switchBuilder) {
if (!deviceMap.containsKey(switchBuilder.getId())) { if (!deviceMap.containsKey(switchBuilder.getId())) {

View File

@ -35,7 +35,7 @@ public class TrainAtpCutAlertMonitoringTask implements AlertMonitoringTask {
private final AlertManager alertManager = AlertManager.getDefault(); private final AlertManager alertManager = AlertManager.getDefault();
private Map<String, TrainInfo.Builder> trainInfoMap = new ConcurrentHashMap<>(); private final Map<String, TrainInfo.Builder> trainInfoMap = new ConcurrentHashMap<>();
public void putTrainInfoMonitor(TrainInfo.Builder train) { public void putTrainInfoMonitor(TrainInfo.Builder train) {

@ -1 +1 @@
Subproject commit d82140370ef78529ad745356e41bad635a333457 Subproject commit da3fb50a050cb48ae2f90c082178ffaba6634967