|
|
|
@ -105,7 +105,7 @@ public class JgServiceImpl implements JgService {
|
|
|
|
|
item.setId(null);
|
|
|
|
|
Optional<Bdz> optionalBdz = bdzRepository.findById(item.getBdzid());
|
|
|
|
|
if (!optionalBdz.isPresent()) {
|
|
|
|
|
throw new BusinessException("未找到该变电站");
|
|
|
|
|
throw new BusinessException("未找到该变电站id=" + item.getBdzid());
|
|
|
|
|
}
|
|
|
|
|
List<Jg> list = repository.findByBdzidAndMc(item.getBdzid(), item.getMc());
|
|
|
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
|
|
@ -119,7 +119,7 @@ public class JgServiceImpl implements JgService {
|
|
|
|
|
public void update(Jg item) throws Exception {
|
|
|
|
|
Optional<Bdz> optionalBdz = bdzRepository.findById(item.getBdzid());
|
|
|
|
|
if (!optionalBdz.isPresent()) {
|
|
|
|
|
throw new BusinessException("未找到该变电站");
|
|
|
|
|
throw new BusinessException("未找到该变电站id=" + item.getBdzid());
|
|
|
|
|
}
|
|
|
|
|
List<Jg> list = repository.findByBdzidAndMcAndIdIsNot(item.getBdzid(), item.getMc(), item.getId());
|
|
|
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
|
|
@ -144,7 +144,7 @@ public class JgServiceImpl implements JgService {
|
|
|
|
|
public Jg detail(Integer id) throws Exception {
|
|
|
|
|
Optional<Jg> optional = repository.findById(id);
|
|
|
|
|
if (!optional.isPresent()) {
|
|
|
|
|
throw new BusinessException("未找到该区域");
|
|
|
|
|
throw new BusinessException("未找到该区域id=" + id);
|
|
|
|
|
}
|
|
|
|
|
Jg jg = optional.get();
|
|
|
|
|
Optional<Bdz> optionalBdz = bdzRepository.findById(jg.getBdzid());
|
|
|
|
|