From ecb7976b82279ea3f05415fb278b87507870fb1c Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期三, 07 一月 2026 10:22:10 +0800
Subject: [PATCH] 修改

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

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DataStatisticsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DataStatisticsController.java
index 6416965..c84fd27 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DataStatisticsController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DataStatisticsController.java
@@ -141,8 +141,10 @@
                 .eq(TLargeKeyGridUser::getUserType, 1));
         List<TLargeKeyPersonnelType> list = largeKeyPersonnelTypeService.list(Wrappers.lambdaQuery(TLargeKeyPersonnelType.class)
                 .ne(TLargeKeyPersonnelType::getShowType, 1));
-        int sum = list.stream().mapToInt(TLargeKeyPersonnelType::getShowNumber).sum();
-        keyCount += sum;
+        if(!CollectionUtils.isEmpty(list)){
+            int sum = list.stream().filter(e->Objects.nonNull(e.getShowNumber())).mapToInt(TLargeKeyPersonnelType::getShowNumber).sum();
+            keyCount += sum;
+        }
         // 网格人数
         long gridCount = largeKeyGridUserService.count(Wrappers.lambdaQuery(TLargeKeyGridUser.class)
                 .eq(TLargeKeyGridUser::getUserType, 2));

--
Gitblit v1.7.1