|
|
|
@ -1,14 +1,8 @@
|
|
|
|
|
package com.ruoyi.business.controller;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.business.domain.HwAlarmInfo;
|
|
|
|
|
import com.ruoyi.business.domain.HwDevice;
|
|
|
|
|
import com.ruoyi.business.domain.HwMonitorUnit;
|
|
|
|
|
import com.ruoyi.business.domain.HwScene;
|
|
|
|
|
import com.ruoyi.business.domain.*;
|
|
|
|
|
import com.ruoyi.business.domain.VO.AllNumsVo;
|
|
|
|
|
import com.ruoyi.business.service.IHwAlarmInfoService;
|
|
|
|
|
import com.ruoyi.business.service.IHwDeviceService;
|
|
|
|
|
import com.ruoyi.business.service.IHwMonitorUnitService;
|
|
|
|
|
import com.ruoyi.business.service.IHwSceneService;
|
|
|
|
|
import com.ruoyi.business.service.*;
|
|
|
|
|
import com.ruoyi.common.core.constant.HwDictConstants;
|
|
|
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
|
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
|
@ -46,9 +40,13 @@ public class HwAppController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IHwDeviceService hwDeviceService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IHwDeviceModeService hwDeviceModeService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取场景,如果是管理员,则可以获取所有场景
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("business:app:index")
|
|
|
|
|
@GetMapping("/selectSecnes")
|
|
|
|
|
public AjaxResult selectSecnes(HwScene scene) {
|
|
|
|
|
List<HwScene> hwScenes = hwSceneService.selectHwSceneList(scene);
|
|
|
|
@ -58,7 +56,7 @@ public class HwAppController extends BaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 按场景展示总的设备数量和总的最子级监控单元数量(app首页上方)
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("business:monitor:standard")
|
|
|
|
|
@RequiresPermissions("business:app:index")
|
|
|
|
|
@GetMapping("/sceneAllNums/{sceneId}")
|
|
|
|
|
public AllNumsVo sceneAllNums(@PathVariable("sceneId") Long sceneId) {
|
|
|
|
|
return hwMonitorUnitService.selectAllNums(sceneId);
|
|
|
|
@ -67,7 +65,7 @@ public class HwAppController extends BaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 分页获取最子集监控单元列表(首页)
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("business:monitor:standard")
|
|
|
|
|
@RequiresPermissions("business:app:index")
|
|
|
|
|
@GetMapping("/limitSubMonitorUnit/{sceneId}")
|
|
|
|
|
public TableDataInfo limitSubMonitorUnit(@PathVariable("sceneId") Long sceneId) {
|
|
|
|
|
HwMonitorUnit hwMonitorUnit = new HwMonitorUnit();
|
|
|
|
@ -85,7 +83,7 @@ public class HwAppController extends BaseController {
|
|
|
|
|
* @date 2023-09-15 11:03
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/getAlarmInfos")
|
|
|
|
|
@RequiresPermissions("business:monitor:alarm")
|
|
|
|
|
@RequiresPermissions("business:app:index")
|
|
|
|
|
public TableDataInfo getAlarmInfos(HwAlarmInfo hwAlarmInfo) {
|
|
|
|
|
hwAlarmInfo.setHandleStatus(HwDictConstants.ALARM_HANDLE_STATUS_NO);
|
|
|
|
|
List<HwAlarmInfo> alarmInfos = hwAlarmInfoService.selectHwAlarmInfoList(hwAlarmInfo);
|
|
|
|
@ -100,7 +98,7 @@ public class HwAppController extends BaseController {
|
|
|
|
|
* @return AjaxResult
|
|
|
|
|
*/
|
|
|
|
|
@PutMapping("/handleAlarmInfo")
|
|
|
|
|
@RequiresPermissions("business:monitor:alarm")
|
|
|
|
|
@RequiresPermissions("business:app:index")
|
|
|
|
|
public AjaxResult handleAlarmInfo(@RequestBody HwAlarmInfo hwAlarmInfo) {
|
|
|
|
|
hwAlarmInfo.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
return toAjax(hwAlarmInfoService.updateHwAlarmInfo(hwAlarmInfo));
|
|
|
|
@ -114,7 +112,7 @@ public class HwAppController extends BaseController {
|
|
|
|
|
* @return list
|
|
|
|
|
* @throws
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("business:monitor:deviceMonitor")
|
|
|
|
|
@RequiresPermissions("business:app:monitorUnit")
|
|
|
|
|
@GetMapping("/treeList/{sceneId}")
|
|
|
|
|
public AjaxResult monitorUnitTree(@PathVariable("sceneId") Long sceneId) {
|
|
|
|
|
HwMonitorUnit queryMonitorUnit = new HwMonitorUnit();
|
|
|
|
@ -129,11 +127,12 @@ public class HwAppController extends BaseController {
|
|
|
|
|
* @date 2023-09-28 13:31
|
|
|
|
|
* @return AjaxResult
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("business:monitor:deviceMonitor")
|
|
|
|
|
@RequiresPermissions("business:app:monitorUnit")
|
|
|
|
|
@GetMapping("/getDevicesInfoByMonitorUnitId/{monitorUnitId}")
|
|
|
|
|
public AjaxResult getDevicesInfoByMonitorUnitId(@PathVariable("monitorUnitId") Long monitorUnitId){
|
|
|
|
|
|
|
|
|
|
return success();
|
|
|
|
|
HwDevice queryDevice = new HwDevice();
|
|
|
|
|
queryDevice.setMonitorUnitId(monitorUnitId);
|
|
|
|
|
return success(hwDeviceService.selectDeviceNum(queryDevice));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -141,7 +140,7 @@ public class HwAppController extends BaseController {
|
|
|
|
|
*
|
|
|
|
|
* @param monitorUnitId 监控单元id
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("business:monitor:deviceMonitor")
|
|
|
|
|
@RequiresPermissions("business:app:monitorUnit")
|
|
|
|
|
@GetMapping("/selectDevicesByMonitorUnitId/{monitorUnitId}/{sceneId}")
|
|
|
|
|
public AjaxResult selectDeviceByDeviceModeByMonitorUnitId(@PathVariable("monitorUnitId") Long monitorUnitId,
|
|
|
|
|
@PathVariable("sceneId") Long sceneId) {
|
|
|
|
@ -156,7 +155,7 @@ public class HwAppController extends BaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 新增设备信息
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("business:device:add")
|
|
|
|
|
@RequiresPermissions("business:app:deviceAdd")
|
|
|
|
|
@Log(title = "设备信息(手机端)", businessType = BusinessType.INSERT)
|
|
|
|
|
@PostMapping
|
|
|
|
|
public AjaxResult add(@RequestBody HwDevice hwDevice) {
|
|
|
|
@ -172,11 +171,38 @@ public class HwAppController extends BaseController {
|
|
|
|
|
*
|
|
|
|
|
* @param deviceCode 设备编号
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("business:monitor:deviceMonitor")
|
|
|
|
|
@RequiresPermissions("business:app:device")
|
|
|
|
|
@GetMapping("/getDeviceByDeviceCode/{deviceCode}")
|
|
|
|
|
public AjaxResult getDeviceByDeviceCode(@PathVariable("deviceCode") String deviceCode){
|
|
|
|
|
return success(hwDeviceService.selectHwDeviceByDeviceCode(deviceCode));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据场景获取设备模型列表
|
|
|
|
|
*
|
|
|
|
|
* @param sceneId 场景ID
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("business:app:deviceAdd")
|
|
|
|
|
@GetMapping("/getDeviceModesBySceneId/{sceneId}")
|
|
|
|
|
public AjaxResult getDeviceModesBySceneId(@PathVariable("sceneId") Long sceneId){
|
|
|
|
|
HwDeviceMode queryDeviceMode = new HwDeviceMode();
|
|
|
|
|
queryDeviceMode.setSceneId(sceneId);
|
|
|
|
|
queryDeviceMode.setDeviceModeStatus(HwDictConstants.DEVICE_MODE_STATUS_NORMAL);
|
|
|
|
|
return success(hwDeviceModeService.selectHwDeviceModeList(queryDeviceMode));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据场景获取网关设备列表
|
|
|
|
|
*
|
|
|
|
|
* @param sceneId 场景ID
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("business:app:deviceAdd")
|
|
|
|
|
@GetMapping("/getGatewayDevicesBySceneId/{sceneId}")
|
|
|
|
|
public AjaxResult getGatewayDevicesBySceneId(@PathVariable("sceneId") Long sceneId){
|
|
|
|
|
HwDevice queryDevice = new HwDevice();
|
|
|
|
|
queryDevice.setSceneId(sceneId);
|
|
|
|
|
queryDevice.setDeviceType(HwDictConstants.DEVICE_TYPE_GATEWAY_DEVICE);
|
|
|
|
|
return success(hwDeviceService.selectHwDeviceList(queryDevice));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|