|
|
|
@ -87,6 +87,10 @@ public class ZsbServiceImpl implements ZsbService {
|
|
|
|
|
if (!optionalLx.isPresent()) {
|
|
|
|
|
throw new Exception("未找到该设备类型");
|
|
|
|
|
}
|
|
|
|
|
List<Zsb> list = repository.findByJgidAndMc(item.getJgid(), item.getMc());
|
|
|
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
|
|
|
throw new Exception("该名称已被使用");
|
|
|
|
|
}
|
|
|
|
|
return repository.save(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -98,6 +102,10 @@ public class ZsbServiceImpl implements ZsbService {
|
|
|
|
|
if (!optionalLx.isPresent()) {
|
|
|
|
|
throw new Exception("未找到该设备类型");
|
|
|
|
|
}
|
|
|
|
|
List<Zsb> list = repository.findByJgidAndMcAndIdIsNot(item.getJgid(), item.getMc(), item.getId());
|
|
|
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
|
|
|
throw new Exception("该名称已被使用");
|
|
|
|
|
}
|
|
|
|
|
repository.save(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|