11.9预警信息+预警评估修改

dev
xiaohuo 8 months ago
parent 88ffead7ba
commit 7358f60df7
  1. 3
      ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java
  2. 211
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/AlertMessages.java
  3. 3
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java
  4. 3
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java
  5. 3
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java
  6. 6
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquBaseServiceImpl.java
  7. 14
      ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml

@ -10,6 +10,7 @@ import com.alops.common.core.page.TableDataInfo;
import com.alops.common.enums.BusinessType;
import com.alops.system.domain.AlertMessage;
import com.alops.system.domain.dto.AlertDto;
import com.alops.system.domain.vo.AlertMessages;
import com.alops.system.domain.vo.homeEquAlertMessageVo;
import com.alops.system.service.IAlertLaunchService;
import com.alops.system.domain.dto.AlertStatisticDto;
@ -98,7 +99,7 @@ public class AlertMessageController extends BaseController
public TableDataInfo list( AlertDto alertMessage)
{
startPage();
List<AlertMessage> list = alertMessageService.selectAlertMessageList(alertMessage);
List<AlertMessages> list = alertMessageService.selectAlertMessageList(alertMessage);
return getDataTable(list);
}

@ -0,0 +1,211 @@
package com.alops.system.domain.vo;
import java.util.Date;
import com.alops.common.annotation.Excel;
import com.alops.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.mail.Message;
/**
* 故障统计对象 alert_message
*
* @author ruoyi
* @date 2025-09-04
*/
@Data
public class AlertMessages
{
private static final long serialVersionUID = 1L;
/** ID */
private Long id;
/** 设备ID */
@Excel(name = "设备ID")
private String equId;
/** 预警类型(枚举表名) */
@Excel(name = "预警类型(枚举表名)")
private String type;
/** 设备类型 */
@Excel(name = "设备类型")
private String equType;
@Excel(name = "设备名称")
private String name;
@Excel(name = "设备编号")
private String equNumber;
/** 解决方案 */
@Excel(name = "解决方案")
private String solution;
/** 故障级别(1-5级) */
@Excel(name = "预警级别(1-5级)")
private Long level;
/** 发生时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date occurTime;
/** 处理人ID */
@Excel(name = "处理人ID")
private String handler;
/** 解决时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date handleTime;
/** 处理状态(open、in_progress_closed) */
@Excel(name = "处理状态")
private String status;
@Excel(name = "信息批次")
private Integer batch;
@Excel(name ="预警信息")
private String message;
@JsonIgnore
@Excel(name ="预警规则id")
private Long alertRuleId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setEquId(String equId)
{
this.equId = equId;
}
public String getEquId()
{
return equId;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setEquType(String equType)
{
this.equType = equType;
}
public String getEquType()
{
return equType;
}
public void setSolution(String solution)
{
this.solution = solution;
}
public String getSolution()
{
return solution;
}
public void setLevel(Long level)
{
this.level = level;
}
public Long getLevel()
{
return level;
}
public void setOccurTime(Date occurTime)
{
this.occurTime = occurTime;
}
public Date getOccurTime()
{
return occurTime;
}
public void setHandler(String handler)
{
this.handler = handler;
}
public String getHandler()
{
return handler;
}
public void setHandleTime(Date handleTime)
{
this.handleTime = handleTime;
}
public Date getHandleTime()
{
return handleTime;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("equId", getEquId())
.append("type", getType())
.append("equType", getEquType())
.append("solution", getSolution())
.append("level", getLevel())
.append("occurTime", getOccurTime())
.append("handler", getHandler())
.append("handleTime", getHandleTime())
.append("status", getStatus())
.append("batch",getBatch())
.toString();
}
}

@ -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.AlertMessages;
import com.alops.system.domain.vo.homeEquAlertMessageVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -44,7 +45,7 @@ public interface AlertMessageMapper
* @param alertMessage 故障统计
* @return 故障统计集合
*/
public List<AlertMessage> selectAlertMessageList(AlertDto alertMessage);
public List<AlertMessages> selectAlertMessageList(AlertDto alertMessage);
public List<homeEquAlertMessageVo> selectStaticAlertMessageList();
public ArrayList<AlertMessage> selectAlertMessageByEquId(String Equid);

@ -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.AlertMessages;
import com.alops.system.domain.vo.homeEquAlertMessageVo;
import java.util.List;
@ -30,7 +31,7 @@ public interface IAlertMessageService
* @param alertMessage 故障统计
* @return 故障统计集合
*/
public List<AlertMessage> selectAlertMessageList(AlertDto alertMessage);
public List<AlertMessages> selectAlertMessageList(AlertDto alertMessage);
public List<homeEquAlertMessageVo> selectStaticAlertMessageList();
public List<AlertMessage> selectAlertMessageListByEquId(String equId);

@ -11,6 +11,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.AlertMessages;
import com.alops.system.domain.vo.homeEquAlertMessageVo;
import com.alops.system.mapper.AlertMessageMapper;
import com.alops.system.service.IAlertMessageService;
@ -48,7 +49,7 @@ public class AlertMessageServiceImpl implements IAlertMessageService
* @return 故障统计
*/
@Override
public List<AlertMessage> selectAlertMessageList(AlertDto alertMessage)
public List<AlertMessages> selectAlertMessageList(AlertDto alertMessage)
{
return alertMessageMapper.selectAlertMessageList(alertMessage);
}

@ -87,9 +87,9 @@ public class EquBaseServiceImpl implements IEquBaseService
vo.setRiskGrade(switch (riskLevel) {
case 1 -> "无风险";
case 2 -> "低";
case 3 -> "中";
case 4 -> "高";
case 2 -> "低风险";
case 3 -> "中风险";
case 4 -> "高风险";
default -> "未知";
});

@ -45,17 +45,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectAlertMessageVo">
SELECT am.id,
am.equ_id,
am.equ_id AS equId ,
am.type,
am.equ_type,
am.equ_type AS equType,
am.solution,
am.level,
am.occur_time,
am.occur_time AS occurTime,
am.handler,
am.handle_time,
am.handle_time AS handleTime,
am.status,
am.batch,
am.message
am.message,
eb.name,
eb.equ_number AS equNumber
FROM alert_message am
LEFT JOIN equ_base eb ON am.equ_id = eb.id
</sql>
@ -64,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select a.id, g.equ_id, type, equ_type, solution, level, occur_time, handler, handle_time, status,batch,message from alert_message a LEFT JOIN equ_gather g ON a.equ_id = g.equ_id
</sql>
<select id="selectAlertMessageList" parameterType="AlertDto" resultMap="AlertMessageResult">
<select id="selectAlertMessageList" parameterType="AlertDto" resultType="AlertMessages">
<include refid="selectAlertMessageVo"/>
<where>
<!-- 时间范围 -->

Loading…
Cancel
Save