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 754900d..814c97f 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,14 +138,17 @@ 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); +// HwDevice device = new HwDevice(); +// device.setSceneId(sceneId); +// List devices = hwDeviceService.selectHwDeviceListWithDeviceMode(device); + + List models = hwDeviceModeService.selectModel(sceneId); JSONObject result = new JSONObject(); result.put("alarmTypes", alarmTypes); result.put("alarmLevels",alarmLevels); - result.put("devices",devices); +// result.put("devices",devices); + result.put("models",models); 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 273a192..6a4cd40 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,5 +246,9 @@ 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 4a7360c..552d4f3 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,4 +147,6 @@ 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 new file mode 100644 index 0000000..764f0e0 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwOfflineRuleController.java @@ -0,0 +1,25 @@ +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 86026d1..322daa7 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 @@ -170,4 +170,6 @@ public interface HwDeviceMapper * 根据设备id查询该设备是否报警 * */ Long selectDeviceIfAlarm(Long deviceId); + + 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 d4297c2..ae1e860 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,4 +143,6 @@ 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 new file mode 100644 index 0000000..819ade1 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwOfflineRuleMapper.java @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000..617e237 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/HwOfflineRuleService.java @@ -0,0 +1,9 @@ +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 d0ba61f..0523311 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,6 +3,7 @@ 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; @@ -134,4 +135,7 @@ 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/HwDeviceModeServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceModeServiceImpl.java index 61187a2..06849ed 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,6 +433,16 @@ 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/resources/mapper/business/HwDeviceMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml index 31a9fb0..8f421f9 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 @@ -55,7 +55,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - @@ -63,9 +62,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + 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 fcb25bb..fab7db8 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,5 +236,7 @@ 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 100241a..28f7aec 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 @@ -80,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"