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 |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 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 d43104f..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
@@ -1,5 +1,6 @@
 package com.ruoyi.web.controller.api;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.system.model.*;
@@ -13,6 +14,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 @Api(tags = "数据大屏")
@@ -31,8 +33,9 @@
     private final TLargeVolunteerService largeVolunteerService;
     private final TLargeKeyGridUserService largeKeyGridUserService;
     private final TLargeKeyPersonnelTypeService largeKeyPersonnelTypeService;
+    private final THelpNeedsService tHelpNeedsService;
     @Autowired
-    public DataStatisticsController(TAppealServicesService appealServicesService, TOldsterWarningService oldsterWarningService, THtmlConfigService htmlConfigService, TLargeDeptService largeDeptService, TLargeUserService largeUserService, TLargeOrganizationService largeOrganizationService, TLargeResourceService largeResourceService, TLargeSocialWorkerService largeSocialWorkerService, TLargeVolunteerService largeVolunteerService, TLargeKeyGridUserService largeKeyGridUserService, TLargeKeyPersonnelTypeService largeKeyPersonnelTypeService) {
+    public DataStatisticsController(TAppealServicesService appealServicesService, TOldsterWarningService oldsterWarningService, THtmlConfigService htmlConfigService, TLargeDeptService largeDeptService, TLargeUserService largeUserService, TLargeOrganizationService largeOrganizationService, TLargeResourceService largeResourceService, TLargeSocialWorkerService largeSocialWorkerService, TLargeVolunteerService largeVolunteerService, TLargeKeyGridUserService largeKeyGridUserService, TLargeKeyPersonnelTypeService largeKeyPersonnelTypeService, THelpNeedsService tHelpNeedsService) {
         this.appealServicesService = appealServicesService;
         this.oldsterWarningService = oldsterWarningService;
         this.htmlConfigService = htmlConfigService;
@@ -44,6 +47,7 @@
         this.largeVolunteerService = largeVolunteerService;
         this.largeKeyGridUserService = largeKeyGridUserService;
         this.largeKeyPersonnelTypeService = largeKeyPersonnelTypeService;
+        this.tHelpNeedsService = tHelpNeedsService;
     }
 
     /**
@@ -60,9 +64,9 @@
      */
     @ApiOperation(value = "获取组织人员列表")
     @GetMapping(value = "/largeUserList")
-    public R<List<TLargeUser>> largeUserList(@RequestParam String deptId) {
+    public R<List<TLargeUser>> largeUserList(String deptId) {
         List<TLargeUser> list = largeUserService.list(Wrappers.lambdaQuery(TLargeUser.class)
-                .eq(TLargeUser::getDeptId, deptId)
+                .eq(Objects.nonNull(deptId),TLargeUser::getDeptId, deptId)
                 .orderByDesc(TLargeUser::getCreateTime));
         return R.ok(list);
     }
@@ -77,9 +81,18 @@
         long appealServicesCount = appealServicesService.count();
         // 养老告警事件
         long warningCount = oldsterWarningService.count();
+        // 随手拍
+        long photoCount = appealServicesService.count(new LambdaQueryWrapper<TAppealServices>().eq(TAppealServices::getAppealType,2));
+        // 诉求服务
+        long appealCount = appealServicesService.count(new LambdaQueryWrapper<TAppealServices>().eq(TAppealServices::getAppealType,1));
+        // 助需
+        long helpNeedsCount = tHelpNeedsService.count();
         Map<String,Long> map = new HashMap<>();
-        map.put("appealServicesCount",appealServicesCount);
+        map.put("appealServicesCount",appealServicesCount+photoCount+appealCount+helpNeedsCount);
         map.put("warningCount",warningCount);
+        map.put("photoCount",photoCount);
+        map.put("appealCount",appealCount);
+        map.put("helpNeedsCount",helpNeedsCount);
         return R.ok(map);
     }
 
@@ -126,12 +139,19 @@
         // 重点人数
         long keyCount = largeKeyGridUserService.count(Wrappers.lambdaQuery(TLargeKeyGridUser.class)
                 .eq(TLargeKeyGridUser::getUserType, 1));
+        List<TLargeKeyPersonnelType> list = largeKeyPersonnelTypeService.list(Wrappers.lambdaQuery(TLargeKeyPersonnelType.class)
+                .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));
         Map<String,Long> map = new HashMap<>();
         map.put("keyCount",keyCount);
-        map.put("gridCount",gridCount);
+        map.put("gridCount",17079L);
+//        map.put("gridCount",gridCount);
         return R.ok(map);
     }
 

--
Gitblit v1.7.1