Commit e77567c25adc82dc77e6746bf5eeb5f79454fcfa
1 parent
3539f7d2
提交代码
Showing
1 changed file
with
29 additions
and
0 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/areamanage/AreaManageController.java
@@ -9,8 +9,12 @@ import com.clouds.common.web.vo.BizResultVO; | @@ -9,8 +9,12 @@ import com.clouds.common.web.vo.BizResultVO; | ||
9 | import com.clouds.common.web.vo.EasyUIDataGridVO; | 9 | import com.clouds.common.web.vo.EasyUIDataGridVO; |
10 | import com.zteits.clouds.api.apibase.bean.BaseRequest; | 10 | import com.zteits.clouds.api.apibase.bean.BaseRequest; |
11 | import com.zteits.clouds.api.apibase.bean.BizResult; | 11 | import com.zteits.clouds.api.apibase.bean.BizResult; |
12 | +import com.zteits.clouds.api.dto.park.param.ParkInfoByAreaBlockIdsRequest; | ||
12 | import com.zteits.clouds.api.dto.sys.AreaTreeDTO; | 13 | import com.zteits.clouds.api.dto.sys.AreaTreeDTO; |
14 | +import com.zteits.clouds.api.dto.sys.TbAreaDTO; | ||
13 | import com.zteits.clouds.api.dto.sys.param.AreaBlockByOrgIdQueryRequest; | 15 | import com.zteits.clouds.api.dto.sys.param.AreaBlockByOrgIdQueryRequest; |
16 | +import com.zteits.clouds.api.dto.sys.param.AreaBlockQueryByParentIdRequest; | ||
17 | +import com.zteits.clouds.api.service.park.ParkingLotService; | ||
14 | import com.zteits.clouds.api.service.sys.TbAreaService; | 18 | import com.zteits.clouds.api.service.sys.TbAreaService; |
15 | import io.swagger.annotations.Api; | 19 | import io.swagger.annotations.Api; |
16 | import io.swagger.annotations.ApiOperation; | 20 | import io.swagger.annotations.ApiOperation; |
@@ -45,6 +49,9 @@ public class AreaManageController { | @@ -45,6 +49,9 @@ public class AreaManageController { | ||
45 | @Autowired | 49 | @Autowired |
46 | private TbAreaService tbAreaService; | 50 | private TbAreaService tbAreaService; |
47 | 51 | ||
52 | + @Autowired | ||
53 | + private ParkingLotService parkingLotService; | ||
54 | + | ||
48 | @ApiOperation("根据归属组织ID查询区域与区块树") | 55 | @ApiOperation("根据归属组织ID查询区域与区块树") |
49 | @PostMapping("/queryAreaAndBlockTree") | 56 | @PostMapping("/queryAreaAndBlockTree") |
50 | public BizResultVO<EasyUIDataGridVO<AreaTreeDTO>> queryAreaAndBlockTree(@RequestBody BaseRequest baseRequest) { | 57 | public BizResultVO<EasyUIDataGridVO<AreaTreeDTO>> queryAreaAndBlockTree(@RequestBody BaseRequest baseRequest) { |
@@ -68,4 +75,26 @@ public class AreaManageController { | @@ -68,4 +75,26 @@ public class AreaManageController { | ||
68 | return resultVO; | 75 | return resultVO; |
69 | } | 76 | } |
70 | 77 | ||
78 | + @ApiOperation("根据区块ID查询区块下停车场数量") | ||
79 | + @PostMapping("/queryParkInfoNumByAreaBlockIds") | ||
80 | + public BizResultVO<Integer> queryParkInfoNumByAreaBlockIds(@RequestBody ParkInfoByAreaBlockIdsRequest request){ | ||
81 | + BizResult<List<AreaTreeDTO>> bizResult = parkingLotService.queryParkInfoByAreaBlockIds(request); | ||
82 | + BizResultVO<Integer> bizResultVO = new BizResultVO<>(); | ||
83 | + Integer num; | ||
84 | + if(ResultUtils.isSuccess(bizResult)){ | ||
85 | + List<AreaTreeDTO> list = bizResult.getData(); | ||
86 | + if(list != null){ | ||
87 | + num = list.size(); | ||
88 | + }else { | ||
89 | + num = 0; | ||
90 | + } | ||
91 | + bizResultVO.setData(num); | ||
92 | + }else{ | ||
93 | + bizResultVO.setCode(bizResult.getErrCode().getCode()); | ||
94 | + bizResultVO.setMsg(bizResult.getErrMsg()); | ||
95 | + } | ||
96 | + | ||
97 | + return bizResultVO; | ||
98 | + } | ||
99 | + | ||
71 | } | 100 | } |