change - add设备报警规则、设备报警记录
parent
a1bf717d40
commit
3ac2a22b07
@ -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));
|
||||
}
|
||||
}
|
@ -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,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
|
||||
})
|
||||
}
|
@ -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…
Reference in New Issue