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;