From 3ac2a22b07a3b11c4cf45f39324c14612561b99c Mon Sep 17 00:00:00 2001 From: yinq Date: Wed, 14 Aug 2024 19:51:08 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20add=E8=AE=BE=E5=A4=87=E6=8A=A5?= =?UTF-8?q?=E8=AD=A6=E8=A7=84=E5=88=99=E3=80=81=E8=AE=BE=E5=A4=87=E6=8A=A5?= =?UTF-8?q?=E8=AD=A6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hw/common/core/constant/DmsConstants.java | 5 + .../DmsBaseAlarmRuleController.java | 108 ++++ .../DmsBaseDeviceLedgerController.java | 12 + .../DmsRecordAlarmInfoController.java | 109 ++++ .../com/hw/dms/domain/DmsBaseAlarmRule.java | 201 +++++++ .../com/hw/dms/domain/DmsRecordAlarmInfo.java | 337 +++++++++++ .../hw/dms/mapper/DmsBaseAlarmRuleMapper.java | 61 ++ .../dms/mapper/DmsRecordAlarmInfoMapper.java | 61 ++ .../dms/service/IDmsBaseAlarmRuleService.java | 61 ++ .../service/IDmsRecordAlarmInfoService.java | 69 +++ .../impl/DmsBaseAlarmRuleServiceImpl.java | 90 +++ .../impl/DmsRecordAlarmInfoServiceImpl.java | 107 ++++ .../mapper/dms/DmsBaseAlarmRuleMapper.xml | 145 +++++ .../mapper/dms/DmsRecordAlarmInfoMapper.xml | 182 ++++++ hw-ui/src/api/dms/dmsBaseAlarmRule.js | 53 ++ hw-ui/src/api/dms/dmsRecordAlarmInfo.js | 53 ++ hw-ui/src/api/dms/ledger.js | 9 + .../src/views/dms/dmsBaseAlarmRule/index.vue | 450 ++++++++++++++ .../views/dms/dmsRecordAlarmInfo/index.vue | 554 ++++++++++++++++++ 19 files changed, 2667 insertions(+) create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseAlarmRuleController.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRecordAlarmInfoController.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBaseAlarmRule.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRecordAlarmInfo.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBaseAlarmRuleMapper.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsRecordAlarmInfoMapper.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsBaseAlarmRuleService.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRecordAlarmInfoService.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseAlarmRuleServiceImpl.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordAlarmInfoServiceImpl.java create mode 100644 hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseAlarmRuleMapper.xml create mode 100644 hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRecordAlarmInfoMapper.xml create mode 100644 hw-ui/src/api/dms/dmsBaseAlarmRule.js create mode 100644 hw-ui/src/api/dms/dmsRecordAlarmInfo.js create mode 100644 hw-ui/src/views/dms/dmsBaseAlarmRule/index.vue create mode 100644 hw-ui/src/views/dms/dmsRecordAlarmInfo/index.vue diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/DmsConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/DmsConstants.java index 0d8dec5..e0de586 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/DmsConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/DmsConstants.java @@ -77,4 +77,9 @@ public class DmsConstants { public static final String MES_BASE_ATTACH_INFO_KNOWLEDGEMAINT="4";//保养知识库 public static final String MES_BASE_ATTACH_INFO_KNOWLEDGEREPAIR="5";//设备知识库 + /** 设备报警状态(0未处理 1人工已处理 2自动恢复)*/ + public static final String DMS_ALARM_STATUS_UN_HANDLE="0";//0未处理 + public static final String DMS_ALARM_STATUS_ARTIFICIAL_HANDLE="1";//1人工已处理 + public static final String DMS_ALARM_STATUS_AUTO_HANDLE="2";//2自动恢复 + } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseAlarmRuleController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseAlarmRuleController.java new file mode 100644 index 0000000..8369d7a --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseAlarmRuleController.java @@ -0,0 +1,108 @@ +package com.hw.dms.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.common.security.annotation.RequiresPermissions; +import com.hw.dms.domain.DmsBaseAlarmRule; +import com.hw.dms.service.IDmsBaseAlarmRuleService; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.utils.poi.ExcelUtil; +import com.hw.common.core.web.page.TableDataInfo; + +/** + * 设备报警规则Controller + * + * @author Yinq + * @date 2024-08-13 + */ +@RestController +@RequestMapping("/dmsBaseAlarmRule") +public class DmsBaseAlarmRuleController extends BaseController { + @Autowired + private IDmsBaseAlarmRuleService dmsBaseAlarmRuleService; + + /** + * 查询设备报警规则列表 + */ + @RequiresPermissions("dms:dmsBaseAlarmRule:list") + @GetMapping("/list") + public TableDataInfo list(DmsBaseAlarmRule dmsBaseAlarmRule) { + startPage(); + List list = dmsBaseAlarmRuleService.selectDmsBaseAlarmRuleList(dmsBaseAlarmRule); + return getDataTable(list); + } + + /** + * 查询设备报警规则下拉框列表 + */ + @GetMapping("/getAlarmRuleList") + public AjaxResult getAlarmRuleList(DmsBaseAlarmRule dmsBaseAlarmRule) { + List list = dmsBaseAlarmRuleService.selectDmsBaseAlarmRuleList(dmsBaseAlarmRule); + return success(list); + } + + /** + * 导出设备报警规则列表 + */ + @RequiresPermissions("dms:dmsBaseAlarmRule:export") + @Log(title = "设备报警规则", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DmsBaseAlarmRule dmsBaseAlarmRule) { + List list = dmsBaseAlarmRuleService.selectDmsBaseAlarmRuleList(dmsBaseAlarmRule); + ExcelUtil util = new ExcelUtil(DmsBaseAlarmRule.class); + util.exportExcel(response, list, "设备报警规则数据"); + } + + /** + * 获取设备报警规则详细信息 + */ + @RequiresPermissions("dms:dmsBaseAlarmRule:query") + @GetMapping(value = "/{alarmRuleId}") + public AjaxResult getInfo(@PathVariable("alarmRuleId") Long alarmRuleId) { + return success(dmsBaseAlarmRuleService.selectDmsBaseAlarmRuleByAlarmRuleId(alarmRuleId)); + } + + /** + * 新增设备报警规则 + */ + @RequiresPermissions("dms:dmsBaseAlarmRule:add") + @Log(title = "设备报警规则", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DmsBaseAlarmRule dmsBaseAlarmRule) { + return toAjax(dmsBaseAlarmRuleService.insertDmsBaseAlarmRule(dmsBaseAlarmRule)); + } + + /** + * 修改设备报警规则 + */ + @RequiresPermissions("dms:dmsBaseAlarmRule:edit") + @Log(title = "设备报警规则", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DmsBaseAlarmRule dmsBaseAlarmRule) { + return toAjax(dmsBaseAlarmRuleService.updateDmsBaseAlarmRule(dmsBaseAlarmRule)); + } + + /** + * 删除设备报警规则 + */ + @RequiresPermissions("dms:dmsBaseAlarmRule:remove") + @Log(title = "设备报警规则", businessType = BusinessType.DELETE) + @DeleteMapping("/{alarmRuleIds}") + public AjaxResult remove(@PathVariable Long[] alarmRuleIds) { + return toAjax(dmsBaseAlarmRuleService.deleteDmsBaseAlarmRuleByAlarmRuleIds(alarmRuleIds)); + } +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceLedgerController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceLedgerController.java index e84479b..ae561cd 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceLedgerController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceLedgerController.java @@ -47,6 +47,18 @@ public class DmsBaseDeviceLedgerController extends BaseController return getDataTable(list); } + /** + * 查询设备台账信息下拉框列表 + * @param dmsBaseDeviceLedger + * @return + */ + @GetMapping("/getDeviceLedgerList") + public AjaxResult getDeviceLedgerList(DmsBaseDeviceLedger dmsBaseDeviceLedger) + { + List list = dmsBaseDeviceLedgerService.selectDmsBaseDeviceLedgerList(dmsBaseDeviceLedger); + return success(list); + } + /** * 导出设备台账信息列表 */ diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRecordAlarmInfoController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRecordAlarmInfoController.java new file mode 100644 index 0000000..6ffeb09 --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRecordAlarmInfoController.java @@ -0,0 +1,109 @@ +package com.hw.dms.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.common.security.annotation.RequiresPermissions; +import com.hw.dms.domain.DmsRecordAlarmInfo; +import com.hw.dms.service.IDmsRecordAlarmInfoService; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.utils.poi.ExcelUtil; +import com.hw.common.core.web.page.TableDataInfo; + +/** + * 设备报警记录Controller + * + * @author Yinq + * @date 2024-08-13 + */ +@RestController +@RequestMapping("/dmsRecordAlarmInfo") +public class DmsRecordAlarmInfoController extends BaseController { + @Autowired + private IDmsRecordAlarmInfoService dmsRecordAlarmInfoService; + + /** + * 查询设备报警记录列表 + */ + @RequiresPermissions("dms:dmsRecordAlarmInfo:list") + @GetMapping("/list") + public TableDataInfo list(DmsRecordAlarmInfo dmsRecordAlarmInfo) { + startPage(); + List list = dmsRecordAlarmInfoService.selectDmsRecordAlarmInfoList(dmsRecordAlarmInfo); + return getDataTable(list); + } + + /** + * 导出设备报警记录列表 + */ + @RequiresPermissions("dms:dmsRecordAlarmInfo:export") + @Log(title = "设备报警记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DmsRecordAlarmInfo dmsRecordAlarmInfo) { + List list = dmsRecordAlarmInfoService.selectDmsRecordAlarmInfoList(dmsRecordAlarmInfo); + ExcelUtil util = new ExcelUtil(DmsRecordAlarmInfo.class); + util.exportExcel(response, list, "设备报警记录数据"); + } + + /** + * 获取设备报警记录详细信息 + */ + @RequiresPermissions("dms:dmsRecordAlarmInfo:query") + @GetMapping(value = "/{alarmId}") + public AjaxResult getInfo(@PathVariable("alarmId") Long alarmId) { + return success(dmsRecordAlarmInfoService.selectDmsRecordAlarmInfoByAlarmId(alarmId)); + } + + /** + * 新增设备报警记录 + */ + @RequiresPermissions("dms:dmsRecordAlarmInfo:add") + @Log(title = "设备报警记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DmsRecordAlarmInfo dmsRecordAlarmInfo) { + return toAjax(dmsRecordAlarmInfoService.insertDmsRecordAlarmInfo(dmsRecordAlarmInfo)); + } + + /** + * 修改设备报警记录 + */ + @RequiresPermissions("dms:dmsRecordAlarmInfo:edit") + @Log(title = "设备报警记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DmsRecordAlarmInfo dmsRecordAlarmInfo) { + return toAjax(dmsRecordAlarmInfoService.updateDmsRecordAlarmInfo(dmsRecordAlarmInfo)); + } + + /** + * 删除设备报警记录 + */ + @RequiresPermissions("dms:dmsRecordAlarmInfo:remove") + @Log(title = "设备报警记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{alarmIds}") + public AjaxResult remove(@PathVariable Long[] alarmIds) { + return toAjax(dmsRecordAlarmInfoService.deleteDmsRecordAlarmInfoByAlarmIds(alarmIds)); + } + + /** + * 设备报警人工处理 + */ + @RequiresPermissions("dms:dmsRecordAlarmInfo:edit") + @Log(title = "设备报警记录", businessType = BusinessType.UPDATE) + @PostMapping("/handleDmsRecordAlarmInfo") + public AjaxResult handleDmsRecordAlarmInfo(@RequestBody DmsRecordAlarmInfo dmsRecordAlarmInfo) { + return toAjax(dmsRecordAlarmInfoService.handleDmsRecordAlarmInfo(dmsRecordAlarmInfo)); + } +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBaseAlarmRule.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBaseAlarmRule.java new file mode 100644 index 0000000..ecf74ca --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBaseAlarmRule.java @@ -0,0 +1,201 @@ +package com.hw.dms.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 设备报警规则对象 dms_base_alarm_rule + * + * @author Yinq + * @date 2024-08-13 + */ +public class DmsBaseAlarmRule extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long alarmRuleId; + + /** + * 设备台账id,关联dms_base_device_ledger的device_id + */ + @Excel(name = "设备台账id,关联dms_base_device_ledger的device_id") + private Long deviceId; + + /** + * 报警类型(1AGV 2PLC 3其他设备) + */ + @Excel(name = "报警类型", readConverterExp = "1=AGV,2=PLC,3=其他设备") + private String alarmType; + + + /** + * 报警级别(1一级 2二级 3三级) + */ + @Excel(name = "报警级别", readConverterExp = "1=一级,2=二级,3=三级") + private String alarmLevel; + + /** + * 通知方式(1WEB 2公众号 3PLC)可多选 + */ + @Excel(name = "通知方式", readConverterExp = "1=WEB,2=公众号,3=PLC") + private String noticeType; + + /** + * 自动恢复标识(0否 1是) + */ + @Excel(name = "自动恢复标识", readConverterExp = "0=否,1=是") + private String recoverType; + + /** + * 报警持续时间(ms) + */ + @Excel(name = "报警持续时间(ms)") + private Long continueTime; + + /** + * 报警状态字 + */ + @Excel(name = "报警状态字") + private String alarmStatusWord; + + /** + * 报警原因 + */ + @Excel(name = "报警原因") + private String alarmReason; + + /** + * 处理建议 + */ + @Excel(name = "处理建议") + private String handleSuggest; + + /** 设备编号 */ + @Excel(name = "设备编号") + private String deviceCode; + + /** 设备名称 */ + @Excel(name = "设备名称") + private String deviceName; + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public void setAlarmRuleId(Long alarmRuleId) { + this.alarmRuleId = alarmRuleId; + } + + public Long getAlarmRuleId() { + return alarmRuleId; + } + + public void setDeviceId(Long deviceId) { + this.deviceId = deviceId; + } + + public Long getDeviceId() { + return deviceId; + } + + public void setAlarmType(String alarmType) { + this.alarmType = alarmType; + } + + public String getAlarmType() { + return alarmType; + } + + public void setAlarmLevel(String alarmLevel) { + this.alarmLevel = alarmLevel; + } + + public String getAlarmLevel() { + return alarmLevel; + } + + public void setNoticeType(String noticeType) { + this.noticeType = noticeType; + } + + public String getNoticeType() { + return noticeType; + } + + public void setRecoverType(String recoverType) { + this.recoverType = recoverType; + } + + public String getRecoverType() { + return recoverType; + } + + public void setContinueTime(Long continueTime) { + this.continueTime = continueTime; + } + + public Long getContinueTime() { + return continueTime; + } + + public void setAlarmStatusWord(String alarmStatusWord) { + this.alarmStatusWord = alarmStatusWord; + } + + public String getAlarmStatusWord() { + return alarmStatusWord; + } + + public void setAlarmReason(String alarmReason) { + this.alarmReason = alarmReason; + } + + public String getAlarmReason() { + return alarmReason; + } + + public void setHandleSuggest(String handleSuggest) { + this.handleSuggest = handleSuggest; + } + + public String getHandleSuggest() { + return handleSuggest; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("alarmRuleId", getAlarmRuleId()) + .append("deviceId", getDeviceId()) + .append("alarmType", getAlarmType()) + .append("alarmLevel", getAlarmLevel()) + .append("noticeType", getNoticeType()) + .append("recoverType", getRecoverType()) + .append("continueTime", getContinueTime()) + .append("alarmStatusWord", getAlarmStatusWord()) + .append("alarmReason", getAlarmReason()) + .append("handleSuggest", getHandleSuggest()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRecordAlarmInfo.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRecordAlarmInfo.java new file mode 100644 index 0000000..8577d0e --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRecordAlarmInfo.java @@ -0,0 +1,337 @@ +package com.hw.dms.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.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 设备报警记录对象 dms_record_alarm_info + * + * @author Yinq + * @date 2024-08-13 + */ +public class DmsRecordAlarmInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long alarmId; + + /** + * 设备台账id,关联dms_base_device_ledger的device_id + */ + @Excel(name = "设备台账id") + private Long deviceId; + + /** + * 设备报警规则id,关联dms_base_alarm_rule的alarm_rule_id + */ + @Excel(name = "设备报警规则id") + private Long alarmRuleId; + + /** + * 报警开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "报警开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date alarmBeginTime; + + /** + * 报警结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "报警结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date alarmEndTime; + + /** + * 报警持续时间(ms) + */ + @Excel(name = "报警持续时间", readConverterExp = "m=s") + private Long continueTime; + + /** + * 报警原因 + */ + @Excel(name = "报警原因") + private String alarmReason; + + /** + * 报警数据 + */ + @Excel(name = "报警数据") + private String alarmData; + + /** + * 报警状态(0未处理 1人工已处理 2自动恢复) + */ + @Excel(name = "报警状态", readConverterExp = "0=未处理,1=人工已处理,2=自动恢复") + private String alarmStatus; + + /** + * 处理建议 + */ + @Excel(name = "处理建议") + private String handleSuggest; + + /** + * 通知状态(0未通知 1已通知) + */ + @Excel(name = "通知状态", readConverterExp = "0=未通知,1=已通知") + private String noticeStatus; + + /** + * 处理人员 + */ + @Excel(name = "处理人员") + private String handleUser; + + /** + * 处理时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "处理时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date handleTime; + + /** + * 原因分析 + */ + @Excel(name = "原因分析") + private String causeAnalysis; + + /** + * 报警类型(1AGV 2PLC 3其他设备) + */ + @Excel(name = "报警类型", readConverterExp = "1=AGV,2=PLC,3=其他设备") + private String alarmType; + + + /** + * 报警级别(1一级 2二级 3三级) + */ + @Excel(name = "报警级别", readConverterExp = "1=一级,2=二级,3=三级") + private String alarmLevel; + + /** + * 通知方式(1WEB 2公众号 3PLC)可多选 + */ + @Excel(name = "通知方式", readConverterExp = "1=WEB,2=公众号,3=PLC") + private String noticeType; + + /** + * 自动恢复标识(0否 1是) + */ + @Excel(name = "自动恢复标识", readConverterExp = "0=否,1=是") + private String recoverType; + + /** + * 报警状态字 + */ + @Excel(name = "报警状态字") + private String alarmStatusWord; + + /** 设备编号 */ + @Excel(name = "设备编号") + private String deviceCode; + + /** 设备名称 */ + @Excel(name = "设备名称") + private String deviceName; + + public String getAlarmType() { + return alarmType; + } + + public void setAlarmType(String alarmType) { + this.alarmType = alarmType; + } + + public String getAlarmLevel() { + return alarmLevel; + } + + public void setAlarmLevel(String alarmLevel) { + this.alarmLevel = alarmLevel; + } + + public String getNoticeType() { + return noticeType; + } + + public void setNoticeType(String noticeType) { + this.noticeType = noticeType; + } + + public String getRecoverType() { + return recoverType; + } + + public void setRecoverType(String recoverType) { + this.recoverType = recoverType; + } + + public String getAlarmStatusWord() { + return alarmStatusWord; + } + + public void setAlarmStatusWord(String alarmStatusWord) { + this.alarmStatusWord = alarmStatusWord; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public void setAlarmId(Long alarmId) { + this.alarmId = alarmId; + } + + public Long getAlarmId() { + return alarmId; + } + + public void setDeviceId(Long deviceId) { + this.deviceId = deviceId; + } + + public Long getDeviceId() { + return deviceId; + } + + public void setAlarmRuleId(Long alarmRuleId) { + this.alarmRuleId = alarmRuleId; + } + + public Long getAlarmRuleId() { + return alarmRuleId; + } + + public void setAlarmBeginTime(Date alarmBeginTime) { + this.alarmBeginTime = alarmBeginTime; + } + + public Date getAlarmBeginTime() { + return alarmBeginTime; + } + + public void setAlarmEndTime(Date alarmEndTime) { + this.alarmEndTime = alarmEndTime; + } + + public Date getAlarmEndTime() { + return alarmEndTime; + } + + public void setContinueTime(Long continueTime) { + this.continueTime = continueTime; + } + + public Long getContinueTime() { + return continueTime; + } + + public void setAlarmReason(String alarmReason) { + this.alarmReason = alarmReason; + } + + public String getAlarmReason() { + return alarmReason; + } + + public void setAlarmData(String alarmData) { + this.alarmData = alarmData; + } + + public String getAlarmData() { + return alarmData; + } + + public void setAlarmStatus(String alarmStatus) { + this.alarmStatus = alarmStatus; + } + + public String getAlarmStatus() { + return alarmStatus; + } + + public void setHandleSuggest(String handleSuggest) { + this.handleSuggest = handleSuggest; + } + + public String getHandleSuggest() { + return handleSuggest; + } + + public void setNoticeStatus(String noticeStatus) { + this.noticeStatus = noticeStatus; + } + + public String getNoticeStatus() { + return noticeStatus; + } + + public void setHandleUser(String handleUser) { + this.handleUser = handleUser; + } + + public String getHandleUser() { + return handleUser; + } + + public void setHandleTime(Date handleTime) { + this.handleTime = handleTime; + } + + public Date getHandleTime() { + return handleTime; + } + + public void setCauseAnalysis(String causeAnalysis) { + this.causeAnalysis = causeAnalysis; + } + + public String getCauseAnalysis() { + return causeAnalysis; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("alarmId", getAlarmId()) + .append("deviceId", getDeviceId()) + .append("alarmRuleId", getAlarmRuleId()) + .append("alarmBeginTime", getAlarmBeginTime()) + .append("alarmEndTime", getAlarmEndTime()) + .append("continueTime", getContinueTime()) + .append("alarmReason", getAlarmReason()) + .append("alarmData", getAlarmData()) + .append("alarmStatus", getAlarmStatus()) + .append("handleSuggest", getHandleSuggest()) + .append("noticeStatus", getNoticeStatus()) + .append("handleUser", getHandleUser()) + .append("handleTime", getHandleTime()) + .append("causeAnalysis", getCauseAnalysis()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBaseAlarmRuleMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBaseAlarmRuleMapper.java new file mode 100644 index 0000000..63f9f24 --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBaseAlarmRuleMapper.java @@ -0,0 +1,61 @@ +package com.hw.dms.mapper; + +import java.util.List; + +import com.hw.dms.domain.DmsBaseAlarmRule; + +/** + * 设备报警规则Mapper接口 + * + * @author Yinq + * @date 2024-08-13 + */ +public interface DmsBaseAlarmRuleMapper { + /** + * 查询设备报警规则 + * + * @param alarmRuleId 设备报警规则主键 + * @return 设备报警规则 + */ + public DmsBaseAlarmRule selectDmsBaseAlarmRuleByAlarmRuleId(Long alarmRuleId); + + /** + * 查询设备报警规则列表 + * + * @param dmsBaseAlarmRule 设备报警规则 + * @return 设备报警规则集合 + */ + public List selectDmsBaseAlarmRuleList(DmsBaseAlarmRule dmsBaseAlarmRule); + + /** + * 新增设备报警规则 + * + * @param dmsBaseAlarmRule 设备报警规则 + * @return 结果 + */ + public int insertDmsBaseAlarmRule(DmsBaseAlarmRule dmsBaseAlarmRule); + + /** + * 修改设备报警规则 + * + * @param dmsBaseAlarmRule 设备报警规则 + * @return 结果 + */ + public int updateDmsBaseAlarmRule(DmsBaseAlarmRule dmsBaseAlarmRule); + + /** + * 删除设备报警规则 + * + * @param alarmRuleId 设备报警规则主键 + * @return 结果 + */ + public int deleteDmsBaseAlarmRuleByAlarmRuleId(Long alarmRuleId); + + /** + * 批量删除设备报警规则 + * + * @param alarmRuleIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDmsBaseAlarmRuleByAlarmRuleIds(Long[] alarmRuleIds); +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsRecordAlarmInfoMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsRecordAlarmInfoMapper.java new file mode 100644 index 0000000..ec67b53 --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsRecordAlarmInfoMapper.java @@ -0,0 +1,61 @@ +package com.hw.dms.mapper; + +import java.util.List; + +import com.hw.dms.domain.DmsRecordAlarmInfo; + +/** + * 设备报警记录Mapper接口 + * + * @author Yinq + * @date 2024-08-13 + */ +public interface DmsRecordAlarmInfoMapper { + /** + * 查询设备报警记录 + * + * @param alarmId 设备报警记录主键 + * @return 设备报警记录 + */ + public DmsRecordAlarmInfo selectDmsRecordAlarmInfoByAlarmId(Long alarmId); + + /** + * 查询设备报警记录列表 + * + * @param dmsRecordAlarmInfo 设备报警记录 + * @return 设备报警记录集合 + */ + public List selectDmsRecordAlarmInfoList(DmsRecordAlarmInfo dmsRecordAlarmInfo); + + /** + * 新增设备报警记录 + * + * @param dmsRecordAlarmInfo 设备报警记录 + * @return 结果 + */ + public int insertDmsRecordAlarmInfo(DmsRecordAlarmInfo dmsRecordAlarmInfo); + + /** + * 修改设备报警记录 + * + * @param dmsRecordAlarmInfo 设备报警记录 + * @return 结果 + */ + public int updateDmsRecordAlarmInfo(DmsRecordAlarmInfo dmsRecordAlarmInfo); + + /** + * 删除设备报警记录 + * + * @param alarmId 设备报警记录主键 + * @return 结果 + */ + public int deleteDmsRecordAlarmInfoByAlarmId(Long alarmId); + + /** + * 批量删除设备报警记录 + * + * @param alarmIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDmsRecordAlarmInfoByAlarmIds(Long[] alarmIds); +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsBaseAlarmRuleService.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsBaseAlarmRuleService.java new file mode 100644 index 0000000..e69dd36 --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsBaseAlarmRuleService.java @@ -0,0 +1,61 @@ +package com.hw.dms.service; + +import java.util.List; + +import com.hw.dms.domain.DmsBaseAlarmRule; + +/** + * 设备报警规则Service接口 + * + * @author Yinq + * @date 2024-08-13 + */ +public interface IDmsBaseAlarmRuleService { + /** + * 查询设备报警规则 + * + * @param alarmRuleId 设备报警规则主键 + * @return 设备报警规则 + */ + public DmsBaseAlarmRule selectDmsBaseAlarmRuleByAlarmRuleId(Long alarmRuleId); + + /** + * 查询设备报警规则列表 + * + * @param dmsBaseAlarmRule 设备报警规则 + * @return 设备报警规则集合 + */ + public List selectDmsBaseAlarmRuleList(DmsBaseAlarmRule dmsBaseAlarmRule); + + /** + * 新增设备报警规则 + * + * @param dmsBaseAlarmRule 设备报警规则 + * @return 结果 + */ + public int insertDmsBaseAlarmRule(DmsBaseAlarmRule dmsBaseAlarmRule); + + /** + * 修改设备报警规则 + * + * @param dmsBaseAlarmRule 设备报警规则 + * @return 结果 + */ + public int updateDmsBaseAlarmRule(DmsBaseAlarmRule dmsBaseAlarmRule); + + /** + * 批量删除设备报警规则 + * + * @param alarmRuleIds 需要删除的设备报警规则主键集合 + * @return 结果 + */ + public int deleteDmsBaseAlarmRuleByAlarmRuleIds(Long[] alarmRuleIds); + + /** + * 删除设备报警规则信息 + * + * @param alarmRuleId 设备报警规则主键 + * @return 结果 + */ + public int deleteDmsBaseAlarmRuleByAlarmRuleId(Long alarmRuleId); +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRecordAlarmInfoService.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRecordAlarmInfoService.java new file mode 100644 index 0000000..cdf2b57 --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRecordAlarmInfoService.java @@ -0,0 +1,69 @@ +package com.hw.dms.service; + +import java.util.List; + +import com.hw.dms.domain.DmsRecordAlarmInfo; + +/** + * 设备报警记录Service接口 + * + * @author Yinq + * @date 2024-08-13 + */ +public interface IDmsRecordAlarmInfoService { + /** + * 查询设备报警记录 + * + * @param alarmId 设备报警记录主键 + * @return 设备报警记录 + */ + public DmsRecordAlarmInfo selectDmsRecordAlarmInfoByAlarmId(Long alarmId); + + /** + * 查询设备报警记录列表 + * + * @param dmsRecordAlarmInfo 设备报警记录 + * @return 设备报警记录集合 + */ + public List selectDmsRecordAlarmInfoList(DmsRecordAlarmInfo dmsRecordAlarmInfo); + + /** + * 新增设备报警记录 + * + * @param dmsRecordAlarmInfo 设备报警记录 + * @return 结果 + */ + public int insertDmsRecordAlarmInfo(DmsRecordAlarmInfo dmsRecordAlarmInfo); + + /** + * 修改设备报警记录 + * + * @param dmsRecordAlarmInfo 设备报警记录 + * @return 结果 + */ + public int updateDmsRecordAlarmInfo(DmsRecordAlarmInfo dmsRecordAlarmInfo); + + /** + * 批量删除设备报警记录 + * + * @param alarmIds 需要删除的设备报警记录主键集合 + * @return 结果 + */ + public int deleteDmsRecordAlarmInfoByAlarmIds(Long[] alarmIds); + + /** + * 删除设备报警记录信息 + * + * @param alarmId 设备报警记录主键 + * @return 结果 + */ + public int deleteDmsRecordAlarmInfoByAlarmId(Long alarmId); + + /** + * 设备报警人工处理 + * @param dmsRecordAlarmInfo + * @return + */ + public int handleDmsRecordAlarmInfo(DmsRecordAlarmInfo dmsRecordAlarmInfo); + +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseAlarmRuleServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseAlarmRuleServiceImpl.java new file mode 100644 index 0000000..4bdfb03 --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseAlarmRuleServiceImpl.java @@ -0,0 +1,90 @@ +package com.hw.dms.service.impl; + +import java.util.List; + +import com.hw.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hw.dms.mapper.DmsBaseAlarmRuleMapper; +import com.hw.dms.domain.DmsBaseAlarmRule; +import com.hw.dms.service.IDmsBaseAlarmRuleService; + +/** + * 设备报警规则Service业务层处理 + * + * @author Yinq + * @date 2024-08-13 + */ +@Service +public class DmsBaseAlarmRuleServiceImpl implements IDmsBaseAlarmRuleService { + @Autowired + private DmsBaseAlarmRuleMapper dmsBaseAlarmRuleMapper; + + /** + * 查询设备报警规则 + * + * @param alarmRuleId 设备报警规则主键 + * @return 设备报警规则 + */ + @Override + public DmsBaseAlarmRule selectDmsBaseAlarmRuleByAlarmRuleId(Long alarmRuleId) { + return dmsBaseAlarmRuleMapper.selectDmsBaseAlarmRuleByAlarmRuleId(alarmRuleId); + } + + /** + * 查询设备报警规则列表 + * + * @param dmsBaseAlarmRule 设备报警规则 + * @return 设备报警规则 + */ + @Override + public List selectDmsBaseAlarmRuleList(DmsBaseAlarmRule dmsBaseAlarmRule) { + return dmsBaseAlarmRuleMapper.selectDmsBaseAlarmRuleList(dmsBaseAlarmRule); + } + + /** + * 新增设备报警规则 + * + * @param dmsBaseAlarmRule 设备报警规则 + * @return 结果 + */ + @Override + public int insertDmsBaseAlarmRule(DmsBaseAlarmRule dmsBaseAlarmRule) { + dmsBaseAlarmRule.setCreateTime(DateUtils.getNowDate()); + return dmsBaseAlarmRuleMapper.insertDmsBaseAlarmRule(dmsBaseAlarmRule); + } + + /** + * 修改设备报警规则 + * + * @param dmsBaseAlarmRule 设备报警规则 + * @return 结果 + */ + @Override + public int updateDmsBaseAlarmRule(DmsBaseAlarmRule dmsBaseAlarmRule) { + dmsBaseAlarmRule.setUpdateTime(DateUtils.getNowDate()); + return dmsBaseAlarmRuleMapper.updateDmsBaseAlarmRule(dmsBaseAlarmRule); + } + + /** + * 批量删除设备报警规则 + * + * @param alarmRuleIds 需要删除的设备报警规则主键 + * @return 结果 + */ + @Override + public int deleteDmsBaseAlarmRuleByAlarmRuleIds(Long[] alarmRuleIds) { + return dmsBaseAlarmRuleMapper.deleteDmsBaseAlarmRuleByAlarmRuleIds(alarmRuleIds); + } + + /** + * 删除设备报警规则信息 + * + * @param alarmRuleId 设备报警规则主键 + * @return 结果 + */ + @Override + public int deleteDmsBaseAlarmRuleByAlarmRuleId(Long alarmRuleId) { + return dmsBaseAlarmRuleMapper.deleteDmsBaseAlarmRuleByAlarmRuleId(alarmRuleId); + } +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordAlarmInfoServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordAlarmInfoServiceImpl.java new file mode 100644 index 0000000..c0ab7b4 --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordAlarmInfoServiceImpl.java @@ -0,0 +1,107 @@ +package com.hw.dms.service.impl; + +import java.util.List; + +import com.hw.common.core.constant.DmsConstants; +import com.hw.common.core.utils.DateUtils; +import com.hw.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hw.dms.mapper.DmsRecordAlarmInfoMapper; +import com.hw.dms.domain.DmsRecordAlarmInfo; +import com.hw.dms.service.IDmsRecordAlarmInfoService; + +/** + * 设备报警记录Service业务层处理 + * + * @author Yinq + * @date 2024-08-13 + */ +@Service +public class DmsRecordAlarmInfoServiceImpl implements IDmsRecordAlarmInfoService { + @Autowired + private DmsRecordAlarmInfoMapper dmsRecordAlarmInfoMapper; + + /** + * 查询设备报警记录 + * + * @param alarmId 设备报警记录主键 + * @return 设备报警记录 + */ + @Override + public DmsRecordAlarmInfo selectDmsRecordAlarmInfoByAlarmId(Long alarmId) { + return dmsRecordAlarmInfoMapper.selectDmsRecordAlarmInfoByAlarmId(alarmId); + } + + /** + * 查询设备报警记录列表 + * + * @param dmsRecordAlarmInfo 设备报警记录 + * @return 设备报警记录 + */ + @Override + public List selectDmsRecordAlarmInfoList(DmsRecordAlarmInfo dmsRecordAlarmInfo) { + return dmsRecordAlarmInfoMapper.selectDmsRecordAlarmInfoList(dmsRecordAlarmInfo); + } + + /** + * 新增设备报警记录 + * + * @param dmsRecordAlarmInfo 设备报警记录 + * @return 结果 + */ + @Override + public int insertDmsRecordAlarmInfo(DmsRecordAlarmInfo dmsRecordAlarmInfo) { + dmsRecordAlarmInfo.setCreateTime(DateUtils.getNowDate()); + return dmsRecordAlarmInfoMapper.insertDmsRecordAlarmInfo(dmsRecordAlarmInfo); + } + + /** + * 修改设备报警记录 + * + * @param dmsRecordAlarmInfo 设备报警记录 + * @return 结果 + */ + @Override + public int updateDmsRecordAlarmInfo(DmsRecordAlarmInfo dmsRecordAlarmInfo) { + dmsRecordAlarmInfo.setUpdateTime(DateUtils.getNowDate()); + return dmsRecordAlarmInfoMapper.updateDmsRecordAlarmInfo(dmsRecordAlarmInfo); + } + + /** + * 批量删除设备报警记录 + * + * @param alarmIds 需要删除的设备报警记录主键 + * @return 结果 + */ + @Override + public int deleteDmsRecordAlarmInfoByAlarmIds(Long[] alarmIds) { + return dmsRecordAlarmInfoMapper.deleteDmsRecordAlarmInfoByAlarmIds(alarmIds); + } + + /** + * 删除设备报警记录信息 + * + * @param alarmId 设备报警记录主键 + * @return 结果 + */ + @Override + public int deleteDmsRecordAlarmInfoByAlarmId(Long alarmId) { + return dmsRecordAlarmInfoMapper.deleteDmsRecordAlarmInfoByAlarmId(alarmId); + } + + /** + * 设备报警人工处理 + * @param dmsRecordAlarmInfo + * @return + */ + @Override + public int handleDmsRecordAlarmInfo(DmsRecordAlarmInfo dmsRecordAlarmInfo) { + dmsRecordAlarmInfo.setAlarmStatus(DmsConstants.DMS_ALARM_STATUS_ARTIFICIAL_HANDLE); + dmsRecordAlarmInfo.setHandleUser(SecurityUtils.getUsername()); + dmsRecordAlarmInfo.setHandleTime(DateUtils.getNowDate()); + dmsRecordAlarmInfo.setUpdateBy(SecurityUtils.getUsername()); + dmsRecordAlarmInfo.setUpdateTime(DateUtils.getNowDate()); + return dmsRecordAlarmInfoMapper.updateDmsRecordAlarmInfo(dmsRecordAlarmInfo); + } +} diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseAlarmRuleMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseAlarmRuleMapper.xml new file mode 100644 index 0000000..89f486f --- /dev/null +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseAlarmRuleMapper.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select dbar.alarm_rule_id, + dbar.device_id, + dbdl.device_code, + dbdl.device_name, + dbar.alarm_type, + dbar.alarm_level, + dbar.notice_type, + dbar.recover_type, + dbar.continue_time, + dbar.alarm_status_word, + dbar.alarm_reason, + dbar.handle_suggest, + dbar.remark, + dbar.create_by, + dbar.create_time, + dbar.update_by, + dbar.update_time + from dms_base_alarm_rule dbar + left join dms_base_device_ledger dbdl on dbar.device_id = dbdl.device_id + + + + + + + + insert into dms_base_alarm_rule + + device_id, + alarm_type, + alarm_level, + notice_type, + recover_type, + continue_time, + alarm_status_word, + alarm_reason, + handle_suggest, + remark, + create_by, + create_time, + update_by, + update_time, + + + #{deviceId}, + #{alarmType}, + #{alarmLevel}, + #{noticeType}, + #{recoverType}, + #{continueTime}, + #{alarmStatusWord}, + #{alarmReason}, + #{handleSuggest}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update dms_base_alarm_rule + + device_id = #{deviceId}, + alarm_type = #{alarmType}, + alarm_level = #{alarmLevel}, + notice_type = #{noticeType}, + recover_type = #{recoverType}, + continue_time = #{continueTime}, + alarm_status_word = #{alarmStatusWord}, + alarm_reason = #{alarmReason}, + handle_suggest = #{handleSuggest}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where alarm_rule_id = #{alarmRuleId} + + + + delete + from dms_base_alarm_rule + where alarm_rule_id = #{alarmRuleId} + + + + delete from dms_base_alarm_rule where alarm_rule_id in + + #{alarmRuleId} + + + \ No newline at end of file diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRecordAlarmInfoMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRecordAlarmInfoMapper.xml new file mode 100644 index 0000000..d8f1edf --- /dev/null +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRecordAlarmInfoMapper.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select drai.alarm_id, + drai.device_id, + dbdl.device_code, + dbdl.device_name, + drai.alarm_rule_id, + dbar.alarm_type, + dbar.alarm_level, + dbar.notice_type, + dbar.recover_type, + dbar.alarm_status_word, + drai.alarm_begin_time, + drai.alarm_end_time, + drai.continue_time, + drai.alarm_reason, + drai.alarm_data, + drai.alarm_status, + drai.handle_suggest, + drai.notice_status, + drai.handle_user, + drai.handle_time, + drai.cause_analysis, + drai.remark, + drai.create_by, + drai.create_time, + drai.update_by, + drai.update_time + from dms_record_alarm_info drai + left join dms_base_device_ledger dbdl on drai.device_id = dbdl.device_id + left join dms_base_alarm_rule dbar on drai.alarm_rule_id = dbar.alarm_rule_id + + + + + + + + insert into dms_record_alarm_info + + device_id, + alarm_rule_id, + alarm_begin_time, + alarm_end_time, + continue_time, + alarm_reason, + alarm_data, + alarm_status, + handle_suggest, + notice_status, + handle_user, + handle_time, + cause_analysis, + remark, + create_by, + create_time, + update_by, + update_time, + + + #{deviceId}, + #{alarmRuleId}, + #{alarmBeginTime}, + #{alarmEndTime}, + #{continueTime}, + #{alarmReason}, + #{alarmData}, + #{alarmStatus}, + #{handleSuggest}, + #{noticeStatus}, + #{handleUser}, + #{handleTime}, + #{causeAnalysis}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update dms_record_alarm_info + + device_id = #{deviceId}, + alarm_rule_id = #{alarmRuleId}, + alarm_begin_time = #{alarmBeginTime}, + alarm_end_time = #{alarmEndTime}, + continue_time = #{continueTime}, + alarm_reason = #{alarmReason}, + alarm_data = #{alarmData}, + alarm_status = #{alarmStatus}, + handle_suggest = #{handleSuggest}, + notice_status = #{noticeStatus}, + handle_user = #{handleUser}, + handle_time = #{handleTime}, + cause_analysis = #{causeAnalysis}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where alarm_id = #{alarmId} + + + + delete + from dms_record_alarm_info + where alarm_id = #{alarmId} + + + + delete from dms_record_alarm_info where alarm_id in + + #{alarmId} + + + \ No newline at end of file diff --git a/hw-ui/src/api/dms/dmsBaseAlarmRule.js b/hw-ui/src/api/dms/dmsBaseAlarmRule.js new file mode 100644 index 0000000..37ffbf5 --- /dev/null +++ b/hw-ui/src/api/dms/dmsBaseAlarmRule.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询设备报警规则列表 +export function listDmsBaseAlarmRule(query) { + return request({ + url: '/dms/dmsBaseAlarmRule/list', + method: 'get', + params: query + }) +} + +// 查询设备报警规则详细 +export function getDmsBaseAlarmRule(alarmRuleId) { + return request({ + url: '/dms/dmsBaseAlarmRule/' + alarmRuleId, + method: 'get' + }) +} + +// 新增设备报警规则 +export function addDmsBaseAlarmRule(data) { + return request({ + url: '/dms/dmsBaseAlarmRule', + method: 'post', + data: data + }) +} + +// 修改设备报警规则 +export function updateDmsBaseAlarmRule(data) { + return request({ + url: '/dms/dmsBaseAlarmRule', + method: 'put', + data: data + }) +} + +// 删除设备报警规则 +export function delDmsBaseAlarmRule(alarmRuleId) { + return request({ + url: '/dms/dmsBaseAlarmRule/' + alarmRuleId, + method: 'delete' + }) +} + +// 查询设备报警规则列表 +export function getAlarmRuleList(query) { + return request({ + url: '/dms/dmsBaseAlarmRule/getAlarmRuleList', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/api/dms/dmsRecordAlarmInfo.js b/hw-ui/src/api/dms/dmsRecordAlarmInfo.js new file mode 100644 index 0000000..9b0cd81 --- /dev/null +++ b/hw-ui/src/api/dms/dmsRecordAlarmInfo.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询设备报警记录列表 +export function listDmsRecordAlarmInfo(query) { + return request({ + url: '/dms/dmsRecordAlarmInfo/list', + method: 'get', + params: query + }) +} + +// 查询设备报警记录详细 +export function getDmsRecordAlarmInfo(alarmId) { + return request({ + url: '/dms/dmsRecordAlarmInfo/' + alarmId, + method: 'get' + }) +} + +// 新增设备报警记录 +export function addDmsRecordAlarmInfo(data) { + return request({ + url: '/dms/dmsRecordAlarmInfo', + method: 'post', + data: data + }) +} + +// 修改设备报警记录 +export function updateDmsRecordAlarmInfo(data) { + return request({ + url: '/dms/dmsRecordAlarmInfo', + method: 'put', + data: data + }) +} + +// 删除设备报警记录 +export function delDmsRecordAlarmInfo(alarmId) { + return request({ + url: '/dms/dmsRecordAlarmInfo/' + alarmId, + method: 'delete' + }) +} + +//设备报警人工处理 +export function handleDmsRecordAlarmInfo(data) { + return request({ + url: '/dms/dmsRecordAlarmInfo/handleDmsRecordAlarmInfo', + method: 'post', + data: data + }) +} diff --git a/hw-ui/src/api/dms/ledger.js b/hw-ui/src/api/dms/ledger.js index d840742..04ce59e 100644 --- a/hw-ui/src/api/dms/ledger.js +++ b/hw-ui/src/api/dms/ledger.js @@ -42,3 +42,12 @@ export function delLedger(deviceId) { method: 'delete' }) } + +// 查询设备台账信息下拉框列表 +export function getDeviceLedgerList(query) { + return request({ + url: '/dms/ledger/getDeviceLedgerList', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/views/dms/dmsBaseAlarmRule/index.vue b/hw-ui/src/views/dms/dmsBaseAlarmRule/index.vue new file mode 100644 index 0000000..9481005 --- /dev/null +++ b/hw-ui/src/views/dms/dmsBaseAlarmRule/index.vue @@ -0,0 +1,450 @@ + + + diff --git a/hw-ui/src/views/dms/dmsRecordAlarmInfo/index.vue b/hw-ui/src/views/dms/dmsRecordAlarmInfo/index.vue new file mode 100644 index 0000000..4c5ccdf --- /dev/null +++ b/hw-ui/src/views/dms/dmsRecordAlarmInfo/index.vue @@ -0,0 +1,554 @@ + + +