Commit cc86ced65c1b996d84da1e73274384a7db042f27
1 parent
15f65b0f
tijiao
Showing
3 changed files
with
242 additions
and
0 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/areamanage/RegionAreaController.java
0 → 100644
1 | +package com.zteits.irain.portal.web.parkinglotcloudplatform.areamanage; | ||
2 | + | ||
3 | +import javax.validation.Valid; | ||
4 | + | ||
5 | +import org.slf4j.Logger; | ||
6 | +import org.slf4j.LoggerFactory; | ||
7 | +import org.springframework.beans.factory.annotation.Autowired; | ||
8 | +import org.springframework.beans.factory.annotation.Value; | ||
9 | +import org.springframework.stereotype.Controller; | ||
10 | +import org.springframework.util.StringUtils; | ||
11 | +import org.springframework.web.bind.annotation.PostMapping; | ||
12 | +import org.springframework.web.bind.annotation.RequestBody; | ||
13 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
14 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
15 | + | ||
16 | +import com.alibaba.dubbo.common.utils.CollectionUtils; | ||
17 | +import com.alibaba.fastjson.JSONObject; | ||
18 | +import com.clouds.common.web.BizController; | ||
19 | +import com.clouds.common.web.vo.BizResultVO; | ||
20 | +import com.clouds.common.web.vo.EasyUIDataGridVO; | ||
21 | +import com.zteits.clouds.api.apibase.bean.BizResult; | ||
22 | +import com.zteits.clouds.api.apibase.bean.PageBean; | ||
23 | +import com.zteits.clouds.api.apibase.constants.ErrorType; | ||
24 | +import com.zteits.clouds.api.apibase.exception.BizException; | ||
25 | +import com.zteits.clouds.api.dto.park.dto.TpPRegionAreaDTO; | ||
26 | +import com.zteits.clouds.api.dto.park.param.DeleteTpPRegionAreaRequest; | ||
27 | +import com.zteits.clouds.api.dto.park.param.QueryTpPRegionAreaForPageRequest; | ||
28 | +import com.zteits.clouds.api.dto.park.param.SaveOrUpdateTpPRegionAreaRequest; | ||
29 | +import com.zteits.clouds.api.dto.sys.SysOpDTO; | ||
30 | +import com.zteits.clouds.api.dto.sys.param.SysOpDeleteRequest; | ||
31 | +import com.zteits.clouds.api.dto.sys.param.SysOpForPageRequest; | ||
32 | +import com.zteits.clouds.api.dto.sys.param.SysOpSaveOrModfiyRequest; | ||
33 | +import com.zteits.clouds.api.service.park.TpPRegionAreaService; | ||
34 | +import com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic.RealTimeMonitorController; | ||
35 | + | ||
36 | +import io.swagger.annotations.Api; | ||
37 | +import io.swagger.annotations.ApiOperation; | ||
38 | +/** | ||
39 | + * | ||
40 | + * 企业云平台->基础信息->泊位区间管理 | ||
41 | + * Copyright: Copyright (c) 2017 zteits | ||
42 | + * | ||
43 | + * @ClassName: RealTimeMonitorController.java | ||
44 | + * @Description: | ||
45 | + * @version: v1.0.0 | ||
46 | + * @author: langlw | ||
47 | + * @date: 2017年8月30日 下午2:50:49 | ||
48 | + * Modification History: | ||
49 | + * Date Author Version Description | ||
50 | + *---------------------------------------------------------* | ||
51 | + * 2017年8月30日 langlw v1.0.0 创建 | ||
52 | + */ | ||
53 | +@Api(value = "企业云平台->基础信息->泊位区间管理", description = "企业云平台->基础信息->泊位区间管理") | ||
54 | +@Controller | ||
55 | +@RequestMapping("/regionArea") | ||
56 | +public class RegionAreaController extends BizController { | ||
57 | + private static final Logger logger = LoggerFactory.getLogger(RegionAreaController.class); | ||
58 | + @Value("${project.syscode}") | ||
59 | + private String sysCode; | ||
60 | + | ||
61 | + @Autowired | ||
62 | + private TpPRegionAreaService tpPRegionAreaService; | ||
63 | + /** | ||
64 | + * 添加或修改泊位区间信息 | ||
65 | + * | ||
66 | + * @param request | ||
67 | + * @return | ||
68 | + * @throws Exception | ||
69 | + * langlw 2017-08-30 | ||
70 | + */ | ||
71 | + @ApiOperation("添加或修改泊位区间信息") | ||
72 | + @PostMapping("saveOrUpdateTpPRegionArea") | ||
73 | + @ResponseBody | ||
74 | + public BizResultVO<Boolean> saveOrUpdateTpPRegionArea(@Valid @RequestBody SaveOrUpdateTpPRegionAreaRequest request) | ||
75 | + throws Exception { | ||
76 | + if(request==null || StringUtils.isEmpty(request.getSysCode())){ | ||
77 | + throw new BizException(ErrorType.BIZ_ERROR,"入参不能为空"); | ||
78 | + } | ||
79 | + logger.info("调用添加或修改区间信息dubbo服务入参:request={}"+JSONObject.toJSONString(request)); | ||
80 | + BizResult<Boolean> result = tpPRegionAreaService.saveOrUpdateTpPRegionArea(request); | ||
81 | + return new BizResultVO<Boolean>(result); | ||
82 | + } | ||
83 | + | ||
84 | + | ||
85 | + | ||
86 | + /** | ||
87 | + * 删除泊位区间信息 | ||
88 | + * | ||
89 | + * @param request | ||
90 | + * @return | ||
91 | + * @throws Exception | ||
92 | + * langlw 2017-08-30 | ||
93 | + */ | ||
94 | + @ApiOperation("删除泊位区间信息") | ||
95 | + @PostMapping("/deleteTpPRegionArea") | ||
96 | + @ResponseBody | ||
97 | + public BizResultVO<Boolean> deleteTpPRegionArea(@RequestBody DeleteTpPRegionAreaRequest request) throws Exception { | ||
98 | + if(null==request || CollectionUtils.isEmpty(request.getIds())){ | ||
99 | + throw new BizException(ErrorType.BIZ_ERROR,"入参不能为空"); | ||
100 | + } | ||
101 | + logger.info("调用删除泊位区间信息dubbo服务入参:request={}"+JSONObject.toJSONString(request)); | ||
102 | + BizResult<Boolean> bizResult = tpPRegionAreaService.deleteTpPRegionArea(request); | ||
103 | + return new BizResultVO<Boolean>(bizResult); | ||
104 | + } | ||
105 | + | ||
106 | + /** | ||
107 | + * 分页查询泊位区间信息 | ||
108 | + * @param request | ||
109 | + * @return | ||
110 | + * @throws Exception | ||
111 | + * langlw 2017-08-30 | ||
112 | + */ | ||
113 | + @ApiOperation("分页查询泊位区间信息") | ||
114 | + @PostMapping("/queryTpPRegionAreaForPage") | ||
115 | + @ResponseBody | ||
116 | + public BizResultVO<EasyUIDataGridVO<TpPRegionAreaDTO>> queryTpPRegionAreaForPage( | ||
117 | + @RequestBody QueryTpPRegionAreaForPageRequest request) | ||
118 | + throws Exception { | ||
119 | + logger.info("调用分页查询泊位区间信息dubbo服务入参:request={}"+JSONObject.toJSONString(request)); | ||
120 | + BizResult<PageBean<TpPRegionAreaDTO>> result = tpPRegionAreaService.queryTpPRegionAreaForPage(request); | ||
121 | + logger.info("调用分页查询泊位区间信息dubbo服务返回信息:response={}"+JSONObject.toJSONString(result)); | ||
122 | + return returnJqGridData(result, TpPRegionAreaDTO.class); | ||
123 | + } | ||
124 | + | ||
125 | +} |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/RealTimeMonitorController.java
0 → 100644
1 | +package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; | ||
2 | + | ||
3 | +import java.util.ArrayList; | ||
4 | +import java.util.HashMap; | ||
5 | +import java.util.List; | ||
6 | +import java.util.Map; | ||
7 | + | ||
8 | +import javax.validation.Valid; | ||
9 | + | ||
10 | +import org.slf4j.Logger; | ||
11 | +import org.slf4j.LoggerFactory; | ||
12 | +import org.springframework.beans.factory.annotation.Autowired; | ||
13 | +import org.springframework.beans.factory.annotation.Value; | ||
14 | +import org.springframework.stereotype.Controller; | ||
15 | +import org.springframework.util.CollectionUtils; | ||
16 | +import org.springframework.util.StringUtils; | ||
17 | +import org.springframework.web.bind.annotation.PostMapping; | ||
18 | +import org.springframework.web.bind.annotation.RequestBody; | ||
19 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
20 | +import org.springframework.web.bind.annotation.RestController; | ||
21 | + | ||
22 | +import com.alibaba.fastjson.JSONObject; | ||
23 | +import com.clouds.common.web.BizController; | ||
24 | +import com.clouds.common.web.vo.BizResultVO; | ||
25 | +import com.clouds.common.web.vo.EasyUIDataGridVO; | ||
26 | +import com.zteits.clouds.api.apibase.bean.BizResult; | ||
27 | +import com.zteits.clouds.api.apibase.bean.PageBean; | ||
28 | +import com.zteits.clouds.api.apibase.constants.ErrorType; | ||
29 | +import com.zteits.clouds.api.apibase.exception.BizException; | ||
30 | +import com.zteits.clouds.api.dto.clouds.param.RealTimeMonitoringRequest; | ||
31 | +import com.zteits.clouds.api.dto.park.dto.ParkOccupancyRateDTO; | ||
32 | +import com.zteits.clouds.api.dto.park.dto.TpPEqpLogDTO; | ||
33 | +import com.zteits.clouds.api.dto.sys.SysOpDTO; | ||
34 | +import com.zteits.clouds.api.dto.sys.SysOrgDTO; | ||
35 | +import com.zteits.clouds.api.dto.sys.SysRoleDTO; | ||
36 | +import com.zteits.clouds.api.dto.sys.param.SysOpDeleteRequest; | ||
37 | +import com.zteits.clouds.api.dto.sys.param.SysOpForPageRequest; | ||
38 | +import com.zteits.clouds.api.dto.sys.param.SysOpSaveOrModfiyRequest; | ||
39 | +import com.zteits.clouds.api.dto.sys.param.SysOrgPageQueryRequest; | ||
40 | +import com.zteits.clouds.api.dto.sys.param.SysRolePageQueryRequest; | ||
41 | +import com.zteits.clouds.api.service.park.EqpBerthsService; | ||
42 | + | ||
43 | +import io.swagger.annotations.Api; | ||
44 | +import io.swagger.annotations.ApiOperation; | ||
45 | +/** | ||
46 | + * | ||
47 | + * 企业云平台->实时监控->点位监控 | ||
48 | + * Copyright: Copyright (c) 2017 zteits | ||
49 | + * | ||
50 | + * @ClassName: RealTimeMonitorController.java | ||
51 | + * @Description: | ||
52 | + * @version: v1.0.0 | ||
53 | + * @author: langlw | ||
54 | + * @date: 2017年8月30日 下午2:50:49 | ||
55 | + * Modification History: | ||
56 | + * Date Author Version Description | ||
57 | + *---------------------------------------------------------* | ||
58 | + * 2017年8月30日 langlw v1.0.0 创建 | ||
59 | + */ | ||
60 | +@Api(value = "企业云平台->实时监控->点位监控", description = "企业云平台->实时监控->点位监控") | ||
61 | +@RestController | ||
62 | +@RequestMapping("/realTime") | ||
63 | +public class RealTimeMonitorController extends BizController { | ||
64 | + private static final Logger logger = LoggerFactory.getLogger(RealTimeMonitorController.class); | ||
65 | + @Value("${project.syscode}") | ||
66 | + private String sysCode; | ||
67 | + | ||
68 | + @Autowired | ||
69 | + private EqpBerthsService eqpBerthsService; | ||
70 | + | ||
71 | + | ||
72 | + /** | ||
73 | + * 分页查询停车场设备日志数据 | ||
74 | + * | ||
75 | + * @param request | ||
76 | + * @return | ||
77 | + * @throws Exception | ||
78 | + * langlw 2017-08-30 | ||
79 | + */ | ||
80 | + @ApiOperation("分页查询停车场设备日志数据") | ||
81 | + @PostMapping("/queryOpsBySysCode") | ||
82 | + public BizResultVO<EasyUIDataGridVO<TpPEqpLogDTO>> queryUsersPageList( | ||
83 | + @RequestBody RealTimeMonitoringRequest request) | ||
84 | + throws Exception { | ||
85 | + logger.info("调用分页查询停车场设备日志数据dubbo服务入参:request={}"+JSONObject.toJSONString(request)); | ||
86 | + BizResult<PageBean<TpPEqpLogDTO>> result = eqpBerthsService.queryParkEqpForPageByPlNo(request); | ||
87 | + logger.info("调用分页查询停车场设备日志数据dubbo服务返回信息:request={}"+JSONObject.toJSONString(result)); | ||
88 | + return returnJqGridData(result, TpPEqpLogDTO.class); | ||
89 | + } | ||
90 | + | ||
91 | + /** | ||
92 | + * 分组查询停车场占用率 | ||
93 | + * | ||
94 | + * @param request | ||
95 | + * @return | ||
96 | + * @throws Exception | ||
97 | + * langlw 2017-08-30 | ||
98 | + */ | ||
99 | + @ApiOperation("分组查询停车场占用率") | ||
100 | + @PostMapping("/queryParkOccupancyRate") | ||
101 | + public BizResultVO<List<ParkOccupancyRateDTO>> queryParkOccupancyRate( | ||
102 | + @RequestBody RealTimeMonitoringRequest request) | ||
103 | + throws Exception { | ||
104 | + if(null != request.getTime()){ | ||
105 | + throw new BizException(ErrorType.PARAMM_NULL); | ||
106 | + } | ||
107 | + logger.info("调用分组查询停车场占用率dubbo服务入参:request={}"+JSONObject.toJSONString(request)); | ||
108 | + BizResult<List<ParkOccupancyRateDTO>> result = eqpBerthsService.queryParkOccupancyRate(request); | ||
109 | + logger.info("调用分组查询停车场占用率dubbo服务返回信息:request={}"+JSONObject.toJSONString(result)); | ||
110 | + return new BizResultVO<List<ParkOccupancyRateDTO>>(result); | ||
111 | + } | ||
112 | +} |
src/main/resources/dubbo/dubbo-park-consumer.xml
@@ -147,6 +147,11 @@ | @@ -147,6 +147,11 @@ | ||
147 | <dubbo:reference id="cloudsParDurationService" interface="com.zteits.clouds.api.service.clouds.CloudsParDurationService" | 147 | <dubbo:reference id="cloudsParDurationService" interface="com.zteits.clouds.api.service.clouds.CloudsParDurationService" |
148 | version="${spring.dubbo.provider.version}" | 148 | version="${spring.dubbo.provider.version}" |
149 | timeout="30000"/> | 149 | timeout="30000"/> |
150 | + | ||
151 | + <!--企业云平台->基础信息->泊位区间管理 --> | ||
152 | + <dubbo:reference id="tpPRegionAreaService" interface="com.zteits.clouds.api.service.park.TpPRegionAreaService" | ||
153 | + version="${spring.dubbo.provider.version}" | ||
154 | + timeout="30000"/> | ||
150 | 155 | ||
151 | 156 | ||
152 | </beans> | 157 | </beans> |
153 | \ No newline at end of file | 158 | \ No newline at end of file |