代码调整

This commit is contained in:
tiger_zhou 2023-12-22 16:38:13 +08:00
parent fc36033c44
commit 926a12d4e2
2 changed files with 5 additions and 3 deletions

View File

@ -82,8 +82,10 @@ public class InterLockData extends AbstractData {
for (AreaConfigVO interlockArea : interlockList) {
List<Station> 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());

View File

@ -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;