From ca7fac100c58009db2dbea40e20bf80b6a1ac821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E4=BC=9F?= Date: Thu, 29 Aug 2024 09:28:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=9B=91=E6=B5=8B=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=B3=BB=E7=BB=9Fbug=E4=BC=98=E5=8C=96=E5=A4=84=E7=90=86HwAlar?= =?UTF-8?q?mRule=E7=B1=BB=E5=B1=9E=E6=80=A7=E7=9A=84=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/business/domain/HwAlarmRule.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwAlarmRule.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwAlarmRule.java index 2948b84..ab0c97e 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwAlarmRule.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwAlarmRule.java @@ -109,6 +109,36 @@ public class HwAlarmRule extends BaseEntity private String ruleDeviceName; private String alarmInfoFlag; + private List ruleDeviceIds; + private Long deviceModeId; + private String deviceModeName; + public void setDeviceModeId(Long deviceModeId) + { + this.deviceModeId = deviceModeId; + } + + public Long getDeviceModeId() + { + return deviceModeId; + } + public void setDeviceModeName(String deviceModeName) + { + this.deviceModeName = deviceModeName; + } + + public String getDeviceModeName() + { + return deviceModeName; + } + public void setRuleDeviceIds(List ruleDeviceIds) + { + this.ruleDeviceIds = ruleDeviceIds; + } + + public List getRuleDeviceIds() + { + return ruleDeviceIds; + } public void setAlarmRuleId(Long alarmRuleId) { From 857a826e9367c60ea3f7f1e331e7764b5b9b4a7e Mon Sep 17 00:00:00 2001 From: maxw Date: Fri, 30 Aug 2024 12:04:46 +0800 Subject: [PATCH 2/2] revert 441b3902104cb5b501e0b85a5cb7bb4be28c133b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit revert 监测平台系统bug优化处理 --- .../controller/HwAlarmRuleController.java | 11 +++---- .../controller/HwDeviceController.java | 4 --- .../controller/HwDeviceModeController.java | 2 -- .../controller/HwOfflineRuleController.java | 25 --------------- .../ruoyi/business/mapper/HwDeviceMapper.java | 4 --- .../business/mapper/HwDeviceModeMapper.java | 2 -- .../business/mapper/HwOfflineRuleMapper.java | 12 ------- .../service/HwOfflineRuleService.java | 9 ------ .../service/IHwDeviceModeService.java | 4 --- .../service/impl/HwAlarmRuleServiceImpl.java | 23 +++++--------- .../service/impl/HwDeviceModeServiceImpl.java | 10 ------ .../impl/HwMonitorUnitServiceImpl.java | 2 +- .../impl/HwOfflineRuleServiceImpl.java | 19 ------------ .../mapper/business/HwAlarmRuleMapper.xml | 5 +-- .../mapper/business/HwDeviceMapper.xml | 31 ++----------------- .../mapper/business/HwDeviceModeMapper.xml | 3 -- .../mapper/business/HwOfflineRuleMapper.xml | 2 -- .../mapper/business/HwSceneMapper.xml | 1 - 18 files changed, 17 insertions(+), 152 deletions(-) delete mode 100644 ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwOfflineRuleController.java delete mode 100644 ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwOfflineRuleMapper.java delete mode 100644 ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/HwOfflineRuleService.java delete mode 100644 ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwOfflineRuleServiceImpl.java diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwAlarmRuleController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwAlarmRuleController.java index 814c97f..754900d 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwAlarmRuleController.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwAlarmRuleController.java @@ -138,17 +138,14 @@ public class HwAlarmRuleController extends BaseController { alarmLevel.setSceneId(sceneId); List alarmLevels = hwAlarmLevelService.selectHwAlarmLevelList(alarmLevel); -// HwDevice device = new HwDevice(); -// device.setSceneId(sceneId); -// List devices = hwDeviceService.selectHwDeviceListWithDeviceMode(device); - - List models = hwDeviceModeService.selectModel(sceneId); + HwDevice device = new HwDevice(); + device.setSceneId(sceneId); + List devices = hwDeviceService.selectHwDeviceListWithDeviceMode(device); JSONObject result = new JSONObject(); result.put("alarmTypes", alarmTypes); result.put("alarmLevels",alarmLevels); -// result.put("devices",devices); - result.put("models",models); + result.put("devices",devices); return success(result); } diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceController.java index 6a4cd40..273a192 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceController.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceController.java @@ -246,9 +246,5 @@ public class HwDeviceController extends BaseController { public void computeOnlineDevicecCount(@PathVariable("days") int days) { hwDeviceService.computeOnlineDevicecCount(days); } - @GetMapping("/getDeviceByModel") - public AjaxResult getDeviceByModel(Long modelId){ - return AjaxResult.success(hwDeviceModeService.getDeviceByModel(modelId)); - } } diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceModeController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceModeController.java index 552d4f3..4a7360c 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceModeController.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceModeController.java @@ -147,6 +147,4 @@ public class HwDeviceModeController extends BaseController { public void rebuildTdSuperTables() { hwDeviceModeService.rebuildTdSuperTables(); } - - } diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwOfflineRuleController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwOfflineRuleController.java deleted file mode 100644 index 764f0e0..0000000 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwOfflineRuleController.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.ruoyi.business.controller; - -import com.ruoyi.business.domain.HwOfflineRule; -import com.ruoyi.business.service.HwOfflineRuleService; -import com.ruoyi.common.core.web.controller.BaseController; -import com.ruoyi.common.core.web.page.TableDataInfo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@RestController -@RequestMapping("/offlineRule") -public class HwOfflineRuleController extends BaseController { - - @Autowired - private HwOfflineRuleService hwOfflineRuleService; - - @GetMapping("list") - public TableDataInfo list(HwOfflineRule hwOfflineRule){ - startPage(); - List hwOfflineRules = hwOfflineRuleService.selectRuleList(hwOfflineRule); - return getDataTable(hwOfflineRules); - } -} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceMapper.java index 678c813..ce781f0 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceMapper.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceMapper.java @@ -134,8 +134,4 @@ public interface HwDeviceMapper * @return List */ public List selectUnallocatedList(HwDevice hwDevice); - - int getOnlineDeviceNum1(Long sceneId); - - List getDeviceByModel(Long modelId); } diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceModeMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceModeMapper.java index ae1e860..d4297c2 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceModeMapper.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceModeMapper.java @@ -143,6 +143,4 @@ public interface HwDeviceModeMapper * @return 设备模型集合 */ public List selectHwDeviceModeJoinList(HwDeviceMode hwDeviceMode); - - List selectModel(Long sceneId); } diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwOfflineRuleMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwOfflineRuleMapper.java deleted file mode 100644 index 819ade1..0000000 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwOfflineRuleMapper.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.ruoyi.business.mapper; - -import com.ruoyi.business.domain.HwOfflineRule; - -import java.util.List; - -public interface HwOfflineRuleMapper { - - List selectHwOfflineRuleJoinList(HwOfflineRule hwOfflineRule); - - -} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/HwOfflineRuleService.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/HwOfflineRuleService.java deleted file mode 100644 index 617e237..0000000 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/HwOfflineRuleService.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.ruoyi.business.service; - -import com.ruoyi.business.domain.HwOfflineRule; - -import java.util.List; - -public interface HwOfflineRuleService { - List selectRuleList(HwOfflineRule hwOfflineRule); -} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwDeviceModeService.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwDeviceModeService.java index 0523311..d0ba61f 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwDeviceModeService.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwDeviceModeService.java @@ -3,7 +3,6 @@ package com.ruoyi.business.service; import java.util.List; import java.util.Map; -import com.ruoyi.business.domain.HwDevice; import com.ruoyi.business.domain.HwDeviceMode; import com.ruoyi.business.domain.HwDeviceModeFunction; import com.ruoyi.business.domain.HwDeviceModeParameter; @@ -135,7 +134,4 @@ public interface IHwDeviceModeService */ public HwDeviceMode selectHwDeviceModeByDeviceId(Long deviceId); - List selectModel(Long sceneId); - - List getDeviceByModel(Long modelId); } diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwAlarmRuleServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwAlarmRuleServiceImpl.java index bf75ffc..30be5cc 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwAlarmRuleServiceImpl.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwAlarmRuleServiceImpl.java @@ -117,21 +117,14 @@ public class HwAlarmRuleServiceImpl implements IHwAlarmRuleService { @Transactional @Override public int insertHwAlarmRule(HwAlarmRule hwAlarmRule) { - List ruleDeviceIds = hwAlarmRule.getRuleDeviceIds(); - int rows = 0; - for (Long ruleDeviceId : ruleDeviceIds) { - hwAlarmRule.setRuleDeviceId(ruleDeviceId); - String triggerExpression = this.getTriggerExpression(hwAlarmRule); - hwAlarmRule.setTriggerExpression(triggerExpression); - hwAlarmRule.setAlarmPushFlag(HwDictConstants.ALARM_PUSH_FLAG_NO); - hwAlarmRule.setCreateTime(DateUtils.getNowDate()); - hwAlarmRule.setTenantId(SecurityUtils.getTenantId()); - hwAlarmRule.setCreateBy(SecurityUtils.getUsername()); - int rowsAdd = hwAlarmRuleMapper.insertHwAlarmRule(hwAlarmRule); - insertHwAlarmRuleLink(hwAlarmRule); - rows += rowsAdd; - } - + String triggerExpression = this.getTriggerExpression(hwAlarmRule); + hwAlarmRule.setTriggerExpression(triggerExpression); + hwAlarmRule.setAlarmPushFlag(HwDictConstants.ALARM_PUSH_FLAG_NO); + hwAlarmRule.setCreateTime(DateUtils.getNowDate()); + hwAlarmRule.setTenantId(SecurityUtils.getTenantId()); + hwAlarmRule.setCreateBy(SecurityUtils.getUsername()); + int rows = hwAlarmRuleMapper.insertHwAlarmRule(hwAlarmRule); + insertHwAlarmRuleLink(hwAlarmRule); return rows; } diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceModeServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceModeServiceImpl.java index 06849ed..61187a2 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceModeServiceImpl.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceModeServiceImpl.java @@ -433,16 +433,6 @@ public class HwDeviceModeServiceImpl implements IHwDeviceModeService { return deviceMode; } - @Override - public List selectModel(Long sceneId) { - return hwDeviceModeMapper.selectModel(sceneId); - } - - @Override - public List getDeviceByModel(Long modelId) { - return hwDeviceMapper.getDeviceByModel(modelId); - } - /** * @param: hwDeviceModeFunction diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitServiceImpl.java index 2f5647e..ed28dc4 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitServiceImpl.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitServiceImpl.java @@ -174,7 +174,7 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService { public SubDeviceSumVo selectSubDeviceSum(Long sceneId) { AllNumsVo numsVo = selectAllNums(sceneId); //获取在线设备数量,获取已发布状态子设备并且关联网关为在线的数量以及在线状态发布状态的直连设备数量之和 - int onlineDeviceNum = hwDeviceMapper.getOnlineDeviceNum1(sceneId); + int onlineDeviceNum = hwDeviceMapper.getOnlineDeviceNum(sceneId); SubDeviceSumVo subDeviceSumVo = new SubDeviceSumVo(); subDeviceSumVo.setSubSum(numsVo.getSubSum());//监控单元数量 diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwOfflineRuleServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwOfflineRuleServiceImpl.java deleted file mode 100644 index f9ffec5..0000000 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwOfflineRuleServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.ruoyi.business.service.impl; - -import com.ruoyi.business.domain.HwOfflineRule; -import com.ruoyi.business.mapper.HwOfflineRuleMapper; -import com.ruoyi.business.service.HwOfflineRuleService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -@Service -public class HwOfflineRuleServiceImpl implements HwOfflineRuleService { - @Autowired - private HwOfflineRuleMapper hwOfflineRuleMapper; - @Override - public List selectRuleList(HwOfflineRule hwOfflineRule) { - List hwOfflineRules = hwOfflineRuleMapper.selectHwOfflineRuleJoinList(hwOfflineRule); - return hwOfflineRules; - } -} diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwAlarmRuleMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwAlarmRuleMapper.xml index 00f7350..66c43e1 100644 --- a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwAlarmRuleMapper.xml +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwAlarmRuleMapper.xml @@ -118,16 +118,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by har.alarm_rule_id desc - select a.alarm_rule_id, a.alarm_rule_name, a.tenant_id, a.scene_id, a.language_code, a.alarm_level_id, a.alarm_type_id, a.rule_type, a.rule_device_id, a.rule_function_total, a.trigger_expression, a.link_flag, a.alarm_rule_status, a.alarm_push_flag, a.alarm_push_content, a.alarm_recover_content, a.remark, a.create_by, a.create_time, a.update_by, a.update_time, a.alarm_rule_field, b.rule_link_id as sub_rule_link_id, b.alarm_rule_type as sub_alarm_rule_type, b.alarm_rule_id as sub_alarm_rule_id, b.link_type as sub_link_type, b.link_device_id as sub_link_device_id, b.link_device_function_id as sub_link_device_function_id, b.link_device_function_identifier as sub_link_device_function_identifier, b.link_device_function_data as sub_link_device_function_data, hd.device_name as sub_link_device_name,hdmf.function_name as sub_link_device_mode_function_name - ,d.device_mode_id as device_mode_id,d.device_mode_name as device_mode_name from hw_alarm_rule a left join hw_alarm_rule_link b on b.alarm_rule_id = a.alarm_rule_id and b.alarm_rule_type=1 left join hw_device hd on b.link_device_id = hd.device_id left join hw_device_mode_function hdmf on b.link_device_function_id=hdmf.mode_function_id - left join hw_device c on a.rule_device_id = c.device_id - left join hw_device_mode d on d.device_mode_id = c.device_mode_id where a.alarm_rule_id = #{alarmRuleId} 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 2ee2514..c981a02 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 @@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -47,9 +48,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceModeMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceModeMapper.xml index a777014..d128d86 100644 --- a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceModeMapper.xml +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceModeMapper.xml @@ -321,9 +321,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by hdm.device_mode_id desc - 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 fab7db8..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 @@ -236,7 +236,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by hor.offline_rule_id desc - \ No newline at end of file diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwSceneMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwSceneMapper.xml index e4a57cf..bb40a02 100644 --- a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwSceneMapper.xml +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwSceneMapper.xml @@ -75,7 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"