From 846a0491a70c77e5bc509a91de83105301424f08 Mon Sep 17 00:00:00 2001 From: wenjy Date: Tue, 3 May 2022 13:28:17 +0800 Subject: [PATCH] =?UTF-8?q?add=20-=20=E5=91=8A=E8=AD=A6=E9=A1=9E=E5=88=A5?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20change=20-=20=E5=91=8A=E8=AD=A6=E5=96=AE?= =?UTF-8?q?=E5=85=83=E6=B7=BB=E5=8A=A0=E5=91=8A=E8=AD=A6=E9=A1=9E=E5=88=A5?= =?UTF-8?q?=E9=97=9C=E8=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/BaseAlarmCategoryController.java | 135 ++++++++++++++++++ .../templates/base/alarmCategory/add.html | 39 +++++ .../base/alarmCategory/alarmCategory.html | 110 ++++++++++++++ .../templates/base/alarmCategory/edit.html | 40 ++++++ .../templates/base/alarmModule/add.html | 9 ++ .../base/alarmModule/alarmModule.html | 13 +- .../templates/base/alarmModule/edit.html | 9 ++ .../system/domain/BaseAlarmCategory.java | 92 ++++++++++++ .../ruoyi/system/domain/BaseAlarmModule.java | 21 +++ .../mapper/BaseAlarmCategoryMapper.java | 61 ++++++++ .../service/IBaseAlarmCategoryService.java | 61 ++++++++ .../impl/BaseAlarmCategoryServiceImpl.java | 105 ++++++++++++++ .../mapper/system/BaseAlarmCategoryMapper.xml | 83 +++++++++++ .../mapper/system/BaseAlarmModuleMapper.xml | 14 +- 14 files changed, 790 insertions(+), 2 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmCategoryController.java create mode 100644 ruoyi-admin/src/main/resources/templates/base/alarmCategory/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/base/alarmCategory/alarmCategory.html create mode 100644 ruoyi-admin/src/main/resources/templates/base/alarmCategory/edit.html create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseAlarmCategory.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseAlarmCategoryMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IBaseAlarmCategoryService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BaseAlarmCategoryServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/BaseAlarmCategoryMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmCategoryController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmCategoryController.java new file mode 100644 index 0000000..971d02b --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmCategoryController.java @@ -0,0 +1,135 @@ +package com.ruoyi.web.controller.base; + +import java.util.Date; +import java.util.List; +import java.util.UUID; + +import com.ruoyi.common.utils.ShiroUtils; +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.BaseAlarmCategory; +import com.ruoyi.system.service.IBaseAlarmCategoryService; +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-05-03 + */ +@Controller +@RequestMapping("/base/alarmCategory") +public class BaseAlarmCategoryController extends BaseController +{ + private String prefix = "base/alarmCategory"; + + @Autowired + private IBaseAlarmCategoryService baseAlarmCategoryService; + + @RequiresPermissions("base:alarmCategory:view") + @GetMapping() + public String alarmCategory() + { + return prefix + "/alarmCategory"; + } + + /** + * 查询告警类别信息列表 + */ + @RequiresPermissions("base:alarmCategory:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(BaseAlarmCategory baseAlarmCategory) + { + startPage(); + List list = baseAlarmCategoryService.selectBaseAlarmCategoryList(baseAlarmCategory); + return getDataTable(list); + } + + /** + * 导出告警类别信息列表 + */ + @RequiresPermissions("base:alarmCategory:export") + @Log(title = "告警类别信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BaseAlarmCategory baseAlarmCategory) + { + List list = baseAlarmCategoryService.selectBaseAlarmCategoryList(baseAlarmCategory); + ExcelUtil util = new ExcelUtil(BaseAlarmCategory.class); + return util.exportExcel(list, "告警类别信息数据"); + } + + /** + * 新增告警类别信息 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存告警类别信息 + */ + @RequiresPermissions("base:alarmCategory:add") + @Log(title = "告警类别信息", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(BaseAlarmCategory baseAlarmCategory) + { + baseAlarmCategory.setAlarmcategoryId(UUID.randomUUID().toString()); + baseAlarmCategory.setCreateBy(ShiroUtils.getLoginName()); + baseAlarmCategory.setCreateTime(new Date()); + return toAjax(baseAlarmCategoryService.insertBaseAlarmCategory(baseAlarmCategory)); + } + + /** + * 修改告警类别信息 + */ + @GetMapping("/edit/{objId}") + public String edit(@PathVariable("objId") Long objId, ModelMap mmap) + { + BaseAlarmCategory baseAlarmCategory = baseAlarmCategoryService.selectBaseAlarmCategoryByObjId(objId); + mmap.put("baseAlarmCategory", baseAlarmCategory); + return prefix + "/edit"; + } + + /** + * 修改保存告警类别信息 + */ + @RequiresPermissions("base:alarmCategory:edit") + @Log(title = "告警类别信息", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BaseAlarmCategory baseAlarmCategory) + { + baseAlarmCategory.setUpdateBy(ShiroUtils.getLoginName()); + baseAlarmCategory.setUpdateTime(new Date()); + return toAjax(baseAlarmCategoryService.updateBaseAlarmCategory(baseAlarmCategory)); + } + + /** + * 删除告警类别信息 + */ + @RequiresPermissions("base:alarmCategory:remove") + @Log(title = "告警类别信息", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(baseAlarmCategoryService.deleteBaseAlarmCategoryByObjIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/resources/templates/base/alarmCategory/add.html b/ruoyi-admin/src/main/resources/templates/base/alarmCategory/add.html new file mode 100644 index 0000000..f036921 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/base/alarmCategory/add.html @@ -0,0 +1,39 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/base/alarmCategory/alarmCategory.html b/ruoyi-admin/src/main/resources/templates/base/alarmCategory/alarmCategory.html new file mode 100644 index 0000000..8aece49 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/base/alarmCategory/alarmCategory.html @@ -0,0 +1,110 @@ + + + + + + +
+
+
+
+
+
    + +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/base/alarmCategory/edit.html b/ruoyi-admin/src/main/resources/templates/base/alarmCategory/edit.html new file mode 100644 index 0000000..38f26fa --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/base/alarmCategory/edit.html @@ -0,0 +1,40 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/base/alarmModule/add.html b/ruoyi-admin/src/main/resources/templates/base/alarmModule/add.html index adc18ad..59f9291 100644 --- a/ruoyi-admin/src/main/resources/templates/base/alarmModule/add.html +++ b/ruoyi-admin/src/main/resources/templates/base/alarmModule/add.html @@ -14,6 +14,15 @@ +
+ +
+ +
+