Commit 9c44aec3ea9f6a46ef7d2c31545ffec58f0a4be4
Merge branch 'branch_0808' of http://192.168.1.195:9998/ZTEITS-Developers/zteits…
…-bcp-portal.git into branch_0808
Showing
3 changed files
with
89 additions
and
5 deletions
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/ParkLotEqpTypeCountVO.java
0 → 100644
1 | +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic; | |
2 | + | |
3 | +/** | |
4 | + * 通过停车场编号统计设备类型数量 | |
5 | + * | |
6 | + * Copyright: Copyright (c) 2017 zteits | |
7 | + * | |
8 | + * @ClassName: ParkLotEqpTypeCountVO.java | |
9 | + * @Description: | |
10 | + * @version: v1.0.0 | |
11 | + * @author: wangfei | |
12 | + * @date: 2017年8月18日 下午2:31:24 | |
13 | + * Modification History: | |
14 | + * Date Author Version Description | |
15 | + *---------------------------------------------------------* | |
16 | + * 2017年6月29日 wangfei v1.0.0 创建 | |
17 | + */ | |
18 | +public class ParkLotEqpTypeCountVO { | |
19 | + | |
20 | + | |
21 | + /**设备类型:1-地磁*/ | |
22 | + private Integer eqpType; | |
23 | + /**设备状态:1-未安装,2-使用中,3-损坏*/ | |
24 | + private Integer eqpState; | |
25 | + /**个数*/ | |
26 | + private Integer eqpNum; | |
27 | + | |
28 | + public Integer getEqpState() { | |
29 | + return eqpState; | |
30 | + } | |
31 | + public void setEqpState(Integer eqpState) { | |
32 | + this.eqpState = eqpState; | |
33 | + } | |
34 | + | |
35 | + public Integer getEqpType() { | |
36 | + return eqpType; | |
37 | + } | |
38 | + public void setEqpType(Integer eqpType) { | |
39 | + this.eqpType = eqpType; | |
40 | + } | |
41 | + public Integer getEqpNum() { | |
42 | + return eqpNum; | |
43 | + } | |
44 | + public void setEqpNum(Integer eqpNum) { | |
45 | + this.eqpNum = eqpNum; | |
46 | + } | |
47 | + | |
48 | +} | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/IndexPageStatisticController.java
... | ... | @@ -13,10 +13,12 @@ import javax.validation.Valid; |
13 | 13 | |
14 | 14 | import org.slf4j.Logger; |
15 | 15 | import org.slf4j.LoggerFactory; |
16 | +import org.springframework.beans.BeanUtils; | |
16 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
17 | 18 | import org.springframework.web.bind.annotation.PostMapping; |
18 | 19 | import org.springframework.web.bind.annotation.RequestBody; |
19 | 20 | import org.springframework.web.bind.annotation.RequestMapping; |
21 | +import org.springframework.web.bind.annotation.ResponseBody; | |
20 | 22 | import org.springframework.web.bind.annotation.RestController; |
21 | 23 | |
22 | 24 | import com.alibaba.dubbo.common.utils.CollectionUtils; |
... | ... | @@ -36,12 +38,15 @@ import com.zteits.clouds.api.dto.clouds.dto.CustIncomeForPayTypeDTO; |
36 | 38 | import com.zteits.clouds.api.dto.clouds.dto.CustIncomeTotalDTO; |
37 | 39 | import com.zteits.clouds.api.dto.clouds.dto.CustIncomeTotalParkDTO; |
38 | 40 | import com.zteits.clouds.api.dto.clouds.param.CustIncomeTotalQueryRequset; |
41 | +import com.zteits.clouds.api.dto.park.dto.ParkLotEqpTypeCountStatisticByCountryDTO; | |
39 | 42 | import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO; |
40 | 43 | import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO; |
44 | +import com.zteits.clouds.api.dto.park.param.EqpTypeQueryByPlNosRequest; | |
41 | 45 | import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest; |
42 | 46 | import com.zteits.clouds.api.dto.park.param.RealTimeVehicleFlowQueryRequest; |
43 | 47 | import com.zteits.clouds.api.service.clouds.CustIncomeService; |
44 | 48 | import com.zteits.clouds.api.service.park.IInOutParkingService; |
49 | +import com.zteits.clouds.api.service.park.ParkingLotEqpService; | |
45 | 50 | import com.zteits.clouds.api.service.park.ParkingLotUseStatisticService; |
46 | 51 | import com.zteits.irain.portal.constant.ParkConstant; |
47 | 52 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.BerthsAndFlowLineChartVO; |
... | ... | @@ -50,6 +55,7 @@ import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.CustInco |
50 | 55 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.CustIncomeTotalVO; |
51 | 56 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO; |
52 | 57 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO.SerieVO; |
58 | +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.ParkLotEqpTypeCountVO; | |
53 | 59 | |
54 | 60 | import io.swagger.annotations.ApiOperation; |
55 | 61 | |
... | ... | @@ -81,6 +87,8 @@ public class IndexPageStatisticController extends BizController { |
81 | 87 | private IInOutParkingService iInOutParkingService; |
82 | 88 | @Autowired |
83 | 89 | private ParkingLotUseStatisticService parkingLotStatisticService; |
90 | + @Autowired | |
91 | + private ParkingLotEqpService parkingLotEqpService; | |
84 | 92 | |
85 | 93 | /** |
86 | 94 | * 云平台首页->企业客户负责所有的停车场汇总.<br/> |
... | ... | @@ -438,12 +446,14 @@ public class IndexPageStatisticController extends BizController { |
438 | 446 | } |
439 | 447 | Double totalfreeRatio = 0.00; |
440 | 448 | for (ParkingLotUseStatisticDTO statisticDTO : pageBean.getDataList()) { |
441 | - totalfreeRatio += this.weightForFreeRation(statisticDTO.getStatisticBeginTime(), | |
442 | - statisticDTO.getFreeRatio(), statisticDTO.getPlNo()); | |
449 | + totalfreeRatio += statisticDTO.getFreeRatio(); | |
450 | + //暂时不加权 | |
451 | + //this.weightForFreeRation(statisticDTO.getStatisticBeginTime(), | |
452 | + //statisticDTO.getFreeRatio(), statisticDTO.getPlNo()); | |
443 | 453 | } |
444 | 454 | logger.info("加权后的空置率之和:" + totalfreeRatio + " 时间戳个数:" + pageBean.getDataList().size()); |
445 | 455 | Double avgFreeRation = totalfreeRatio / pageBean.getDataList().size(); |
446 | - String result = String.format("%.2f", avgFreeRation); | |
456 | + String result = String.format("%.2f", avgFreeRation*100); | |
447 | 457 | return new BizResultVO<String>().setData(result); |
448 | 458 | } |
449 | 459 | |
... | ... | @@ -481,4 +491,27 @@ public class IndexPageStatisticController extends BizController { |
481 | 491 | System.out.println(new BigDecimal("00.0").doubleValue() == 0); |
482 | 492 | } |
483 | 493 | |
494 | + /** | |
495 | + * @param request | |
496 | + * @return | |
497 | + * 2017年8月18日 wangfei | |
498 | + */ | |
499 | + @ApiOperation(value="根据停车场编号统计设备数量") | |
500 | + @PostMapping("statisticParkLotEqpCountByPlNos") | |
501 | + @ResponseBody | |
502 | + public BizResult<List<ParkLotEqpTypeCountVO>> statisticParkLotEqpCountByPlNos(@RequestBody | |
503 | + EqpTypeQueryByPlNosRequest request){ | |
504 | + logger.info("停车场编号:"+request.getPlNos()+" 统计设备数量等信息"); | |
505 | + List<ParkLotEqpTypeCountVO> resultList = new ArrayList<>(); | |
506 | + BizResult<List<ParkLotEqpTypeCountStatisticByCountryDTO>> result = parkingLotEqpService | |
507 | + .StatisticParkLotEqpCountByPlNos(request); | |
508 | + if (!CollectionUtils.isEmpty(result.getData())) { | |
509 | + for (ParkLotEqpTypeCountStatisticByCountryDTO i :result.getData()) { | |
510 | + ParkLotEqpTypeCountVO vo = new ParkLotEqpTypeCountVO(); | |
511 | + BeanUtils.copyProperties(i, vo); | |
512 | + resultList.add(vo); | |
513 | + } | |
514 | + } | |
515 | + return new BizResult<>(resultList); | |
516 | + } | |
484 | 517 | } | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/parklotmanage/ParkLotManageController.java
1 | 1 | package com.zteits.irain.portal.web.parkinglotcloudplatform.parklotmanage; |
2 | 2 | |
3 | +import java.util.ArrayList; | |
3 | 4 | import java.util.List; |
4 | 5 | import java.util.Map; |
5 | 6 | |
... | ... | @@ -104,8 +105,10 @@ public class ParkLotManageController{ |
104 | 105 | private List<String> GetParkLotNosByCurrUser(String sysCode) throws Exception { |
105 | 106 | logger.info("根据登录人权限获取停车场列表"); |
106 | 107 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
107 | - List<String> plNos = userInfo.getOrgIds(); | |
108 | - | |
108 | + List<String> plNos =new ArrayList<>(); | |
109 | + if(null !=userInfo){ | |
110 | + plNos = userInfo.getOrgIds(); | |
111 | + } | |
109 | 112 | return plNos; |
110 | 113 | } |
111 | 114 | } | ... | ... |