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