From 88ffead7ba6041085e5d3da884030a468748c952 Mon Sep 17 00:00:00 2001 From: xiaohuo <14141624+dsgfhrh@user.noreply.gitee.com> Date: Sun, 9 Nov 2025 15:48:13 +0800 Subject: [PATCH 01/10] =?UTF-8?q?11.9=E9=A2=84=E8=AD=A6=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/alops/system/domain/dto/AlertDto.java | 2 ++ .../main/resources/mapper/system/AlertMessageMapper.xml | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertDto.java index 1e788111..1886f959 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertDto.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertDto.java @@ -12,4 +12,6 @@ public class AlertDto { private String status; private String location; private String inCharge; + private String name; + private String equNumber; } 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 ef1c2c8b..f13c626d 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 @@ -82,6 +82,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND eb.in_charge = #{inCharge} + + + AND eb.name LIKE CONCAT('%', #{name}, '%') + + + + + AND eb.equ_number = #{equNumber} + ORDER BY am.batch DESC From d00e9985860479ffacaf97bfa11a67c0dd2d91d5 Mon Sep 17 00:00:00 2001 From: Wangxin Date: Sun, 9 Nov 2025 19:31:05 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E3=80=90web=E3=80=91=20title=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inMonitoring/devicesState/cardItem.vue | 15 ++++++-- .../inMonitoring/devicesState/detail.vue | 38 +++++++++++-------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/cardItem.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/cardItem.vue index de4e043b..2f32d965 100644 --- a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/cardItem.vue +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/cardItem.vue @@ -26,26 +26,26 @@ 设备级别 - {{cardData.deviceLevel || '暂无'}}级 + {{cardData.deviceLevel || '暂无'}}级
安装位置 - {{cardData.location || '暂无'}} + {{cardData.location || '暂无'}}
品牌型号 - {{cardData.brand || '暂无'}} + {{cardData.brand || '暂无'}}
带外IP - {{cardData.ip || '暂无'}} + {{cardData.ip || '暂无'}}
@@ -420,6 +420,7 @@ export default { .info-label i { font-size: 12px; + width: 8px; color: #4299e1; } @@ -427,6 +428,12 @@ export default { font-size: 14px; font-weight: 600; color: #2d3748; + padding-left: 14px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: help; + width: 90px; } .chart-container { diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue index 343f06e2..e2b30f31 100644 --- a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue @@ -26,31 +26,31 @@ 设备编号 - {{details.equNumber || '暂无'}} + {{details.equNumber || '暂无'}}
固件版本 - {{details.version || '暂无'}} + {{details.version || '暂无'}}
设备级别 - {{details.deviceLevel || '暂无'}}级 + {{details.deviceLevel || '暂无'}}级
安装位置 - {{details.location || '暂无'}} + {{details.location || '暂无'}}
品牌型号 - {{details.brand || '暂无'}} + {{details.brand || '暂无'}}
@@ -62,33 +62,33 @@ 生产厂商名称 - {{details.equManuName || '暂无'}} + {{details.equManuName || '暂无'}}
供货商名称 - {{details.supplierName || '暂无'}} + {{details.supplierName || '暂无'}}
供货商联系人 - {{ details.contactBy || '暂无'}} + {{ details.contactBy || '暂无'}}
供货商联系电话 - {{ details.contactWay || '暂无'}} + {{ details.contactWay || '暂无'}}
质保时间 - {{details.warranty || '暂无'}} + {{details.warranty || '暂无'}}
@@ -100,7 +100,7 @@ 带外管理IP - {{details.ip || '暂无'}} + {{details.ip || '暂无'}}
@@ -112,13 +112,13 @@ 安装日期 - {{details.installDate || '暂无'}} + {{details.installDate || '暂无'}}
管理员 - {{details.inCharge || '暂无'}} + {{details.inCharge || '暂无'}}
@@ -129,19 +129,19 @@ 设备持续运行时长 - {{formatDuration(details.contWorkPeriod) || '暂无'}} + {{formatDuration(details.contWorkPeriod) || '暂无'}}
待处理预警数 - {{details.unhandledAlertCount || '暂无'}} + {{details.unhandledAlertCount || '暂无'}}
预警总数 - {{details.alertCount || '暂无'}} + {{details.alertCount || '暂无'}}
@@ -1138,4 +1138,10 @@ mounted() { font-weight: 600; border-bottom: 2px solid #2d3748; } + .info-value { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: help; + } \ No newline at end of file From 7358f60df714668b8d668693ea8dfffafbf0048b Mon Sep 17 00:00:00 2001 From: xiaohuo <14141624+dsgfhrh@user.noreply.gitee.com> Date: Sun, 9 Nov 2025 19:54:15 +0800 Subject: [PATCH 03/10] =?UTF-8?q?11.9=E9=A2=84=E8=AD=A6=E4=BF=A1=E6=81=AF+?= =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=AF=84=E4=BC=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AlertMessageController.java | 3 +- .../alops/system/domain/vo/AlertMessages.java | 211 ++++++++++++++++++ .../system/mapper/AlertMessageMapper.java | 3 +- .../system/service/IAlertMessageService.java | 3 +- .../service/impl/AlertMessageServiceImpl.java | 3 +- .../service/impl/EquBaseServiceImpl.java | 6 +- .../mapper/system/AlertMessageMapper.xml | 14 +- 7 files changed, 230 insertions(+), 13 deletions(-) create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/AlertMessages.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 0553cf58..f3a2d360 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 @@ -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 list = alertMessageService.selectAlertMessageList(alertMessage); + List list = alertMessageService.selectAlertMessageList(alertMessage); return getDataTable(list); } diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/AlertMessages.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/AlertMessages.java new file mode 100644 index 00000000..f2f03fa8 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/AlertMessages.java @@ -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(); + } +} + 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 ddfdcfbf..99fc2776 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.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 selectAlertMessageList(AlertDto alertMessage); + public List selectAlertMessageList(AlertDto alertMessage); public List selectStaticAlertMessageList(); public ArrayList selectAlertMessageByEquId(String 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 03655ea1..24cc525b 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.AlertMessages; import com.alops.system.domain.vo.homeEquAlertMessageVo; import java.util.List; @@ -30,7 +31,7 @@ public interface IAlertMessageService * @param alertMessage 故障统计 * @return 故障统计集合 */ - public List selectAlertMessageList(AlertDto alertMessage); + public List selectAlertMessageList(AlertDto alertMessage); public List selectStaticAlertMessageList(); public List selectAlertMessageListByEquId(String equId); 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 18dedbae..fe302016 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 @@ -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 selectAlertMessageList(AlertDto alertMessage) + public List selectAlertMessageList(AlertDto alertMessage) { return alertMessageMapper.selectAlertMessageList(alertMessage); } diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquBaseServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquBaseServiceImpl.java index ee8ab02b..0fd1aeaf 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquBaseServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquBaseServiceImpl.java @@ -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 -> "未知"; }); 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 f13c626d..02642643 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 @@ -45,17 +45,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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 @@ -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 - From fbef639ab4b66d0d8cc8c25d8a3b1fadf4ae53c2 Mon Sep 17 00:00:00 2001 From: Wangxin Date: Sun, 9 Nov 2025 20:27:25 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E3=80=90web=E3=80=91=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ALOps_sys_fe/alops-ui/.env.development | 2 +- ALOps_sys_fe/alops-ui/.env.production | 2 +- ALOps_sys_fe/alops-ui/package.json | 2 +- ALOps_sys_fe/alops-ui/public/index.html | 3 +- .../src/layout/components/Sidebar/Logo.vue | 2 +- .../src/views/QandA/knowledge/index.vue | 45 ++++++++++++++++++- .../inMonitoring/inMonitor/message/index.vue | 10 ++++- ALOps_sys_fe/alops-ui/src/views/index.vue | 4 +- 8 files changed, 61 insertions(+), 9 deletions(-) diff --git a/ALOps_sys_fe/alops-ui/.env.development b/ALOps_sys_fe/alops-ui/.env.development index fb5fbac8..e71bf2b4 100644 --- a/ALOps_sys_fe/alops-ui/.env.development +++ b/ALOps_sys_fe/alops-ui/.env.development @@ -1,5 +1,5 @@ # 页面标题 -VUE_APP_TITLE = 中国烟草 +VUE_APP_TITLE = 唐山烟草网络设备智能监管平台 # 开发环境配置 ENV = 'development' diff --git a/ALOps_sys_fe/alops-ui/.env.production b/ALOps_sys_fe/alops-ui/.env.production index d23f04e4..4ee328cb 100644 --- a/ALOps_sys_fe/alops-ui/.env.production +++ b/ALOps_sys_fe/alops-ui/.env.production @@ -1,5 +1,5 @@ # 页面标题 -VUE_APP_TITLE = 中国烟草 +VUE_APP_TITLE = 唐山烟草网络设备智能监管平台 # 生产环境配置 ENV = 'production' diff --git a/ALOps_sys_fe/alops-ui/package.json b/ALOps_sys_fe/alops-ui/package.json index e006c998..76fbb0c0 100644 --- a/ALOps_sys_fe/alops-ui/package.json +++ b/ALOps_sys_fe/alops-ui/package.json @@ -1,7 +1,7 @@ { "name": "ruoyi", "version": "3.9.0", - "description": "中国烟草", + "description": "唐山烟草网络设备智能监管平台", "author": "若依", "license": "MIT", "scripts": { diff --git a/ALOps_sys_fe/alops-ui/public/index.html b/ALOps_sys_fe/alops-ui/public/index.html index 2754cc0b..10a5ed57 100644 --- a/ALOps_sys_fe/alops-ui/public/index.html +++ b/ALOps_sys_fe/alops-ui/public/index.html @@ -4,9 +4,10 @@ + - <%= webpackConfig.name %> + 唐山烟草网络设备智能监管平台 \ No newline at end of file + + + \ No newline at end of file diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue index c4be9c7c..fa5ac6fa 100644 --- a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue @@ -33,13 +33,13 @@ - 删除 + 删除 @@ -80,9 +80,9 @@ From dbb777c87ed6f0f6bc2f065db9d4c84e7c9f0dbe Mon Sep 17 00:00:00 2001 From: Wangxin Date: Sun, 9 Nov 2025 22:59:42 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E3=80=90web=E3=80=91=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=80=E5=88=86=E9=92=9F=E6=B6=88=E5=A4=B1=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ALOps_sys_fe/alops-ui/src/utils/websocket.js | 2 +- ALOps_sys_fe/alops-ui/src/views/index.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ALOps_sys_fe/alops-ui/src/utils/websocket.js b/ALOps_sys_fe/alops-ui/src/utils/websocket.js index 778dd75f..8e15b7b5 100644 --- a/ALOps_sys_fe/alops-ui/src/utils/websocket.js +++ b/ALOps_sys_fe/alops-ui/src/utils/websocket.js @@ -194,7 +194,7 @@ class WebSocketClient { title: message.title || '系统通知', message: message.content, type: 'info', - duration: 1000000, // 10秒后自动关闭 + duration: 60000, // 60秒后自动关闭 showClose: true, onClick: () => { // 可以在这里添加点击通知后的处理逻辑 diff --git a/ALOps_sys_fe/alops-ui/src/views/index.vue b/ALOps_sys_fe/alops-ui/src/views/index.vue index 1caf5ad3..3447bedf 100644 --- a/ALOps_sys_fe/alops-ui/src/views/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/index.vue @@ -378,7 +378,7 @@ export default { // 定期更新设备状态数据(每分钟更新一次) setInterval(() => { this.refreshDeviceStatus(); - }, 60000); + }, 600000); }, activated() { // 每次进入首页时刷新数据 From 7a101cbb3ba8692c65b497ed98631d4a3e030f53 Mon Sep 17 00:00:00 2001 From: xiaohuo <14141624+dsgfhrh@user.noreply.gitee.com> Date: Sun, 9 Nov 2025 23:07:07 +0800 Subject: [PATCH 08/10] =?UTF-8?q?11.9AI=E5=BC=82=E5=B8=B8+=E9=A2=84?= =?UTF-8?q?=E8=AD=A6=E4=BF=A1=E6=81=AF=E6=9D=83=E9=99=90=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AlertMessageController.java | 2 +- .../alops/chat/service/AItokenService.java | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) 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 f3a2d360..e325d021 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 @@ -132,7 +132,7 @@ public class AlertMessageController extends BaseController /** * 删除预警信息 */ - @PreAuthorize("@ss.hasPermi('system:message:remove')") + @PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:remove')") @ApiOperation("删除预警信息") @Log(title = "删除预警信息", businessType = BusinessType.UPDATE) @DeleteMapping("/{ids}") diff --git a/ALOps_sys_backend/alops-chat/src/main/java/com/alops/chat/service/AItokenService.java b/ALOps_sys_backend/alops-chat/src/main/java/com/alops/chat/service/AItokenService.java index cddc07a3..57e453cc 100644 --- a/ALOps_sys_backend/alops-chat/src/main/java/com/alops/chat/service/AItokenService.java +++ b/ALOps_sys_backend/alops-chat/src/main/java/com/alops/chat/service/AItokenService.java @@ -310,6 +310,32 @@ public class AItokenService { return "AI模型正在加载中,请稍等2-3分钟后再试。如果问题持续存在,可能需要检查系统资源配置。"; } } + // 处理"length"状态 - 表示响应因长度限制被截断 + else if ("length".equals(doneReason)) { + System.out.println("第 " + attempt + " 次尝试:模型响应因长度限制被截断"); + // 尝试获取已生成的内容 + JsonNode messageNode = rootNode.get("message"); + if (messageNode != null) { + JsonNode contentNode = messageNode.get("content"); + if (contentNode != null) { + String content = contentNode.asText(); + if (content != null && !content.isEmpty()) { + System.out.println("尽管响应被截断,但已获取到部分回答内容,长度: " + content.length()); + return content; + } + } + } + + // 如果没有获取到内容,继续重试 + if (attempt < maxRetries) { + long waitTime = 3000 * attempt; + System.out.println("等待 " + (waitTime/1000) + " 秒后重试..."); + Thread.sleep(waitTime); + continue; + } else { + return "AI模型响应过长被截断,请尝试提出更具体的问题。"; + } + } // 只有当done_reason为stop时才表示真正结束 else if (!"stop".equals(doneReason)) { System.out.println("第 " + attempt + " 次尝试:模型返回未知的done_reason: " + doneReason); From 4aedf1dc274f6e76cc7b5cf7f31143b73d5aba87 Mon Sep 17 00:00:00 2001 From: xiaohuo <14141624+dsgfhrh@user.noreply.gitee.com> Date: Mon, 10 Nov 2025 13:59:48 +0800 Subject: [PATCH 09/10] =?UTF-8?q?11.10=E9=87=87=E9=9B=86=E8=A7=84=E5=88=99?= =?UTF-8?q?+=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/equManagement/EquBaseController.java | 8 +++++--- .../equManagement/ScheduleRulesController.java | 3 ++- .../exceptionController/AlertMessageController.java | 6 +++--- .../exceptionController/AlertRuleController.java | 10 +++++----- .../controller/exceptionController/equAssessment.java | 2 +- .../web/controller/message/messageController.java | 2 +- .../src/main/java/com/alops/system/job/GatherJob.java | 1 + 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquBaseController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquBaseController.java index d0f9d7ee..4f5e96c5 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquBaseController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquBaseController.java @@ -50,6 +50,7 @@ public class EquBaseController extends BaseController @PreAuthorize("@ss.hasPermi('device:files:list')") @GetMapping("/list") @ApiOperation("查询多个设备信息") + @Log(title = "设备档案查询", businessType = BusinessType.OTHER) public TableDataInfo list( EquBaseQueryDto equBase) { startPage(); @@ -147,6 +148,7 @@ public class EquBaseController extends BaseController @PreAuthorize("@ss.hasPermi('device:files:query1')") @GetMapping(value = "/{id}") @ApiOperation("查询单个设备信息") + @Log(title = "单个设备查询", businessType = BusinessType.OTHER) public AjaxResult getInfo(@PathVariable("id") String id) { return success(equBaseService.selectEquBaseById(id)); @@ -221,7 +223,7 @@ public class EquBaseController extends BaseController * MultipartFile file */ @PreAuthorize("@ss.hasPermi('device:files:add')") - @Log(title = "设备基本信息", businessType = BusinessType.INSERT) + @Log(title = "增加设备档案信息", businessType = BusinessType.INSERT) @PostMapping(value = "/add") @ApiOperation("增加设备档案信息") public AjaxResult add(@RequestBody EquBase equBase) { @@ -244,7 +246,7 @@ public class EquBaseController extends BaseController * 修改设备基本信息 */ @PreAuthorize("@ss.hasPermi('device:files:edit')") - @Log(title = "设备基本信息", businessType = BusinessType.UPDATE) + @Log(title = "更新设备档案基本信息", businessType = BusinessType.UPDATE) @PutMapping("/modify") @ApiOperation("修改设备档案信息") public AjaxResult edit(@RequestBody EquBase equBase){ @@ -263,7 +265,7 @@ public class EquBaseController extends BaseController * 删除设备基本信息 */ @PreAuthorize("@ss.hasPermi('device:files:remove')") - @Log(title = "设备基本信息", businessType = BusinessType.DELETE) + @Log(title = "删除设备档案基本信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") @ApiOperation("删除设备档案信息") public AjaxResult remove(@PathVariable String[] ids) diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/ScheduleRulesController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/ScheduleRulesController.java index c72424cc..1e71bfbf 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/ScheduleRulesController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/ScheduleRulesController.java @@ -61,7 +61,7 @@ public class ScheduleRulesController extends BaseController @PreAuthorize("@ss.hasPermi('device:deviceInformation:protoCollect')") @PostMapping("/addRule") @ApiOperation("立即确定") - + @Log(title = "设备信息采集", businessType = BusinessType.OTHER) public AjaxResult run(@RequestBody ScheduleRules newRule) throws SchedulerException, ExecutionException, InterruptedException { // 先检查是否有任务正在执行 @@ -99,6 +99,7 @@ public class ScheduleRulesController extends BaseController */ @PreAuthorize("@ss.hasPermi('equipment:rules:list')") @GetMapping("/list") + @Log(title = "设备信息采集基本信息", businessType = BusinessType.OTHER) public TableDataInfo list(ScheduleRules scheduleRules) { startPage(); 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 e325d021..819f79ef 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 @@ -80,7 +80,7 @@ public class AlertMessageController extends BaseController @PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:statistic:list')") @GetMapping ("/statistic/list") @ApiOperation("首页查询预警信息") - @Log(title = "查询预警信息", businessType = BusinessType.UPDATE) + @Log(title = "查询预警信息", businessType = BusinessType.OTHER) public TableDataInfo homeList() { startPage(); @@ -95,7 +95,7 @@ public class AlertMessageController extends BaseController @PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:list')") @GetMapping ("/list") @ApiOperation("查询预警信息") - @Log(title = "查询预警信息", businessType = BusinessType.UPDATE) + @Log(title = "查询预警信息", businessType = BusinessType.OTHER) public TableDataInfo list( AlertDto alertMessage) { startPage(); @@ -134,7 +134,7 @@ public class AlertMessageController extends BaseController */ @PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:remove')") @ApiOperation("删除预警信息") - @Log(title = "删除预警信息", businessType = BusinessType.UPDATE) + @Log(title = "删除预警信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java index d2aaeff3..5b7cdbc9 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java @@ -50,7 +50,7 @@ public class AlertRuleController extends BaseController { */ @PreAuthorize("@ss.hasPermi('inMonitoring:alertRule:add')") @ApiOperation("增加预警规则") - @Log(title = "【增加预警规则】", businessType = BusinessType.DELETE) + @Log(title = "【增加预警规则】", businessType = BusinessType.INSERT) @PostMapping("/addRule") public AjaxResult addRule(@RequestBody AlertRuleAddDto dto) { try { @@ -69,7 +69,7 @@ public class AlertRuleController extends BaseController { */ @PreAuthorize("@ss.hasPermi('inMonitoring:alertRule:edit')") @ApiOperation("修改预警规则") - @Log(title = "【修改预警规则】", businessType = BusinessType.DELETE) + @Log(title = "【修改预警规则】", businessType = BusinessType.UPDATE) @PutMapping("/editRule") public AjaxResult editRule(@RequestBody AlertRuleAddDto dto) { try { @@ -86,7 +86,7 @@ public class AlertRuleController extends BaseController { */ @PreAuthorize("@ss.hasPermi('inMonitoring:alertRule:list')") @GetMapping("/list") - @Log(title = "【查询预警规则】", businessType = BusinessType.DELETE) + @Log(title = "【查询预警规则】", businessType = BusinessType.OTHER) @ApiOperation("查询预警规则") public TableDataInfo list(AlertRule alertRule) { startPage(); @@ -102,7 +102,7 @@ public class AlertRuleController extends BaseController { @PreAuthorize("@ss.hasPermi('inMonitoring:alertRule:query')") @GetMapping(value = "/{id}") @ApiOperation("查询预警详细规则") - @Log(title = "【查询预警详细规则】", businessType = BusinessType.DELETE) + @Log(title = "【查询预警详细规则】", businessType = BusinessType.OTHER) public AjaxResult getInfo(@PathVariable("id") Long id) { return success(alertRuleService.selectDetailAlertRuleById(id)); } @@ -139,7 +139,7 @@ public class AlertRuleController extends BaseController { @ApiOperation("获取预警参数") @PreAuthorize("@ss.hasPermi('inMonitoring:alertRule:byTable')") @GetMapping("/byTable") - @Log(title = "【获取预警参数】", businessType = BusinessType.EXPORT) + @Log(title = "【获取预警参数】", businessType = BusinessType.OTHER) public AjaxResult getParamsByTableName() { return AjaxResult.success("获取预警参数成功",dictAlarmParamService.getParamsByTableName()); } diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/equAssessment.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/equAssessment.java index a24f2b89..f3b96138 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/equAssessment.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/equAssessment.java @@ -30,7 +30,7 @@ public class equAssessment extends BaseController { @PreAuthorize("@ss.hasPermi('inMonitoring:equAssessment:list')") @GetMapping("/list") @ApiOperation("设备评估信息") - @Log(title = "设备评估与预测", businessType = BusinessType.UPDATE) + @Log(title = "设备评估与预测", businessType = BusinessType.OTHER) public TableDataInfo homeList() { startPage(); diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/message/messageController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/message/messageController.java index bf1a36e3..07d5a413 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/message/messageController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/message/messageController.java @@ -64,7 +64,7 @@ public class messageController extends BaseController { @PreAuthorize("@ss.hasPermi('message:view')") @ApiOperation("获取用户消息列表") - @Log(title = "【消息列表】") + @Log(title = "消息列表", businessType = BusinessType.OTHER) @GetMapping("/list") public TableDataInfo getMessageList() { startPage(); diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/job/GatherJob.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/job/GatherJob.java index 5304d589..977ad4aa 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/job/GatherJob.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/job/GatherJob.java @@ -43,6 +43,7 @@ public class GatherJob implements Job { // 1.状态为5时取消调度任务 if (rule.getStatus() == 5) { rule.setStatus(4); + scheduleRulesMapper.updateScheduleRules(rule); Scheduler scheduler = context.getScheduler(); JobKey jobKey = context.getJobDetail().getKey(); // scheduler.deleteJob(jobKey); From 9a4ba243d70c49e805b96a11ebe2dd801d175350 Mon Sep 17 00:00:00 2001 From: xiaohuo <14141624+dsgfhrh@user.noreply.gitee.com> Date: Mon, 10 Nov 2025 15:30:29 +0800 Subject: [PATCH 10/10] =?UTF-8?q?11.10=E9=87=87=E9=9B=86=E8=A7=84=E5=88=99?= =?UTF-8?q?=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/alops/system/job/GatherJob.java | 2 +- .../impl/ScheduleRulesServiceImpl.java | 87 +++++++++++++------ 2 files changed, 60 insertions(+), 29 deletions(-) diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/job/GatherJob.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/job/GatherJob.java index 977ad4aa..74522106 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/job/GatherJob.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/job/GatherJob.java @@ -124,7 +124,7 @@ public class GatherJob implements Job { rule.setStatus(3); scheduleRulesMapper.updateScheduleRules(rule); try { - String Content=String.format("采集任务整体执行失败,规则ID=%s,规则名称=%s,原因:%s", + String Content=String.format("采集任务整体执行失败,规则ID=%s,规则名称=%s,原因:%s,已取消任务", rule.getId(), rule.getRuleName(), e.getMessage()); iAlertSenderService.sendInternalMessage("采集任务整体执行失败" ,Content,"2" ); diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ScheduleRulesServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ScheduleRulesServiceImpl.java index 8bc738dd..28fc24d4 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ScheduleRulesServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ScheduleRulesServiceImpl.java @@ -205,7 +205,7 @@ public class ScheduleRulesServiceImpl implements IScheduleRulesService { oidMap.put(dev.getEquManuId(), equOidMapper.findByManuIdAndStatus(dev.getEquManuId())); } // 并发采集 - ExecutorService executor = Executors.newFixedThreadPool(10); + ExecutorService executor = Executors.newFixedThreadPool(12); List> futures = new ArrayList<>(); for (EquBase device : devices) { futures.add(executor.submit(() -> { @@ -271,12 +271,12 @@ public class ScheduleRulesServiceImpl implements IScheduleRulesService { gatherValidator.validateBeforeDbOperation(successList, failed, oidMap); - List failedEquIds = validationResult.getFailed().stream() - .map(f -> f.get("equId")) - .collect(Collectors.toList()); +// List failedEquIds = validationResult.getFailed().stream() +// .map(f -> f.get("equId")) +// .collect(Collectors.toList()); // 事务内:删除成功设备依附表 + 插入成功设备数据 + 执行预警 - deleteAllEquipmentData(failedEquIds); // 删除依附表,不含 equ_gather + deleteAllEquipmentData(validationResult.getSuccessList()); // 删除依附表,不含 equ_gather // 插入成功设备数据(内部失败会抛异常,触发事务回滚) persistAndUpdate(validationResult.getSuccessList()); @@ -287,33 +287,64 @@ public class ScheduleRulesServiceImpl implements IScheduleRulesService { return Code.SUCCESS; } - @Transactional(rollbackFor = Exception.class) - public void deleteAllEquipmentData(List failedEquIds) { - // 1️⃣ 查询失败设备最新采集ID - List excludeGatherIds = failedEquIds == null || failedEquIds.isEmpty() ? - Collections.emptyList() : equGatherMapper.selectLatestGatherIdsByEquIds(failedEquIds); - - // 2️⃣ 依附表列表 - String[] dependentTables = {"equ_interface", "equ_routing", "equ_veneer", "equ_vlan"}; - - for (String table : dependentTables) { - int deleted; - if (excludeGatherIds.isEmpty()) { - // 没有失败设备,直接清空表 - deleted = jdbcTemplate.update("DELETE FROM " + table); - } else { - // 使用占位符方式安全删除 - String inSql = excludeGatherIds.stream().map(id -> "?").collect(Collectors.joining(",")); - String sql = String.format("DELETE FROM %s WHERE equ_gather_id NOT IN (%s)", table, inSql); - deleted = jdbcTemplate.update(sql, excludeGatherIds.toArray()); - } - log.info("表 {} 删除 {} 条数据,保留失败设备采集ID: {}", table, deleted, excludeGatherIds); - } +// @Transactional(rollbackFor = Exception.class) +// public void deleteAllEquipmentData(List failedEquIds) { +// // 1️⃣ 查询失败设备最新采集ID +// List excludeGatherIds = failedEquIds == null || failedEquIds.isEmpty() ? +// Collections.emptyList() : equGatherMapper.selectLatestGatherIdsByEquIds(failedEquIds); +// +// // 2️⃣ 依附表列表 +// String[] dependentTables = {"equ_interface", "equ_routing", "equ_veneer", "equ_vlan"}; +// +// for (String table : dependentTables) { +// int deleted; +// if (excludeGatherIds.isEmpty()) { +// // 没有失败设备,直接清空表 +// deleted = jdbcTemplate.update("DELETE FROM " + table); +// } else { +// // 使用占位符方式安全删除 +// String inSql = excludeGatherIds.stream().map(id -> "?").collect(Collectors.joining(",")); +// String sql = String.format("DELETE FROM %s WHERE equ_gather_id NOT IN (%s)", table, inSql); +// deleted = jdbcTemplate.update(sql, excludeGatherIds.toArray()); +// } +// log.info("表 {} 删除 {} 条数据,保留失败设备采集ID: {}", table, deleted, excludeGatherIds); +// } +// +// log.info("依附表数据删除完成,共保留 {} 个失败设备最新采集ID", excludeGatherIds.size()); +// } +@Transactional(rollbackFor = Exception.class) +public void deleteAllEquipmentData(List successList) { + + // 1️⃣ 提取成功设备ID列表 + List successEquIds = successList.stream() + .map(g -> g.getEquGather().getEquId()) + .filter(Objects::nonNull) + .distinct() + .collect(Collectors.toList()); + + // 2️⃣ 查询这些设备的最新采集ID(要保留的) + List latestGatherIds = equGatherMapper.selectLatestGatherIdsByEquIds(successEquIds); + if (latestGatherIds == null || latestGatherIds.isEmpty()) { + log.warn("未查询到成功设备的最新采集ID,跳过删除操作"); + return; + } - log.info("依附表数据删除完成,共保留 {} 个失败设备最新采集ID", excludeGatherIds.size()); + // 3️⃣ 依附表列表 + String[] dependentTables = {"equ_interface", "equ_routing", "equ_veneer", "equ_vlan"}; + + // 4️⃣ 拼 SQL: 删除所有 成功设备 + String placeholders = latestGatherIds.stream().map(id -> "?").collect(Collectors.joining(",")); + for (String table : dependentTables) { + String sql = String.format("DELETE FROM %s WHERE equ_gather_id IN (%s)", table, placeholders); + int deleted = jdbcTemplate.update(sql, latestGatherIds.toArray()); + log.info("表 {} 删除旧数据 {} 条)", table, deleted); } + log.info("✅ 成功清理依附表数据,"); +} + + /** * 批量落库、更新采集次数、执行最新预警 * 事务保证,如果任何步骤失败,整个操作回滚