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 c04c955..0034f75 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 @@ -82,8 +82,10 @@ public class AxleLedInterlockTask implements AlertMonitoringTask { Integer lineIdInt = Integer.parseInt(lineId); //收集联锁下的所有所有区段设备 List resultList = this.collectorLedWarDevices(findWarnAlertType, lineId, detail.getDevices()); - log.info("线路[{}] 联锁区[{}] 需要加载设备数量[{}] 实际加载数量[{}] 区段被占用情况[{}]", lineId, rtuIdJoinStr, deviceCount, resultList.size(), - resultList.stream().filter(d -> d.occupied).map(d -> d.deviceCode).collect(Collectors.joining(","))); + if (resultList.stream().anyMatch(d -> d.occupied)) { + log.info("线路[{}] 联锁区[{}] 需要加载设备数量[{}] 实际加载数量[{}] 区段被占用情况[{}]", lineId, rtuIdJoinStr, deviceCount, resultList.size(), + resultList.stream().filter(d -> d.occupied).map(d -> d.deviceCode).collect(Collectors.joining(","))); + } int occupidedSzie = (int) resultList.stream().filter(d -> d.occupied).count(); String customName = String.format("%s-%s", findWarnAlertType.name(), detail.getAreaConfigId()); if (occupidedSzie >= deviceCount) {