From ec9ce06bba427c7b9d680217af6065a82e2af075 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期四, 13 三月 2025 17:54:01 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
index 0632ce4..46f6c7d 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -1065,7 +1065,7 @@
             if (chargingOrder.getOrderSource().equals(2)){
                 serviceCharge = serviceCharge.add(chargingOrder.getServiceCharge()!=null?chargingOrder.getServiceCharge().multiply(new BigDecimal("0.2")).setScale(2,BigDecimal.ROUND_DOWN):new BigDecimal("0"));
                 commissionAmount = commissionAmount.add(chargingOrder.getServiceCharge()!=null?chargingOrder.getServiceCharge().multiply(new BigDecimal("0.2")).setScale(2,BigDecimal.ROUND_DOWN):new BigDecimal("0"));
-            }else{
+            }else if (chargingOrder.getServiceCharge()!=null){
                 serviceCharge = serviceCharge.add(chargingOrder.getServiceCharge());
             }
 
@@ -1260,14 +1260,14 @@
             }
         }
 
-        List<TChargingOrder> list = chargingOrderService.lambdaQuery().ge(TChargingOrder::getCreateTime, start).le(TChargingOrder::getCreateTime, end).in(TChargingOrder::getSiteId, siteIds).list();
-        List<Long> chargingOrderIds = list.stream().map(TChargingOrder::getId).collect(Collectors.toList());
-        chargingOrderIds.add(-1L);
+//        List<TChargingOrder> list = chargingOrderService.lambdaQuery().ge(TChargingOrder::getCreateTime, start).le(TChargingOrder::getCreateTime, end).in(TChargingOrder::getSiteId, siteIds).list();
+//        List<Long> chargingOrderIds = list.stream().map(TChargingOrder::getId).collect(Collectors.toList());
+//        chargingOrderIds.add(-1L);
         //上方饼图
-         List<Map<String,Object>> maps =   chargingOrderService.getSumByType(chargingOrderIds);
+         List<Map<String,Object>> maps =   chargingOrderService.getSumByType(start,end);
 
         if (statisticsQueryDto.getDayType()==1){
-            List<Map<String,Object>> maps1 = chargingOrderService.getDateData(chargingOrderIds);
+            List<Map<String,Object>> maps1 = chargingOrderService.getDateData(start,end);
 
             List<Map<String, Object>> charMap = new ArrayList<>();
             // 生成从 "00:00" 到 "23:00" 的时间数据
@@ -1294,7 +1294,7 @@
 
 
 
-            List<Map<String,Object>> maps1 = chargingOrderService.getWeekData(chargingOrderIds);
+            List<Map<String,Object>> maps1 = chargingOrderService.getWeekData(start,end);
 
             LocalDate startDate = statisticsQueryDto.getStartTime();
             LocalDate endDate = statisticsQueryDto.getEndTime();
@@ -1324,7 +1324,7 @@
             }
             tCharingOrderMapVO.setMaps1(dateRangeStatistics);
         }else if (statisticsQueryDto.getDayType()==3){
-            List<Map<String,Object>> maps1 = chargingOrderService.getMonthData(chargingOrderIds);
+            List<Map<String,Object>> maps1 = chargingOrderService.getMonthData(start,end);
 
             LocalDate startDate = statisticsQueryDto.getStartTime();
             LocalDate endDate = statisticsQueryDto.getEndTime();
@@ -1354,7 +1354,7 @@
             }
             tCharingOrderMapVO.setMaps1(dateRangeStatistics);
         }else  if (statisticsQueryDto.getDayType()==4){
-            List<Map<String,Object>> maps1 = chargingOrderService.getYearData(chargingOrderIds);
+            List<Map<String,Object>> maps1 = chargingOrderService.getYearData(start,end);
 
             LocalDate startDate = statisticsQueryDto.getStartTime();
             LocalDate endDate = statisticsQueryDto.getEndTime();
@@ -1385,7 +1385,7 @@
             }
             tCharingOrderMapVO.setMaps1(dateRangeStatistics);
         }else if (statisticsQueryDto.getDayType()==5){
-            List<Map<String,Object>> maps1 = chargingOrderService.getByDate(chargingOrderIds);
+            List<Map<String,Object>> maps1 = chargingOrderService.getByDate(start,end);
 
             LocalDate startDate = statisticsQueryDto.getStartTime();
             LocalDate endDate = statisticsQueryDto.getEndTime();

--
Gitblit v1.7.1