|
@@ -1,6 +1,8 @@
|
|
|
package com.bosshand.virgo.api.operate.controller;
|
|
|
|
|
|
import com.bosshand.virgo.api.operate.model.OperateFlowData;
|
|
|
+import com.bosshand.virgo.api.operate.service.OperateDeviceLevelService;
|
|
|
+import com.bosshand.virgo.api.operate.service.OperateDeviceService;
|
|
|
import com.bosshand.virgo.api.operate.service.OperateFlowDataService;
|
|
|
import com.bosshand.virgo.api.service.ProjectItemTargetRoomService;
|
|
|
import com.bosshand.virgo.core.response.Response;
|
|
@@ -9,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -24,6 +27,12 @@ public class OperateFlowDataController {
|
|
|
@Autowired
|
|
|
ProjectItemTargetRoomService projectItemTargetRoomService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ OperateDeviceService operateDeviceService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ OperateDeviceLevelService operateDeviceLevelService;
|
|
|
+
|
|
|
@ApiOperation(value = "详情", notes = "详情")
|
|
|
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
|
|
public Response get(@PathVariable long id) {
|
|
@@ -50,6 +59,20 @@ public class OperateFlowDataController {
|
|
|
@ApiOperation(value = "分页查询", notes = "分页查询")
|
|
|
@RequestMapping(value = "/{currPage}/{pageSize}", method = RequestMethod.POST)
|
|
|
public Response getList(@RequestBody OperateFlowData operateFlowData, @PathVariable int currPage, @PathVariable int pageSize) {
|
|
|
+ // 根据目录id获取下面是所有设备id
|
|
|
+ long deviceLevelId = operateFlowData.getDeviceLevelId();
|
|
|
+ if (deviceLevelId != 0) {
|
|
|
+ List<Long> levelIds = new ArrayList<>();
|
|
|
+ operateDeviceLevelService.getLevel(levelIds, deviceLevelId);
|
|
|
+ List<Long> deviceIds = operateDeviceService.getDeviceLevelIds(levelIds);
|
|
|
+ if (deviceIds.size() > 0) {
|
|
|
+ operateFlowData.setDeviceIds(deviceIds);
|
|
|
+ } else {
|
|
|
+ deviceIds.add(-1L);
|
|
|
+ operateFlowData.setDeviceIds(deviceIds);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
List<OperateFlowData> list = operateFlowDataService.getListLimit(operateFlowData, currPage, pageSize);
|
|
|
if (list.size() > 0) {
|
|
|
for (OperateFlowData of : list) {
|