| | |
| | | package com.ruoyi.device.camera.controller; |
| | | |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.device.camera.domain.ArdCameras; |
| | | import com.ruoyi.device.camera.domain.CameraCmd; |
| | | import com.ruoyi.device.camera.service.IArdCamerasService; |
| | | import com.ruoyi.device.camera.service.ICameraSdkService; |
| | | import com.ruoyi.device.dhsdk.service.IDhClientService; |
| | | import com.ruoyi.device.hiksdk.service.IHikClientService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.device.camera.domain.ArdCameras; |
| | | import com.ruoyi.device.camera.domain.CameraCmd; |
| | | import com.ruoyi.device.camera.service.IArdCamerasService; |
| | | import com.ruoyi.device.dhsdk.service.IDhClientService; |
| | | import com.ruoyi.device.hiksdk.service.IHikClientService; |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: |
| | | * @ClassName: CameraSdkController |
| | | * @Author: 刘苏义 |
| | | * @Date: 2023年10月14日17:02:56 |
| | | **/ |
| | | |
| | | @Api(tags = "相机通用SDK接口") |
| | | @Controller |
| | | @RequestMapping("/cameraSdk") |
| | | @Anonymous |
| | | public class CameraSdkController extends BaseController { |
| | | |
| | | @Resource |
| | | private ICameraSdkService cameraSdkService; |
| | | @Resource |
| | | private IArdCamerasService ardCamerasService; |
| | | |
| | | /** |
| | | * @描述 初始加载SDK库文件 |
| | | * @返回值 void |
| | | * @创建人 刘苏义 |
| | | * @创建时间 2023/1/17 16:13 |
| | | * @修改人和其它信息 if (Platform.isLinux()) |
| | | */ |
| | | @PostConstruct |
| | | public void initSDK() { |
| | | cameraSdkService.initSDK(); |
| | | } |
| | | |
| | | @RequestMapping("/preview") |
| | | private String preview() { |
| | | return "preview"; |
| | | } |
| | | |
| | | @RequestMapping("/index") |
| | | private String index() { |
| | | return "test"; |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | public @ResponseBody |
| | | AjaxResult list(ArdCameras ardCamera) { |
| | | List<ArdCameras> list = ardCamerasService.selectArdCamerasListNoDataScope(ardCamera); |
| | | return AjaxResult.success("相机列表:", list); |
| | | } |
| | | |
| | | @ApiOperation("获取码流压缩参数") |
| | | @PostMapping("/getVideoCompressionCfg") |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"}) |
| | | @Log(title = "获取码流压缩参数", businessType = BusinessType.CONTROL) |
| | | public @ResponseBody |
| | | AjaxResult getVideoCompressionCfg(@RequestBody CameraCmd cmd) { |
| | | return AjaxResult.success(cameraSdkService.getVideoCompressionCfg(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("在线状态") |
| | | @PostMapping("/state") |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId"}) |
| | | @Log(title = "在线状态", businessType = BusinessType.CONTROL) |
| | | public @ResponseBody |
| | | AjaxResult getOnlineState(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | boolean onLine = cameraSdkService.isOnLine(cmd); |
| | | return AjaxResult.success(onLine); |
| | | } |
| | | |
| | | @ApiOperation(value = "云台控制", notes = "Code:1-左上 2-上 3-右上 4-左 5-巡航 6-右 7-左下 8-下 9-右下 10-焦距变大 11-焦距变小\n" + |
| | | "12-焦点前调 13-焦点后调 14-光圈扩大 15-光圈缩小 16-雨刷开启") |
| | | @PostMapping("/PTZControlWithSpeed") |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.speed", "cmd.enable", "cmd.code"}) |
| | | @Log(title = "云台控制", businessType = BusinessType.CONTROL) |
| | | public @ResponseBody |
| | | AjaxResult PTZControlWithSpeed(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.pTZControl(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("调用预置点") |
| | | @PostMapping("/gotoPreset") |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.presetIndex"}) |
| | | @Log(title = "调用预置点", businessType = BusinessType.CONTROL) |
| | | public @ResponseBody |
| | | AjaxResult gotoPreset(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.gotoPreset(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("设置预置点") |
| | | @PostMapping("/setPreset") |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.presetIndex"}) |
| | | @Log(title = "设置预置点", businessType = BusinessType.CONTROL) |
| | | public @ResponseBody |
| | | AjaxResult setPreset(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.setPreset(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("获取聚焦值") |
| | | @PostMapping("/getFocusPos") |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"}) |
| | | @Log(title = "获取聚焦值", businessType = BusinessType.CONTROL) |
| | | public @ResponseBody |
| | | AjaxResult getFocusPos(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | Map<String, Object> Map = cameraSdkService.getFocusPos(cmd); |
| | | return AjaxResult.success("获取聚焦值", Map); |
| | | } |
| | | |
| | | @ApiOperation("设置聚焦值") |
| | | @PostMapping("/setFocusPos") |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.dwFocusPos"}) |
| | | @Log(title = "设置聚焦值", businessType = BusinessType.CONTROL) |
| | | public @ResponseBody |
| | | AjaxResult setFocusPos(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.setFocusPos(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("获取PTZ") |
| | | @PostMapping("/getPTZ") |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"}) |
| | | @Log(title = "获取PTZ", businessType = BusinessType.CONTROL) |
| | | public @ResponseBody |
| | | AjaxResult getPTZ(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | Map<String, Object> ptzMap = cameraSdkService.getPtz(cmd); |
| | | return AjaxResult.success("获取ptz", ptzMap); |
| | | } |
| | | |
| | | @ApiOperation("获取PTZ范围") |
| | | @PostMapping("/getPTZScope") |
| | | @Log(title = "获取PTZ范围", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"}) |
| | | public @ResponseBody |
| | | AjaxResult getPTZScope(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | Map<String, Object> ptzMap = cameraSdkService.getPtzScope(cmd); |
| | | return AjaxResult.success("获取ptz范围", ptzMap); |
| | | } |
| | | |
| | | @ApiOperation("设置PTZ") |
| | | @PostMapping("/setPTZ") |
| | | @Log(title = "设置PTZ", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.ptzMap"}) |
| | | public @ResponseBody |
| | | AjaxResult setPTZ(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.setPtz(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("指向目标") |
| | | @PostMapping("/setTargetPosition") |
| | | @Log(title = "指向目标", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.targetPosition"}) |
| | | public @ResponseBody |
| | | AjaxResult setTargetPosition(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.guideTargetPosition(cmd)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("设置零方位角") |
| | | @PostMapping("/setZeroPTZ") |
| | | @Log(title = "设置零方位角", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"}) |
| | | public @ResponseBody |
| | | AjaxResult setZeroPTZ(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.setZeroPtz(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("设置锁定") |
| | | @PostMapping("/setPTZLock") |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.expired"}) |
| | | @Log(title = "设置锁定", businessType = BusinessType.CONTROL) |
| | | public @ResponseBody |
| | | AjaxResult setPTZLock(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return AjaxResult.success(cameraSdkService.controlLock(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("设置解锁") |
| | | @PostMapping("/setPTZUnLock") |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId"}) |
| | | @Log(title = "设置解锁", businessType = BusinessType.CONTROL) |
| | | public @ResponseBody |
| | | AjaxResult setPTZUnLock(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return AjaxResult.success(cameraSdkService.controlUnLock(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("获取云台锁定信息") |
| | | @PostMapping("/getPTZLockInfo") |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"}) |
| | | @Log(title = "获取云台锁定信息", businessType = BusinessType.CONTROL) |
| | | public @ResponseBody |
| | | AjaxResult getPTZLockInfo(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | int byWorkMode = cameraSdkService.getPTZLockInfo(cmd); |
| | | if (byWorkMode == 0) { |
| | | return AjaxResult.success("云台锁定状态:解锁"); |
| | | } else if (byWorkMode == 1) { |
| | | return AjaxResult.success("云台锁定状态:锁定"); |
| | | } else { |
| | | return AjaxResult.error("云台锁定状态:失败"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("透雾开关") |
| | | @PostMapping("/defogcfg") |
| | | @Log(title = "透雾开关", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"}) |
| | | public @ResponseBody |
| | | AjaxResult defogcfg(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.controlDefogcfg(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("红外开关") |
| | | @PostMapping("/infrarecfg") |
| | | @Log(title = "红外开关", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"}) |
| | | public @ResponseBody |
| | | AjaxResult infrarecfg(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.controlInfrarecfg(cmd)); |
| | | } |
| | | |
| | | @ApiOperation(value = "手动/自动聚焦", notes = "true手动flase自动") |
| | | @PostMapping("/focusMode") |
| | | @Log(title = "手动/自动聚焦", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"}) |
| | | public @ResponseBody |
| | | AjaxResult enableFocusMode(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.controlFocusMode(cmd)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取聚焦模式", notes = "1手动2自动") |
| | | @PostMapping("/getFocusMode") |
| | | public @ResponseBody |
| | | AjaxResult getFocusMode(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | String focusMode = cameraSdkService.getFocusMode(cmd); |
| | | return AjaxResult.success(focusMode); |
| | | } |
| | | |
| | | @ApiOperation("云台加热") |
| | | @PostMapping("/heateRpwron") |
| | | @Log(title = "云台加热", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"}) |
| | | public @ResponseBody |
| | | AjaxResult heateRpwron(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.controlPTHeateRpwron(cmd)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("镜头加热") |
| | | @PostMapping("/cameraDeicing") |
| | | @Log(title = "镜头加热", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"}) |
| | | public @ResponseBody |
| | | AjaxResult cameraDeicing(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(cameraSdkService.controlCameraDeicing(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("相机抓图") |
| | | @PostMapping("/picCutCate") |
| | | @Log(title = "相机抓图", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"}) |
| | | public @ResponseBody |
| | | AjaxResult picCutCate(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | String path = cameraSdkService.picCutCate(cmd); |
| | | return toAjaxString(path, "相机抓图"); |
| | | } |
| | | |
| | | @ApiOperation("获取相机架设参数") |
| | | @PostMapping("/getGisInfo") |
| | | @Log(title = "获取相机架设参数", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"}) |
| | | public @ResponseBody |
| | | AjaxResult getGisInfo(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return AjaxResult.success(cameraSdkService.getGisInfo(cmd)); |
| | | } |
| | | |
| | | @ApiOperation("手动录像开始") |
| | | @PostMapping("/recordStart") |
| | | @Log(title = "手动录像开始", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"}) |
| | | public @ResponseBody |
| | | AjaxResult recordStart(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | boolean b = cameraSdkService.recordStart(cmd); |
| | | return toAjax(b); |
| | | } |
| | | @ApiOperation("手动录像停止") |
| | | @PostMapping("/recordStop") |
| | | @Log(title = "手动录像停止", businessType = BusinessType.CONTROL) |
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.recordBucketName", "cmd.recordObjectName"}) |
| | | public @ResponseBody |
| | | AjaxResult recordStop(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | String url = cameraSdkService.recordStopToMinio(cmd); |
| | | return AjaxResult.success(url); |
| | | } |
| | | } |
| | | package com.ruoyi.device.camera.controller;
|
| | |
|
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
| | | import com.ruoyi.common.annotation.Anonymous;
|
| | | import com.ruoyi.common.annotation.Log;
|
| | | import com.ruoyi.common.core.controller.BaseController;
|
| | | import com.ruoyi.common.core.domain.AjaxResult;
|
| | | import com.ruoyi.common.enums.BusinessType;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.device.camera.domain.ArdCameras;
|
| | | import com.ruoyi.device.camera.domain.CameraCmd;
|
| | | import com.ruoyi.device.camera.service.IArdCamerasService;
|
| | | import com.ruoyi.device.camera.service.ICameraSdkService;
|
| | |
|
| | | import com.ruoyi.device.noguidezone.domain.ArdCameraNoGuideZone;
|
| | | import com.ruoyi.device.noguidezone.service.IArdCameraNoGuideZoneService;
|
| | | import com.ruoyi.utils.gis.GisUtil;
|
| | | import com.ruoyi.utils.gis.Point;
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | /**
|
| | | * @Description: 相机通用SDK接口
|
| | | * @ClassName: CameraSdkController
|
| | | * @Author: 刘苏义
|
| | | * @Date: 2023年10月14日17:02:56
|
| | | **/
|
| | |
|
| | | @Api(tags = "相机通用SDK接口")
|
| | | @Controller
|
| | | @RequestMapping("/cameraSdk")
|
| | | @Anonymous
|
| | | public class CameraSdkController extends BaseController {
|
| | |
|
| | | @Resource
|
| | | private ICameraSdkService cameraSdkService;
|
| | | @Resource
|
| | | private IArdCamerasService ardCamerasService;
|
| | |
|
| | | @Autowired
|
| | | private IArdCameraNoGuideZoneService ardCameraNoGuideZoneService;
|
| | |
|
| | |
|
| | | @RequestMapping("/preview")
|
| | | private String preview() {
|
| | | return "preview";
|
| | | }
|
| | |
|
| | | @RequestMapping("/index")
|
| | | private String index() {
|
| | | return "test";
|
| | | }
|
| | |
|
| | | @GetMapping("/list")
|
| | | public @ResponseBody
|
| | | AjaxResult list(ArdCameras ardCamera) {
|
| | | List<ArdCameras> list = ardCamerasService.selectArdCamerasListNoDataScope(ardCamera);
|
| | | return AjaxResult.success("相机列表:", list);
|
| | | }
|
| | |
|
| | | @ApiOperation("获取码流压缩参数")
|
| | | @PostMapping("/getVideoCompressionCfg")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
|
| | | @Log(title = "获取码流压缩参数", businessType = BusinessType.CONTROL)
|
| | | public @ResponseBody
|
| | | AjaxResult getVideoCompressionCfg(@RequestBody CameraCmd cmd) {
|
| | | return AjaxResult.success(cameraSdkService.getVideoCompressionCfg(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation("在线状态")
|
| | | @PostMapping("/state")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId"})
|
| | | @Log(title = "在线状态", businessType = BusinessType.CONTROL)
|
| | | public @ResponseBody
|
| | | AjaxResult getOnlineState(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | boolean onLine = cameraSdkService.isOnLine(cmd);
|
| | | return AjaxResult.success(onLine);
|
| | | }
|
| | |
|
| | | @ApiOperation(value = "云台控制", notes = "Code:1-左上 2-上 3-右上 4-左 5-巡航 6-右 7-左下 8-下 9-右下 10-焦距变大 11-焦距变小\n" +
|
| | | "12-焦点前调 13-焦点后调 14-光圈扩大 15-光圈缩小 16-雨刷开启")
|
| | | @PostMapping("/PTZControlWithSpeed")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.speed", "cmd.enable", "cmd.code"})
|
| | | @Log(title = "云台控制", businessType = BusinessType.CONTROL)
|
| | | public @ResponseBody
|
| | | AjaxResult PTZControlWithSpeed(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return cameraSdkService.pTZControl(cmd);
|
| | | }
|
| | |
|
| | | @ApiOperation("调用预置点")
|
| | | @PostMapping("/gotoPreset")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.presetIndex"})
|
| | | @Log(title = "调用预置点", businessType = BusinessType.CONTROL)
|
| | | public @ResponseBody
|
| | | AjaxResult gotoPreset(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return toAjax(cameraSdkService.gotoPreset(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation("设置预置点")
|
| | | @PostMapping("/setPreset")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.presetIndex"})
|
| | | @Log(title = "设置预置点", businessType = BusinessType.CONTROL)
|
| | | public @ResponseBody
|
| | | AjaxResult setPreset(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return toAjax(cameraSdkService.setPreset(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation("获取聚焦值")
|
| | | @PostMapping("/getFocusPos")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
|
| | | @Log(title = "获取聚焦值", businessType = BusinessType.CONTROL)
|
| | | public @ResponseBody
|
| | | AjaxResult getFocusPos(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | int focus = cameraSdkService.getFocusPos(cmd);
|
| | | return AjaxResult.success("获取聚焦值", focus);
|
| | | }
|
| | |
|
| | | @ApiOperation("设置聚焦值")
|
| | | @PostMapping("/setFocusPos")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.dwFocusPos"})
|
| | | @Log(title = "设置聚焦值", businessType = BusinessType.CONTROL)
|
| | | public @ResponseBody
|
| | | AjaxResult setFocusPos(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return toAjax(cameraSdkService.setFocusPos(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation("获取PTZ")
|
| | | @PostMapping("/getPTZ")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
|
| | | @Log(title = "获取PTZ", businessType = BusinessType.CONTROL)
|
| | | public @ResponseBody
|
| | | AjaxResult getPTZ(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | Map<String, Object> ptzMap = cameraSdkService.getPtz(cmd);
|
| | | return AjaxResult.success("获取ptz", ptzMap);
|
| | | }
|
| | |
|
| | | @ApiOperation("获取PTZ范围")
|
| | | @PostMapping("/getPTZScope")
|
| | | @Log(title = "获取PTZ范围", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
|
| | | public @ResponseBody
|
| | | AjaxResult getPTZScope(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | Map<String, Object> ptzMap = cameraSdkService.getPtzScope(cmd);
|
| | | return AjaxResult.success("获取ptz范围", ptzMap);
|
| | | }
|
| | |
|
| | | @ApiOperation("设置PTZ")
|
| | | @PostMapping("/setPTZ")
|
| | | @Log(title = "设置PTZ", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.ptzMap"})
|
| | | public @ResponseBody
|
| | | AjaxResult setPTZ(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return cameraSdkService.setPtz(cmd);
|
| | | }
|
| | |
|
| | | @ApiOperation("指向目标")
|
| | | @PostMapping("/setTargetPosition")
|
| | | @Log(title = "指向目标", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.targetPosition"})
|
| | | public @ResponseBody
|
| | | AjaxResult setTargetPosition(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | //拦截手动引导
|
| | | ArdCameraNoGuideZone ardCameraNoGuideZone = new ArdCameraNoGuideZone();
|
| | | ardCameraNoGuideZone.setCameraId(cmd.getCameraId());
|
| | | ardCameraNoGuideZone.setEnabled("1");
|
| | | //获取当前相机的禁引可视域列表
|
| | | List<ArdCameraNoGuideZone> ardCameraNoGuideZones = ardCameraNoGuideZoneService.selectArdCameraNoGuideZoneList(ardCameraNoGuideZone);
|
| | | if (ardCameraNoGuideZones.size() > 0) {
|
| | | //获取到当前相机的坐标集合
|
| | | for(ArdCameraNoGuideZone zone:ardCameraNoGuideZones) {
|
| | | String[] parts = zone.getPoi().split(",");
|
| | | List<Point> pointList = new ArrayList<>();
|
| | | for (int i = 0; i < parts.length; i += 3) {
|
| | | Point point = new Point();
|
| | | point.setLongitude(Double.valueOf(parts[i]));
|
| | | point.setLatitude(Double.valueOf(parts[i + 1]));
|
| | | pointList.add(point);
|
| | | }
|
| | | double lon = cmd.getTargetPosition()[0];
|
| | | double lat = cmd.getTargetPosition()[1];
|
| | | Point targetPoint = new Point(lon, lat);
|
| | | //判断引导目标是否在坐标集合组成的多边形内
|
| | | boolean inPolygon = GisUtil.isInPolygon(targetPoint, pointList);
|
| | | if(inPolygon)
|
| | | {
|
| | | return AjaxResult.error("引导坐标位于禁引可视域内");
|
| | | }
|
| | | }
|
| | | }
|
| | | return toAjax(cameraSdkService.guideTargetPosition(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation("指向目标井")
|
| | | @PostMapping("/setTargetWell")
|
| | | @Log(title = "指向目标井", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.wellId"})
|
| | | public @ResponseBody
|
| | | AjaxResult setTargetWell(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return cameraSdkService.guideTargetWell(cmd);
|
| | | }
|
| | |
|
| | | @ApiOperation("设置零方位角")
|
| | | @PostMapping("/setZeroPTZ")
|
| | | @Log(title = "设置零方位角", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
|
| | | public @ResponseBody
|
| | | AjaxResult setZeroPTZ(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return toAjax(cameraSdkService.setZeroPtz(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation("设置锁定")
|
| | | @PostMapping("/setPTZLock")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.expired"})
|
| | | @Log(title = "设置锁定", businessType = BusinessType.CONTROL)
|
| | | public @ResponseBody
|
| | | AjaxResult setPTZLock(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return AjaxResult.success(cameraSdkService.controlLock(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation("设置解锁")
|
| | | @PostMapping("/setPTZUnLock")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId"})
|
| | | @Log(title = "设置解锁", businessType = BusinessType.CONTROL)
|
| | | public @ResponseBody
|
| | | AjaxResult setPTZUnLock(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return AjaxResult.success(cameraSdkService.controlUnLock(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation("获取云台锁定信息")
|
| | | @PostMapping("/getPTZLockInfo")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
|
| | | @Log(title = "获取云台锁定信息", businessType = BusinessType.CONTROL)
|
| | | public @ResponseBody
|
| | | AjaxResult getPTZLockInfo(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | int byWorkMode = cameraSdkService.getPTZLockInfo(cmd);
|
| | | if (byWorkMode == 0) {
|
| | | return AjaxResult.success("云台锁定状态:解锁");
|
| | | } else if (byWorkMode == 1) {
|
| | | return AjaxResult.success("云台锁定状态:锁定");
|
| | | } else {
|
| | | return AjaxResult.error("云台锁定状态:失败");
|
| | | }
|
| | | }
|
| | |
|
| | | @ApiOperation("透雾开关")
|
| | | @PostMapping("/defogcfg")
|
| | | @Log(title = "透雾开关", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"})
|
| | | public @ResponseBody
|
| | | AjaxResult defogcfg(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return toAjax(cameraSdkService.controlDefogcfg(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation("红外开关")
|
| | | @PostMapping("/infrarecfg")
|
| | | @Log(title = "红外开关", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"})
|
| | | public @ResponseBody
|
| | | AjaxResult infrarecfg(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return toAjax(cameraSdkService.controlInfrarecfg(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation(value = "手动/自动聚焦", notes = "true手动flase自动")
|
| | | @PostMapping("/focusMode")
|
| | | @Log(title = "手动/自动聚焦", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"})
|
| | | public @ResponseBody
|
| | | AjaxResult enableFocusMode(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return toAjax(cameraSdkService.controlFocusMode(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation(value = "获取聚焦模式", notes = "1手动2自动")
|
| | | @PostMapping("/getFocusMode")
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
|
| | | public @ResponseBody
|
| | | AjaxResult getFocusMode(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | String focusMode = cameraSdkService.getFocusMode(cmd);
|
| | | return AjaxResult.success(focusMode);
|
| | | }
|
| | |
|
| | | @ApiOperation("云台加热")
|
| | | @PostMapping("/heateRpwron")
|
| | | @Log(title = "云台加热", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"})
|
| | | public @ResponseBody
|
| | | AjaxResult heateRpwron(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return toAjax(cameraSdkService.controlPTHeateRpwron(cmd));
|
| | | }
|
| | |
|
| | |
|
| | | @ApiOperation("镜头加热")
|
| | | @PostMapping("/cameraDeicing")
|
| | | @Log(title = "镜头加热", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"})
|
| | | public @ResponseBody
|
| | | AjaxResult cameraDeicing(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return toAjax(cameraSdkService.controlCameraDeicing(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation("相机抓图")
|
| | | @PostMapping("/picCutCate")
|
| | | @Log(title = "相机抓图", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
|
| | | public @ResponseBody
|
| | | AjaxResult picCutCate(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | String path = cameraSdkService.picCutCate(cmd);
|
| | | return toAjaxString(path, "相机抓图");
|
| | | }
|
| | |
|
| | | @ApiOperation("获取相机架设参数")
|
| | | @PostMapping("/getGisInfo")
|
| | | @Log(title = "获取相机架设参数", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
|
| | | public @ResponseBody
|
| | | AjaxResult getGisInfo(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return AjaxResult.success(cameraSdkService.getGisInfo(cmd));
|
| | | }
|
| | |
|
| | | @ApiOperation("录像")
|
| | | @PostMapping("/record")
|
| | | @Log(title = "手动录像开始", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"})
|
| | | public @ResponseBody
|
| | | AjaxResult record(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | String url = cameraSdkService.record(cmd);
|
| | | return AjaxResult.success(url);
|
| | | }
|
| | |
|
| | | @ApiOperation("手动录像开始")
|
| | | @PostMapping("/recordStart")
|
| | | @Log(title = "手动录像开始", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
|
| | | public @ResponseBody
|
| | | AjaxResult recordStart(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | boolean b = cameraSdkService.recordStart(cmd);
|
| | | return toAjax(b);
|
| | | }
|
| | |
|
| | | @ApiOperation("手动录像停止")
|
| | | @PostMapping("/recordStop")
|
| | | @Log(title = "手动录像停止", businessType = BusinessType.CONTROL)
|
| | | @ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.recordBucketName", "cmd.recordObjectName"})
|
| | | public @ResponseBody
|
| | | AjaxResult recordStop(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | String url = cameraSdkService.recordStopToMinio(cmd);
|
| | | return AjaxResult.success(url);
|
| | | }
|
| | | }
|