Commit beedfcc7ade4999795100ce0284a8c74412a8266
Merge remote-tracking branch 'origin/dev' into dev
Showing
1 changed file
with
6 additions
and
0 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/road/RoadApiImpl.java
| @@ -21,6 +21,9 @@ import java.util.List; | @@ -21,6 +21,9 @@ import java.util.List; | ||
| 21 | import java.util.Map; | 21 | import java.util.Map; |
| 22 | import java.util.stream.Collectors; | 22 | import java.util.stream.Collectors; |
| 23 | 23 | ||
| 24 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 25 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.TREE_ROAD_NOT_EXISTS; | ||
| 26 | + | ||
| 24 | /** | 27 | /** |
| 25 | * @author yanhuiqing | 28 | * @author yanhuiqing |
| 26 | * @version 1.0 | 29 | * @version 1.0 |
| @@ -64,6 +67,9 @@ public class RoadApiImpl implements RoadApi { | @@ -64,6 +67,9 @@ public class RoadApiImpl implements RoadApi { | ||
| 64 | @Override | 67 | @Override |
| 65 | public RoadStreetRespDTO getRoadInfoById(String id) { | 68 | public RoadStreetRespDTO getRoadInfoById(String id) { |
| 66 | RoadRespVO roadRespVO = roadService.getUniqueRoad(Long.parseLong(id)); | 69 | RoadRespVO roadRespVO = roadService.getUniqueRoad(Long.parseLong(id)); |
| 70 | + if(null == roadRespVO){ | ||
| 71 | + throw exception(TREE_ROAD_NOT_EXISTS); | ||
| 72 | + } | ||
| 67 | RoadStreetRespDTO targetVO = BeanUtils.toBean(roadRespVO, RoadStreetRespDTO.class); | 73 | RoadStreetRespDTO targetVO = BeanUtils.toBean(roadRespVO, RoadStreetRespDTO.class); |
| 68 | targetVO.setId(roadRespVO.getId().toString()); | 74 | targetVO.setId(roadRespVO.getId().toString()); |
| 69 | return targetVO; | 75 | return targetVO; |