diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/OilReportController.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/OilReportController.java index e5ca76a..dbcd15b 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/OilReportController.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/OilReportController.java @@ -46,11 +46,11 @@ public class OilReportController extends BaseController { // 异常设备数 int abnormalDeviceCount = getDeviceCount(deptId, year, 0); // 全年解决报警次数 -// int alarmSolveCountYear = oilThDeviceDealService.countThDeviceDealByYear(year); + int alarmSolveCountYear = oilThDeviceDealService.countThDeviceDealByYear(year); resultMap.put("deviceCount", deviceCount); resultMap.put("normalDeviceCount", normalDeviceCount); resultMap.put("abnormalDeviceCount", abnormalDeviceCount); -// resultMap.put("alarmSolveCountYear", alarmSolveCountYear); + resultMap.put("alarmSolveCountYear", alarmSolveCountYear); return AjaxResult.success(resultMap); } diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/OilMonitorMapper.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/OilMonitorMapper.java index 943fbdd..0fa096c 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/OilMonitorMapper.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/OilMonitorMapper.java @@ -114,5 +114,5 @@ public interface OilMonitorMapper { Integer querryDealTotal(@Param("reportId") Long reportId); - + Integer countThDeviceDealByYear(@Param("year") String year); } diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceDealMapper.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceDealMapper.java index 73acd7c..c38a008 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceDealMapper.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceDealMapper.java @@ -3,14 +3,7 @@ package com.ruoyi.project.oil.mapper; import org.apache.ibatis.annotations.Param; -import java.util.Map; -/** - * @author Lenovo - * @description 针对表【th_device_deal】的数据库操作Mapper - * @createDate 2024-10-29 15:40:41 - * @Entity com.ruoyi.oil.domain.monitor.ThDeviceDeal - */ public interface ThDeviceDealMapper { - int countThDeviceDealByYear(@Param("year") String year); + int selectThDeviceDealByYear(@Param("year") String year); } diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceDealServiceImpl.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceDealServiceImpl.java index 183bb5f..984031b 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceDealServiceImpl.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceDealServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.project.oil.service.impl; +import com.ruoyi.project.oil.mapper.OilMonitorMapper; import com.ruoyi.project.oil.mapper.ThDeviceDealMapper; import com.ruoyi.project.oil.service.IOilThDeviceDealService; import org.springframework.beans.factory.annotation.Autowired; @@ -9,10 +10,10 @@ import org.springframework.stereotype.Service; public class OilThDeviceDealServiceImpl implements IOilThDeviceDealService { @Autowired - private ThDeviceDealMapper thDeviceDealMapper; + private OilMonitorMapper oilMonitorMapper; @Override public int countThDeviceDealByYear(String year) { - return thDeviceDealMapper.countThDeviceDealByYear(year); + return oilMonitorMapper.countThDeviceDealByYear(year); } } diff --git a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/OilMonitorMapper.xml b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/OilMonitorMapper.xml index 8603449..0413d70 100644 --- a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/OilMonitorMapper.xml +++ b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/OilMonitorMapper.xml @@ -471,4 +471,9 @@ select t.id,t. name,t.unit_no,t.system_no,t.status,t.sn,t.file_url,t.note,t.crea + + \ No newline at end of file diff --git a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceDeal.xml b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceDeal.xml deleted file mode 100644 index 9bf1bb6..0000000 --- a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceDeal.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ruoyi-ui/src/views/reportGenerate/bound/index.vue b/ruoyi-ui/src/views/reportGenerate/bound/index.vue index 75b6f3a..358add0 100644 --- a/ruoyi-ui/src/views/reportGenerate/bound/index.vue +++ b/ruoyi-ui/src/views/reportGenerate/bound/index.vue @@ -42,7 +42,7 @@
@@ -107,59 +107,8 @@ export default { dept: null, year: "", total: 0, - tableData: [ - { - deptName: "企业1", - sn: "SN001", - position: "位置1", - month1: 1, - month2: 2, - month3: 3, - month4: 4, - month5: 5, - month6: 6, - month7: 7, - month8: 8, - month9: 9, - month10: 10, - month11: 11, - month12: 12, - }, - { - deptName: "企业2", - sn: "SN002", - position: "位置2", - month1: 1, - month2: 2, - month3: 3, - month4: 4, - month5: 5, - month6: 6, - month7: 7, - month8: 8, - month9: 9, - month10: 10, - month11: 11, - month12: 12, - }, - { - deptName: "企业3", - sn: "SN003", - position: "位置3", - month1: 1, - month2: 2, - month3: 3, - month4: 4, - month5: 5, - month6: 6, - month7: 7, - month8: 8, - month9: 9, - month10: 10, - month11: 11, - month12: 12, - }, - ], + tableData: [], + rowTagNum: 4, dashboardTag: [ { label: "设备总数", @@ -171,26 +120,26 @@ export default { key: "normalDeviceCount", icon: "el-icon-help", }, - { - label: "异常设备数", - key: "abnormalDeviceCount", - icon: "el-icon-s-help", - }, + // { + // label: "异常设备数", + // key: "abnormalDeviceCount", + // icon: "el-icon-s-help", + // }, // { // label: "正在报警设备数", // key: "alarmDeviceCount", // icon: "el-icon-message-solid", // }, - // { - // label: "全年报警次数", - // key: "alarmCountYear", - // icon: "el-icon-s-marketing", - // }, - // { - // label: "全年解决报警次数", - // key: "alarmSolveCountYear", - // icon: "el-icon-folder-checked", - // }, + { + label: "全年报警次数", + key: "alarmCountYear", + icon: "el-icon-s-marketing", + }, + { + label: "全年解决报警次数", + key: "alarmSolveCountYear", + icon: "el-icon-folder-checked", + }, // { // label: "全年未解决报警次数", // key: "alarmUnsolvedCountYear", @@ -243,7 +192,7 @@ export default { } return newArr; } - return splitArray(this.dashboardTag, 3); + return splitArray(this.dashboardTag, this.rowTagNum); }, }, methods: { @@ -272,6 +221,17 @@ export default { }).then((res) => { if (res.code === 200) { this.tableData = res.data; + console.log(this.tableData); + this.dashboardData.alarmCountYear = res.data.reduce((prev, cur) => { + for (let key in cur) { + if (key.includes("month")) { + prev += cur[key]; + } + } + return prev; + }, + 0 + ); } }); @@ -308,7 +268,7 @@ export default { display: flex; flex-direction: column; justify-content: center; - align-items: end; + align-items: flex-end; .card-content__title { font-size: 14px;