Compare commits

..

No commits in common. '4aedf1dc274f6e76cc7b5cf7f31143b73d5aba87' and 'dbb777c87ed6f0f6bc2f065db9d4c84e7c9f0dbe' have entirely different histories.

  1. 8
      ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquBaseController.java
  2. 3
      ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/ScheduleRulesController.java
  3. 11
      ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java
  4. 10
      ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java
  5. 2
      ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/equAssessment.java
  6. 2
      ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/message/messageController.java
  7. 26
      ALOps_sys_backend/alops-chat/src/main/java/com/alops/chat/service/AItokenService.java
  8. 2
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertDto.java
  9. 211
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/AlertMessages.java
  10. 1
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/job/GatherJob.java
  11. 3
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java
  12. 3
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java
  13. 3
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java
  14. 6
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquBaseServiceImpl.java
  15. 23
      ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml

@ -50,7 +50,6 @@ 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();
@ -148,7 +147,6 @@ 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));
@ -223,7 +221,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) {
@ -246,7 +244,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){
@ -265,7 +263,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)

@ -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,7 +99,6 @@ public class ScheduleRulesController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('equipment:rules:list')")
@GetMapping("/list")
@Log(title = "设备信息采集基本信息", businessType = BusinessType.OTHER)
public TableDataInfo list(ScheduleRules scheduleRules)
{
startPage();

@ -10,7 +10,6 @@ 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;
@ -80,7 +79,7 @@ public class AlertMessageController extends BaseController
@PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:statistic:list')")
@GetMapping ("/statistic/list")
@ApiOperation("首页查询预警信息")
@Log(title = "查询预警信息", businessType = BusinessType.OTHER)
@Log(title = "查询预警信息", businessType = BusinessType.UPDATE)
public TableDataInfo homeList()
{
startPage();
@ -95,11 +94,11 @@ public class AlertMessageController extends BaseController
@PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:list')")
@GetMapping ("/list")
@ApiOperation("查询预警信息")
@Log(title = "查询预警信息", businessType = BusinessType.OTHER)
@Log(title = "查询预警信息", businessType = BusinessType.UPDATE)
public TableDataInfo list( AlertDto alertMessage)
{
startPage();
List<AlertMessages> list = alertMessageService.selectAlertMessageList(alertMessage);
List<AlertMessage> list = alertMessageService.selectAlertMessageList(alertMessage);
return getDataTable(list);
}
@ -132,9 +131,9 @@ public class AlertMessageController extends BaseController
/**
* 删除预警信息
*/
@PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:remove')")
@PreAuthorize("@ss.hasPermi('system:message:remove')")
@ApiOperation("删除预警信息")
@Log(title = "删除预警信息", businessType = BusinessType.DELETE)
@Log(title = "删除预警信息", businessType = BusinessType.UPDATE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{

@ -50,7 +50,7 @@ public class AlertRuleController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('inMonitoring:alertRule:add')")
@ApiOperation("增加预警规则")
@Log(title = "【增加预警规则】", businessType = BusinessType.INSERT)
@Log(title = "【增加预警规则】", businessType = BusinessType.DELETE)
@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.UPDATE)
@Log(title = "【修改预警规则】", businessType = BusinessType.DELETE)
@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.OTHER)
@Log(title = "【查询预警规则】", businessType = BusinessType.DELETE)
@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.OTHER)
@Log(title = "【查询预警详细规则】", businessType = BusinessType.DELETE)
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.OTHER)
@Log(title = "【获取预警参数】", businessType = BusinessType.EXPORT)
public AjaxResult getParamsByTableName() {
return AjaxResult.success("获取预警参数成功",dictAlarmParamService.getParamsByTableName());
}

@ -30,7 +30,7 @@ public class equAssessment extends BaseController {
@PreAuthorize("@ss.hasPermi('inMonitoring:equAssessment:list')")
@GetMapping("/list")
@ApiOperation("设备评估信息")
@Log(title = "设备评估与预测", businessType = BusinessType.OTHER)
@Log(title = "设备评估与预测", businessType = BusinessType.UPDATE)
public TableDataInfo homeList()
{
startPage();

@ -64,7 +64,7 @@ public class messageController extends BaseController {
@PreAuthorize("@ss.hasPermi('message:view')")
@ApiOperation("获取用户消息列表")
@Log(title = "消息列表", businessType = BusinessType.OTHER)
@Log(title = "消息列表")
@GetMapping("/list")
public TableDataInfo getMessageList() {
startPage();

@ -310,32 +310,6 @@ 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);

@ -12,6 +12,4 @@ public class AlertDto {
private String status;
private String location;
private String inCharge;
private String name;
private String equNumber;
}

@ -1,211 +0,0 @@
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();
}
}

@ -43,7 +43,6 @@ 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);

@ -2,7 +2,6 @@ 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;
@ -45,7 +44,7 @@ public interface AlertMessageMapper
* @param alertMessage 故障统计
* @return 故障统计集合
*/
public List<AlertMessages> selectAlertMessageList(AlertDto alertMessage);
public List<AlertMessage> selectAlertMessageList(AlertDto alertMessage);
public List<homeEquAlertMessageVo> selectStaticAlertMessageList();
public ArrayList<AlertMessage> selectAlertMessageByEquId(String Equid);

@ -3,7 +3,6 @@ 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;
@ -31,7 +30,7 @@ public interface IAlertMessageService
* @param alertMessage 故障统计
* @return 故障统计集合
*/
public List<AlertMessages> selectAlertMessageList(AlertDto alertMessage);
public List<AlertMessage> selectAlertMessageList(AlertDto alertMessage);
public List<homeEquAlertMessageVo> selectStaticAlertMessageList();
public List<AlertMessage> selectAlertMessageListByEquId(String equId);

@ -11,7 +11,6 @@ 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;
@ -49,7 +48,7 @@ public class AlertMessageServiceImpl implements IAlertMessageService
* @return 故障统计
*/
@Override
public List<AlertMessages> selectAlertMessageList(AlertDto alertMessage)
public List<AlertMessage> 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,19 +45,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectAlertMessageVo">
SELECT am.id,
am.equ_id AS equId ,
am.equ_id,
am.type,
am.equ_type AS equType,
am.equ_type,
am.solution,
am.level,
am.occur_time AS occurTime,
am.occur_time,
am.handler,
am.handle_time AS handleTime,
am.handle_time,
am.status,
am.batch,
am.message,
eb.name,
eb.equ_number AS equNumber
am.message
FROM alert_message am
LEFT JOIN equ_base eb ON am.equ_id = eb.id
</sql>
@ -66,7 +64,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" resultType="AlertMessages">
<select id="selectAlertMessageList" parameterType="AlertDto" resultMap="AlertMessageResult">
<include refid="selectAlertMessageVo"/>
<where>
<!-- 时间范围 -->
@ -84,15 +82,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 设备管理员精确匹配 -->
<if test="inCharge != null and inCharge != ''"> AND eb.in_charge = #{inCharge} </if>
<!-- ✅ 设备名称模糊匹配 -->
<if test="name != null and name != ''">
AND eb.name LIKE CONCAT('%', #{name}, '%')
</if>
<!-- ✅ 设备编号精准匹配 -->
<if test="equNumber != null and equNumber != ''">
AND eb.equ_number = #{equNumber}
</if>
</where>
<!-- 按 batch 从大到小排序 -->
ORDER BY am.batch DESC

Loading…
Cancel
Save