diff --git a/src/main/java/com/xydl/cac/service/impl/ParamBindServiceImpl.java b/src/main/java/com/xydl/cac/service/impl/ParamBindServiceImpl.java index f2c258a..3b5bdcf 100644 --- a/src/main/java/com/xydl/cac/service/impl/ParamBindServiceImpl.java +++ b/src/main/java/com/xydl/cac/service/impl/ParamBindServiceImpl.java @@ -159,6 +159,30 @@ public class ParamBindServiceImpl implements ParamBindService { throw new Exception("该逻辑设备实例已被" + list.get(0).getName() + "绑定"); } + List attList = attRepository.findByIcdConfigTypeId(type.getId()); + Optional optionalModevType = modevTypeRepository.findById(modev.getModevtid()); + if (optionalModevType.isPresent()) { + ModevType modevType = optionalModevType.get(); + if (StringUtils.isNotBlank(modevType.getTablename())) { + List columnList = dataService.getDataTableColumns(modevType.getTablename()); + for (IcdConfigTypeAtt att : attList) { + if (StringUtils.isNotBlank(att.getColName())) { + boolean found = false; + for (ColumnModel col : columnList) { + if (col.getName().equals(att.getColName())) { + found = true; + break; + } + } + if (!found) { + throw new Exception("当前监控设备对应的表" + modevType.getTablename() + "里不存在配置属性" + + att.getDoName() + "绑定的字段" + att.getColName()); + } + } + } + } + } + modev.setIcdid(item.getIcdid()); modevRepository.save(modev); }