From 851d4aacc5d7bebdfddcd7d279a8136e34a5c261 Mon Sep 17 00:00:00 2001
From: yanderong <307678080@qq.com>
Date: 星期三, 24 六月 2026 14:01:57 +0800
Subject: [PATCH] feat: 可视化大屏统计bug修改,出行卡兑换返回金额

---
 ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderStatisticsServiceImpl.java |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderStatisticsServiceImpl.java b/ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderStatisticsServiceImpl.java
index 0e1bcc3..f8e6832 100644
--- a/ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderStatisticsServiceImpl.java
+++ b/ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderStatisticsServiceImpl.java
@@ -9,7 +9,6 @@
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
-import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 
@@ -40,12 +39,8 @@
      * 总体订单
      */
     public TOrderStatisticsTotalOrderVo totalOrderStatistics(String startDate, String endDate) {
-        if(StringUtils.isNotEmpty(startDate)) {
-            startDate = startDate+" 00:00:00";
-        }
-        if(StringUtils.isNotEmpty(endDate)) {
-            endDate = endDate+" 23:59:59";
-        }
+        startDate = Optional.ofNullable(startDate).filter(StringUtils::isNotEmpty).map(s -> s +" 00:00:00").orElseThrow(() -> new ServiceException("总体订单统计,开始时间不能为空"));
+        endDate = Optional.ofNullable(endDate).filter(StringUtils::isNotEmpty).map(e -> e +" 23:59:59").orElseThrow(() -> new ServiceException("总体订单统计,结束时间不能为空"));
         TOrderStatisticsTotalOrderVo totalOrderVo = orderTaxiMapper.totalOrderStatistics(startDate, endDate);
         return Optional.ofNullable(totalOrderVo).map(TOrderStatisticsTotalOrderVo::convert).orElse(new TOrderStatisticsTotalOrderVo());
     }
@@ -55,6 +50,7 @@
      * @param type 1 日新增,2月新增
      */
     public List<TOrderStatisticsCountVo> newAddPassengerStatistics(Integer type) {
+        Optional.ofNullable(type).orElseThrow(() -> new ServiceException("新增乘客统计,请求类型不能为空"));
         return orderTaxiMapper.newAddPassengerStatistics(type);
     }
 
@@ -63,6 +59,7 @@
      * @param type 1 日订单量,2月订单量
      */
     public List<TOrderStatisticsCountVo> orderCountStatistics(Integer type) {
+        Optional.ofNullable(type).orElseThrow(() -> new ServiceException("订单量统计,请求类型不能为空"));
         return orderTaxiMapper.orderCountStatistics(type);
     }
 
@@ -78,6 +75,7 @@
      * @param type 1 今日,2本周,3本月
      */
     public List<TOrderStatisticsCarVo> driverCarStatistics(Integer type) {
+        Optional.ofNullable(type).orElseThrow(() -> new ServiceException("司机接单排名统计,请求类型不能为空"));
         return orderTaxiMapper.driverCarStatistics(type);
     }
 
@@ -86,6 +84,7 @@
      * @param type 1 今日,2本周,3本月
      */
     public List<TOrderStatisticsPassengerVo> passengerStatistics(Integer type) {
+        Optional.ofNullable(type).orElseThrow(() -> new ServiceException("乘客排名统计,请求类型不能为空"));
         return orderTaxiMapper.passengerStatistics(type);
     }
 }

--
Gitblit v1.7.1