Commit 98926e1d0528963bae08eccc6fe267cb6466336a
Merge branch 'branch_0808' of http://192.168.1.195:9998/ZTEITS-Developers/zteits…
…-bcp-portal.git into branch_0808
Showing
2 changed files
with
78 additions
and
4 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/areamanage/AreaManageController.java
0 → 100644
| 1 | +package com.zteits.irain.portal.web.parkinglotcloudplatform.areamanage; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | + | |
| 5 | +import javax.servlet.http.HttpSession; | |
| 6 | + | |
| 7 | +import com.clouds.common.utils.ResultUtils; | |
| 8 | +import com.clouds.common.web.vo.BizResultVO; | |
| 9 | +import com.clouds.common.web.vo.EasyUIDataGridVO; | |
| 10 | +import com.zteits.clouds.api.apibase.bean.BaseRequest; | |
| 11 | +import com.zteits.clouds.api.apibase.bean.BizResult; | |
| 12 | +import com.zteits.clouds.api.apibase.constants.ErrorType; | |
| 13 | +import com.zteits.clouds.api.apibase.exception.BizException; | |
| 14 | +import com.zteits.clouds.api.dto.sys.param.AreaBlockByOrgIdQueryRequest; | |
| 15 | +import com.zteits.clouds.api.dto.sys.param.AreaTreeDTO; | |
| 16 | +import com.zteits.clouds.api.service.sys.TbAreaService; | |
| 17 | +import io.swagger.annotations.Api; | |
| 18 | +import io.swagger.annotations.ApiOperation; | |
| 19 | +import org.apache.poi.ss.formula.functions.T; | |
| 20 | +import org.slf4j.Logger; | |
| 21 | +import org.slf4j.LoggerFactory; | |
| 22 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 23 | +import org.springframework.web.bind.annotation.PostMapping; | |
| 24 | +import org.springframework.web.bind.annotation.RequestBody; | |
| 25 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 26 | +import org.springframework.web.bind.annotation.RestController; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * Copyright: Copyright (c) 2017 zteits | |
| 30 | + * | |
| 31 | + * @ClassName: com.zteits.irain.portal.web.parkinglotcloudplatform.areamanage | |
| 32 | + * @Description: | |
| 33 | + * @version: v1.0.0 | |
| 34 | + * @author: atao | |
| 35 | + * @date: 2017/8/29 下午4:23 | |
| 36 | + * Modification History: | |
| 37 | + * Date Author Version Description | |
| 38 | + * ---------------------------------------------------------* | |
| 39 | + * 2017/8/29 atao v1.0.0 创建 | |
| 40 | + */ | |
| 41 | +@Api(value = "区域管理", description = "区域管理") | |
| 42 | +@RestController | |
| 43 | +@RequestMapping("/areaManage") | |
| 44 | +public class AreaManageController { | |
| 45 | + private Logger logger = LoggerFactory.getLogger(AreaManageController.class); | |
| 46 | + @Autowired | |
| 47 | + private HttpSession session; | |
| 48 | + @Autowired | |
| 49 | + private TbAreaService tbAreaService; | |
| 50 | + | |
| 51 | + @ApiOperation("根据归属组织ID查询区域与区块树") | |
| 52 | + @PostMapping("/queryAreaAndBlockTree") | |
| 53 | + public BizResultVO<EasyUIDataGridVO<AreaTreeDTO>> queryAreaAndBlockTree(@RequestBody BaseRequest baseRequest){ | |
| 54 | + | |
| 55 | + BizResultVO<EasyUIDataGridVO<AreaTreeDTO>> resultVO = new BizResultVO<>(); | |
| 56 | + EasyUIDataGridVO<AreaTreeDTO> easyUIDataGridVO = new EasyUIDataGridVO<>(); | |
| 57 | + AreaBlockByOrgIdQueryRequest request = new AreaBlockByOrgIdQueryRequest(); | |
| 58 | + request.setSysCode(baseRequest.getSysCode()); | |
| 59 | + // TODO 此处orgId 从当前登录操作人中取,现在先不限制 | |
| 60 | + request.setOrgId(1L); | |
| 61 | + BizResult<List<AreaTreeDTO>> result= tbAreaService.queryAreaBlockByOrgId(request); | |
| 62 | + if(ResultUtils.isSuccess(result)){ | |
| 63 | + easyUIDataGridVO.setRows(result.getData()); | |
| 64 | + easyUIDataGridVO.setTotal(result.getData().size()); | |
| 65 | + resultVO.setData(easyUIDataGridVO); | |
| 66 | + }else { | |
| 67 | + resultVO.setCode(result.getErrCode().getCode()); | |
| 68 | + resultVO.setMsg(result.getErrMsg()); | |
| 69 | + } | |
| 70 | + | |
| 71 | + return resultVO; | |
| 72 | + } | |
| 73 | + | |
| 74 | +} | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthsStatisticController.java
| ... | ... | @@ -376,17 +376,17 @@ public class BerthsStatisticController extends BizController { |
| 376 | 376 | if (!parkLotMap.containsKey(key)) { |
| 377 | 377 | Map<String, Double> timeAndVal = Maps.newHashMap(); |
| 378 | 378 | if (ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE == berthRatio) { |
| 379 | - timeAndVal.put(statisEndTime, statisticDTO.getFreeRatio() * 100); | |
| 379 | + timeAndVal.put(statisEndTime, null==statisticDTO.getFreeRatio()? 0: statisticDTO.getFreeRatio()* 100); | |
| 380 | 380 | parkLotMap.put(key, timeAndVal); |
| 381 | 381 | } else if (ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER == berthRatio) { |
| 382 | - timeAndVal.put(statisEndTime, statisticDTO.getTurnoverRatio() ); | |
| 382 | + timeAndVal.put(statisEndTime, null==statisticDTO.getTurnoverRatio()?0:statisticDTO.getTurnoverRatio() ); | |
| 383 | 383 | parkLotMap.put(key, timeAndVal); |
| 384 | 384 | } |
| 385 | 385 | } else { |
| 386 | 386 | if (ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE == berthRatio) { |
| 387 | - parkLotMap.get(key).put(statisEndTime, statisticDTO.getFreeRatio() * 100); | |
| 387 | + parkLotMap.get(key).put(statisEndTime, null==statisticDTO.getFreeRatio()? 0: statisticDTO.getFreeRatio()* 100); | |
| 388 | 388 | } else if (ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER == berthRatio) { |
| 389 | - parkLotMap.get(key).put(statisEndTime, statisticDTO.getTurnoverRatio() ); | |
| 389 | + parkLotMap.get(key).put(statisEndTime, null==statisticDTO.getTurnoverRatio()?0:statisticDTO.getTurnoverRatio() ); | |
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | ... | ... |