From 035cc673bf2907bf42e4665de576457be2ff9ac8 Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Wed, 27 Dec 2023 17:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiannccda/ats/warn/axle/AxleLedInterlockTask.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) {