diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java index 340f7196..5722a6b5 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java @@ -13,6 +13,7 @@ import com.alops.common.utils.SecurityUtils; import com.alops.common.utils.poi.ExcelUtil; import com.alops.system.domain.AlertMessage; import com.alops.system.domain.dto.AlertDto; +import com.alops.system.domain.vo.homeEquAlertMessage; import com.alops.system.service.IAlertLaunchService; import com.alops.system.domain.AlertRule; import com.alops.system.domain.EquInterface; @@ -84,6 +85,21 @@ public class AlertMessageController extends BaseController /** * 查询预警信息统计列表 */ + @PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:statistic:list')") + @GetMapping ("/statistic/list") + @ApiOperation("查询预警信息") + @Log(title = "查询预警信息", businessType = BusinessType.UPDATE) + public TableDataInfo homeList() + { + startPage(); + List list = alertMessageService.selectStaticAlertMessageList(); + return getDataTable(list); + } + + + /** + * 首页查询预警信息统计列表 + */ @PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:list')") @GetMapping ("/list") @ApiOperation("查询预警信息") diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertMessage.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertMessage.java index a6bf00be..ce625b13 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertMessage.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertMessage.java @@ -9,6 +9,8 @@ import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import javax.mail.Message; + /** * 故障统计对象 alert_message * @@ -23,7 +25,6 @@ public class AlertMessage /** ID */ private Long id; - /** 设备ID */ @Excel(name = "设备ID") private String equId; @@ -75,6 +76,8 @@ public class AlertMessage + + public void setId(Long id) { this.id = id; diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/homeEquAlertMessage.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/homeEquAlertMessage.java new file mode 100644 index 00000000..39b631a4 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/homeEquAlertMessage.java @@ -0,0 +1,38 @@ +package com.alops.system.domain.vo; + +import com.alops.common.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +@Data +public class homeEquAlertMessage { + + + /** 预警级别(1-5级) */ + @Excel(name = "预警级别(1-5级)") + private Long level; + + /** 发生时间 */ + @Excel(name = "发生时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date occurTime; + + + @Excel(name = "预警信息") + private String message; + + + /** 处理状态(open、in_progress_closed) */ + @Excel(name = "处理状态") + private String status; + + @Excel(name = "处理状态") + private String name; + + @Excel(name = "处理状态") + private String location; + + + +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java index 98050cf4..ad98dcf8 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java @@ -2,6 +2,7 @@ package com.alops.system.mapper; import com.alops.system.domain.AlertMessage; import com.alops.system.domain.dto.AlertDto; +import com.alops.system.domain.vo.homeEquAlertMessage; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -44,6 +45,8 @@ public interface AlertMessageMapper * @return 故障统计集合 */ public List selectAlertMessageList(AlertDto alertMessage); + + public List selectStaticAlertMessageList(); public ArrayList selectAlertMessageByEquId(Long Equid); /** diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java index 03ca8cf9..efcd7596 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java @@ -3,6 +3,7 @@ package com.alops.system.service; import com.alops.system.domain.AlertMessage; import com.alops.system.domain.dto.AlertDto; import com.alops.system.domain.dto.AlertStatisticDto; +import com.alops.system.domain.vo.homeEquAlertMessage; import java.util.List; @@ -30,7 +31,7 @@ public interface IAlertMessageService * @return 故障统计集合 */ public List selectAlertMessageList(AlertDto alertMessage); - + public List selectStaticAlertMessageList(); public List selectAlertMessageListByEquId(Long equId); /** diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertLaunchServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertLaunchServiceImpl.java index c1938f68..ea5c0aec 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertLaunchServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertLaunchServiceImpl.java @@ -153,7 +153,7 @@ public class AlertLaunchServiceImpl implements IAlertLaunchService { String msgdes = fillTemplate(rule.getAlertTemplate(), row, rule); msg.setBatch(currentBatch); - + msg.setMessage(msgdes); messages.add(msg); msgs.add(msgdes); diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java index 1cb64e00..c6feb4ac 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java @@ -12,6 +12,7 @@ import com.alops.system.domain.dto.AlertDto; import com.alops.system.domain.dto.AlertStatisticDto; import com.alops.system.domain.dto.LevelCountDto; import com.alops.system.domain.dto.TypeCountDto; +import com.alops.system.domain.vo.homeEquAlertMessage; import com.alops.system.mapper.AlertMessageMapper; import com.alops.system.service.IAlertMessageService; import org.springframework.beans.factory.annotation.Autowired; @@ -53,6 +54,12 @@ public class AlertMessageServiceImpl implements IAlertMessageService return alertMessageMapper.selectAlertMessageList(alertMessage); } + @Override + public List selectStaticAlertMessageList(){ + + return alertMessageMapper.selectStaticAlertMessageList(); + } + @Override public List selectAlertMessageListByEquId(Long equId) { diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java index 7840b76f..0cd383f0 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java @@ -56,7 +56,7 @@ public class AlertRuleServiceImpl implements IAlertRuleService sql = buildSql(rule, conditions); } rule.setAlertSql(sql); - + rule.setEnable(1); // 插入规则 alertRuleMapper.insertAlertRule(rule); diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml index 4e77ec62..0a2df36b 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml @@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + + + + + +