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 a98af005..12de7821 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 @@ -129,10 +129,6 @@ public class EquBaseController extends BaseController @GetMapping(value = "/queryimage/{id}") @ApiOperation("查询单个设备图片") public void getImage(@PathVariable String id, HttpServletResponse response) throws IOException { - if (id instanceof String) { - System.out.println("这是一个字符串"); - } - byte[] imgBytes = equBaseService.selectEquBaseImageById(id).getEquImage(); diff --git a/ALOps_sys_backend/alops-admin/src/main/resources/application-druid.yml b/ALOps_sys_backend/alops-admin/src/main/resources/application-druid.yml index ebb307be..5b4337af 100644 --- a/ALOps_sys_backend/alops-admin/src/main/resources/application-druid.yml +++ b/ALOps_sys_backend/alops-admin/src/main/resources/application-druid.yml @@ -6,7 +6,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://localhost:3306/alops_sys?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://localhost:3306/aiops_sys?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root password: 1234 # 从库数据源 diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquBase.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquBase.java index ef601d24..1c4c3eb0 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquBase.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquBase.java @@ -15,7 +15,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; * 设备基本信息对象 equ_base * * @author ruoyi - * @date 2025-09-19 + * @date 2025-09-19F */ @Data public class EquBase @@ -25,6 +25,7 @@ public class EquBase /** 设备唯一标识(设备编号) */ private String id; + /** (设备编号) */ private String equNumber; /** 设备名称 */ @@ -43,13 +44,6 @@ public class EquBase @Excel(name = "设备厂商 id") private String manufacture; - public EquManu getManufactureVO() { - return manufactureVO; - } - - public void setManufactureVO(EquManu manufactureVO) { - this.manufactureVO = manufactureVO; - } private EquManu manufactureVO; 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 70504743..c1938f68 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 @@ -213,7 +213,7 @@ public class AlertLaunchServiceImpl implements IAlertLaunchService { // 3. SQL:取每台设备最新记录和次新记录,比较该字段是否变化,并关联设备类型 String sql = - "SELECT g1.*, t.name AS equ_type,b.name AS equ_name" + + "SELECT g1.*, t.name AS equ_type,b.name AS equ_name,b.equ_number" + "FROM equ_gather g1 " + "JOIN equ_gather g2 ON g1.equ_id = g2.equ_id " + "JOIN equ_base b ON g1.equ_id = b.id " + 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 46d971ed..7840b76f 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 @@ -140,7 +140,7 @@ public class AlertRuleServiceImpl implements IAlertRuleService if ("equ_gather".equalsIgnoreCase(rule.getTableName())) { // equ_gather 作为主表 - sql.append("g.*, t.name AS equ_type ,b.name AS equ_name") + sql.append("g.*, t.name AS equ_type ,b.name AS equ_name,b.equ_number ") .append("FROM equ_gather g ") .append("JOIN equ_base b ON g.equ_id = b.id ") .append("JOIN equ_type t ON b.equ_type = t.id ") // ★ 新增关联 @@ -153,7 +153,7 @@ public class AlertRuleServiceImpl implements IAlertRuleService .append(buildConditionsSql(conditions)); } else { // 其他表,需要连 equ_gather → equ_base → equ_type - sql.append("src.*, g.equ_id, t.name AS equ_type,b.name AS equ_name ") + sql.append("src.*, g.equ_id, t.name AS equ_type,b.name AS equ_name,b.equ_number ") .append("FROM ").append(rule.getTableName()).append(" src ") .append("JOIN equ_gather g ON src.equ_gather_id = g.id ") .append("JOIN equ_base b ON g.equ_id = b.id ") 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 9432f32c..d4960ed9 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 @@ -159,6 +159,7 @@ public class EquBaseServiceImpl implements IEquBaseService if (equBase.getCreateDate() == null) { equBase.setCreateDate(new Date()); } + equBase.setId(UUID.randomUUID().toString()); equBase.setCreateBy(SecurityUtils.getLoginUser().getUserId()); return equBaseMapper.insertEquBase(equBase); } 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 18aa1a24..a4958add 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 @@ -95,7 +95,6 @@ public class ScheduleRulesServiceImpl implements IScheduleRulesService { } // 2. 执行新规则 - //首先存入规则在执行 Date now = new Date(); Long userId = SecurityUtils.getLoginUser().getUserId(); diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquBaseMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquBaseMapper.xml index aaf1774c..8e3eaedc 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquBaseMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquBaseMapper.xml @@ -25,9 +25,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - @@ -43,19 +40,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + - - + - - @@ -77,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, name, version, ip, manufacture, location, equ_type, in_charge, install_date, life_cycle, warranty, create_by, create_date, status, device_level, supplier_id from equ_base + select id,equ_number, name, version, ip, manufacture, location, equ_type, in_charge, install_date, life_cycle, warranty, create_by, create_date, status, device_level, supplier_id from equ_base @@ -101,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" b.id AS id, + b.equ_number AS equNumber b.name AS name, b.version AS version, b.ip AS ip, @@ -117,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" b.status AS status, b.device_level AS deviceLevel, g.health AS health +