From 2e485d0de1d6e2727807e28d2ddbac4a8eb6d6ac Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Tue, 26 Dec 2023 11:09:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=97=A0=E5=85=B3=E8=81=94?= =?UTF-8?q?=E9=9B=86=E4=B8=AD=E7=AB=99=E6=B5=8B=E8=AF=95=E4=B8=8D=E4=BA=88?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../joylink/xiannccda/mock/message/occ/MockOccServer.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 1102be8..dd31701 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 @@ -43,6 +43,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.stream.Collectors; import lombok.Data; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; @@ -55,6 +56,7 @@ import org.springframework.web.bind.annotation.RestController; //@Component @RestController() @RequestMapping("/mock/server") +@Slf4j public class MockOccServer { @PostMapping("send") @@ -134,6 +136,10 @@ public class MockOccServer { } for (DeviceNameInfo di : md.getDeviceInfos()) { Integer rtuId_ = findDeviceRtuId((int) lineId, di.getDeviceType(), di.getDeviceName(), md.getAlertType()); + if (Objects.isNull(rtuId_)) { + log.error("{}没有找到对应的集中站,不予处理", di.getDeviceName()); + continue; + } if (messageId == MessageId.DEVICE_STATUS_CHANGE) { MockDeviceStatusReq mockDeviceStatusReq = new MockDeviceStatusReq(messageId, lineId, rtuId_.shortValue(), di.getDeviceType(), di.getDeviceName(), md.deviceStatus());