From ced5c8b162c1ea875ca9e920518ffec5c6b02d90 Mon Sep 17 00:00:00 2001 From: gongjiale <942894820@qq.com> Date: Sat, 12 Oct 2024 22:24:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E9=83=A8=E5=88=86=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oil/controller/HomeController.java | 47 + .../ruoyi/project/oil/mapper/HomeMapper.java | 24 + .../project/oil/service/IHomeService.java | 23 + .../oil/service/impl/HomeServiceImpl.java | 38 + .../src/main/resources/application.yml | 8 +- .../main/resources/mybatis/oil/HomeMapper.xml | 42 + ruoyi-ui/src/api/home.js | 150 +--- ruoyi-ui/src/views/home/components/Left.vue | 219 +---- ruoyi-ui/src/views/home/components/Right.vue | 836 +++++------------- ruoyi-ui/src/views/home/components/middle.vue | 250 +++--- .../src/views/home/components/topicHeader.vue | 23 +- 11 files changed, 606 insertions(+), 1054 deletions(-) create mode 100644 RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/HomeController.java create mode 100644 RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/HomeMapper.java create mode 100644 RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IHomeService.java create mode 100644 RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/HomeServiceImpl.java create mode 100644 RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/HomeMapper.xml diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/HomeController.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/HomeController.java new file mode 100644 index 0000000..3477828 --- /dev/null +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/HomeController.java @@ -0,0 +1,47 @@ +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.IHomeService; +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.List; +import java.util.Map; + +import static com.ruoyi.framework.web.domain.AjaxResult.success; + +/** + * 首页 + */ +@RestController +@RequestMapping("/home") +public class HomeController extends BaseController { + @Autowired + private IHomeService homeService; + /** + * 查询设备数量情况 + */ + @GetMapping("/queryDeviceCount") + public AjaxResult queryDeviceCount() { + Map list = homeService.queryDeviceCount(); + return success(list); + } + /** + * 查询各企业设备总数 + */ + @GetMapping("/queryDeviceByFactory") + public AjaxResult queryDeviceByFactory() { + List> list = homeService.queryDeviceByFactory(); + return success(list); + } + + @GetMapping("/queryTodayAlarm") + public AjaxResult queryTodayAlarm(String date) { + List> list = homeService.queryTodayAlarm(date); + return success(list); + } + +} diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/HomeMapper.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/HomeMapper.java new file mode 100644 index 0000000..75cc35a --- /dev/null +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/HomeMapper.java @@ -0,0 +1,24 @@ +package com.ruoyi.project.oil.mapper; + +import java.util.List; +import java.util.Map; + +public interface HomeMapper { + /** + * 查询设备数量情况 + * @return + */ + public Map queryDeviceCount() ; + + /** + * 查询各企业设备总数 + */ + List> queryDeviceByFactory(); + + /** + * 查询今日报警信息 + * @param queryTodayAlarm + * @return + */ + List> queryTodayAlarm(String date); +} diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IHomeService.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IHomeService.java new file mode 100644 index 0000000..ea8554e --- /dev/null +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IHomeService.java @@ -0,0 +1,23 @@ +package com.ruoyi.project.oil.service; + +import java.util.List; +import java.util.Map; + +public interface IHomeService { + /** + * 查询设备数量情况 + */ + Map queryDeviceCount(); + /** + * 查询各企业设备总数 + */ + + List> queryDeviceByFactory(); + + /** + * 查询今日报警信息 + * @param date + * @return + */ + List> queryTodayAlarm(String date); +} diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/HomeServiceImpl.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/HomeServiceImpl.java new file mode 100644 index 0000000..a7ef84c --- /dev/null +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/HomeServiceImpl.java @@ -0,0 +1,38 @@ +package com.ruoyi.project.oil.service.impl; + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.oil.domain.SendInfo; +import com.ruoyi.project.oil.mapper.HomeMapper; +import com.ruoyi.project.oil.service.IHomeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +import java.util.List; +import java.util.Map; + +import static com.ruoyi.framework.web.domain.AjaxResult.success; + +@Service +public class HomeServiceImpl implements IHomeService { + + @Autowired + private HomeMapper homeMapper; + + + @Override + public Map queryDeviceCount() { + return homeMapper.queryDeviceCount(); + } + + @Override + public List> queryDeviceByFactory() { + return homeMapper.queryDeviceByFactory(); + } + + @Override + public List> queryTodayAlarm(String queryTodayAlarm) { + return homeMapper.queryTodayAlarm(queryTodayAlarm); + } +} diff --git a/RuoYi-Vue-Oracle/src/main/resources/application.yml b/RuoYi-Vue-Oracle/src/main/resources/application.yml index 370056a..850a9e5 100644 --- a/RuoYi-Vue-Oracle/src/main/resources/application.yml +++ b/RuoYi-Vue-Oracle/src/main/resources/application.yml @@ -73,15 +73,15 @@ spring: # redis 配置 redis: # 地址 - # host: 192.168.31.105 - host: 127.0.0.1 + host: 192.168.31.105 + # host: 127.0.0.1 # 端口,默认为6379 port: 6379 # 数据库索引 database: 0 # 密码 - password: 123456 - #password: admin123! + # password: 123456 + password: admin123! # 连接超时时间 timeout: 10s lettuce: diff --git a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/HomeMapper.xml b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/HomeMapper.xml new file mode 100644 index 0000000..148318a --- /dev/null +++ b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/HomeMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/home.js b/ruoyi-ui/src/api/home.js index 5225430..1526faf 100644 --- a/ruoyi-ui/src/api/home.js +++ b/ruoyi-ui/src/api/home.js @@ -1,58 +1,29 @@ import request from '@/utils/request' -// 获取密封点概况 -export function countGroupByType(params) { +// 获取设备状况 +export function queryDeviceCount() { return request({ - url: '/point/countGroupByType', + url: '/home/queryDeviceCount', method: 'get', - params:params + }) +} +//查询各企业设备总是 +export function queryDeviceByFactory() { + return request({ + url: '/home/queryDeviceByFactory', + method: 'get', + }) +} +//查询今日报警 +export function queryTodayAlarm(data) { + return request({ + url: '/home/queryTodayAlarm', + method: 'get', + params: data }) } -// 获取各区市的企业情况 -export function aggregateByCity(params) { - return request({ - url: '/factory/aggregateByCity', - method: 'get', - params:params - }) - } - // 查询全市共有多少企业 -export function queryCountFactory(params) { - return request({ - url: '/factory/queryCountFactory', - method: 'get', - params:params - }) - } - // 查询全市企业的经纬度 -export function getAllFactory(params) { - - return request({ - url: '/factory/getAllFactory', - method: 'get', - params:params - }) - } - // 查询企业的设备列表 -export function queryDeviceByFactory(params) { - - - return request({ - url: '/app/queryDeviceByFactory', - method: 'get', - params:params - }) -} -// 查询各个企业检测进度 -export function queryDetectProgress(data) { - return request({ - url: '/exam/queryDetectProgress', - method: 'post', - data: data - }) - } // 查询各个企业vocs排放量统计 export function findEmissionCharts(data) { return request({ @@ -62,91 +33,6 @@ export function findEmissionCharts(data) { }) } -// 查询不合规统计 -export function queryOilNot(data) { - return request({ - url: '/point/queryOilNot', - method: 'post', - data: data - }) - } - // 查询不合规明细 -export function queryOilNotDetail(data) { - return request({ - url: '/point/queryOilNotDetail', - method: 'post', - data: data - }) - } - // 查询建档不合规统计 -export function queryArchivesNot(data) { - return request({ - url: '/point/queryArchivesNot', - method: 'post', - data: data - }) -} -// 查询建档不合规明细 -export function quertNotArchivesDetail(data) { - return request({ - url: '/point/quertNotArchivesDetail', - method: 'post', - data: data - }) -} - - - // 查询检测不合规统计 -export function findIllegal(data) { - return request({ - url: '/exam/findIllegal', - method: 'post', - data: data - }) -} - // 查询检测不合规明细 - export function findIllegalByFactoryId(data) { - return request({ - url: '/exam/findIllegalByFactoryId', - method: 'post', - data: data - }) - } - // 查询修复不合规统计 - export function findRecheckIllegal(data) { - return request({ - url: '/recheck/findIllegal', - method: 'post', - data: data - }) - } - // 查询修复不合规明细 - export function findIllegalRecheckByFactoryId(data) { - return request({ - url: '/recheck/findIllegalByFactoryId', - method: 'post', - data: data - }) -} - - -//查询未检测的密封点 -export function queryFailDetect(data) { - return request({ - url: '/ldar/queryFailDetect', - method: 'post', - data: data - }) -} -//查询未检测的密封点详情 -export function queryFailDetectList(data) { - return request({ - url: '/ldar/queryFailDetectList', - method: 'post', - data: data - }) -} - //发送消息 export function sendMessage(data) { return request({ diff --git a/ruoyi-ui/src/views/home/components/Left.vue b/ruoyi-ui/src/views/home/components/Left.vue index 1d1da8c..081c9f4 100644 --- a/ruoyi-ui/src/views/home/components/Left.vue +++ b/ruoyi-ui/src/views/home/components/Left.vue @@ -16,7 +16,7 @@
集团共有监测设备
-