From 81bb3317d935a1bcca6b7532dae9fe4d0f4e114c Mon Sep 17 00:00:00 2001 From: xiaohuo <14141624+dsgfhrh@user.noreply.gitee.com> Date: Mon, 6 Oct 2025 16:33:58 +0800 Subject: [PATCH] =?UTF-8?q?10.6=E9=A2=84=E8=AD=A6=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=92=8C=E9=A6=96=E9=A1=B52=E9=83=A8?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AlertMessageController.java | 16 ++++++++ .../com/alops/system/domain/AlertMessage.java | 6 ++- .../system/domain/vo/homeEquAlertMessage.java | 38 +++++++++++++++++++ .../system/mapper/AlertMessageMapper.java | 3 ++ .../system/service/IAlertMessageService.java | 3 +- .../service/impl/AlertLaunchServiceImpl.java | 2 +- .../service/impl/AlertMessageServiceImpl.java | 7 ++++ .../service/impl/AlertRuleServiceImpl.java | 2 +- .../mapper/system/AlertMessageMapper.xml | 26 ++++++++++--- 9 files changed, 94 insertions(+), 9 deletions(-) create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/homeEquAlertMessage.java 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 c80ad07f..5be528e3 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; @@ -72,6 +73,9 @@ public class AlertMessage + @Excel(name = "预警信息") + private String message; + public void setId(Long 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 5921383b..c2effeae 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 @@ -10,6 +10,7 @@ import java.util.Map; 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 com.alops.system.mapper.AlertMessageMapper; import com.alops.system.service.IAlertMessageService; import org.springframework.beans.factory.annotation.Autowired; @@ -51,6 +52,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 d748818f..41b13452 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 @@ -7,10 +7,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - @@ -19,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -30,12 +29,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" INSERT INTO alert_message - (equ_id, type, equ_type, solution, level, occur_time, handler, handle_time, status,batch) + (equ_id, type, equ_type, solution, level, occur_time, handler, handle_time, status,batch,message) VALUES (#{msg.equId},#{msg.type}, #{msg.equType}, #{msg.solution}, #{msg.level}, #{msg.occurTime}, - #{msg.handler}, #{msg.handleTime}, #{msg.status}, #{msg.batch}) + #{msg.handler}, #{msg.handleTime}, #{msg.status}, #{msg.batch}, #{msg.message}) @@ -52,7 +51,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" am.handler, am.handle_time, am.status, - am.batch + am.batch, + am.message FROM alert_message am LEFT JOIN equ_base eb ON am.equ_id = eb.id @@ -83,6 +83,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ORDER BY am.batch DESC + + + + +