| | |
| | | package com.ruoyi.utils.sdk.hiksdk.controller;
|
| | |
|
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
| | | import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService;
|
| | | import com.ruoyi.common.annotation.Log;
|
| | | import com.ruoyi.common.core.controller.BaseController;
|
| | | import com.ruoyi.common.enums.BusinessType;
|
| | |
| | | private HikvisionSDK sdk;
|
| | | @Resource
|
| | | private IArdCamerasService ardCamerasService;
|
| | | @Resource
|
| | | private IArdAlarmpointsWellService ardAlarmpointsWellService;
|
| | |
|
| | |
|
| | | @RequestMapping("/preview")
|
| | |
| | | return sdk.controlCameraDeicing(cmd);
|
| | | }
|
| | |
|
| | | @PostMapping("/captureJPEGPicture")
|
| | | @PostMapping("/localCapture")
|
| | | public @ResponseBody
|
| | | AjaxResult captureJPEGPicture(@RequestBody CameraCmd cmd) {
|
| | | void localCapture(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return sdk.captureJPEGPicture(cmd);
|
| | | sdk.localCapture(cmd);
|
| | | }
|
| | |
|
| | | @ApiOperation("相机抓图")
|
| | |
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | return AjaxResult.success(sdk.getGisInfo(cmd));
|
| | | }
|
| | |
|
| | | @PostMapping("/getCameraVideoLable")
|
| | | public @ResponseBody
|
| | | AjaxResult getCameraVideoLable(@RequestBody CameraCmd cmd) {
|
| | | cmd.setOperator(SecurityUtils.getUserId());
|
| | | Map<String, Object> map = sdk.getGisInfo(cmd);
|
| | | Map<String, Object> data = (Map<String, Object>) map.get("data");
|
| | | Float p = (Float) data.get("p");
|
| | | Float t = (Float) data.get("t");
|
| | | Float z = (Float) data.get("z");
|
| | | Float fHorFieldAngle = (Float) data.get("fHorFieldAngle");// 水平视场角
|
| | | Float fVerFieldAngle = (Float) data.get("fVerFieldAngle");// 垂直视场角
|
| | | /*if(z <= 1.0){
|
| | | return AjaxResult.error("变焦小于1");
|
| | | }*/
|
| | | if(t > 359.0){
|
| | | return AjaxResult.error("俯仰角过小");
|
| | | }
|
| | | List<Map<String,Object>> result = ardAlarmpointsWellService.getCameraVideoLable(SecurityUtils.getDeptId(),cmd.getCameraId(),p,t,fHorFieldAngle,fVerFieldAngle);
|
| | | if(result == null){
|
| | | return AjaxResult.error("该光电没有挂接塔");
|
| | | }
|
| | | return AjaxResult.success(result);
|
| | | }
|
| | | }
|