From 3ac9997460636d692f44e69e0b4fb7570acace33 Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Thu, 21 Dec 2023 10:27:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ats/message/collect/datasource/DeviceStatusData.java | 1 + .../xiannccda/ats/warn/BuleDisplayMonitoringTask.java | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/DeviceStatusData.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/DeviceStatusData.java index e0f05f4..37fbaee 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/DeviceStatusData.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/DeviceStatusData.java @@ -141,6 +141,7 @@ public class DeviceStatusData extends AbstractData { b.setIpSingleSwitchStusLocked(false); b.setIpSingleSwitchStusCbtcOccupied(false); b.setIpSingleSwitchStusCiOccupied(false); + b.setIpSingleSwitchStusJammed(false); } } } diff --git a/src/main/java/club/joylink/xiannccda/ats/warn/BuleDisplayMonitoringTask.java b/src/main/java/club/joylink/xiannccda/ats/warn/BuleDisplayMonitoringTask.java index 163c225..36d93e8 100644 --- a/src/main/java/club/joylink/xiannccda/ats/warn/BuleDisplayMonitoringTask.java +++ b/src/main/java/club/joylink/xiannccda/ats/warn/BuleDisplayMonitoringTask.java @@ -22,6 +22,7 @@ import com.google.protobuf.GeneratedMessageV3; import com.google.protobuf.GeneratedMessageV3.Builder; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -61,17 +62,18 @@ public class BuleDisplayMonitoringTask implements AlertMonitoringTask { private Map findRtuDeviceSource(String lineIdStr) { DeviceStatusData deviceStatusData = DeviceDataRepository.findDataSouce(lineIdStr, DataTypeEnum.DEVICE); if (deviceStatusData.getAllDeviceMap().isEmpty()) { - return null; + return Collections.emptyMap(); } Map builderMap = deviceStatusData.getAllDeviceMap().get(Rtu.getDescriptor().getName()); - if (builderMap.isEmpty()) { - return null; + if (CollectionUtils.isEmpty(builderMap)) { + return Collections.emptyMap(); } return builderMap; } private List findRtuBuild(Map builderMap) { List collectRtuList = Lists.newArrayList(); + for (Builder value : builderMap.values()) { if (value instanceof DeviceStatusProto.Rtu.Builder rtu) { Station station = findAllStation(rtu.getLineId(), rtu.getId());