Browse Source

Merge branch 'dev' of depot-qinghai/depot-monitor-qinghai into master

gdd 5 months ago
parent
commit
1a8f9d36fe

+ 1 - 1
src/main/java/com/chinaitop/depot/hk/dto/req/CaptureReqDTO.java

@@ -12,7 +12,7 @@ import lombok.Data;
12 12
  * @date 2024/6/22
13 13
  **/
14 14
 @Data
15
-@AllArgsConstructor
15
+//@AllArgsConstructor
16 16
 public class CaptureReqDTO {
17 17
     /**
18 18
      * 监控点编号

+ 4 - 2
src/main/java/com/chinaitop/depot/hk/dto/req/RecordStartReqDTO.java

@@ -1,6 +1,6 @@
1 1
 package com.chinaitop.depot.hk.dto.req;
2 2
 
3
-import lombok.AllArgsConstructor;
3
+
4 4
 import lombok.Data;
5 5
 
6 6
 /**
@@ -12,7 +12,7 @@ import lombok.Data;
12 12
  * @date 2024/6/20
13 13
  **/
14 14
 @Data
15
-@AllArgsConstructor
15
+//@AllArgsConstructor
16 16
 public class RecordStartReqDTO {
17 17
 
18 18
     /**
@@ -29,5 +29,7 @@ public class RecordStartReqDTO {
29 29
      * 存储类型,0-中心存储,1-设备存储,默认为0-中心存储,如果不指定则默认采用中心存储方式
30 30
      */
31 31
     private Integer type;
32
+
33
+    
32 34
 }
33 35
 

+ 41 - 25
src/main/java/com/chinaitop/depot/monitor/controller/PreviewPlaybackController.java

@@ -15,25 +15,31 @@ import com.chinaitop.depot.monitor.model.CameraCapture;
15 15
 import com.chinaitop.depot.monitor.model.CameraRecord;
16 16
 import com.chinaitop.depot.monitor.service.CameraCaptureService;
17 17
 import com.chinaitop.depot.monitor.service.CameraRecordService;
18
+import com.fasterxml.jackson.core.JsonParseException;
19
+import com.fasterxml.jackson.databind.JsonMappingException;
20
+import com.fasterxml.jackson.databind.ObjectMapper;
18 21
 
19 22
 import io.swagger.annotations.Api;
20
-import io.swagger.annotations.ApiImplicitParam;
21
-import io.swagger.annotations.ApiImplicitParams;
22 23
 import io.swagger.annotations.ApiOperation;
23 24
 
24 25
 import org.springframework.beans.factory.annotation.Value;
25 26
 import org.springframework.http.MediaType;
26 27
 import org.springframework.util.LinkedMultiValueMap;
27 28
 import org.springframework.util.MultiValueMap;
29
+import org.springframework.web.bind.annotation.RequestBody;
28 30
 import org.springframework.web.bind.annotation.RequestMapping;
29 31
 import org.springframework.web.bind.annotation.RequestMethod;
30 32
 import org.springframework.web.bind.annotation.RestController;
31 33
 import org.springframework.web.client.RestTemplate;
32 34
 
35
+import java.io.IOException;
36
+
33 37
 import javax.annotation.Resource;
34 38
 
35 39
 /**
36 40
  * 视频预览回放
41
+ * 
42
+ * 预览---开始手动录像---停止手动录像----回放--手动抓图--云台控制
37 43
  */
38 44
 @RestController
39 45
 @RequestMapping(value = "/previewPlayback")
@@ -62,9 +68,6 @@ public class PreviewPlaybackController {
62 68
      */
63 69
     @RequestMapping(value="/getPreview", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
64 70
     @ApiOperation(value="预览", notes = "预览")
65
-    @ApiImplicitParams({
66
-            @ApiImplicitParam(name = "{cameraIndexCode}", value = "监控点编号", paramType = "query")
67
-    })
68 71
     public PreviewResDTO getAlarmPhone(PreviewReqDTO previewReqDTO) {
69 72
         return hkService.previewURLs(previewReqDTO);
70 73
     }
@@ -75,23 +78,9 @@ public class PreviewPlaybackController {
75 78
      * @param playbackReqDTO
76 79
      * @return
77 80
      */
78
-    @RequestMapping(value="/getPlayback", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
81
+    @RequestMapping(value="/getPlayback", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
79 82
     @ApiOperation(value="回放", notes = "回放")
80
-    /*@ApiImplicitParams({
81
-            @ApiImplicitParam(name = "cameraIndexCode", value = "监控点唯一标识,分页获取监控点资源接口获取返回参数", paramType = "query"),
82
-            @ApiImplicitParam(name = "recordLocation", value = "存储类型, 0:中心存储, 1:设备存储 (默认为中心存储)", paramType = "query"),
83
-            @ApiImplicitParam(name = "protocol", value = "取流协议", paramType = "query"),
84
-            @ApiImplicitParam(name = "transmode", value = "传输协议,默认为TCP", paramType = "query"),
85
-            @ApiImplicitParam(name = "beginTime", value = "开始时间,ISO8601格式", paramType = "query"),
86
-            @ApiImplicitParam(name = "endTime", value = "结束时间,与开始时间相差不超过三天,ISO8601格式", paramType = "query"),
87
-            @ApiImplicitParam(name = "uuid", value = "分页查询id,用于继续查询剩余片段,默认为空字符串 (设备存储生效)", paramType = "query"),
88
-            @ApiImplicitParam(name = "uuid", value = "分页查询id,用于继续查询剩余片段,默认为空字符串 (设备存储生效)", paramType = "query"),
89
-            @ApiImplicitParam(name = "expand", value = "扩展内容,支持指定解码格式等,格式:key=value,多个以&隔开", paramType = "query"),
90
-            @ApiImplicitParam(name = "streamform", value = "输出码流转封装格式,默认为RTP ,ps", paramType = "query"),
91
-            @ApiImplicitParam(name = "lockType", value = "查询录像的锁定类型,默认查询全部录像 0  1未锁定 2锁定", paramType = "query")
92
-
93
-    })*/
94
-    public PlaybackResDTO getPlayback(PlaybackReqDTO playbackReqDTO) {
83
+    public PlaybackResDTO getPlayback(@RequestBody PlaybackReqDTO playbackReqDTO) {
95 84
         return hkService.playbackURLs(playbackReqDTO);
96 85
     }
97 86
 
@@ -100,10 +89,23 @@ public class PreviewPlaybackController {
100 89
      * 开始手动录像
101 90
      * @param recordStartReqDTO
102 91
      * @return
92
+     * @throws IOException 
93
+     * @throws JsonMappingException 
94
+     * @throws JsonParseException 
103 95
      */
104
-    @RequestMapping(value="/recordStart", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
96
+    @RequestMapping(value="/recordStart", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
105 97
     @ApiOperation(value="开始手动录像", notes = "开始手动录像")
106
-    public RecordStartResDTO recordStart(RecordStartReqDTO recordStartReqDTO,CameraRecord cameraRecord) {
98
+    public RecordStartResDTO recordStart(String recordStartReqDTOJson, String cameraRecordJson) throws Exception {
99
+    	
100
+        
101
+        // JSON字符串转对象
102
+        ObjectMapper mapper1 = new ObjectMapper();
103
+        CameraRecord cameraRecord = (CameraRecord)mapper1.readValue(cameraRecordJson, CameraRecord.class);
104
+        
105
+        // JSON字符串转对象
106
+        ObjectMapper mapper = new ObjectMapper();
107
+        RecordStartReqDTO recordStartReqDTO = (RecordStartReqDTO)mapper.readValue(recordStartReqDTOJson, RecordStartReqDTO.class);
108
+        
107 109
     	
108 110
     	RecordStartResDTO recordStartResDTO = hkService.recordStart(recordStartReqDTO);
109 111
     	
@@ -127,12 +129,26 @@ public class PreviewPlaybackController {
127 129
     /**
128 130
      * 手动抓图
129 131
      * @param captureReqDTO
132
+     * @throws IOException 
133
+     * @throws JsonMappingException 
134
+     * @throws JsonParseException 
130 135
      */
131
-    @RequestMapping(value="/manualCapture", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
136
+    @RequestMapping(value="/manualCapture", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
132 137
     @ApiOperation(value="手动抓图", notes = "手动抓图")
133
-    public String manualCapture(CaptureReqDTO captureReqDTO,CameraCapture cameraCapture) {
138
+    public String manualCapture(String captureReqDTOJson, String cameraCaptureJson) throws Exception {
139
+    	
140
+    	
141
+    	// JSON字符串转对象
142
+        ObjectMapper mapper1 = new ObjectMapper();
143
+        CaptureReqDTO captureReqDTO = (CaptureReqDTO)mapper1.readValue(captureReqDTOJson, CaptureReqDTO.class);
144
+        
145
+        // JSON字符串转对象
146
+        ObjectMapper mapper = new ObjectMapper();
147
+        CameraCapture cameraCapture = (CameraCapture)mapper.readValue(cameraCaptureJson, CameraCapture.class);
148
+        
134 149
     	CaptureResDTO captureResDTO = hkService.manualCapture(captureReqDTO);
135 150
          
151
+    	
136 152
          //加到表里
137 153
     	CameraCapture cameraCapture1 = cameraCaptureService.save(cameraCapture,captureResDTO.getPicUrl());
138 154
          if(cameraCapture1.getId()>0){

+ 3 - 2
src/main/java/com/chinaitop/depot/monitor/service/impl/CameraCaptureServiceImpl.java

@@ -25,8 +25,9 @@ public class CameraCaptureServiceImpl implements CameraCaptureService{
25 25
 		//cameraCapture.setCameraId(cameraCapture.getCameraId());
26 26
 		//cameraCapture.setOrgId(cameraCapture.getOrgId()+"");
27 27
 		// 图片地址转 文件流  picUrl
28
-		String wjl = NetFileUtil.getBase64Content(picUrl);
29
-		cameraCapture.setCntxwjl(wjl);
28
+		//String wjl = NetFileUtil.getBase64Content(picUrl);
29
+		//System.out.println(wjl.length()+"*******************");
30
+		cameraCapture.setCntxwjl(picUrl);//文件地址
30 31
 		//cameraCapture.setStorehouseId(cameraCapture.getStorehouseId());
31 32
 		//cameraCapture.setTxwjhzm(txwjhzm);//图像文件后缀名
32 33
 		//cameraCapture.setWarehouseId(cameraCapture.getWarehouseId());//