From 0923c2a6f1a7b4d28e39f566f9ff27557e2bf250 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期五, 27 三月 2026 14:57:29 +0800
Subject: [PATCH] 修改
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DataStatisticsController.java | 8 +++++---
1 files changed, 5 insertions(+), 3 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..2264aba 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
@@ -140,9 +140,11 @@
long keyCount = largeKeyGridUserService.count(Wrappers.lambdaQuery(TLargeKeyGridUser.class)
.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;
+ .eq(TLargeKeyPersonnelType::getShowType, 1));
+ 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