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 | 21 | import java.util.Map; |
| 22 | 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 | 28 | * @author yanhuiqing |
| 26 | 29 | * @version 1.0 |
| ... | ... | @@ -64,6 +67,9 @@ public class RoadApiImpl implements RoadApi { |
| 64 | 67 | @Override |
| 65 | 68 | public RoadStreetRespDTO getRoadInfoById(String id) { |
| 66 | 69 | RoadRespVO roadRespVO = roadService.getUniqueRoad(Long.parseLong(id)); |
| 70 | + if(null == roadRespVO){ | |
| 71 | + throw exception(TREE_ROAD_NOT_EXISTS); | |
| 72 | + } | |
| 67 | 73 | RoadStreetRespDTO targetVO = BeanUtils.toBean(roadRespVO, RoadStreetRespDTO.class); |
| 68 | 74 | targetVO.setId(roadRespVO.getId().toString()); |
| 69 | 75 | return targetVO; | ... | ... |