From 95aa19d43f4f502f678a8a8178148108446c16c2 Mon Sep 17 00:00:00 2001 From: wenjy Date: Sat, 26 Mar 2022 20:17:59 +0800 Subject: [PATCH] =?UTF-8?q?add=20-=20=E5=BC=82=E5=B8=B8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/WisdomScenarioContorller.java | 4 + .../record/RecordAlarmController.java | 126 ++++++++++++++++++ .../src/main/resources/application-druid.yml | 10 +- .../src/main/resources/templates/record/a | 0 .../templates/record/recordAlarm/add.html | 61 +++++++++ .../templates/record/recordAlarm/edit.html | 62 +++++++++ .../record/recordAlarm/recordAlarm.html | 121 +++++++++++++++++ .../templates/section/substation.html | 19 +-- .../com/ruoyi/system/domain/RecordAlarm.java | 109 +++++++++++++++ .../system/mapper/RecordAlarmMapper.java | 61 +++++++++ .../system/service/IRecordAlarmService.java | 61 +++++++++ .../service/impl/RecordAlarmServiceImpl.java | 94 +++++++++++++ .../mapper/system/RecordAlarmMapper.xml | 80 +++++++++++ 13 files changed, 794 insertions(+), 14 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordAlarmController.java create mode 100644 ruoyi-admin/src/main/resources/templates/record/a create mode 100644 ruoyi-admin/src/main/resources/templates/record/recordAlarm/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/record/recordAlarm/edit.html create mode 100644 ruoyi-admin/src/main/resources/templates/record/recordAlarm/recordAlarm.html create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordAlarm.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/RecordAlarmMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IRecordAlarmService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecordAlarmServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/RecordAlarmMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/WisdomScenarioContorller.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/WisdomScenarioContorller.java index 74e1793..5a5ad1f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/WisdomScenarioContorller.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/WisdomScenarioContorller.java @@ -101,4 +101,8 @@ public class WisdomScenarioContorller { return JSONArray.toJSONString(collect); } + + public String getAlarmModule(String monitorUnitId){ + return null; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordAlarmController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordAlarmController.java new file mode 100644 index 0000000..e69a999 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordAlarmController.java @@ -0,0 +1,126 @@ +package com.ruoyi.web.controller.record; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.RecordAlarm; +import com.ruoyi.system.service.IRecordAlarmService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 异常数据记录Controller + * + * @author WenJY + * @date 2022-03-26 + */ +@Controller +@RequestMapping("/record/recordAlarm") +public class RecordAlarmController extends BaseController +{ + private String prefix = "record/recordAlarm"; + + @Autowired + private IRecordAlarmService recordAlarmService; + + @RequiresPermissions("record:recordAlarm:view") + @GetMapping() + public String recordAlarm() + { + return prefix + "/recordAlarm"; + } + + /** + * 查询异常数据记录列表 + */ + @RequiresPermissions("record:recordAlarm:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(RecordAlarm recordAlarm) + { + startPage(); + List list = recordAlarmService.selectRecordAlarmList(recordAlarm); + return getDataTable(list); + } + + /** + * 导出异常数据记录列表 + */ + @RequiresPermissions("record:recordAlarm:export") + @Log(title = "异常数据记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(RecordAlarm recordAlarm) + { + List list = recordAlarmService.selectRecordAlarmList(recordAlarm); + ExcelUtil util = new ExcelUtil(RecordAlarm.class); + return util.exportExcel(list, "异常数据记录数据"); + } + + /** + * 新增异常数据记录 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存异常数据记录 + */ + @RequiresPermissions("record:recordAlarm:add") + @Log(title = "异常数据记录", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(RecordAlarm recordAlarm) + { + return toAjax(recordAlarmService.insertRecordAlarm(recordAlarm)); + } + + /** + * 修改异常数据记录 + */ + @GetMapping("/edit/{sensorId}") + public String edit(@PathVariable("sensorId") String sensorId, ModelMap mmap) + { + RecordAlarm recordAlarm = recordAlarmService.selectRecordAlarmBySensorId(sensorId); + mmap.put("recordAlarm", recordAlarm); + return prefix + "/edit"; + } + + /** + * 修改保存异常数据记录 + */ + @RequiresPermissions("record:recordAlarm:edit") + @Log(title = "异常数据记录", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(RecordAlarm recordAlarm) + { + return toAjax(recordAlarmService.updateRecordAlarm(recordAlarm)); + } + + /** + * 删除异常数据记录 + */ + @RequiresPermissions("record:recordAlarm:remove") + @Log(title = "异常数据记录", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(recordAlarmService.deleteRecordAlarmBySensorIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index ed3ae52..abaf8f6 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,12 +6,12 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: Haiwei123456 -# url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 +# url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # username: root -# password: root +# password: Haiwei123456 + url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: root # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/templates/record/a b/ruoyi-admin/src/main/resources/templates/record/a new file mode 100644 index 0000000..e69de29 diff --git a/ruoyi-admin/src/main/resources/templates/record/recordAlarm/add.html b/ruoyi-admin/src/main/resources/templates/record/recordAlarm/add.html new file mode 100644 index 0000000..76ec615 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/record/recordAlarm/add.html @@ -0,0 +1,61 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/record/recordAlarm/edit.html b/ruoyi-admin/src/main/resources/templates/record/recordAlarm/edit.html new file mode 100644 index 0000000..db008f6 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/record/recordAlarm/edit.html @@ -0,0 +1,62 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/record/recordAlarm/recordAlarm.html b/ruoyi-admin/src/main/resources/templates/record/recordAlarm/recordAlarm.html new file mode 100644 index 0000000..b089d2c --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/record/recordAlarm/recordAlarm.html @@ -0,0 +1,121 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/section/substation.html b/ruoyi-admin/src/main/resources/templates/section/substation.html index 87da090..e13f5e9 100644 --- a/ruoyi-admin/src/main/resources/templates/section/substation.html +++ b/ruoyi-admin/src/main/resources/templates/section/substation.html @@ -217,12 +217,12 @@ id="wisdmoScenarioTitle">监控单元
78
传感器
-
设备高温
3
-
设备振动
3
-
烟雾火情
3
-
环境大风
3
-
室内渗水
3
-
安消视觉
3
+
----
-
+
----
-
+
----
-
+
----
-
+
----
-
+
----
-
@@ -235,6 +235,10 @@