From cb3ed199ae90eb5917e0d745454076f002bd6980 Mon Sep 17 00:00:00 2001 From: xins Date: Wed, 15 Nov 2023 16:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=A5=E4=BE=9D=E5=BE=AE=E6=9C=8D=E5=8A=A11.?= =?UTF-8?q?9.9=20business=201=E3=80=81=E6=AF=8F=E4=B8=AA=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E9=85=8D=E7=BD=AE=E4=B8=80=E4=B8=AA=E7=A6=BB?= =?UTF-8?q?=E7=BA=BF=E6=8A=A5=E8=AD=A6=E8=A7=84=E5=88=99=E3=80=82=202?= =?UTF-8?q?=E3=80=81=E6=AF=8F=E4=B8=AA=E8=AE=BE=E5=A4=87=E4=B9=9F=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E9=85=8D=E7=BD=AE=E4=B8=80=E4=B8=AA=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E8=A7=84=E5=88=99=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/core/constant/HwDictConstants.java | 3 +++ .../java/com/ruoyi/common/log/enums/BusinessType.java | 7 ++++++- .../com/ruoyi/business/mapper/HwOfflineTargetMapper.java | 9 +++++++++ .../main/resources/mapper/business/HwDeviceMapper.xml | 2 +- .../resources/mapper/business/HwOfflineRuleMapper.xml | 3 ++- .../resources/mapper/business/HwOfflineTargetMapper.xml | 9 +++++++++ ruoyi-ui/src/views/business/offlineRule/index.vue | 2 +- 7 files changed, 31 insertions(+), 4 deletions(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/HwDictConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/HwDictConstants.java index 3d673e8..3c68d1c 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/HwDictConstants.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/HwDictConstants.java @@ -176,4 +176,7 @@ public class HwDictConstants { public static final String ALARM_TYPE_COMMON_FLAG_YES = "1";//报警类型通用标识:是 public static final String ALARM_TYPE_COMMON_FLAG_NO = "0";//报警类型通用标识:否 + public static final String OFFLINE_RULE_TYPE_DEVICE = "1";//离线报警规则类型:设备 + public static final String OFFLINE_RULE_TYPE_SCENE = "3";//离线报警规则类型:场景 + } diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessType.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessType.java index 8212b25..da2e9f3 100644 --- a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessType.java +++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessType.java @@ -70,5 +70,10 @@ public enum BusinessType /** * 重建表 */ - REBUILD + REBUILD, + + /** + * 分配 + */ + ALLOCATE } diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwOfflineTargetMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwOfflineTargetMapper.java index 5740b3b..09c40d5 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwOfflineTargetMapper.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwOfflineTargetMapper.java @@ -38,4 +38,13 @@ public interface HwOfflineTargetMapper { */ public int deleteOfflineTargets(@Param("offlineRuleId") Long offlineRuleId, @Param("targetType") String targetType, @Param("targetIds") Long[] targetIds); + + /** + * @param: offlineTarget + * @description 查询离线报警规则目标数量 + * @author xins + * @date 2023-11-15 11:24 + * @return Integer + */ + public Integer selectOfflineTargetCount(HwOfflineTarget offlineTarget); } diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml index f44b020..03ada52 100644 --- a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml @@ -346,7 +346,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select distinct hd.device_id,hd.device_code,hd.device_name,hd.device_type,hd.publish_time,hmu.monitor_unit_name from hw_device hd left join hw_monitor_unit hmu on hd.monitor_unit_id = hmu.monitor_unit_id where hd.device_status != '9' and hd.scene_id=#{sceneId} - and not exists (select 1 from hw_offline_target hot where hot.target_id=hd.device_id and hot.offline_rule_id = #{offlineRuleId}) + and not exists (select 1 from hw_offline_target hot where hot.target_id=hd.device_id and hot.target_type = 1) AND hd.device_code like concat('%', #{deviceCode}, '%') diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwOfflineRuleMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwOfflineRuleMapper.xml index 0741226..fcb25bb 100644 --- a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwOfflineRuleMapper.xml +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwOfflineRuleMapper.xml @@ -57,7 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select count(1) from hw_offline_target hot + + and target_type = #{targetType} + and target_id = #{targetId} + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/business/offlineRule/index.vue b/ruoyi-ui/src/views/business/offlineRule/index.vue index b28766d..806661b 100644 --- a/ruoyi-ui/src/views/business/offlineRule/index.vue +++ b/ruoyi-ui/src/views/business/offlineRule/index.vue @@ -559,7 +559,7 @@ export default { tenantId: null, sceneId: null, alarmLevelId: null, - ruleType: '3', + ruleType: '1', offlineTime: undefined, offlineNumberTime: 1, offlineNumber: 1,