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 @@