diff --git a/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedInterlockTask.java b/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedInterlockTask.java index b4eda99..3e9cee4 100644 --- a/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedInterlockTask.java +++ b/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedInterlockTask.java @@ -62,20 +62,19 @@ public class AxleLedInterlockTask implements AlertMonitoringTask { } for (String lineId : lineCollSet) { InterLockData interLockData = DeviceDataRepository.findDataSouce(lineId, DataTypeEnum.INTER_LOCK); - List interlockOneList = interLockData.findKeysStart(AlertType.INTERLOCK_LEVEL_ONE.name()); + List interlockOneList = interLockData.findKeysStart(AlertType.INTERLOCK_LEVEL_ONE.name()) + .stream().filter(d -> StringUtils.endsWith(d, AlertDeviceType.DEVICE_TYPE_TRACK.name())).toList(); for (String lockLevel : interlockOneList) { - if (StringUtils.endsWith(lockLevel, AlertDeviceType.DEVICE_TYPE_TRACK.name())) { - Map detailMap = interLockData.getDetailByInterlockKey(lockLevel); - for (Entry interLockDetail : detailMap.entrySet()) { - String rtuIdJoinStr = interLockDetail.getKey(); - InterLockDetail detail = interLockDetail.getValue(); - Optional redOpt = this.handle(lineId, detail, AlertType.AXLE_LED_RED, AlertType.AXLE_LED_RED_INTERLOCK_AREA, rtuIdJoinStr); - Optional orangeOpt = this.handle(lineId, detail, AlertType.AXLE_LED_ORANGE, AlertType.AXLE_LED_ORANGE_INTERLOCK_AREA, rtuIdJoinStr); + Map detailMap = interLockData.getDetailByInterlockKey(lockLevel); + for (Entry interLockDetail : detailMap.entrySet()) { + String rtuIdJoinStr = interLockDetail.getKey(); + InterLockDetail detail = interLockDetail.getValue(); + Optional redOpt = this.handle(lineId, detail, AlertType.AXLE_LED_RED, AlertType.AXLE_LED_RED_INTERLOCK_AREA, rtuIdJoinStr); + Optional orangeOpt = this.handle(lineId, detail, AlertType.AXLE_LED_ORANGE, AlertType.AXLE_LED_ORANGE_INTERLOCK_AREA, rtuIdJoinStr); - redOpt.ifPresent(axleInterLockSource -> this.alertManager.emit(new LedMostEvent(axleInterLockSource))); - orangeOpt.ifPresent(axleInterLockSource -> this.alertManager.emit(new LedMostEvent(axleInterLockSource))); + redOpt.ifPresent(axleInterLockSource -> this.alertManager.emit(new LedMostEvent(axleInterLockSource))); + orangeOpt.ifPresent(axleInterLockSource -> this.alertManager.emit(new LedMostEvent(axleInterLockSource))); - } } } } diff --git a/src/main/java/club/joylink/xiannccda/mock/message/occ/MockOccServer.java b/src/main/java/club/joylink/xiannccda/mock/message/occ/MockOccServer.java index dd31701..2af6991 100644 --- a/src/main/java/club/joylink/xiannccda/mock/message/occ/MockOccServer.java +++ b/src/main/java/club/joylink/xiannccda/mock/message/occ/MockOccServer.java @@ -155,7 +155,7 @@ public class MockOccServer { } private Integer findDeviceRtuId(Integer lineId, DeviceType dt, String deviceName, AlertType alertType) { - if (alertType == AlertType.AXLE_LED_RED || alertType == AlertType.AXLE_LED_ORANGE) { + if (alertType == AlertType.AXLE_LED_RED || alertType == AlertType.AXLE_LED_ORANGE || alertType == AlertType.TRAIN_EB_ATP) { MessageOrBuilder t = LineGraphicDataRepository.getDeviceByCodeNotException(lineId, deviceName); if (t instanceof Turnout) {