diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmModuleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmModuleController.java new file mode 100644 index 0000000..08fa3e3 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmModuleController.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.BaseAlarmModule; +import com.ruoyi.system.service.IBaseAlarmModuleService; +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("/base/alarmModule") +public class BaseAlarmModuleController extends BaseController +{ + private String prefix = "base/alarmModule"; + + @Autowired + private IBaseAlarmModuleService baseAlarmModuleService; + + @RequiresPermissions("base:alarmModule:view") + @GetMapping() + public String alarmModule() + { + return prefix + "/alarmModule"; + } + + /** + * 查询报警信息单元列表 + */ + @RequiresPermissions("base:alarmModule:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(BaseAlarmModule baseAlarmModule) + { + startPage(); + List list = baseAlarmModuleService.selectBaseAlarmModuleList(baseAlarmModule); + return getDataTable(list); + } + + /** + * 导出报警信息单元列表 + */ + @RequiresPermissions("base:alarmModule:export") + @Log(title = "报警信息单元", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BaseAlarmModule baseAlarmModule) + { + List list = baseAlarmModuleService.selectBaseAlarmModuleList(baseAlarmModule); + ExcelUtil util = new ExcelUtil(BaseAlarmModule.class); + return util.exportExcel(list, "报警信息单元数据"); + } + + /** + * 新增报警信息单元 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存报警信息单元 + */ + @RequiresPermissions("base:alarmModule:add") + @Log(title = "报警信息单元", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(BaseAlarmModule baseAlarmModule) + { + baseAlarmModule.setAlarmmoduleId(UUID.randomUUID().toString()); + baseAlarmModule.setCreatedBy(ShiroUtils.getLoginName()); + baseAlarmModule.setCreatedTime(new Date()); + return toAjax(baseAlarmModuleService.insertBaseAlarmModule(baseAlarmModule)); + } + + /** + * 修改报警信息单元 + */ + @GetMapping("/edit/{objId}") + public String edit(@PathVariable("objId") String objId, ModelMap mmap) + { + BaseAlarmModule baseAlarmModule = baseAlarmModuleService.selectBaseAlarmModuleByObjId(objId); + mmap.put("baseAlarmModule", baseAlarmModule); + return prefix + "/edit"; + } + + /** + * 修改保存报警信息单元 + */ + @RequiresPermissions("base:alarmModule:edit") + @Log(title = "报警信息单元", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BaseAlarmModule baseAlarmModule) + { + baseAlarmModule.setUpdatedBy(ShiroUtils.getLoginName()); + baseAlarmModule.setUpdatedTime(new Date()); + return toAjax(baseAlarmModuleService.updateBaseAlarmModule(baseAlarmModule)); + } + + /** + * 删除报警信息单元 + */ + @RequiresPermissions("base:alarmModule:remove") + @Log(title = "报警信息单元", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(baseAlarmModuleService.deleteBaseAlarmModuleByObjIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/resources/templates/base/alarmModule/add.html b/ruoyi-admin/src/main/resources/templates/base/alarmModule/add.html new file mode 100644 index 0000000..f81b0cf --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/base/alarmModule/add.html @@ -0,0 +1,60 @@ + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/base/alarmModule/alarmModule.html b/ruoyi-admin/src/main/resources/templates/base/alarmModule/alarmModule.html new file mode 100644 index 0000000..75feb70 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/base/alarmModule/alarmModule.html @@ -0,0 +1,129 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/base/alarmModule/edit.html b/ruoyi-admin/src/main/resources/templates/base/alarmModule/edit.html new file mode 100644 index 0000000..67deca1 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/base/alarmModule/edit.html @@ -0,0 +1,62 @@ + + + + + + + +
+
+ + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseAlarmModule.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseAlarmModule.java new file mode 100644 index 0000000..0100ba9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseAlarmModule.java @@ -0,0 +1,164 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 报警信息单元对象 base_alarm_module + * + * @author WenJY + * @date 2022-03-26 + */ +public class BaseAlarmModule extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键标识 */ + private String objId; + + /** 单元编号 */ + @Excel(name = "单元编号") + private String alarmmoduleId; + + /** 告警单元 */ + @Excel(name = "告警单元") + private String alarmmoduleText; + + /** 监控单元 */ + @Excel(name = "监控单元") + private String monitorunitId; + + /** 报警类型 */ + private String alarmTypeId; + + /** 是否启用 */ + @Excel(name = "是否启用") + private Long enableFlag; + + /** 创建人 */ + @Excel(name = "创建人") + private String createdBy; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createdTime; + + /** 更新人 */ + @Excel(name = "更新人") + private String updatedBy; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date updatedTime; + + public void setObjId(String objId) + { + this.objId = objId; + } + + public String getObjId() + { + return objId; + } + public void setAlarmmoduleId(String alarmmoduleId) + { + this.alarmmoduleId = alarmmoduleId; + } + + public String getAlarmmoduleId() + { + return alarmmoduleId; + } + public void setAlarmmoduleText(String alarmmoduleText) + { + this.alarmmoduleText = alarmmoduleText; + } + + public String getAlarmmoduleText() + { + return alarmmoduleText; + } + public void setMonitorunitId(String monitorunitId) + { + this.monitorunitId = monitorunitId; + } + + public String getMonitorunitId() + { + return monitorunitId; + } + public void setEnableFlag(Long enableFlag) + { + this.enableFlag = enableFlag; + } + + public Long getEnableFlag() + { + return enableFlag; + } + public void setCreatedBy(String createdBy) + { + this.createdBy = createdBy; + } + + public String getCreatedBy() + { + return createdBy; + } + public void setCreatedTime(Date createdTime) + { + this.createdTime = createdTime; + } + + public Date getCreatedTime() + { + return createdTime; + } + public void setUpdatedBy(String updatedBy) + { + this.updatedBy = updatedBy; + } + + public String getUpdatedBy() + { + return updatedBy; + } + public void setUpdatedTime(Date updatedTime) + { + this.updatedTime = updatedTime; + } + + public Date getUpdatedTime() + { + return updatedTime; + } + + public String getAlarmTypeId() { + return alarmTypeId; + } + + public void setAlarmTypeId(String alarmTypeId) { + this.alarmTypeId = alarmTypeId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("alarmmoduleId", getAlarmmoduleId()) + .append("alarmmoduleText", getAlarmmoduleText()) + .append("monitorunitId", getMonitorunitId()) + .append("enableFlag", getEnableFlag()) + .append("createdBy", getCreatedBy()) + .append("createdTime", getCreatedTime()) + .append("updatedBy", getUpdatedBy()) + .append("updatedTime", getUpdatedTime()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseAlarmModuleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseAlarmModuleMapper.java new file mode 100644 index 0000000..396ccfd --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseAlarmModuleMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.BaseAlarmModule; + +/** + * 报警信息单元Mapper接口 + * + * @author WenJY + * @date 2022-03-26 + */ +public interface BaseAlarmModuleMapper +{ + /** + * 查询报警信息单元 + * + * @param objId 报警信息单元主键 + * @return 报警信息单元 + */ + public BaseAlarmModule selectBaseAlarmModuleByObjId(String objId); + + /** + * 查询报警信息单元列表 + * + * @param baseAlarmModule 报警信息单元 + * @return 报警信息单元集合 + */ + public List selectBaseAlarmModuleList(BaseAlarmModule baseAlarmModule); + + /** + * 新增报警信息单元 + * + * @param baseAlarmModule 报警信息单元 + * @return 结果 + */ + public int insertBaseAlarmModule(BaseAlarmModule baseAlarmModule); + + /** + * 修改报警信息单元 + * + * @param baseAlarmModule 报警信息单元 + * @return 结果 + */ + public int updateBaseAlarmModule(BaseAlarmModule baseAlarmModule); + + /** + * 删除报警信息单元 + * + * @param objId 报警信息单元主键 + * @return 结果 + */ + public int deleteBaseAlarmModuleByObjId(String objId); + + /** + * 批量删除报警信息单元 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBaseAlarmModuleByObjIds(String[] objIds); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBaseAlarmModuleService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBaseAlarmModuleService.java new file mode 100644 index 0000000..b9b1edd --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBaseAlarmModuleService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.BaseAlarmModule; + +/** + * 报警信息单元Service接口 + * + * @author WenJY + * @date 2022-03-26 + */ +public interface IBaseAlarmModuleService +{ + /** + * 查询报警信息单元 + * + * @param objId 报警信息单元主键 + * @return 报警信息单元 + */ + public BaseAlarmModule selectBaseAlarmModuleByObjId(String objId); + + /** + * 查询报警信息单元列表 + * + * @param baseAlarmModule 报警信息单元 + * @return 报警信息单元集合 + */ + public List selectBaseAlarmModuleList(BaseAlarmModule baseAlarmModule); + + /** + * 新增报警信息单元 + * + * @param baseAlarmModule 报警信息单元 + * @return 结果 + */ + public int insertBaseAlarmModule(BaseAlarmModule baseAlarmModule); + + /** + * 修改报警信息单元 + * + * @param baseAlarmModule 报警信息单元 + * @return 结果 + */ + public int updateBaseAlarmModule(BaseAlarmModule baseAlarmModule); + + /** + * 批量删除报警信息单元 + * + * @param objIds 需要删除的报警信息单元主键集合 + * @return 结果 + */ + public int deleteBaseAlarmModuleByObjIds(String objIds); + + /** + * 删除报警信息单元信息 + * + * @param objId 报警信息单元主键 + * @return 结果 + */ + public int deleteBaseAlarmModuleByObjId(String objId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BaseAlarmModuleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BaseAlarmModuleServiceImpl.java new file mode 100644 index 0000000..e6d74da --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BaseAlarmModuleServiceImpl.java @@ -0,0 +1,94 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.BaseAlarmModuleMapper; +import com.ruoyi.system.domain.BaseAlarmModule; +import com.ruoyi.system.service.IBaseAlarmModuleService; +import com.ruoyi.common.core.text.Convert; + +/** + * 报警信息单元Service业务层处理 + * + * @author WenJY + * @date 2022-03-26 + */ +@Service +public class BaseAlarmModuleServiceImpl implements IBaseAlarmModuleService +{ + @Autowired + private BaseAlarmModuleMapper baseAlarmModuleMapper; + + /** + * 查询报警信息单元 + * + * @param objId 报警信息单元主键 + * @return 报警信息单元 + */ + @Override + public BaseAlarmModule selectBaseAlarmModuleByObjId(String objId) + { + return baseAlarmModuleMapper.selectBaseAlarmModuleByObjId(objId); + } + + /** + * 查询报警信息单元列表 + * + * @param baseAlarmModule 报警信息单元 + * @return 报警信息单元 + */ + @Override + public List selectBaseAlarmModuleList(BaseAlarmModule baseAlarmModule) + { + return baseAlarmModuleMapper.selectBaseAlarmModuleList(baseAlarmModule); + } + + /** + * 新增报警信息单元 + * + * @param baseAlarmModule 报警信息单元 + * @return 结果 + */ + @Override + public int insertBaseAlarmModule(BaseAlarmModule baseAlarmModule) + { + return baseAlarmModuleMapper.insertBaseAlarmModule(baseAlarmModule); + } + + /** + * 修改报警信息单元 + * + * @param baseAlarmModule 报警信息单元 + * @return 结果 + */ + @Override + public int updateBaseAlarmModule(BaseAlarmModule baseAlarmModule) + { + return baseAlarmModuleMapper.updateBaseAlarmModule(baseAlarmModule); + } + + /** + * 批量删除报警信息单元 + * + * @param objIds 需要删除的报警信息单元主键 + * @return 结果 + */ + @Override + public int deleteBaseAlarmModuleByObjIds(String objIds) + { + return baseAlarmModuleMapper.deleteBaseAlarmModuleByObjIds(Convert.toStrArray(objIds)); + } + + /** + * 删除报警信息单元信息 + * + * @param objId 报警信息单元主键 + * @return 结果 + */ + @Override + public int deleteBaseAlarmModuleByObjId(String objId) + { + return baseAlarmModuleMapper.deleteBaseAlarmModuleByObjId(objId); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/BaseAlarmModuleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BaseAlarmModuleMapper.xml new file mode 100644 index 0000000..b1d3795 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/BaseAlarmModuleMapper.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + select ObjId, AlarmModule_Id, AlarmModule_Text, MonitorUnit_Id,AlarmType_Id, Enable_Flag, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME from base_alarm_module + + + + + + + + insert into base_alarm_module + + ObjId, + AlarmModule_Id, + AlarmModule_Text, + MonitorUnit_Id, + AlarmType_Id, + Enable_Flag, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + + + #{objId}, + #{alarmmoduleId}, + #{alarmmoduleText}, + #{monitorunitId}, + #{alarmTypeId}, + #{enableFlag}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + + + + + update base_alarm_module + + AlarmModule_Id = #{alarmmoduleId}, + AlarmModule_Text = #{alarmmoduleText}, + MonitorUnit_Id = #{monitorunitId}, + AlarmType_Id = #{alarmTypeId}, + Enable_Flag = #{enableFlag}, + CREATED_BY = #{createdBy}, + CREATED_TIME = #{createdTime}, + UPDATED_BY = #{updatedBy}, + UPDATED_TIME = #{updatedTime}, + + where ObjId = #{objId} + + + + delete from base_alarm_module where ObjId = #{objId} + + + + delete from base_alarm_module where ObjId in + + #{objId} + + + + \ No newline at end of file