From 00779ea0f8374e5bbdffc8faa20d65e3c72616c2 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期六, 02 十一月 2024 19:26:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TParkingRecordServiceImpl.java | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 53 insertions(+), 5 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 8e6f6e9..1f67215 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
@@ -10,6 +10,7 @@
import com.ruoyi.chargingPile.api.vo.TParkingRecordPageInfoVO;
import com.ruoyi.chargingPile.api.vo.TParkingRecordVO;
import com.ruoyi.chargingPile.domain.SiteMenu;
+import com.ruoyi.chargingPile.dto.ParkingRecordQueryDto;
import com.ruoyi.chargingPile.mapper.SiteMapper;
import com.ruoyi.chargingPile.mapper.TParkingLotMapper;
import com.ruoyi.chargingPile.mapper.TParkingRecordMapper;
@@ -17,10 +18,12 @@
import com.ruoyi.common.core.web.page.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -47,20 +50,65 @@
@Override
public TParkingRecordPageInfoVO pageList(ParkingRecordQuery query) {
+ PageInfo<TParkingRecordVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize());
// 查询站点的停车场id
if(Objects.nonNull(query.getSiteId())){
Site site = siteMapper.selectById(query.getSiteId());
- List<TParkingLot> tParkingLots = parkingLotMapper.selectList(Wrappers.lambdaQuery(TParkingLot.class)
- .eq(TParkingLot::getSiteId, site.getId()));
- List<Integer> lotIds = tParkingLots.stream().map(TParkingLot::getId).collect(Collectors.toList());
- query.setLotIds(lotIds);
+ if (site!=null){
+ List<TParkingLot> tParkingLots = parkingLotMapper.selectList(Wrappers.lambdaQuery(TParkingLot.class)
+ .eq(TParkingLot::getSiteId, site.getId()));
+ List<Integer> lotIds = tParkingLots.stream().map(TParkingLot::getId).collect(Collectors.toList());
+ if(CollectionUtils.isEmpty(lotIds)){
+ TParkingRecordPageInfoVO tParkingRecordPageInfoVO = new TParkingRecordPageInfoVO();
+ tParkingRecordPageInfoVO.setParkingRecordVOS(new PageInfo<TParkingRecordVO>());
+ return tParkingRecordPageInfoVO;
+ }
+ query.setLotIds(lotIds);
+ }
+
}
- PageInfo<TParkingRecordVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize());
List<TParkingRecordVO> list = this.baseMapper.pageList(query,pageInfo);
pageInfo.setRecords(list);
// 查询总数
TParkingRecordPageInfoVO infoVO = this.baseMapper.getParkingRecordCount(query);
+ if (infoVO==null){
+ infoVO = new TParkingRecordPageInfoVO();
+ infoVO.setTimeoutAmountSum(new BigDecimal("0"));
+ infoVO.setOrderCount(0);
+ infoVO.setParkingDurationSum(0);
+ infoVO.setFeeDurationSum(0);
+ }
infoVO.setParkingRecordVOS(pageInfo);
return infoVO;
}
+
+ @Override
+ public List<Map<String, Object>> parkingData(ParkingRecordQueryDto parkingRecordQueryDto) {
+ return this.baseMapper.parkingData(parkingRecordQueryDto);
+ }
+
+ @Override
+ public List<Map<String, Object>> parkingDataByDate(ParkingRecordQueryDto parkingRecordQueryDto) {
+ return this.baseMapper.parkingDataByDate(parkingRecordQueryDto);
+ }
+
+ @Override
+ public List<Map<String, Object>> getCarColor(ParkingRecordQueryDto parkingRecordQueryDto) {
+ return this.baseMapper.getCarColor(parkingRecordQueryDto);
+ }
+
+ @Override
+ public List<Map<String, Object>> getOutType(ParkingRecordQueryDto parkingRecordQueryDto) {
+ return this.baseMapper.getOutType(parkingRecordQueryDto);
+ }
+
+ @Override
+ public List<Map<String, Object>> getIsCharge(ParkingRecordQueryDto parkingRecordQueryDto) {
+ return this.baseMapper.getIsCharge(parkingRecordQueryDto);
+ }
+
+ @Override
+ public List<Map<String, Object>> income(ParkingRecordQueryDto parkingRecordQueryDto) {
+ return this.baseMapper.income(parkingRecordQueryDto);
+ }
}
--
Gitblit v1.7.1