Commit 48cbd9100bbb44b0b68d0d8a2864dc014b544410
1 parent
9c44aec3
tijiao
Showing
1 changed file
with
8 additions
and
10 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthsStatisticController.java
| @@ -470,29 +470,27 @@ public class BerthsStatisticController extends BizController { | @@ -470,29 +470,27 @@ public class BerthsStatisticController extends BizController { | ||
| 470 | @ApiOperation("获取停车场信息统计和今日收益") | 470 | @ApiOperation("获取停车场信息统计和今日收益") |
| 471 | @PostMapping("getParkStaticsticAndTodayAmount") | 471 | @PostMapping("getParkStaticsticAndTodayAmount") |
| 472 | public BizResultVO<List<ParkStaticsticAndTodayAmountVO>> getParkStaticsticAndTodayAmount(@RequestBody QueryTodayOrderRequest request) throws Exception{ | 472 | public BizResultVO<List<ParkStaticsticAndTodayAmountVO>> getParkStaticsticAndTodayAmount(@RequestBody QueryTodayOrderRequest request) throws Exception{ |
| 473 | - // 1.调用接口查询当前登录人管辖的停车场名称 | ||
| 474 | - UserInfo userInfo = sessionCommUtil.getUserInfo(); | ||
| 475 | - List<String> plNos=Lists.newArrayList(); | ||
| 476 | - if(null != userInfo){ | ||
| 477 | - plNos= userInfo.getOrgIds(); | ||
| 478 | - } | 473 | + if(CollectionUtils.isEmpty(request.getPlNos())){ |
| 474 | + throw new BizException(ErrorType.PARAMM_NULL, "入参不能为空!"); | ||
| 475 | + } | ||
| 476 | + | ||
| 479 | //今日收益 | 477 | //今日收益 |
| 480 | List<ParkStaticsticAndTodayAmountVO> listVO= new ArrayList<ParkStaticsticAndTodayAmountVO>(); | 478 | List<ParkStaticsticAndTodayAmountVO> listVO= new ArrayList<ParkStaticsticAndTodayAmountVO>(); |
| 481 | BizResult<Map<String, BigDecimal>> result = tdBOrderService.queryTodayAmountSumByPlno(request); | 479 | BizResult<Map<String, BigDecimal>> result = tdBOrderService.queryTodayAmountSumByPlno(request); |
| 482 | Map<String, BigDecimal> mapAmount=ResultUtils.getBizResultData(result); | 480 | Map<String, BigDecimal> mapAmount=ResultUtils.getBizResultData(result); |
| 483 | //空闲车位数 | 481 | //空闲车位数 |
| 484 | ParkFreeBerthGetByPlnoRequest parkFreeBerthGetByPlnoRequest = new ParkFreeBerthGetByPlnoRequest(); | 482 | ParkFreeBerthGetByPlnoRequest parkFreeBerthGetByPlnoRequest = new ParkFreeBerthGetByPlnoRequest(); |
| 485 | - request.setPlNos(plNos); | ||
| 486 | - request.setSysCode(sysCode); | 483 | + parkFreeBerthGetByPlnoRequest.setPlNos(request.getPlNos()); |
| 484 | + parkFreeBerthGetByPlnoRequest.setSysCode(request.getSysCode()); | ||
| 487 | BizResult<Map<String, Integer>> freeBerthsNumBizResult = parkFreeBerthService.getParkFreeBerthByPlno(parkFreeBerthGetByPlnoRequest); | 485 | BizResult<Map<String, Integer>> freeBerthsNumBizResult = parkFreeBerthService.getParkFreeBerthByPlno(parkFreeBerthGetByPlnoRequest); |
| 488 | Map<String, Integer> freeBerthsNumMap = ResultUtils.getBizResultData(freeBerthsNumBizResult); | 486 | Map<String, Integer> freeBerthsNumMap = ResultUtils.getBizResultData(freeBerthsNumBizResult); |
| 489 | - for (String plNo : plNos) { | 487 | + for (String plNo : request.getPlNos()) { |
| 490 | //先查询缓存 | 488 | //先查询缓存 |
| 491 | ParkingLotDTO lotDTO = ParkingLotCacheUtil.getParkLotByPlNo(plNo); | 489 | ParkingLotDTO lotDTO = ParkingLotCacheUtil.getParkLotByPlNo(plNo); |
| 492 | if(lotDTO == null){ | 490 | if(lotDTO == null){ |
| 493 | //查询数据库 | 491 | //查询数据库 |
| 494 | QueryParkLotInfoByPkNoRequest request1 = new QueryParkLotInfoByPkNoRequest(); | 492 | QueryParkLotInfoByPkNoRequest request1 = new QueryParkLotInfoByPkNoRequest(); |
| 495 | - request1.setSysCode(sysCode); | 493 | + request1.setSysCode(request.getSysCode()); |
| 496 | request1.setPklNo(plNo); | 494 | request1.setPklNo(plNo); |
| 497 | BizResult<ParkingLotDTO> bizResult2 = parkingLotQueryService.QueryParkingLotByPkNo(request1); | 495 | BizResult<ParkingLotDTO> bizResult2 = parkingLotQueryService.QueryParkingLotByPkNo(request1); |
| 498 | lotDTO = ResultUtils.getBizResultData(bizResult2); | 496 | lotDTO = ResultUtils.getBizResultData(bizResult2); |