From 17d42a4d6398d93af62067641ea888f124ddbb5b Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Fri, 26 May 2023 15:46:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9NCC=E6=8A=A5=E8=AD=A6bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/service/alarm/NccAlarmService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/alarm/NccAlarmService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/alarm/NccAlarmService.java index 70fdc0fc7..9a3c1e9ec 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/alarm/NccAlarmService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/alarm/NccAlarmService.java @@ -26,6 +26,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; /** * NCC系统报警监测、通知服务 @@ -136,12 +137,14 @@ public class NccAlarmService { return defaultReason; } AtsAlarm atsAlarm = deviceFaultAlarm.get(); - MapElement element = repository.getByCode(atsAlarm.getCode()); + if (StringUtils.hasText(atsAlarm.getDeviceCode())) { + return defaultReason; + } + MapElement element = repository.findByCode(atsAlarm.getDeviceCode()); if (!(element instanceof MayOutOfOrderDevice)) { return defaultReason; } - MayOutOfOrderDevice device = repository.getByCode(atsAlarm.getDeviceCode(), - MayOutOfOrderDevice.class); + MayOutOfOrderDevice device = (MayOutOfOrderDevice) element; DeviceFault deviceFault = device.getFault(); if (deviceFault == null) { return defaultReason;