From 8e7df6fb8341c40425dc47c0de23e22f389202f4 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期五, 23 一月 2026 16:11:42 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/smart_screen

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java |   76 ++++++++++++++++++++++++++++++++++---
 1 files changed, 69 insertions(+), 7 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 5a86225..1fb19a1 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
@@ -9,6 +9,8 @@
 import com.ruoyi.system.model.*;
 import com.ruoyi.system.query.StoryListQuery;
 import com.ruoyi.system.service.*;
+import com.ruoyi.system.vo.ClientDashboardQuery;
+import com.ruoyi.system.vo.ClientDashboardVO;
 import com.ruoyi.system.vo.ScreenUserVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -21,6 +23,7 @@
 
 import java.util.HashMap;
 import java.util.List;
+import java.util.Optional;
 
 /**
  * 数据统计面板 前端控制器
@@ -30,12 +33,10 @@
  */
 @RestController
 @RequestMapping("/dashboard-statistics")
-@Api(tags = "数据统计面板")
+@Api(tags = "首页")
 @RequiredArgsConstructor(onConstructor_ = @Lazy)
 public class DashboardStatisticsController {
 
-    @Autowired
-    private ScreenAccountService screenAccountService;
 
     @Autowired
     private TokenService tokenService;
@@ -52,6 +53,8 @@
     @Autowired
     private AccidentBriefService accidentBriefService;
 
+    @Autowired
+    private AccidentClassificationService accidentClassificationService;
 
 
     @ApiOperation("获取当前登录信息")
@@ -72,13 +75,18 @@
                     screenUserVo.setName(param.getName());
                     screenUserVo.setPermissionClient(param.getPermissionClient());
                     screenUserVo.setPermissionProject(param.getPermissionProject());
+                    screenUserVo.setCommentType(param.getCommentType());
                 }
             }else if(type==2){
                 Project project = projectService.getById(id);
                 if(project==null){
                     return R.fail("项目不存在");
                 }
-
+                Client client = clientService.getById(project.getClientId());
+                ClientParam param = clientParamService.getOne(new LambdaQueryWrapper<ClientParam>().eq(ClientParam::getClientId, client.getId()));
+                if(param!=null){
+                    screenUserVo.setCommentType(param.getCommentType());
+                }
                 screenUserVo.setName(project.getName());
                 screenUserVo.setPermissionProject(project.getPermission());
             }
@@ -92,10 +100,10 @@
 
 
     @ApiOperation(value = "获取故事简讯列表",response = AccidentBrief.class)
-    @PostMapping("/getStoryList")
-    public R<Page<AccidentBrief>> getStoryList(@RequestBody StoryListQuery query) {
+    @PostMapping("/getStoryPage")
+    public R<Page<AccidentBrief>> getStoryPage(@RequestBody StoryListQuery query) {
         Page<AccidentBrief> page = new Page<>(query.getPageNum(), query.getPageSize());
-
+        List<AccidentClassification> list = accidentClassificationService.list(new LambdaQueryWrapper<AccidentClassification>().eq(AccidentClassification::getDeleted, false));
         LambdaQueryWrapper<AccidentBrief> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(AccidentBrief::getState,1);
         if(query.getCity()!=null && !query.getCity().isEmpty()){
@@ -114,6 +122,39 @@
         }
         wrapper.orderByDesc(AccidentBrief::getTime);
         Page<AccidentBrief> accidentBriefPage = accidentBriefService.page(page, wrapper);
+        accidentBriefPage.getRecords().forEach(item->{
+            item.setClassifyName(list.stream().filter(classify->classify.getId().equals(item.getClassifyId())).findFirst().get().getName());
+        });
+        return R.ok(accidentBriefPage);
+    }
+
+
+
+    @ApiOperation(value = "获取故事简讯列表-不分页",response = AccidentBrief.class)
+    @PostMapping("/getStoryList")
+    public R<List<AccidentBrief>> getStoryList(@RequestBody StoryListQuery query) {
+        List<AccidentClassification> list = accidentClassificationService.list(new LambdaQueryWrapper<AccidentClassification>().eq(AccidentClassification::getDeleted, false));
+        LambdaQueryWrapper<AccidentBrief> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(AccidentBrief::getState,1);
+        if(query.getCity()!=null && !query.getCity().isEmpty()){
+            wrapper.eq(AccidentBrief::getCity, query.getCity());
+        }
+        if(query.getClassifyId()!=null){
+            wrapper.eq(AccidentBrief::getClassifyId, query.getClassifyId());
+        }
+        if(query.getTime()!=null && !query.getTime().isEmpty()){
+            String sTime = query.getTime().split(" - ")[0]+" 00:00:00";
+            String eTime = query.getTime().split(" - ")[1]+" 23:59:59";
+            wrapper.between(AccidentBrief::getTime,sTime,eTime);
+        }
+        if(query.getContent()!=null && !query.getContent().isEmpty()){
+            wrapper.like(AccidentBrief::getContent, query.getContent());
+        }
+        wrapper.orderByDesc(AccidentBrief::getTime);
+        List<AccidentBrief> accidentBriefPage = accidentBriefService.list( wrapper);
+        accidentBriefPage.forEach(item->{
+            item.setClassifyName(list.stream().filter(classify -> classify.getId().equals(item.getClassifyId())).findFirst().orElse(new AccidentClassification()).getName());
+        });
         return R.ok(accidentBriefPage);
     }
 
@@ -125,6 +166,27 @@
         return R.ok(accidentBrief);
     }
 
+    @ApiOperation(value = "获取故事简讯详情分类",response = AccidentClassification.class)
+    @GetMapping("/getStoryClassify")
+    public R<List<AccidentClassification>> getStoryClassify() {
+        List<AccidentClassification> list = accidentClassificationService.list(new LambdaQueryWrapper<AccidentClassification>().eq(AccidentClassification::getDeleted, false));
+        return R.ok(list);
+    }
+
+    /**
+     * 获取委托方大屏首页统计数据
+     *
+     * @param query 查询参数
+     * @return 统计数据
+     */
+    @PostMapping("/index")
+    @ApiOperation(value = "获取委托方大屏首页统计数据",tags = {"委托方端"})
+    public R<ClientDashboardVO> index(@RequestBody ClientDashboardQuery query) {
+        ClientDashboardVO dashboard = clientService.getClientDashboard(query);
+        return R.ok(dashboard);
+    }
+    
+
 
 
 

--
Gitblit v1.7.1