From 72b2ace0177f9d3879733b7ac80848d65aa313e2 Mon Sep 17 00:00:00 2001 From: LokerL Date: Fri, 11 Oct 2024 21:16:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E6=8A=A5=E8=AD=A6?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E5=8E=82=E7=95=8C=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整报警管理-厂界在线页面,解决选择部门后页面无数据的问题,修改页面后端接口。 --- .../oil/controller/OilAnalysisController.java | 31 + .../oil/mapper/ThDeviceReportMapper.java | 7 + .../service/IOilThDeviceReportService.java | 4 + .../impl/OilThDeviceReportService.java | 10 + .../mybatis/oil/ThDeviceReportMapper.xml | 48 ++ ruoyi-ui/src/api/analysis/index.js | 9 + .../src/views/dataAnalysis/bound/index.vue | 620 ++++++++++-------- 7 files changed, 440 insertions(+), 289 deletions(-) create mode 100644 RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/OilAnalysisController.java create mode 100644 ruoyi-ui/src/api/analysis/index.js diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/OilAnalysisController.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/OilAnalysisController.java new file mode 100644 index 0000000..c752cbd --- /dev/null +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/OilAnalysisController.java @@ -0,0 +1,31 @@ +package com.ruoyi.project.oil.controller; + +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.oil.service.IOilThDeviceReportService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/analysis") +public class OilAnalysisController extends BaseController { + + @Autowired + private IOilThDeviceReportService oilThDeviceReportService; + + @GetMapping("/factoryBoundaryOnline") + public AjaxResult getDeviceReport(Long deptId, String beginDate, String endDate) { + List> alarmCount = oilThDeviceReportService.selectAlarmCountByDeptIdAndDateRange(deptId, beginDate, endDate); + List> alarmCountDesc = oilThDeviceReportService.selectAlarmCountByDeptIdAndDateRangeDesc(deptId, beginDate, endDate); + Map resultMap = new HashMap<>(); + resultMap.put("alarmCount", alarmCount); + resultMap.put("alarmCountDesc", alarmCountDesc); + return AjaxResult.success(resultMap); + } +} diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceReportMapper.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceReportMapper.java index 394ef2f..72dea74 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceReportMapper.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceReportMapper.java @@ -71,4 +71,11 @@ public interface ThDeviceReportMapper { */ @MapKey("day") List> dailyReportDataOverview(@Param("day") String day); + + @MapKey("day") + List> selectAlarmCountByDeptIdAndDateRange(@Param("deptId") Long deptId, @Param("beginDate") String beginDate, @Param("endDate") String endDate); + + @MapKey("sn") + List> selectAlarmCountByDeptIdAndDateRangeDesc(@Param("deptId") Long deptId, @Param("beginDate") String beginDate, @Param("endDate") String endDate); + } diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IOilThDeviceReportService.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IOilThDeviceReportService.java index 809c6dc..c4ab0b1 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IOilThDeviceReportService.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IOilThDeviceReportService.java @@ -9,4 +9,8 @@ public interface IOilThDeviceReportService { List> monthReportDataOverviewDeviceDs(Long deptId, String month); List> dailyReportDataOverview(String day); + + List> selectAlarmCountByDeptIdAndDateRange(Long deptId, String beginDate, String endDate); + + List> selectAlarmCountByDeptIdAndDateRangeDesc(Long deptId, String beginDate, String endDate); } diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceReportService.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceReportService.java index bdd02be..65bafc5 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceReportService.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceReportService.java @@ -31,4 +31,14 @@ public class OilThDeviceReportService implements IOilThDeviceReportService { return camelCaseMapListKey(thDeviceReportMapper.dailyReportDataOverview(day)); } + @Override + public List> selectAlarmCountByDeptIdAndDateRange(Long deptId, String beginDate, String endDate) { + return camelCaseMapListKey(thDeviceReportMapper.selectAlarmCountByDeptIdAndDateRange(deptId, beginDate, endDate)); + } + + @Override + public List> selectAlarmCountByDeptIdAndDateRangeDesc(Long deptId, String beginDate, String endDate) { + return camelCaseMapListKey(thDeviceReportMapper.selectAlarmCountByDeptIdAndDateRangeDesc(deptId, beginDate, endDate)); + } + } diff --git a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml index 1d90452..ec182ed 100644 --- a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml +++ b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml @@ -177,4 +177,52 @@ GROUP BY TO_CHAR(d.report_time, 'YYYY-MM-DD'), ppp.dept_name, pp.dept_name, p.dept_name, d.sn ORDER BY ppp.dept_name, pp.dept_name, p.dept_name + + + + + diff --git a/ruoyi-ui/src/api/analysis/index.js b/ruoyi-ui/src/api/analysis/index.js new file mode 100644 index 0000000..f37aa86 --- /dev/null +++ b/ruoyi-ui/src/api/analysis/index.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function factoryBoundaryOnline(params) { + return request({ + url: '/analysis/factoryBoundaryOnline', + params: params, + method: 'get', + }) +} diff --git a/ruoyi-ui/src/views/dataAnalysis/bound/index.vue b/ruoyi-ui/src/views/dataAnalysis/bound/index.vue index 65889da..fc380de 100644 --- a/ruoyi-ui/src/views/dataAnalysis/bound/index.vue +++ b/ruoyi-ui/src/views/dataAnalysis/bound/index.vue @@ -1,302 +1,344 @@ - - - - \ No newline at end of file + lineStyle: { + color: "#DE390F", + }, + label: { + show: true, + color: "#ddd", + formatter: "{c}%", // {c}数据值 + }, + }, + ], + }; + + this.myChart = echarts.init(this.$refs.qdCityMap1); + this.myChart.setOption(option); + }, + }, +}; + +