change - add设备报警规则、设备报警记录

master
yinq 3 months ago
parent a1bf717d40
commit 3ac2a22b07

@ -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自动恢复
}

@ -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<DmsBaseAlarmRule> list = dmsBaseAlarmRuleService.selectDmsBaseAlarmRuleList(dmsBaseAlarmRule);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/getAlarmRuleList")
public AjaxResult getAlarmRuleList(DmsBaseAlarmRule dmsBaseAlarmRule) {
List<DmsBaseAlarmRule> 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<DmsBaseAlarmRule> list = dmsBaseAlarmRuleService.selectDmsBaseAlarmRuleList(dmsBaseAlarmRule);
ExcelUtil<DmsBaseAlarmRule> util = new ExcelUtil<DmsBaseAlarmRule>(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));
}
}

@ -47,6 +47,18 @@ public class DmsBaseDeviceLedgerController extends BaseController
return getDataTable(list);
}
/**
*
* @param dmsBaseDeviceLedger
* @return
*/
@GetMapping("/getDeviceLedgerList")
public AjaxResult getDeviceLedgerList(DmsBaseDeviceLedger dmsBaseDeviceLedger)
{
List<DmsBaseDeviceLedger> list = dmsBaseDeviceLedgerService.selectDmsBaseDeviceLedgerList(dmsBaseDeviceLedger);
return success(list);
}
/**
*
*/

@ -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<DmsRecordAlarmInfo> 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<DmsRecordAlarmInfo> list = dmsRecordAlarmInfoService.selectDmsRecordAlarmInfoList(dmsRecordAlarmInfo);
ExcelUtil<DmsRecordAlarmInfo> util = new ExcelUtil<DmsRecordAlarmInfo>(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));
}
}

@ -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_ledgerdevice_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();
}
}

@ -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_ledgerdevice_id
*/
@Excel(name = "设备台账id")
private Long deviceId;
/**
* id,dms_base_alarm_rulealarm_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();
}
}

@ -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<DmsBaseAlarmRule> 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);
}

@ -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<DmsRecordAlarmInfo> 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);
}

@ -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<DmsBaseAlarmRule> 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);
}

@ -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<DmsRecordAlarmInfo> 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);
}

@ -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<DmsBaseAlarmRule> 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);
}
}

@ -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<DmsRecordAlarmInfo> 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);
}
}

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.dms.mapper.DmsBaseAlarmRuleMapper">
<resultMap type="DmsBaseAlarmRule" id="DmsBaseAlarmRuleResult">
<result property="alarmRuleId" column="alarm_rule_id"/>
<result property="deviceId" column="device_id"/>
<result property="alarmType" column="alarm_type"/>
<result property="alarmLevel" column="alarm_level"/>
<result property="noticeType" column="notice_type"/>
<result property="recoverType" column="recover_type"/>
<result property="continueTime" column="continue_time"/>
<result property="alarmStatusWord" column="alarm_status_word"/>
<result property="alarmReason" column="alarm_reason"/>
<result property="handleSuggest" column="handle_suggest"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="deviceCode" column="device_code"/>
<result property="deviceName" column="device_name"/>
</resultMap>
<sql id="selectDmsBaseAlarmRuleVo">
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
</sql>
<select id="selectDmsBaseAlarmRuleList" parameterType="DmsBaseAlarmRule" resultMap="DmsBaseAlarmRuleResult">
<include refid="selectDmsBaseAlarmRuleVo"/>
<where>
<if test="deviceId != null ">and dbar.device_id = #{deviceId}</if>
<if test="alarmType != null and alarmType != ''">and dbar.alarm_type = #{alarmType}</if>
<if test="alarmLevel != null and alarmLevel != ''">and dbar.alarm_level = #{alarmLevel}</if>
<if test="noticeType != null and noticeType != ''">and dbar.notice_type like concat('%', #{noticeType}, '%')
</if>
<if test="recoverType != null and recoverType != ''">and dbar.recover_type = #{recoverType}</if>
<if test="continueTime != null ">and dbar.continue_time = #{continueTime}</if>
<if test="alarmStatusWord != null and alarmStatusWord != ''">and dbar.alarm_status_word = #{alarmStatusWord}
</if>
<if test="alarmReason != null and alarmReason != ''">and dbar.alarm_reason like concat('%', #{alarmReason},
'%')
</if>
<if test="handleSuggest != null and handleSuggest != ''">and dbar.handle_suggest like concat('%',
#{handleSuggest}, '%')
</if>
</where>
</select>
<select id="selectDmsBaseAlarmRuleByAlarmRuleId" parameterType="Long" resultMap="DmsBaseAlarmRuleResult">
<include refid="selectDmsBaseAlarmRuleVo"/>
where dbar.alarm_rule_id = #{alarmRuleId}
</select>
<insert id="insertDmsBaseAlarmRule" parameterType="DmsBaseAlarmRule" useGeneratedKeys="true"
keyProperty="alarmRuleId">
insert into dms_base_alarm_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceId != null">device_id,</if>
<if test="alarmType != null and alarmType != ''">alarm_type,</if>
<if test="alarmLevel != null and alarmLevel != ''">alarm_level,</if>
<if test="noticeType != null">notice_type,</if>
<if test="recoverType != null">recover_type,</if>
<if test="continueTime != null">continue_time,</if>
<if test="alarmStatusWord != null">alarm_status_word,</if>
<if test="alarmReason != null">alarm_reason,</if>
<if test="handleSuggest != null">handle_suggest,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceId != null">#{deviceId},</if>
<if test="alarmType != null and alarmType != ''">#{alarmType},</if>
<if test="alarmLevel != null and alarmLevel != ''">#{alarmLevel},</if>
<if test="noticeType != null">#{noticeType},</if>
<if test="recoverType != null">#{recoverType},</if>
<if test="continueTime != null">#{continueTime},</if>
<if test="alarmStatusWord != null">#{alarmStatusWord},</if>
<if test="alarmReason != null">#{alarmReason},</if>
<if test="handleSuggest != null">#{handleSuggest},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDmsBaseAlarmRule" parameterType="DmsBaseAlarmRule">
update dms_base_alarm_rule
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="alarmType != null and alarmType != ''">alarm_type = #{alarmType},</if>
<if test="alarmLevel != null and alarmLevel != ''">alarm_level = #{alarmLevel},</if>
<if test="noticeType != null">notice_type = #{noticeType},</if>
<if test="recoverType != null">recover_type = #{recoverType},</if>
<if test="continueTime != null">continue_time = #{continueTime},</if>
<if test="alarmStatusWord != null">alarm_status_word = #{alarmStatusWord},</if>
<if test="alarmReason != null">alarm_reason = #{alarmReason},</if>
<if test="handleSuggest != null">handle_suggest = #{handleSuggest},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where alarm_rule_id = #{alarmRuleId}
</update>
<delete id="deleteDmsBaseAlarmRuleByAlarmRuleId" parameterType="Long">
delete
from dms_base_alarm_rule
where alarm_rule_id = #{alarmRuleId}
</delete>
<delete id="deleteDmsBaseAlarmRuleByAlarmRuleIds" parameterType="String">
delete from dms_base_alarm_rule where alarm_rule_id in
<foreach item="alarmRuleId" collection="array" open="(" separator="," close=")">
#{alarmRuleId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,182 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.dms.mapper.DmsRecordAlarmInfoMapper">
<resultMap type="DmsRecordAlarmInfo" id="DmsRecordAlarmInfoResult">
<result property="alarmId" column="alarm_id"/>
<result property="deviceId" column="device_id"/>
<result property="alarmRuleId" column="alarm_rule_id"/>
<result property="alarmBeginTime" column="alarm_begin_time"/>
<result property="alarmEndTime" column="alarm_end_time"/>
<result property="continueTime" column="continue_time"/>
<result property="alarmReason" column="alarm_reason"/>
<result property="alarmData" column="alarm_data"/>
<result property="alarmStatus" column="alarm_status"/>
<result property="handleSuggest" column="handle_suggest"/>
<result property="noticeStatus" column="notice_status"/>
<result property="handleUser" column="handle_user"/>
<result property="handleTime" column="handle_time"/>
<result property="causeAnalysis" column="cause_analysis"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="alarmLevel" column="alarm_level"/>
<result property="noticeType" column="notice_type"/>
<result property="recoverType" column="recover_type"/>
<result property="alarmType" column="alarm_type"/>
<result property="deviceCode" column="device_code"/>
<result property="deviceName" column="device_name"/>
</resultMap>
<sql id="selectDmsRecordAlarmInfoVo">
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
</sql>
<select id="selectDmsRecordAlarmInfoList" parameterType="DmsRecordAlarmInfo" resultMap="DmsRecordAlarmInfoResult">
<include refid="selectDmsRecordAlarmInfoVo"/>
<where>
<if test="deviceId != null ">and drai.device_id = #{deviceId}</if>
<if test="alarmType != null and alarmType != ''">and dbar.alarm_type = #{alarmType}</if>
<if test="alarmLevel != null and alarmLevel != ''">and dbar.alarm_level = #{alarmLevel}</if>
<if test="alarmRuleId != null ">and drai.alarm_rule_id = #{alarmRuleId}</if>
<if test="params.beginAlarmBeginTime != null and params.beginAlarmBeginTime != '' and params.endAlarmBeginTime != null and params.endAlarmBeginTime != ''">
and drai.alarm_begin_time between #{params.beginAlarmBeginTime} and #{params.endAlarmBeginTime}
</if>
<if test="params.beginAlarmEndTime != null and params.beginAlarmEndTime != '' and params.endAlarmEndTime != null and params.endAlarmEndTime != ''">
and drai.alarm_end_time between #{params.beginAlarmEndTime} and #{params.endAlarmEndTime}
</if>
<if test="continueTime != null ">and drai.continue_time = #{continueTime}</if>
<if test="alarmReason != null and alarmReason != ''">and drai.alarm_reason = #{alarmReason}</if>
<if test="alarmData != null and alarmData != ''">and drai.alarm_data = #{alarmData}</if>
<if test="alarmStatus != null and alarmStatus != ''">and drai.alarm_status = #{alarmStatus}</if>
<if test="handleSuggest != null and handleSuggest != ''">and drai.handle_suggest = #{handleSuggest}</if>
<if test="noticeStatus != null and noticeStatus != ''">and drai.notice_status = #{noticeStatus}</if>
<if test="handleUser != null and handleUser != ''">and drai.handle_user = #{handleUser}</if>
<if test="params.beginHandleTime != null and params.beginHandleTime != '' and params.endHandleTime != null and params.endHandleTime != ''">
and drai.handle_time between #{params.beginHandleTime} and #{params.endHandleTime}
</if>
<if test="causeAnalysis != null and causeAnalysis != ''">and drai.cause_analysis = #{causeAnalysis}</if>
</where>
order by drai.alarm_begin_time desc
</select>
<select id="selectDmsRecordAlarmInfoByAlarmId" parameterType="Long" resultMap="DmsRecordAlarmInfoResult">
<include refid="selectDmsRecordAlarmInfoVo"/>
where alarm_id = #{alarmId}
</select>
<insert id="insertDmsRecordAlarmInfo" parameterType="DmsRecordAlarmInfo" useGeneratedKeys="true"
keyProperty="alarmId">
insert into dms_record_alarm_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceId != null">device_id,</if>
<if test="alarmRuleId != null">alarm_rule_id,</if>
<if test="alarmBeginTime != null">alarm_begin_time,</if>
<if test="alarmEndTime != null">alarm_end_time,</if>
<if test="continueTime != null">continue_time,</if>
<if test="alarmReason != null">alarm_reason,</if>
<if test="alarmData != null">alarm_data,</if>
<if test="alarmStatus != null and alarmStatus != ''">alarm_status,</if>
<if test="handleSuggest != null">handle_suggest,</if>
<if test="noticeStatus != null and noticeStatus != ''">notice_status,</if>
<if test="handleUser != null">handle_user,</if>
<if test="handleTime != null">handle_time,</if>
<if test="causeAnalysis != null">cause_analysis,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceId != null">#{deviceId},</if>
<if test="alarmRuleId != null">#{alarmRuleId},</if>
<if test="alarmBeginTime != null">#{alarmBeginTime},</if>
<if test="alarmEndTime != null">#{alarmEndTime},</if>
<if test="continueTime != null">#{continueTime},</if>
<if test="alarmReason != null">#{alarmReason},</if>
<if test="alarmData != null">#{alarmData},</if>
<if test="alarmStatus != null and alarmStatus != ''">#{alarmStatus},</if>
<if test="handleSuggest != null">#{handleSuggest},</if>
<if test="noticeStatus != null and noticeStatus != ''">#{noticeStatus},</if>
<if test="handleUser != null">#{handleUser},</if>
<if test="handleTime != null">#{handleTime},</if>
<if test="causeAnalysis != null">#{causeAnalysis},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDmsRecordAlarmInfo" parameterType="DmsRecordAlarmInfo">
update dms_record_alarm_info
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="alarmRuleId != null">alarm_rule_id = #{alarmRuleId},</if>
<if test="alarmBeginTime != null">alarm_begin_time = #{alarmBeginTime},</if>
<if test="alarmEndTime != null">alarm_end_time = #{alarmEndTime},</if>
<if test="continueTime != null">continue_time = #{continueTime},</if>
<if test="alarmReason != null">alarm_reason = #{alarmReason},</if>
<if test="alarmData != null">alarm_data = #{alarmData},</if>
<if test="alarmStatus != null and alarmStatus != ''">alarm_status = #{alarmStatus},</if>
<if test="handleSuggest != null">handle_suggest = #{handleSuggest},</if>
<if test="noticeStatus != null and noticeStatus != ''">notice_status = #{noticeStatus},</if>
<if test="handleUser != null">handle_user = #{handleUser},</if>
<if test="handleTime != null">handle_time = #{handleTime},</if>
<if test="causeAnalysis != null">cause_analysis = #{causeAnalysis},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where alarm_id = #{alarmId}
</update>
<delete id="deleteDmsRecordAlarmInfoByAlarmId" parameterType="Long">
delete
from dms_record_alarm_info
where alarm_id = #{alarmId}
</delete>
<delete id="deleteDmsRecordAlarmInfoByAlarmIds" parameterType="String">
delete from dms_record_alarm_info where alarm_id in
<foreach item="alarmId" collection="array" open="(" separator="," close=")">
#{alarmId}
</foreach>
</delete>
</mapper>

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

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

@ -42,3 +42,12 @@ export function delLedger(deviceId) {
method: 'delete'
})
}
// 查询设备台账信息下拉框列表
export function getDeviceLedgerList(query) {
return request({
url: '/dms/ledger/getDeviceLedgerList',
method: 'get',
params: query
})
}

@ -0,0 +1,450 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="设备名称" prop="deviceId">
<el-select v-model="queryParams.deviceId" placeholder="请选择设备名称" filterable clearable>
<el-option
v-for="item in deviceLedgerList"
:key="item.deviceId"
:label="item.deviceName"
:value="item.deviceId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="报警类型" prop="alarmType">
<el-select v-model="queryParams.alarmType" placeholder="请选择报警类型" clearable>
<el-option
v-for="dict in dict.type.dms_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="报警级别" prop="alarmLevel">
<el-select v-model="queryParams.alarmLevel" placeholder="请选择报警级别" clearable>
<el-option
v-for="dict in dict.type.dms_alarm_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="自动恢复标识" prop="recoverType">
<el-select v-model="queryParams.recoverType" placeholder="请选择自动恢复标识" clearable>
<el-option
v-for="dict in dict.type.dms_recover_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="报警持续时间(ms)" prop="continueTime">-->
<!-- <el-input-->
<!-- v-model="queryParams.continueTime"-->
<!-- placeholder="请输入报警持续时间(ms)"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="报警状态字" prop="alarmStatusWord">
<el-input
v-model="queryParams.alarmStatusWord"
placeholder="请输入报警状态字"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['dms:dmsBaseAlarmRule:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['dms:dmsBaseAlarmRule:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['dms:dmsBaseAlarmRule:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['dms:dmsBaseAlarmRule:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="dmsBaseAlarmRuleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="主键标识" align="center" prop="alarmRuleId" v-if="columns[0].visible"/>
<el-table-column label="设备名称" align="center" prop="deviceName" v-if="columns[1].visible"/>
<el-table-column label="报警类型" align="center" prop="alarmType" v-if="columns[2].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_alarm_type" :value="scope.row.alarmType"/>
</template>
</el-table-column>
<el-table-column label="报警级别" align="center" prop="alarmLevel" v-if="columns[3].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_alarm_level" :value="scope.row.alarmLevel"/>
</template>
</el-table-column>
<el-table-column label="通知方式" align="center" prop="noticeType" v-if="columns[4].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_notice_type"
:value="scope.row.noticeType ? scope.row.noticeType.split(',') : []"/>
</template>
</el-table-column>
<el-table-column label="自动恢复标识" align="center" prop="recoverType" v-if="columns[5].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_recover_type" :value="scope.row.recoverType"/>
</template>
</el-table-column>
<el-table-column label="报警持续时间(ms)" align="center" prop="continueTime" v-if="columns[6].visible" width="130"/>
<el-table-column label="报警状态字" align="center" prop="alarmStatusWord" v-if="columns[7].visible"/>
<el-table-column label="报警原因" align="center" prop="alarmReason" v-if="columns[8].visible"
:show-overflow-tooltip="true"/>
<el-table-column label="处理建议" align="center" prop="handleSuggest" v-if="columns[9].visible"
:show-overflow-tooltip="true"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[10].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['dms:dmsBaseAlarmRule:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['dms:dmsBaseAlarmRule:remove']"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备报警规则对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-form-item label="设备名称" prop="deviceId">
<el-select v-model="form.deviceId" placeholder="请选择设备名称">
<el-option
v-for="item in deviceLedgerList"
:key="item.deviceId"
:label="item.deviceName"
:value="item.deviceId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="报警类型" prop="alarmType">
<el-radio-group v-model="form.alarmType">
<el-radio
v-for="dict in dict.type.dms_alarm_type"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="报警级别" prop="alarmLevel">
<el-select v-model="form.alarmLevel" placeholder="请选择报警级别">
<el-option
v-for="dict in dict.type.dms_alarm_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="通知方式" prop="noticeType">
<el-checkbox-group v-model="form.noticeType">
<el-checkbox
v-for="dict in dict.type.dms_notice_type"
:key="dict.value"
:label="dict.value">
{{ dict.label }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="自动恢复标识" prop="recoverType">
<el-radio-group v-model="form.recoverType">
<el-radio
v-for="dict in dict.type.dms_recover_type"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="报警持续时间(ms)" prop="continueTime">
<el-input-number v-model="form.continueTime" placeholder="请输入报警持续时间(ms)"/>
</el-form-item>
<el-form-item label="报警状态字" prop="alarmStatusWord">
<el-input v-model="form.alarmStatusWord" placeholder="请输入报警状态字"/>
</el-form-item>
<el-form-item label="报警原因" prop="alarmReason">
<el-input v-model="form.alarmReason" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="处理建议" prop="handleSuggest">
<el-input v-model="form.handleSuggest" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listDmsBaseAlarmRule,
getDmsBaseAlarmRule,
delDmsBaseAlarmRule,
addDmsBaseAlarmRule,
updateDmsBaseAlarmRule
} from "@/api/dms/dmsBaseAlarmRule";
import {getDeviceLedgerList} from "@/api/dms/ledger";
export default {
name: "DmsBaseAlarmRule",
dicts: ['dms_recover_type', 'dms_notice_type', 'dms_alarm_type', 'dms_alarm_level'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dmsBaseAlarmRuleList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceId: null,
alarmType: null,
alarmLevel: null,
noticeType: null,
recoverType: null,
continueTime: null,
alarmStatusWord: null,
alarmReason: null,
handleSuggest: null,
},
//
form: {},
//
rules: {
deviceId: [
{required: true, message: "设备名称", trigger: "blur"}
],
alarmType: [
{required: true, message: "报警类型不能为空", trigger: "change"}
],
alarmLevel: [
{required: true, message: "报警级别不能为空", trigger: "change"}
],
},
columns: [
{key: 0, label: `主键标识`, visible: false},
{key: 1, label: `设备名称`, visible: true},
{key: 2, label: `报警类型`, visible: true},
{key: 3, label: `报警级别`, visible: true},
{key: 4, label: `通知方式`, visible: true},
{key: 5, label: `自动恢复标识`, visible: true},
{key: 6, label: `报警持续时间(ms)`, visible: true},
{key: 7, label: `报警状态字`, visible: true},
{key: 8, label: `报警原因`, visible: true},
{key: 9, label: `处理建议`, visible: true},
{key: 10, label: `备注`, visible: true}
],
//
deviceLedgerList: []
};
},
created() {
getDeviceLedgerList(null).then(response => {
this.deviceLedgerList = response.data
})
this.getList();
},
methods: {
/** 查询设备报警规则列表 */
getList() {
this.loading = true;
listDmsBaseAlarmRule(this.queryParams).then(response => {
this.dmsBaseAlarmRuleList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
alarmRuleId: null,
deviceId: null,
deviceCode: null,
deviceName: null,
alarmType: null,
alarmLevel: null,
noticeType: [],
recoverType: null,
continueTime: null,
alarmStatusWord: null,
alarmReason: null,
handleSuggest: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.alarmRuleId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备报警规则";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const alarmRuleId = row.alarmRuleId || this.ids
getDmsBaseAlarmRule(alarmRuleId).then(response => {
this.form = response.data;
this.form.noticeType = this.form.noticeType.split(",");
this.open = true;
this.title = "修改设备报警规则";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.noticeType = this.form.noticeType.join(",");
if (this.form.alarmRuleId != null) {
updateDmsBaseAlarmRule(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDmsBaseAlarmRule(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const alarmRuleIds = row.alarmRuleId || this.ids;
this.$modal.confirm('是否确认删除设备报警规则编号为"' + alarmRuleIds + '"的数据项?').then(function () {
return delDmsBaseAlarmRule(alarmRuleIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('dms/dmsBaseAlarmRule/export', {
...this.queryParams
}, `dmsBaseAlarmRule_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,554 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="设备名称" prop="deviceId">
<el-select v-model="queryParams.deviceId" placeholder="请选择设备名称" filterable clearable>
<el-option
v-for="item in deviceLedgerList"
:key="item.deviceId"
:label="item.deviceName"
:value="item.deviceId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="报警类型" prop="alarmType">
<el-select v-model="queryParams.alarmType" placeholder="请选择报警类型" clearable>
<el-option
v-for="dict in dict.type.dms_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="报警级别" prop="alarmLevel">
<el-select v-model="queryParams.alarmLevel" placeholder="请选择报警级别" clearable>
<el-option
v-for="dict in dict.type.dms_alarm_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="报警状态" prop="alarmStatus">
<el-select v-model="queryParams.alarmStatus" placeholder="请选择报警状态" clearable>
<el-option
v-for="dict in dict.type.dms_alarm_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="通知状态" prop="noticeStatus">
<el-select v-model="queryParams.noticeStatus" placeholder="请选择通知状态" clearable>
<el-option
v-for="dict in dict.type.dms_notice_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="报警开始时间">
<el-date-picker
v-model="daterangeAlarmBeginTime"
style="width: 340px"
value-format=" yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
></el-date-picker>
</el-form-item>
<!-- <el-form-item label="报警结束时间">-->
<!-- <el-date-picker-->
<!-- v-model="daterangeAlarmEndTime"-->
<!-- style="width: 240px"-->
<!-- value-format=" yyyy-MM-dd HH:mm:ss"-->
<!-- type="datetimerange"-->
<!-- range-separator="-"-->
<!-- start-placeholder="开始时间"-->
<!-- end-placeholder="结束时间"-->
<!-- ></el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="处理人员" prop="handleUser">-->
<!-- <el-input-->
<!-- v-model="queryParams.handleUser"-->
<!-- placeholder="请输入处理人员"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="处理时间">-->
<!-- <el-date-picker-->
<!-- v-model="daterangeHandleTime"-->
<!-- style="width: 240px"-->
<!-- value-format=" yyyy-MM-dd HH:mm:ss"-->
<!-- type="datetimerange"-->
<!-- range-separator="-"-->
<!-- start-placeholder="开始时间"-->
<!-- end-placeholder="结束时间"-->
<!-- ></el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['dms:dmsRecordAlarmInfo:add']"-->
<!-- >新增-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['dms:dmsRecordAlarmInfo:edit']"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['dms:dmsRecordAlarmInfo:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['dms:dmsRecordAlarmInfo:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="dmsRecordAlarmInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="主键标识" align="center" prop="alarmId" v-if="columns[0].visible"/>
<el-table-column label="设备名称" align="center" prop="deviceName" v-if="columns[1].visible"/>
<el-table-column label="设备报警规则id" align="center" prop="alarmRuleId" v-if="columns[2].visible"/>
<el-table-column label="报警类型" align="center" prop="alarmType" v-if="columns[19].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_alarm_type" :value="scope.row.alarmType"/>
</template>
</el-table-column>
<el-table-column label="报警级别" align="center" prop="alarmLevel" v-if="columns[20].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_alarm_level" :value="scope.row.alarmLevel"/>
</template>
</el-table-column>
<el-table-column label="通知方式" align="center" prop="noticeType" v-if="columns[21].visible" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_notice_type"
:value="scope.row.noticeType ? scope.row.noticeType.split(',') : []"/>
</template>
</el-table-column>
<el-table-column label="自动恢复标识" align="center" prop="recoverType" v-if="columns[22].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_recover_type" :value="scope.row.recoverType"/>
</template>
</el-table-column>
<el-table-column label="报警状态字" align="center" prop="alarmStatusWord" v-if="columns[23].visible" width="90"/>
<el-table-column label="报警状态" align="center" prop="alarmStatus" v-if="columns[8].visible" width="90">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_alarm_status" :value="scope.row.alarmStatus"/>
</template>
</el-table-column>
<el-table-column label="报警原因" align="center" prop="alarmReason" v-if="columns[6].visible"
:show-overflow-tooltip="true"/>
<el-table-column label="报警数据" align="center" prop="alarmData" v-if="columns[7].visible"
:show-overflow-tooltip="true"/>
<el-table-column label="处理建议" align="center" prop="handleSuggest" v-if="columns[9].visible"
:show-overflow-tooltip="true"/>
<el-table-column label="通知状态" align="center" prop="noticeStatus" v-if="columns[10].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_notice_status" :value="scope.row.noticeStatus"/>
</template>
</el-table-column>
<el-table-column label="报警开始时间" align="center" prop="alarmBeginTime" width="180" v-if="columns[3].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.alarmBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="报警结束时间" align="center" prop="alarmEndTime" width="180" v-if="columns[4].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.alarmEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="报警持续时间(ms)" align="center" prop="continueTime" v-if="columns[5].visible" width="130"/>
<el-table-column label="处理人员" align="center" prop="handleUser" v-if="columns[11].visible"/>
<el-table-column label="处理时间" align="center" prop="handleTime" width="180" v-if="columns[12].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.handleTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="原因分析" align="center" prop="causeAnalysis" v-if="columns[13].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[14].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-success"
@click="handleUpdate(scope.row)"
v-hasPermi="['dms:dmsRecordAlarmInfo:edit']"
v-if="scope.row.alarmStatus === '0'"
>处理
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['dms:dmsRecordAlarmInfo:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备报警记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" disabled/>
</el-form-item>
<!-- <el-form-item label="设备报警规则id" prop="alarmRuleId">-->
<!-- <el-input v-model="form.alarmRuleId" placeholder="请输入设备报警规则id"/>-->
<!-- </el-form-item>-->
<el-form-item label="报警开始时间" prop="alarmBeginTime">
<el-date-picker clearable
v-model="form.alarmBeginTime"
type="datetime"
value-format=" yyyy-MM-dd HH:mm:ss"
disabled>
</el-date-picker>
</el-form-item>
<el-form-item label="报警结束时间" prop="alarmEndTime">
<el-date-picker clearable
v-model="form.alarmEndTime"
type="datetime"
value-format=" yyyy-MM-dd HH:mm:ss"
disabled>
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="报警持续时间(ms)" prop="continueTime">-->
<!-- <el-input v-model="form.continueTime" placeholder="请输入报警持续时间(ms)"/>-->
<!-- </el-form-item>-->
<el-form-item label="报警原因" prop="alarmReason">
<el-input v-model="form.alarmReason" type="textarea" disabled/>
</el-form-item>
<el-form-item label="报警数据" prop="alarmData">
<el-input v-model="form.alarmData" type="textarea" disabled/>
</el-form-item>
<el-form-item label="报警状态" prop="alarmStatus">
<el-radio-group v-model="form.alarmStatus" disabled>
<el-radio
v-for="dict in dict.type.dms_alarm_status"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="处理建议" prop="handleSuggest">
<el-input v-model="form.handleSuggest" type="textarea" disabled/>
</el-form-item>
<!-- <el-form-item label="通知状态" prop="noticeStatus">-->
<!-- <el-radio-group v-model="form.noticeStatus" disabled>-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.dms_notice_status"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{ dict.label }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item label="原因分析" prop="causeAnalysis">
<el-input v-model="form.causeAnalysis" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<!-- <el-form-item label="备注" prop="remark">-->
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listDmsRecordAlarmInfo,
getDmsRecordAlarmInfo,
delDmsRecordAlarmInfo,
addDmsRecordAlarmInfo,
updateDmsRecordAlarmInfo,
handleDmsRecordAlarmInfo
} from "@/api/dms/dmsRecordAlarmInfo";
import {getDeviceLedgerList} from "@/api/dms/ledger";
export default {
name: "DmsRecordAlarmInfo",
dicts: ['dms_notice_status', 'dms_alarm_status', 'dms_recover_type', 'dms_notice_type', 'dms_alarm_type', 'dms_alarm_level'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dmsRecordAlarmInfoList: [],
//
title: "",
//
open: false,
//
daterangeAlarmBeginTime: [],
//
daterangeAlarmEndTime: [],
//
daterangeHandleTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceId: null,
alarmRuleId: null,
alarmBeginTime: null,
alarmEndTime: null,
continueTime: null,
alarmReason: null,
alarmData: null,
alarmStatus: null,
handleSuggest: null,
noticeStatus: null,
handleUser: null,
handleTime: null,
causeAnalysis: null,
},
//
form: {},
//
rules: {
deviceId: [
{required: true, message: "设备名称不能为空", trigger: "blur"}
],
alarmRuleId: [
{required: true, message: "设备报警规则id不能为空", trigger: "blur"}
],
alarmStatus: [
{required: true, message: "报警状态不能为空", trigger: "change"}
],
noticeStatus: [
{required: true, message: "通知状态不能为空", trigger: "change"}
],
},
columns: [
{key: 0, label: `主键标识`, visible: false},
{key: 1, label: `设备名称`, visible: true},
{key: 2, label: `设备报警规则id`, visible: false},
{key: 3, label: `报警开始时间`, visible: true},
{key: 4, label: `报警结束时间`, visible: true},
{key: 5, label: `报警持续时间(ms)`, visible: true},
{key: 6, label: `报警原因`, visible: true},
{key: 7, label: `报警数据`, visible: true},
{key: 8, label: `报警状态`, visible: true},
{key: 9, label: `处理建议`, visible: true},
{key: 10, label: `通知状态`, visible: true},
{key: 11, label: `处理人员`, visible: true},
{key: 12, label: `处理时间`, visible: true},
{key: 13, label: `原因分析`, visible: true},
{key: 14, label: `备注`, visible: false},
{key: 15, label: `创建人`, visible: true},
{key: 16, label: `创建时间`, visible: true},
{key: 17, label: `更新人`, visible: true},
{key: 18, label: `更新时间`, visible: true},
{key: 19, label: `报警类型`, visible: true},
{key: 20, label: `报警级别`, visible: true},
{key: 21, label: `通知方式`, visible: true},
{key: 22, label: `自动恢复标识`, visible: false},
{key: 23, label: `报警状态字`, visible: true},
],
//
deviceLedgerList: []
};
},
created() {
getDeviceLedgerList(null).then(response => {
this.deviceLedgerList = response.data
})
this.getList();
},
methods: {
/** 查询设备报警记录列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeAlarmBeginTime && '' != this.daterangeAlarmBeginTime) {
this.queryParams.params["beginAlarmBeginTime"] = this.daterangeAlarmBeginTime[0];
this.queryParams.params["endAlarmBeginTime"] = this.daterangeAlarmBeginTime[1];
}
if (null != this.daterangeAlarmEndTime && '' != this.daterangeAlarmEndTime) {
this.queryParams.params["beginAlarmEndTime"] = this.daterangeAlarmEndTime[0];
this.queryParams.params["endAlarmEndTime"] = this.daterangeAlarmEndTime[1];
}
if (null != this.daterangeHandleTime && '' != this.daterangeHandleTime) {
this.queryParams.params["beginHandleTime"] = this.daterangeHandleTime[0];
this.queryParams.params["endHandleTime"] = this.daterangeHandleTime[1];
}
listDmsRecordAlarmInfo(this.queryParams).then(response => {
this.dmsRecordAlarmInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
alarmId: null,
deviceId: null,
alarmRuleId: null,
alarmBeginTime: null,
alarmEndTime: null,
continueTime: null,
alarmReason: null,
alarmData: null,
alarmStatus: null,
handleSuggest: null,
noticeStatus: null,
handleUser: null,
handleTime: null,
causeAnalysis: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeAlarmBeginTime = [];
this.daterangeAlarmEndTime = [];
this.daterangeHandleTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.alarmId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备报警记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const alarmId = row.alarmId || this.ids
getDmsRecordAlarmInfo(alarmId).then(response => {
this.form = response.data;
this.open = true;
this.title = "设备报警处理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.alarmId != null) {
handleDmsRecordAlarmInfo(this.form).then(response => {
this.$modal.msgSuccess("处理成功");
this.open = false;
this.getList();
});
} else {
addDmsRecordAlarmInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const alarmIds = row.alarmId || this.ids;
this.$modal.confirm('是否确认删除设备报警记录编号为"' + alarmIds + '"的数据项?').then(function () {
return delDmsRecordAlarmInfo(alarmIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('dms/dmsRecordAlarmInfo/export', {
...this.queryParams
}, `dmsRecordAlarmInfo_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save