From cbb154b3d05762d1d8aee87b3c11237c8983a60d Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 01 四月 2026 17:06:12 +0800
Subject: [PATCH] 修改bug
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java | 43 ++++++++++++++++++++++++++++++++++++++++---
1 files changed, 40 insertions(+), 3 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 1cec76a..3b19da2 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
@@ -33,7 +33,7 @@
*/
@RestController
@RequestMapping("/dashboard-statistics")
-@Api(tags = "数据统计面板")
+@Api(tags = "首页")
@RequiredArgsConstructor(onConstructor_ = @Lazy)
public class DashboardStatisticsController {
@@ -62,6 +62,7 @@
public R<ScreenUserVo> getLoginInfo(Integer type, Integer id) {
ScreenUserVo screenUserVo = new ScreenUserVo();
screenUserVo.setType(type);
+
if(type!=null && id !=null){
if(type==1){
@@ -69,6 +70,7 @@
if(client==null){
return R.fail("委托方不存在");
}
+ screenUserVo.setClientId(id);
ClientParam param = clientParamService.getOne(new LambdaQueryWrapper<ClientParam>().eq(ClientParam::getClientId, client.getId()));
if(param!=null){
screenUserVo.setLogo(param.getLogo());
@@ -76,6 +78,15 @@
screenUserVo.setPermissionClient(param.getPermissionClient());
screenUserVo.setPermissionProject(param.getPermissionProject());
screenUserVo.setCommentType(param.getCommentType());
+ screenUserVo.setSafetyId(param.getSafetyId());
+ String name = clientParamService.getTemplateName(param.getSafetyId());
+ screenUserVo.setSafetyName(name);
+
+ screenUserVo.setDeviceTemplateId(param.getDeviceTemplateId());
+ screenUserVo.setDeviceTemplateName(clientParamService.getTemplateName(param.getDeviceTemplateId()));
+
+ screenUserVo.setBigHiddenDanger(param.getBigHiddenDanger());
+ screenUserVo.setGeneralHiddenDanger(param.getGeneralHiddenDanger());
}
}else if(type==2){
Project project = projectService.getById(id);
@@ -83,11 +94,22 @@
return R.fail("项目不存在");
}
Client client = clientService.getById(project.getClientId());
+ screenUserVo.setClientId(client.getId());
ClientParam param = clientParamService.getOne(new LambdaQueryWrapper<ClientParam>().eq(ClientParam::getClientId, client.getId()));
if(param!=null){
+ screenUserVo.setLogo(param.getLogo());
+ screenUserVo.setName(param.getName());
screenUserVo.setCommentType(param.getCommentType());
+ screenUserVo.setSafetyId(param.getSafetyId());
+ String name = clientParamService.getTemplateName(param.getSafetyId());
+ screenUserVo.setSafetyName(name);
+ screenUserVo.setDeviceTemplateId(param.getDeviceTemplateId());
+ String name1 = clientParamService.getTemplateName(param.getDeviceTemplateId());
+ screenUserVo.setDeviceTemplateName(name1);
+ screenUserVo.setBigHiddenDanger(param.getBigHiddenDanger());
+ screenUserVo.setGeneralHiddenDanger(param.getGeneralHiddenDanger());
}
- screenUserVo.setName(project.getName());
+ screenUserVo.setProjectName(project.getName());
screenUserVo.setPermissionProject(project.getPermission());
}
@@ -106,9 +128,17 @@
List<AccidentClassification> list = accidentClassificationService.list(new LambdaQueryWrapper<AccidentClassification>().eq(AccidentClassification::getDeleted, false));
LambdaQueryWrapper<AccidentBrief> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(AccidentBrief::getState,1);
+ wrapper.eq(AccidentBrief::getDeleted,false);
if(query.getCity()!=null && !query.getCity().isEmpty()){
wrapper.eq(AccidentBrief::getCity, query.getCity());
}
+ if(query.getProvince()!=null && !query.getProvince().isEmpty()){
+ wrapper.eq(AccidentBrief::getProvince, query.getProvince());
+ }
+ if(query.getArea()!=null && !query.getArea().isEmpty()){
+ wrapper.eq(AccidentBrief::getArea, query.getArea());
+ }
+
if(query.getClassifyId()!=null){
wrapper.eq(AccidentBrief::getClassifyId, query.getClassifyId());
}
@@ -166,6 +196,13 @@
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);
+ }
+
/**
* 获取委托方大屏首页统计数据
*
@@ -173,7 +210,7 @@
* @return 统计数据
*/
@PostMapping("/index")
- @ApiOperation("获取委托方大屏首页统计数据")
+ @ApiOperation(value = "获取委托方大屏首页统计数据",tags = {"委托方端"})
public R<ClientDashboardVO> index(@RequestBody ClientDashboardQuery query) {
ClientDashboardVO dashboard = clientService.getClientDashboard(query);
return R.ok(dashboard);
--
Gitblit v1.7.1