From bb18fbb5291e13b0545b90e8d8641c8392f7a112 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期三, 06 十一月 2024 16:25:37 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TParkingRecordServiceImpl.java | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TParkingRecordServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TParkingRecordServiceImpl.java index 7048099..6a65354 100644 --- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TParkingRecordServiceImpl.java +++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TParkingRecordServiceImpl.java @@ -59,13 +59,26 @@ .eq(TParkingLot::getSiteId, site.getId())); List<Integer> lotIds = tParkingLots.stream().map(TParkingLot::getId).collect(Collectors.toList()); if(CollectionUtils.isEmpty(lotIds)){ - return new TParkingRecordPageInfoVO(); + TParkingRecordPageInfoVO tParkingRecordPageInfoVO = new TParkingRecordPageInfoVO(); + tParkingRecordPageInfoVO.setParkingRecordVOS(new PageInfo<TParkingRecordVO>()); + return tParkingRecordPageInfoVO; } query.setLotIds(lotIds); } } List<TParkingRecordVO> list = this.baseMapper.pageList(query,pageInfo); + for (TParkingRecordVO tParkingRecordVO : list) { + if (tParkingRecordVO.getParkingDuration()==null){ + tParkingRecordVO.setFeeDuration(0); + }else if(tParkingRecordVO.getFreeDuration()==null){ + tParkingRecordVO.setFeeDuration(tParkingRecordVO.getParkingDuration()); + }else{ + tParkingRecordVO.setFeeDuration(tParkingRecordVO.getParkingDuration()-tParkingRecordVO.getFreeDuration()); + } + tParkingRecordVO.setOrderAmount(tParkingRecordVO.getOrderAmount().add(tParkingRecordVO.getTimeoutAmount())); + tParkingRecordVO.setParkingFee(tParkingRecordVO.getOrderAmount()); + } pageInfo.setRecords(list); // 查询总数 TParkingRecordPageInfoVO infoVO = this.baseMapper.getParkingRecordCount(query); -- Gitblit v1.7.1