Pārlūkot izejas kodu

批量获取监控点的预置点信息

wyb 3 mēneši atpakaļ
vecāks
revīzija
c6a1e72738

+ 14 - 0
src/main/java/com/chinaitop/depot/hk/constant/ApiHkConstant.java

@@ -70,6 +70,20 @@ public interface ApiHkConstant {
70 70
      * @date: 2024/7/1
71 71
      **/
72 72
     String API_HK_PTZS_CONTROLLING = "/artemis/api/video/v1/ptzs/controlling";
73
+    /**
74
+     * 查询预置点信息
75
+     *
76
+     * @author: ybw
77
+     * @date: 2024/8/2
78
+     **/
79
+    String API_HK_PRESETS_SEARCH = "/artemis//api/video/v1/presets/searches";
80
+    /**
81
+     * 批量获取监控点的预置点信息
82
+     *
83
+     * @author: ybw
84
+     * @date: 2024/7/1
85
+     **/
86
+    String API_HK_PRESETS_GET = "/artemis/api/video/v1/presets/get";
73 87
 
74 88
 
75 89
     /**

+ 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
      * 监控点编号

+ 28 - 0
src/main/java/com/chinaitop/depot/hk/dto/req/PresetsReqDTO.java

@@ -0,0 +1,28 @@
1
+package com.chinaitop.depot.hk.dto.req;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+/**
8
+ * 批量获取监控点的预置点信息
9
+ *
10
+ * @author ybw
11
+ * @version V1.0
12
+ * @className PresetsReqDTO
13
+ * @date 2024/8/2
14
+ **/
15
+@Data
16
+@NoArgsConstructor
17
+@AllArgsConstructor
18
+public class PresetsReqDTO {
19
+
20
+    /**
21
+     * 监控点唯一标识集,
22
+     * 可通过分页获取监控点资源获取
23
+     *
24
+     * @author: ybw
25
+     * @date: 2024/8/2
26
+     **/
27
+    private String[] cameraIndexCodes;
28
+}

+ 27 - 0
src/main/java/com/chinaitop/depot/hk/dto/req/PresetsSearchReqDTO.java

@@ -0,0 +1,27 @@
1
+package com.chinaitop.depot.hk.dto.req;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+/**
8
+ * 查询预置点信息
9
+ *
10
+ * @author ybw
11
+ * @version V1.0
12
+ * @className SearchPresetsReqDTO
13
+ * @date 2024/8/2
14
+ **/
15
+@Data
16
+@AllArgsConstructor
17
+@NoArgsConstructor
18
+public class PresetsSearchReqDTO {
19
+    /**
20
+     * 监控点唯一标识集,
21
+     * 可通过分页获取监控点资源获取
22
+     *
23
+     * @author: ybw
24
+     * @date: 2024/8/2
25
+     **/
26
+    private String cameraIndexCode;
27
+}

+ 2 - 4
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
-
3
+import lombok.AllArgsConstructor;
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,7 +29,5 @@ public class RecordStartReqDTO {
29 29
      * 存储类型,0-中心存储,1-设备存储,默认为0-中心存储,如果不指定则默认采用中心存储方式
30 30
      */
31 31
     private Integer type;
32
-
33
-    
34 32
 }
35 33
 

+ 76 - 0
src/main/java/com/chinaitop/depot/hk/dto/res/PresetsResDTO.java

@@ -0,0 +1,76 @@
1
+package com.chinaitop.depot.hk.dto.res;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+import java.util.List;
8
+
9
+/**
10
+ * 批量获取监控点的预置点信息
11
+ *
12
+ * @author ybw
13
+ * @version V1.0
14
+ * @className PresetsReqDTO
15
+ * @date 2024/8/2
16
+ **/
17
+@Data
18
+@NoArgsConstructor
19
+@AllArgsConstructor
20
+public class PresetsResDTO {
21
+
22
+    /**
23
+     * 结果总数
24
+     *
25
+     * @author: ybw
26
+     * @date: 2024/8/2
27
+     **/
28
+    private int total;
29
+    /**
30
+     * 监控点预置点信息列表
31
+     *
32
+     * @author: ybw
33
+     * @date: 2024/8/2
34
+     **/
35
+    private List<ListBean> list;
36
+
37
+
38
+    @Data
39
+    public static class ListBean {
40
+
41
+        /**
42
+         * 监控点编号
43
+         *
44
+         * @author: ybw
45
+         * @date: 2024/8/2
46
+         **/
47
+        private String cameraIndexCode;
48
+        /**
49
+         * 预置点信息
50
+         *
51
+         * @author: ybw
52
+         * @date: 2024/8/2
53
+         **/
54
+        private List<PresetPointsBean> presetPoints;
55
+
56
+        @Data
57
+        public static class PresetPointsBean {
58
+
59
+            /**
60
+             * 预置点名称
61
+             *
62
+             * @author: ybw
63
+             * @date: 2024/8/2
64
+             **/
65
+            private String presetPointName;
66
+            /**
67
+             * 预置点编号
68
+             *
69
+             * @author: ybw
70
+             * @date: 2024/8/2
71
+             **/
72
+            private int presetPointIndex;
73
+
74
+        }
75
+    }
76
+}

+ 61 - 0
src/main/java/com/chinaitop/depot/hk/dto/res/PresetsSearchResDTO.java

@@ -0,0 +1,61 @@
1
+package com.chinaitop.depot.hk.dto.res;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+import java.util.List;
8
+
9
+/**
10
+ * 查询预置点信息
11
+ *
12
+ * @author ybw
13
+ * @version V1.0
14
+ * @className SearchPresetsReqDTO
15
+ * @date 2024/8/2
16
+ **/
17
+@Data
18
+@NoArgsConstructor
19
+@AllArgsConstructor
20
+public class PresetsSearchResDTO {
21
+
22
+    /**
23
+     * 结果总数
24
+     *
25
+     * @author: ybw
26
+     * @date: 2024/8/2
27
+     **/
28
+    private int total;
29
+    /**
30
+     * 预置点信息
31
+     *
32
+     * @author: ybw
33
+     * @date: 2024/8/2
34
+     **/
35
+    private List<ListBean> list;
36
+
37
+    @Data
38
+    public static class ListBean {
39
+        /**
40
+         * 预置点名称
41
+         *
42
+         * @author: ybw
43
+         * @date: 2024/8/2
44
+         **/
45
+        private String presetPointName;
46
+        /**
47
+         * 预置点编号
48
+         *
49
+         * @author: ybw
50
+         * @date: 2024/8/2
51
+         **/
52
+        private int presetPointIndex;
53
+        /**
54
+         * 监控点编号
55
+         *
56
+         * @author: ybw
57
+         * @date: 2024/8/2
58
+         **/
59
+        private String cameraIndexCode;
60
+    }
61
+}

+ 25 - 0
src/main/java/com/chinaitop/depot/hk/service/HkService.java

@@ -119,4 +119,29 @@ public interface HkService {
119 119
      * @date: 2024/6/20
120 120
      **/
121 121
     void controlling(ControllerReqDTO controllerReqDTO);
122
+
123
+
124
+    //----------------------------------------视频应用服务-预置点管理-----------------------------------------------
125
+
126
+    /**
127
+     * 查询预置点信息
128
+     *
129
+     * @param presetsSearchReqDTO
130
+     * @methodName: searchPresets
131
+     * @return: com.ybw.dto.res.PresetsSearchResDTO
132
+     * @author: ybw
133
+     * @date: 2024/8/2
134
+     **/
135
+    PresetsSearchResDTO searchPresets(PresetsSearchReqDTO presetsSearchReqDTO);
136
+
137
+    /**
138
+     * 批量获取监控点的预置点信息
139
+     *
140
+     * @param presetsReqDTO
141
+     * @methodName: getPresets
142
+     * @return: com.ybw.dto.res.PresetsResDTO
143
+     * @author: ybw
144
+     * @date: 2024/8/2
145
+     **/
146
+    PresetsResDTO getPresets(PresetsReqDTO presetsReqDTO);
122 147
 }

+ 43 - 0
src/main/java/com/chinaitop/depot/hk/service/impl/HkServiceImpl.java

@@ -219,4 +219,47 @@ public class HkServiceImpl implements HkService {
219 219
             log.error("controlling error:", e);
220 220
         }
221 221
     }
222
+
223
+    @Override
224
+    public PresetsSearchResDTO searchPresets(PresetsSearchReqDTO presetsSearchReqDTO) {
225
+        try {
226
+            // 接口地址
227
+            Map<String, String> path = getPath(ApiHkConstant.API_HK_PRESETS_SEARCH);
228
+            String result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig, path, JSON.toJSONString(presetsSearchReqDTO), null, null,  ContentType.CONTENT_TYPE_JSON);
229
+            log.info("result:{}",result);
230
+            ResultResDTO<PresetsSearchResDTO> resultResDTO = JSONObject.parseObject(
231
+                    result,
232
+                    new TypeReference<ResultResDTO<PresetsSearchResDTO>>() {
233
+                    }
234
+            );
235
+            log.info("{}", JSON.toJSONString(resultResDTO));
236
+            if (ApiHkConstant.Code.SUCCESS.equals(resultResDTO.getCode())) {
237
+                return resultResDTO.getData();
238
+            }
239
+        } catch (Exception e) {
240
+            log.error("searchPresets error:", e);
241
+        }
242
+        return null;
243
+    }
244
+
245
+    @Override
246
+    public PresetsResDTO getPresets(PresetsReqDTO presetsReqDTO) {
247
+        try {
248
+            // 接口地址
249
+            Map<String, String> path = getPath(ApiHkConstant.API_HK_PRESETS_GET);
250
+            String result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig, path, JSON.toJSONString(presetsReqDTO), null, null,  ContentType.CONTENT_TYPE_JSON);
251
+            ResultResDTO<PresetsResDTO> resultResDTO = JSONObject.parseObject(
252
+                    result,
253
+                    new TypeReference<ResultResDTO<PresetsResDTO>>() {
254
+                    }
255
+            );
256
+            log.info("{}", JSON.toJSONString(resultResDTO));
257
+            if (ApiHkConstant.Code.SUCCESS.equals(resultResDTO.getCode())) {
258
+                return resultResDTO.getData();
259
+            }
260
+        } catch (Exception e) {
261
+            log.error("getPresets error:", e);
262
+        }
263
+        return null;
264
+    }
222 265
 }