From 45403c689e2e0d6e69d32e1833faabc116f859e2 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期四, 19 九月 2024 14:58:40 +0800
Subject: [PATCH] 修改接口

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TDataStatisticsController.java |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TDataStatisticsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TDataStatisticsController.java
index a0fba52..59e98fc 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TDataStatisticsController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TDataStatisticsController.java
@@ -322,9 +322,9 @@
         List<PersonnelStatisticsVO> personnelStatisticsVOS = orderMealService.personnelStatistics(query);
         personnelStatisticsAndSumVO.setPersonnelStatisticsVOS(personnelStatisticsVOS);
         if(!CollectionUtils.isEmpty(personnelStatisticsVOS)){
-            personnelStatisticsAndSumVO.setPersonCountSum(personnelStatisticsVOS.stream().mapToInt(PersonnelStatisticsVO::getPersonCount).sum());
+            personnelStatisticsAndSumVO.setPersonCountSum(personnelStatisticsVOS.stream().filter(e->e.getPersonCount() != null).mapToInt(PersonnelStatisticsVO::getPersonCount).sum());
             // 计算列表中平均金额乘以人数的总和
-            personnelStatisticsAndSumVO.setTotalMoney(personnelStatisticsVOS.stream().mapToDouble(personnelStatisticsVO -> personnelStatisticsVO.getAvgAmount().doubleValue() * personnelStatisticsVO.getPersonCount()).sum());
+            personnelStatisticsAndSumVO.setTotalMoney(personnelStatisticsVOS.stream().filter(e->e.getPersonCount() != null).mapToDouble(personnelStatisticsVO -> personnelStatisticsVO.getAvgAmount().doubleValue() * personnelStatisticsVO.getPersonCount()).sum());
         }
         return AjaxResult.success(personnelStatisticsAndSumVO);
     }

--
Gitblit v1.7.1