Commit 9f7f3508cdc8901dbb9c58082fb2c5bfbb14aded
1
Showing
9 changed files
with
286 additions
and
29 deletions
.gitignore
src/main/java/com/zteits/irain/portal/config/RedisMsgListenerContainer.java
1 | -package com.zteits.irain.portal.config; | 1 | +/*package com.zteits.irain.portal.config; |
2 | 2 | ||
3 | import org.springframework.context.annotation.Bean; | 3 | import org.springframework.context.annotation.Bean; |
4 | import org.springframework.context.annotation.Configuration; | 4 | import org.springframework.context.annotation.Configuration; |
@@ -9,7 +9,7 @@ import org.springframework.data.redis.listener.RedisMessageListenerContainer; | @@ -9,7 +9,7 @@ import org.springframework.data.redis.listener.RedisMessageListenerContainer; | ||
9 | import com.clouds.common.constants.RedisKeyEnum; | 9 | import com.clouds.common.constants.RedisKeyEnum; |
10 | import com.zteits.irain.portal.config.listener.FreeBrethsListener; | 10 | import com.zteits.irain.portal.config.listener.FreeBrethsListener; |
11 | 11 | ||
12 | -/** | 12 | +*//** |
13 | * redis 消息队列监听容器 | 13 | * redis 消息队列监听容器 |
14 | * | 14 | * |
15 | * Copyright: Copyright (c) 2017 zteits | 15 | * Copyright: Copyright (c) 2017 zteits |
@@ -23,17 +23,17 @@ import com.zteits.irain.portal.config.listener.FreeBrethsListener; | @@ -23,17 +23,17 @@ import com.zteits.irain.portal.config.listener.FreeBrethsListener; | ||
23 | * Date Author Version Description | 23 | * Date Author Version Description |
24 | *---------------------------------------------------------* | 24 | *---------------------------------------------------------* |
25 | * 2017年6月7日 zhaowg v1.0.0 创建 | 25 | * 2017年6月7日 zhaowg v1.0.0 创建 |
26 | - */ | 26 | + *//* |
27 | @Configuration | 27 | @Configuration |
28 | public class RedisMsgListenerContainer { | 28 | public class RedisMsgListenerContainer { |
29 | 29 | ||
30 | - /** | 30 | + *//** |
31 | * 空闲车位监听容器 | 31 | * 空闲车位监听容器 |
32 | * @param connectionFactory | 32 | * @param connectionFactory |
33 | * @param brethsListener | 33 | * @param brethsListener |
34 | * @return | 34 | * @return |
35 | * 2017年6月7日 zhaowg | 35 | * 2017年6月7日 zhaowg |
36 | - */ | 36 | + *//* |
37 | @Bean | 37 | @Bean |
38 | RedisMessageListenerContainer freeBrethscontainer(RedisConnectionFactory connectionFactory,FreeBrethsListener brethsListener) { | 38 | RedisMessageListenerContainer freeBrethscontainer(RedisConnectionFactory connectionFactory,FreeBrethsListener brethsListener) { |
39 | RedisMessageListenerContainer container = new RedisMessageListenerContainer(); | 39 | RedisMessageListenerContainer container = new RedisMessageListenerContainer(); |
@@ -42,3 +42,4 @@ public class RedisMsgListenerContainer { | @@ -42,3 +42,4 @@ public class RedisMsgListenerContainer { | ||
42 | return container; | 42 | return container; |
43 | } | 43 | } |
44 | } | 44 | } |
45 | +*/ | ||
45 | \ No newline at end of file | 46 | \ No newline at end of file |
src/main/java/com/zteits/irain/portal/config/listener/FreeBrethsListener.java
1 | -package com.zteits.irain.portal.config.listener; | 1 | +/*package com.zteits.irain.portal.config.listener; |
2 | 2 | ||
3 | import java.util.ArrayList; | 3 | import java.util.ArrayList; |
4 | import java.util.List; | 4 | import java.util.List; |
@@ -20,7 +20,7 @@ import com.zteits.irain.portal.service.interfaces.induction.InductionService; | @@ -20,7 +20,7 @@ import com.zteits.irain.portal.service.interfaces.induction.InductionService; | ||
20 | import com.zteits.irain.portal.service.interfaces.induction.param.DoLevelTwoAndThreeInductionReleaseBatchRequest; | 20 | import com.zteits.irain.portal.service.interfaces.induction.param.DoLevelTwoAndThreeInductionReleaseBatchRequest; |
21 | import com.zteits.irain.portal.service.interfaces.induction.param.InductionRelease; | 21 | import com.zteits.irain.portal.service.interfaces.induction.param.InductionRelease; |
22 | 22 | ||
23 | -/** | 23 | +*//** |
24 | * 空闲车位监听器<br> | 24 | * 空闲车位监听器<br> |
25 | * | 25 | * |
26 | * Copyright: Copyright (c) 2017 zteits | 26 | * Copyright: Copyright (c) 2017 zteits |
@@ -34,7 +34,7 @@ import com.zteits.irain.portal.service.interfaces.induction.param.InductionRelea | @@ -34,7 +34,7 @@ import com.zteits.irain.portal.service.interfaces.induction.param.InductionRelea | ||
34 | * Date Author Version Description | 34 | * Date Author Version Description |
35 | *---------------------------------------------------------* | 35 | *---------------------------------------------------------* |
36 | * 2017年6月7日 zhaowg v1.0.0 创建 | 36 | * 2017年6月7日 zhaowg v1.0.0 创建 |
37 | - */ | 37 | + *//* |
38 | @Component | 38 | @Component |
39 | public class FreeBrethsListener implements MessageListener{ | 39 | public class FreeBrethsListener implements MessageListener{ |
40 | private static final Logger logger = LoggerFactory.getLogger(FreeBrethsListener.class); | 40 | private static final Logger logger = LoggerFactory.getLogger(FreeBrethsListener.class); |
@@ -65,3 +65,4 @@ public class FreeBrethsListener implements MessageListener{ | @@ -65,3 +65,4 @@ public class FreeBrethsListener implements MessageListener{ | ||
65 | inductionService.doLevelTwoAndThreeInductionReleaseBatch(releaseBatchRequest); | 65 | inductionService.doLevelTwoAndThreeInductionReleaseBatch(releaseBatchRequest); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | +*/ | ||
68 | \ No newline at end of file | 69 | \ No newline at end of file |
src/main/java/com/zteits/irain/portal/vo/govclouds/ParkingDeviceVO.java
0 → 100644
1 | +package com.zteits.irain.portal.vo.govclouds; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | + | ||
5 | +public class ParkingDeviceVO implements Serializable { | ||
6 | + | ||
7 | + /** | ||
8 | + * | ||
9 | + */ | ||
10 | + private static final long serialVersionUID = 1L; | ||
11 | + /**早先数量*/ | ||
12 | + private Integer onlineCount; | ||
13 | + /**总量*/ | ||
14 | + private Integer allCount; | ||
15 | + /**类型*/ | ||
16 | + private Integer type; | ||
17 | + | ||
18 | + public Integer getOnlineCount() { | ||
19 | + return onlineCount; | ||
20 | + } | ||
21 | + public void setOnlineCount(Integer onlineCount) { | ||
22 | + this.onlineCount = onlineCount; | ||
23 | + } | ||
24 | + public Integer getAllCount() { | ||
25 | + return allCount; | ||
26 | + } | ||
27 | + public void setAllCount(Integer allCount) { | ||
28 | + this.allCount = allCount; | ||
29 | + } | ||
30 | + public Integer getType() { | ||
31 | + return type; | ||
32 | + } | ||
33 | + public void setType(Integer type) { | ||
34 | + this.type = type; | ||
35 | + } | ||
36 | + | ||
37 | +} |
src/main/java/com/zteits/irain/portal/vo/govclouds/ParkingStatisVO.java
0 → 100644
1 | +package com.zteits.irain.portal.vo.govclouds; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.List; | ||
5 | + | ||
6 | +import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO; | ||
7 | + | ||
8 | +public class ParkingStatisVO implements Serializable{ | ||
9 | + | ||
10 | + /** | ||
11 | + * | ||
12 | + */ | ||
13 | + private static final long serialVersionUID = 1L; | ||
14 | + | ||
15 | + | ||
16 | + private List<ParkingLotUseStatisticDTO> statisList; | ||
17 | + /**占用率**/ | ||
18 | + private Double avgOccupyRate; | ||
19 | + /**周转率*/ | ||
20 | + private Double avgTurnoverRate; | ||
21 | + /**空闲车位*/ | ||
22 | + private Integer freeParkingSpace; | ||
23 | + /**停车场设备信息**/ | ||
24 | + private List<ParkingDeviceVO> deviceVoList; | ||
25 | + | ||
26 | + | ||
27 | + public Integer getFreeParkingSpace() { | ||
28 | + return freeParkingSpace; | ||
29 | + } | ||
30 | + public void setFreeParkingSpace(Integer freeParkingSpace) { | ||
31 | + this.freeParkingSpace = freeParkingSpace; | ||
32 | + } | ||
33 | + public List<ParkingDeviceVO> getDeviceVoList() { | ||
34 | + return deviceVoList; | ||
35 | + } | ||
36 | + public void setDeviceVoList(List<ParkingDeviceVO> deviceVoList) { | ||
37 | + this.deviceVoList = deviceVoList; | ||
38 | + } | ||
39 | + public List<ParkingLotUseStatisticDTO> getStatisList() { | ||
40 | + return statisList; | ||
41 | + } | ||
42 | + public void setStatisList(List<ParkingLotUseStatisticDTO> statisList) { | ||
43 | + this.statisList = statisList; | ||
44 | + } | ||
45 | + public Double getAvgOccupyRate() { | ||
46 | + return avgOccupyRate; | ||
47 | + } | ||
48 | + public void setAvgOccupyRate(Double avgOccupyRate) { | ||
49 | + this.avgOccupyRate = avgOccupyRate; | ||
50 | + } | ||
51 | + public Double getAvgTurnoverRate() { | ||
52 | + return avgTurnoverRate; | ||
53 | + } | ||
54 | + public void setAvgTurnoverRate(Double avgTurnoverRate) { | ||
55 | + this.avgTurnoverRate = avgTurnoverRate; | ||
56 | + } | ||
57 | + | ||
58 | +} |
src/main/java/com/zteits/irain/portal/web/govclouds/DataGeneralizeController.java
@@ -714,13 +714,12 @@ public class DataGeneralizeController { | @@ -714,13 +714,12 @@ public class DataGeneralizeController { | ||
714 | //分->元 | 714 | //分->元 |
715 | BigDecimal hundred = new BigDecimal("100"); | 715 | BigDecimal hundred = new BigDecimal("100"); |
716 | OrderTransDTO o = orderDTO.getData(); | 716 | OrderTransDTO o = orderDTO.getData(); |
717 | - o.setAliTotalAmount(o.getAliTotalAmount() == null ? new BigDecimal("0") : o.getAliTotalAmount().divide(hundred)); | ||
718 | - o.setCashTotalAmount(o.getCashTotalAmount() == null ? new BigDecimal("0") : o.getCashTotalAmount().divide(hundred)); | ||
719 | - o.setPayedTotalAmount(o.getPayedTotalAmount() == null ? new BigDecimal("0") : o.getPayedTotalAmount().divide(hundred)); | ||
720 | - o.setWxTotalAmount(o.getWxTotalAmount() == null ? new BigDecimal("0") : o.getWxTotalAmount().divide(hundred)); | ||
721 | - o.setYlTotalAmount(o.getYlTotalAmount() == null ? new BigDecimal("0") : o.getYlTotalAmount().divide(hundred)); | 717 | + o.setAliTotalAmount(o.getAliTotalAmount()!=null?o.getAliTotalAmount().divide(hundred):new BigDecimal("0")); |
718 | + o.setCashTotalAmount(o.getCashTotalAmount()!=null?o.getCashTotalAmount().divide(hundred):new BigDecimal("0")); | ||
719 | + o.setPayedTotalAmount(o.getPayedTotalAmount()!=null?o.getPayedTotalAmount().divide(hundred):new BigDecimal("0")); | ||
720 | + o.setWxTotalAmount(o.getWxTotalAmount()!=null?o.getWxTotalAmount().divide(hundred):new BigDecimal("0")); | ||
721 | + o.setYlTotalAmount(o.getYlTotalAmount()!=null?o.getYlTotalAmount().divide(hundred):new BigDecimal("0")); | ||
722 | orderDTO.setData(o); | 722 | orderDTO.setData(o); |
723 | - | ||
724 | logger.info("调用后场dubbo服务,响应为: result={}", JSONObject.toJSONString(orderDTO)); | 723 | logger.info("调用后场dubbo服务,响应为: result={}", JSONObject.toJSONString(orderDTO)); |
725 | return orderDTO; | 724 | return orderDTO; |
726 | } | 725 | } |
src/main/java/com/zteits/irain/portal/web/govclouds/ParkingContrailController.java
@@ -18,17 +18,41 @@ import org.springframework.web.bind.annotation.RequestMapping; | @@ -18,17 +18,41 @@ import org.springframework.web.bind.annotation.RequestMapping; | ||
18 | import org.springframework.web.bind.annotation.ResponseBody; | 18 | import org.springframework.web.bind.annotation.ResponseBody; |
19 | 19 | ||
20 | import com.alibaba.fastjson.JSONObject; | 20 | import com.alibaba.fastjson.JSONObject; |
21 | +import com.clouds.common.cache.park.ParkFreeBerthsCacheUtil; | ||
22 | +import com.clouds.common.utils.AppRsesultUtil; | ||
23 | +import com.clouds.common.utils.DateUtil; | ||
21 | import com.clouds.common.web.BizController; | 24 | import com.clouds.common.web.BizController; |
22 | import com.clouds.common.web.vo.BizResultVO; | 25 | import com.clouds.common.web.vo.BizResultVO; |
26 | +import com.google.common.collect.Lists; | ||
27 | +import com.xiaoleilu.hutool.util.CollectionUtil; | ||
23 | import com.zteits.clouds.api.apibase.bean.BizResult; | 28 | import com.zteits.clouds.api.apibase.bean.BizResult; |
24 | import com.zteits.clouds.api.apibase.bean.PageBean; | 29 | import com.zteits.clouds.api.apibase.bean.PageBean; |
30 | +import com.zteits.clouds.api.apibase.constants.BasicEnum; | ||
31 | +import com.zteits.clouds.api.apibase.constants.ErrorType; | ||
32 | +import com.zteits.clouds.api.dto.govclouds.dto.ParkEqpAndPDACountDTO; | ||
25 | import com.zteits.clouds.api.dto.govclouds.dto.ParkingCountForTypeDTO; | 33 | import com.zteits.clouds.api.dto.govclouds.dto.ParkingCountForTypeDTO; |
26 | -import com.zteits.clouds.api.dto.govclouds.dto.ParkingTrackDTO; | 34 | +import com.zteits.clouds.api.dto.govclouds.param.QueryParkEqpAndPDACountRequest; |
27 | import com.zteits.clouds.api.dto.govclouds.param.QueryParkingCountRequest; | 35 | import com.zteits.clouds.api.dto.govclouds.param.QueryParkingCountRequest; |
28 | -import com.zteits.clouds.api.dto.govclouds.param.QueryParkingTrackRequest; | 36 | +import com.zteits.clouds.api.dto.park.dto.BerthsDTO; |
37 | +import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO; | ||
38 | +import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO; | ||
39 | +import com.zteits.clouds.api.dto.park.dto.TodayVehicleFlowOccupyRateAndTurnOverDTO; | ||
40 | +import com.zteits.clouds.api.dto.park.param.CommonPlnosQueryRequest; | ||
41 | +import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest; | ||
42 | +import com.zteits.clouds.api.dto.park.param.QueryParkLotInfoByPkNoRequest; | ||
43 | +import com.zteits.clouds.api.dto.pay.TdCFileDTO; | ||
44 | +import com.zteits.clouds.api.dto.pay.param.SysFileGetBySourceIdAndTypeRequest; | ||
29 | import com.zteits.clouds.api.service.govclouds.ParkPreferenceService; | 45 | import com.zteits.clouds.api.service.govclouds.ParkPreferenceService; |
46 | +import com.zteits.clouds.api.service.park.BerthManageService; | ||
47 | +import com.zteits.clouds.api.service.park.ParkingLotEqpService; | ||
48 | +import com.zteits.clouds.api.service.park.ParkingLotQueryService; | ||
49 | +import com.zteits.clouds.api.service.park.ParkingLotUseStatisticService; | ||
50 | +import com.zteits.clouds.api.service.park.TpPPdaService; | ||
51 | +import com.zteits.clouds.api.service.pay.TdCFileService; | ||
30 | import com.zteits.irain.portal.vo.govclouds.ParkingBusiCircleForTypeVO; | 52 | import com.zteits.irain.portal.vo.govclouds.ParkingBusiCircleForTypeVO; |
31 | import com.zteits.irain.portal.vo.govclouds.ParkingCountForTypeVO; | 53 | import com.zteits.irain.portal.vo.govclouds.ParkingCountForTypeVO; |
54 | +import com.zteits.irain.portal.vo.govclouds.ParkingDeviceVO; | ||
55 | +import com.zteits.irain.portal.vo.govclouds.ParkingStatisVO; | ||
32 | 56 | ||
33 | import io.swagger.annotations.Api; | 57 | import io.swagger.annotations.Api; |
34 | import io.swagger.annotations.ApiOperation; | 58 | import io.swagger.annotations.ApiOperation; |
@@ -55,6 +79,23 @@ public class ParkingContrailController extends BizController{ | @@ -55,6 +79,23 @@ public class ParkingContrailController extends BizController{ | ||
55 | private static final Logger logger = LoggerFactory.getLogger(ParkingContrailController.class); | 79 | private static final Logger logger = LoggerFactory.getLogger(ParkingContrailController.class); |
56 | @Autowired | 80 | @Autowired |
57 | private ParkPreferenceService parkPreferenceService; | 81 | private ParkPreferenceService parkPreferenceService; |
82 | + //停车场基本信息查询服务 | ||
83 | + @Autowired | ||
84 | + private ParkingLotQueryService parkingLotQueryService; | ||
85 | + //附件查询服务-查询停车场图片 | ||
86 | + @Autowired | ||
87 | + private TdCFileService tdCFileService; | ||
88 | + //停车场泊位信息查询 | ||
89 | + @Autowired | ||
90 | + private BerthManageService berthManageService; | ||
91 | + //停车场空置率 周转率查询 | ||
92 | + @Autowired | ||
93 | + private ParkingLotUseStatisticService parkingLotUseStatisticService; | ||
94 | + @Autowired | ||
95 | + //硬件设备服务 | ||
96 | + private ParkingLotEqpService parkingLotEqpService; | ||
97 | + @Autowired | ||
98 | + private TpPPdaService tpPPdaService; | ||
58 | 99 | ||
59 | @ApiOperation("停车编好->饼图") | 100 | @ApiOperation("停车编好->饼图") |
60 | @PostMapping("/parkingCountForPlType") | 101 | @PostMapping("/parkingCountForPlType") |
@@ -107,20 +148,135 @@ public class ParkingContrailController extends BizController{ | @@ -107,20 +148,135 @@ public class ParkingContrailController extends BizController{ | ||
107 | return result; | 148 | return result; |
108 | } | 149 | } |
109 | 150 | ||
110 | - @ApiOperation("停车车轨迹") | ||
111 | - @PostMapping("/queryParkingTrack") | ||
112 | - @ResponseBody | ||
113 | - public BizResultVO<ParkingTrackDTO> queryParkingTrack(@RequestBody QueryParkingTrackRequest queryParkingTrackRequest,HttpServletRequest request, HttpServletResponse response) throws Exception{ | ||
114 | - BizResultVO<List<ParkingTrackDTO>> result = new BizResultVO<List<ParkingTrackDTO>>(); | ||
115 | - logger.info("---begin停车轨迹-->根据车牌查询该车的行车轨迹Controller,入参={}",JSONObject.toJSON(queryParkingTrackRequest)); | ||
116 | - BizResult<ParkingTrackDTO> bizResult =parkPreferenceService.queryParkingTrack(queryParkingTrackRequest); | ||
117 | - logger.info("---begin停车轨迹-->根据车牌查询该车的行车轨迹Controller,结果={}",result); | ||
118 | - return new BizResultVO<ParkingTrackDTO>(bizResult); | ||
119 | - } | ||
120 | 151 | ||
121 | 152 | ||
153 | + @ApiOperation("停车场基本信息查询") | ||
154 | + @PostMapping("/queryParkingBaseInfo") | ||
155 | + @ResponseBody | ||
156 | + public BizResultVO<ParkingLotDTO> queryParkingBaseInfo(@RequestBody QueryParkLotInfoByPkNoRequest queryParkLotInfoByPkNoRequest,HttpServletRequest request, HttpServletResponse response) throws Exception{ | ||
157 | + BizResultVO<ParkingLotDTO> result = new BizResultVO<ParkingLotDTO>(); | ||
158 | + logger.info("停车场停车资源-基本信息查询 Controller,入参={}",JSONObject.toJSON(queryParkLotInfoByPkNoRequest)); | ||
159 | + | ||
160 | + queryParkLotInfoByPkNoRequest.setSysCode(BasicEnum.SYS_CODE.getValue()); | ||
161 | + logger.debug("开始 查询停车场信息:" + JSONObject.toJSONString(queryParkLotInfoByPkNoRequest)); | ||
162 | + BizResult<ParkingLotDTO> rtMap = parkingLotQueryService.QueryParkingLotByPkNo(queryParkLotInfoByPkNoRequest); | ||
163 | + logger.debug("结束 查询停车场信息:" + JSONObject.toJSONString(rtMap)); | ||
164 | + ParkingLotDTO parkingLotDTO = new ParkingLotDTO(); | ||
165 | + if(rtMap.isSuccess()){ | ||
166 | + parkingLotDTO =rtMap.getData(); | ||
167 | + if(parkingLotDTO ==null){ | ||
168 | + AppRsesultUtil.fail(ErrorType.RESOURCE_NOT_EXISTS.getCode(), ErrorType.RESOURCE_NOT_EXISTS.getMsg()); | ||
169 | + } | ||
170 | + } | ||
171 | + Integer freeParkingSpace = ParkFreeBerthsCacheUtil.getFreeBerthsByPlNo(queryParkLotInfoByPkNoRequest.getPklNo()); | ||
172 | + rtMap.getData().setBerthNum(freeParkingSpace); | ||
173 | + | ||
174 | + logger.debug("start 停车场图片查询"); | ||
175 | + SysFileGetBySourceIdAndTypeRequest sysFileGetBySourceIdAndTypeRequest = new SysFileGetBySourceIdAndTypeRequest(); | ||
176 | + sysFileGetBySourceIdAndTypeRequest.setSourceId(queryParkLotInfoByPkNoRequest.getPklNo()); | ||
177 | + sysFileGetBySourceIdAndTypeRequest.setSysCode(queryParkLotInfoByPkNoRequest.getSysCode()); | ||
178 | + BizResult<List<TdCFileDTO>> fileList = tdCFileService.getFilesBySourceIdAndType(sysFileGetBySourceIdAndTypeRequest); | ||
179 | + | ||
180 | + List<String> picUrls = Lists.newArrayList(); | ||
181 | + if(fileList.isSuccess() && CollectionUtil.isNotEmpty(fileList.getData())){ | ||
182 | + fileList.getData().forEach(file->picUrls.add(file.getFilePath())); | ||
183 | + }else{ | ||
184 | + /** 如果没有查询停车场的真实图片--则展示默认的停车场图片**/ | ||
185 | + SysFileGetBySourceIdAndTypeRequest sysFileRequest = new SysFileGetBySourceIdAndTypeRequest(); | ||
186 | + /*** '停车场类型:1:路内(占用道路停车位),2-路外',*/ | ||
187 | + if(rtMap.getData().getPlType()==1){ | ||
188 | + sysFileRequest.setSourceId("defaul_park_pic_out"); | ||
189 | + }else{ | ||
190 | + sysFileRequest.setSourceId("defaul_park_pic_in"); | ||
191 | + } | ||
192 | + sysFileRequest.setFileType(1); | ||
193 | + sysFileRequest.setSysCode(queryParkLotInfoByPkNoRequest.getSysCode()); | ||
194 | + BizResult<List<TdCFileDTO>> defaultfileList = tdCFileService.getFilesBySourceIdAndType(sysFileRequest); | ||
195 | + if(defaultfileList.isSuccess() && CollectionUtil.isNotEmpty(defaultfileList.getData())){ | ||
196 | + defaultfileList.getData().forEach(file->picUrls.add(file.getFilePath())); | ||
197 | + } | ||
198 | + } | ||
199 | + logger.debug("end 停车场图片查询:{}",JSONObject.toJSONString(picUrls)); | ||
200 | + | ||
201 | + BizResult<List<BerthsDTO>> rsMaplist = berthManageService.queryBerthsByPlNo(queryParkLotInfoByPkNoRequest); | ||
202 | + if(rsMaplist.isSuccess() && CollectionUtil.isNotEmpty(rsMaplist.getData())){ | ||
203 | + rtMap.getData().setBerths(rsMaplist.getData()); | ||
204 | + } | ||
205 | + | ||
206 | + result.setData(rtMap.getData()); | ||
207 | + result.getData().setPicUrls(picUrls); | ||
208 | + return result; | ||
209 | + } | ||
122 | 210 | ||
123 | 211 | ||
212 | + @ApiOperation("停车场停车数据查询") | ||
213 | + @PostMapping("/queryParkingdatas") | ||
214 | + @ResponseBody | ||
215 | + public BizResultVO<ParkingStatisVO> queryParkingdatas(@RequestBody QueryParkLotInfoByPkNoRequest queryParkLotInfoByPkNoRequest,HttpServletRequest request, HttpServletResponse response) throws Exception{ | ||
216 | + BizResultVO<ParkingStatisVO> result = new BizResultVO<ParkingStatisVO>(); | ||
217 | + | ||
218 | + List<ParkingDeviceVO> deviceVoList = Lists.newArrayList(); | ||
219 | + logger.info("停车场停车资源-停车场停车数据查询 Controller,入参={}",JSONObject.toJSON(queryParkLotInfoByPkNoRequest)); | ||
220 | + ParkingStatisVO vo = new ParkingStatisVO(); | ||
221 | + List<String> plNos = Lists.newArrayList(); | ||
222 | + plNos.add(queryParkLotInfoByPkNoRequest.getPklNo()); | ||
223 | + CommonPlnosQueryRequest commonPlnosQueryRequest = new CommonPlnosQueryRequest(); | ||
224 | + commonPlnosQueryRequest.setPlNos(plNos); | ||
225 | + commonPlnosQueryRequest.setSysCode(queryParkLotInfoByPkNoRequest.getSysCode()); | ||
226 | + BizResult<List<TodayVehicleFlowOccupyRateAndTurnOverDTO>> rsList = parkingLotUseStatisticService.queryTodayVehicleFlowOccupyRateAndTurnOver(commonPlnosQueryRequest); | ||
227 | + if(rsList.isSuccess() && CollectionUtil.isNotEmpty(rsList.getData())){ | ||
228 | + TodayVehicleFlowOccupyRateAndTurnOverDTO dto = rsList.getData().get(0); | ||
229 | + vo.setAvgOccupyRate(dto.getAvgOccupyRate()); | ||
230 | + vo.setAvgTurnoverRate(dto.getAvgTurnoverRate()); | ||
231 | + } | ||
232 | + | ||
233 | + ParkingLotUseStatisticForPageRequest staticRequest = new ParkingLotUseStatisticForPageRequest(); | ||
234 | + staticRequest.setBeginTime(DateUtil.getTimeBeforeDay(DateUtil.getSysDate())); | ||
235 | + staticRequest.setEndTime(DateUtil.getSysDate()); | ||
236 | + //staticRequest.setQueryKind(2); | ||
237 | + staticRequest.setPlNos(plNos); | ||
238 | + staticRequest.getBaseRequest().setPageSize(100); | ||
239 | + staticRequest.setSysCode(queryParkLotInfoByPkNoRequest.getSysCode()); | ||
240 | + BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotUseStatisticService | ||
241 | + .queryParkingLotUseStatisticForPage(staticRequest); | ||
242 | + /**周转率,空置率不为空**/ | ||
243 | + if(bizResult.isSuccess() && CollectionUtil.isNotEmpty(bizResult.getData().getDataList())){ | ||
244 | + vo.setStatisList(bizResult.getData().getDataList()); | ||
245 | + } | ||
246 | + | ||
247 | + QueryParkEqpAndPDACountRequest queryParkEqpAndPDACountRequest = new QueryParkEqpAndPDACountRequest(); | ||
248 | + queryParkEqpAndPDACountRequest.setPlNos(plNos); | ||
249 | + queryParkEqpAndPDACountRequest.setSysCode(queryParkLotInfoByPkNoRequest.getSysCode()); | ||
250 | + logger.info("停车场停车资源-停车场停车数据查询 -查询硬件设备,入参={}",JSONObject.toJSON(queryParkEqpAndPDACountRequest)); | ||
251 | + BizResult<List<ParkEqpAndPDACountDTO>> eqpList = parkingLotEqpService.queryParkEqpCountByPlNos(queryParkEqpAndPDACountRequest); | ||
252 | + logger.info("停车场停车资源-停车场停车数据查询 -查询硬件设备 地磁,出参={}",JSONObject.toJSON(eqpList)); | ||
253 | + if(eqpList.isSuccess() && CollectionUtil.isNotEmpty(eqpList.getData())){ | ||
254 | + eqpList.getData().forEach(eqp->{ | ||
255 | + ParkingDeviceVO device = new ParkingDeviceVO(); | ||
256 | + device.setType(eqp.getEqpType()); | ||
257 | + device.setAllCount(eqp.getAllEqpCount()); | ||
258 | + device.setOnlineCount(eqp.getOnlineEqpCount()); | ||
259 | + deviceVoList.add(device); | ||
260 | + }); | ||
261 | + } | ||
262 | + BizResult<List<ParkEqpAndPDACountDTO>> pdaList = tpPPdaService.queryPDACountByPlNosAndPdaType(queryParkEqpAndPDACountRequest); | ||
263 | + logger.info("停车场停车资源-停车场停车数据查询 -查询硬件设备 PDA等,出参={}",JSONObject.toJSON(pdaList)); | ||
264 | + if(pdaList.isSuccess() && CollectionUtil.isNotEmpty(pdaList.getData())){ | ||
265 | + pdaList.getData().forEach(pda->{ | ||
266 | + ParkingDeviceVO device = new ParkingDeviceVO(); | ||
267 | + device.setType(pda.getEqpType()); | ||
268 | + device.setAllCount(pda.getAllEqpCount()); | ||
269 | + device.setOnlineCount(pda.getOnlineEqpCount()); | ||
270 | + deviceVoList.add(device); | ||
271 | + }); | ||
272 | + } | ||
273 | + /**获取停车场的空闲车位*/ | ||
274 | + Integer freeParkingSpace = ParkFreeBerthsCacheUtil.getFreeBerthsByPlNo(queryParkLotInfoByPkNoRequest.getPklNo()); | ||
275 | + vo.setFreeParkingSpace(freeParkingSpace); | ||
276 | + vo.setDeviceVoList(deviceVoList); | ||
277 | + result.setData(vo); | ||
278 | + return result; | ||
279 | + } | ||
124 | 280 | ||
125 | } | 281 | } |
126 | 282 |
src/main/resources/application.properties
1 | -project.syscode=zteits-gcp-portal | ||
2 | -spring.application.name=zteits-gcp-portal | 1 | +project.syscode=zteits-park-portal |
2 | +spring.application.name=zteits-park-portal | ||
3 | server.port=8094 | 3 | server.port=8094 |
4 | 4 | ||
5 | # logging | 5 | # logging |
6 | logging.level.root=info | 6 | logging.level.root=info |
7 | #logging.level.org.springframework.web=DEBUG | 7 | #logging.level.org.springframework.web=DEBUG |
8 | logging.level.com.zteits.irain.portal=debug | 8 | logging.level.com.zteits.irain.portal=debug |
9 | -logging.path=./logs/${spring.application.name} | 9 | +#logging.path=${user.home}/logs |
10 | logging.file=${spring.application.name}.log | 10 | logging.file=${spring.application.name}.log |
11 | logging.config=classpath:logback-spring.xml | 11 | logging.config=classpath:logback-spring.xml |
12 | 12 |
src/main/resources/dubbo/dubbo-park-consumer.xml
@@ -138,6 +138,9 @@ | @@ -138,6 +138,9 @@ | ||
138 | version="${spring.dubbo.provider.version}" | 138 | version="${spring.dubbo.provider.version}" |
139 | timeout="30000"/> | 139 | timeout="30000"/> |
140 | 140 | ||
141 | + <dubbo:reference id="berthManageService" interface="com.zteits.clouds.api.service.park.BerthManageService" | ||
142 | + version="${spring.dubbo.provider.version}" | ||
143 | + timeout="30000"/> | ||
141 | 144 | ||
142 | <!-- PDA管理 --> | 145 | <!-- PDA管理 --> |
143 | <dubbo:reference id="tpPPdaService" interface="com.zteits.clouds.api.service.park.TpPPdaService" | 146 | <dubbo:reference id="tpPPdaService" interface="com.zteits.clouds.api.service.park.TpPPdaService" |