From 926a12d4e2241105e655c4c5bf433c3317db4804 Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Fri, 22 Dec 2023 16:38:13 +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/InterLockData.java | 6 ++++-- .../xiannccda/service/config/DeviceAreaConfigService.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/InterLockData.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/InterLockData.java index 65b81ea..250fbeb 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/InterLockData.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/InterLockData.java @@ -79,11 +79,13 @@ public class InterLockData extends AbstractData { private void handleLevelOne(AlertType alertType, Map> alertTypeListMap, MessageOrBuilder builder, Integer lineId) { List interlockList = alertTypeListMap.get(alertType); Integer rtuId = DeviceStatusDataOperate.findFieldVal(builder, "rtuId", Integer.class); - + for (AreaConfigVO interlockArea : interlockList) { List sortStationList = this.sortRtu(interlockArea.getDatas(), lineId); + Integer min = Integer.parseInt(sortStationList.get(0).getCode()); Integer max = Integer.parseInt(sortStationList.get(sortStationList.size() - 1).getCode()); + if (rtuId >= min && rtuId <= max) { if (builder instanceof Track.Builder track) { String axleCode = LineGraphicDataRepository.findAxleCodeFromLogicCode(lineId, track.getId()); @@ -169,7 +171,7 @@ public class InterLockData extends AbstractData { @Override public void reset() { - + } public static class InterLockDetail { diff --git a/src/main/java/club/joylink/xiannccda/service/config/DeviceAreaConfigService.java b/src/main/java/club/joylink/xiannccda/service/config/DeviceAreaConfigService.java index ffc5cfa..94347b9 100644 --- a/src/main/java/club/joylink/xiannccda/service/config/DeviceAreaConfigService.java +++ b/src/main/java/club/joylink/xiannccda/service/config/DeviceAreaConfigService.java @@ -104,7 +104,7 @@ public class DeviceAreaConfigService { public void saveOrUpdate(DeviceAreaConfigDto dto) { BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(CollectionUtils.isNotEmpty(dto.getAlertTypes()), "绑定数据类型不能为空"); BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotTrue(dto.getAlertTypes().contains(AlertType.INTERLOCK_LEVEL_ONE.name()) && dto.getAlertTypes().size() != 1, "联锁区只能选择一个类型"); - BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotTrue(dto.getAlertTypes().contains(AlertType.INTERLOCK_LEVEL_ONE.name()) && dto.getData().size() > 1, "联锁区只能添加一个设备"); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotTrue(dto.getAlertTypes().contains(AlertType.INTERLOCK_LEVEL_ONE.name()) && dto.getData().size() > 2, "联锁区只能添加二个设备"); BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(CollectionUtils.isNotEmpty(dto.getData()), "绑定数据不能为空"); boolean isUpdate = false;