From 3474825ce00fe0949dcbc1baff294f52d426ccbd Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期六, 24 一月 2026 18:36:29 +0800
Subject: [PATCH] 大屏项目接口

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/ProjectCategoryCalculator.java        |    2 ++
 ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenUserVo.java                          |    6 ++++++
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java |    4 ++++
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ProjectInfoServiceImpl.java      |    8 ++++----
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java
index 1fb19a1..375954c 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java
@@ -76,6 +76,8 @@
                     screenUserVo.setPermissionClient(param.getPermissionClient());
                     screenUserVo.setPermissionProject(param.getPermissionProject());
                     screenUserVo.setCommentType(param.getCommentType());
+                    screenUserVo.setSafetyId(param.getSafetyId());
+                    screenUserVo.setDeviceTemplateId(param.getDeviceTemplateId());
                 }
             }else if(type==2){
                 Project project = projectService.getById(id);
@@ -86,6 +88,8 @@
                 ClientParam param = clientParamService.getOne(new LambdaQueryWrapper<ClientParam>().eq(ClientParam::getClientId, client.getId()));
                 if(param!=null){
                     screenUserVo.setCommentType(param.getCommentType());
+                    screenUserVo.setSafetyId(param.getSafetyId());
+                    screenUserVo.setDeviceTemplateId(param.getDeviceTemplateId());
                 }
                 screenUserVo.setName(project.getName());
                 screenUserVo.setPermissionProject(project.getPermission());
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ProjectCategoryCalculator.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ProjectCategoryCalculator.java
index a594f0d..bdd2ee8 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ProjectCategoryCalculator.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ProjectCategoryCalculator.java
@@ -316,6 +316,8 @@
                     .average()
                     .orElse(0.0);
 
+            System.out.println("results"+results);
+
             // 计算设备检查平均分(需要解析 device_res_map)
             List<Float> deviceScores = results.stream()
                     .filter(e -> StringUtils.hasText(e.getDeviceResMap()))
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ProjectInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ProjectInfoServiceImpl.java
index 5b16ef0..142bd8b 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ProjectInfoServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ProjectInfoServiceImpl.java
@@ -73,10 +73,10 @@
 
 
         }
-
         LocalDate thisMonth = LocalDate.now().minusMonths(0).with(TemporalAdjusters.firstDayOfMonth());
         Map<String, List<Record>> map = list.stream().collect(groupingBy(Record::getHierarchyName));
-        List<ProjectHiddenDangerTrendVo> resultList = map.entrySet().stream().map(entry -> {
+        List<ProjectHiddenDangerTrendVo> resultList = new ArrayList<>();
+        for (Map.Entry<String, List<Record>> entry : map.entrySet()) {
             ProjectHiddenDangerTrendVo vo = new ProjectHiddenDangerTrendVo();
             vo.setName(entry.getKey());
             List<Record> value = entry.getValue();
@@ -96,8 +96,8 @@
             }else {
                 vo.setRate(0.00d);
             }
-            return vo;
-        }).toList();
+            resultList.add(vo) ;
+        }
 
 
         return resultList;
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenUserVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenUserVo.java
index 6c3a0f4..fc22371 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenUserVo.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenUserVo.java
@@ -22,4 +22,10 @@
 
     @ApiModelProperty(value = "1委托方 2项目")
     private Integer type;
+
+    @ApiModelProperty(value = "安全报告模板id")
+    private Integer safetyId;
+
+    @ApiModelProperty(value = "设备模板id")
+    private Integer deviceTemplateId;
 }

--
Gitblit v1.7.1