|
@@ -9,12 +9,14 @@ import com.bz.zoneiot.water.web.service.CameraManageService;
|
|
|
import com.bz.zoneiot.water.core.entity.CameraManage;
|
|
|
import com.bz.zoneiot.core.common.pojo.AjaxMessage;
|
|
|
import com.bz.zoneiot.core.common.util.BeanCopyUtils;
|
|
|
+import com.bz.zoneiot.water.web.service.impl.SceneService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -31,6 +33,9 @@ public class CameraManageController {
|
|
|
@Autowired
|
|
|
private CameraManageService cameraManageService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private SceneService sceneService;
|
|
|
+
|
|
|
@RequestMapping(value = "insert", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "增加摄像头",notes = "stauts为300009,公司/部门信息错误")
|
|
|
public AjaxMessage<Integer> insert(@ApiParam(value = "新增摄像头", required = true) @RequestBody CameraManage cameraManage) {
|
|
@@ -84,10 +89,20 @@ public class CameraManageController {
|
|
|
public AjaxMessage selectBySceneId(@RequestParam(required = false) Integer sceneId) {
|
|
|
CameraManage cameraManage = new CameraManage();
|
|
|
cameraManage.setSceneId(sceneId);
|
|
|
+
|
|
|
List<CameraManage> cameraManages = cameraManageService.selectList(cameraManage);
|
|
|
return AjaxMessage.success(cameraManages);
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping(value = "listBySceneId", method = RequestMethod.POST)
|
|
|
+ @ApiOperation(value = "查询场景树下的摄像头")
|
|
|
+ public AjaxMessage listBySceneId(@RequestParam(required = false) Long sceneId) {
|
|
|
+ List<Long> sceneIds = sceneService.findByParentIdsLike(sceneId);
|
|
|
+ List<CameraManage> cameraManages = cameraManageService.selectListBySceneId(sceneIds);
|
|
|
+ return AjaxMessage.success(cameraManages);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@RequestMapping(value = "get", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "获取单个摄像头信息")
|
|
|
public AjaxMessage selectById(@RequestParam(required = false) Integer id) {
|