|
@@ -3,11 +3,13 @@ package com.huimv.video.dhicc.test.controller;
|
|
//拿视频回放
|
|
//拿视频回放
|
|
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
import com.dahuatech.icc.exception.ClientException;
|
|
import com.dahuatech.icc.exception.ClientException;
|
|
import com.huimv.video.dhicc.result.R;
|
|
import com.huimv.video.dhicc.result.R;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo03;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo03;
|
|
|
|
+import com.huimv.video.dhicc.test.request.Video.VideoRecordQueryRequestSg;
|
|
import com.huimv.video.dhicc.test.request.Video.VideoRecordRequestCn;
|
|
import com.huimv.video.dhicc.test.request.Video.VideoRecordRequestCn;
|
|
import com.huimv.video.dhicc.test.request.Video.VideoRecordRequestHn;
|
|
import com.huimv.video.dhicc.test.request.Video.VideoRecordRequestHn;
|
|
import com.huimv.video.dhicc.test.request.Video.VideoRecordRequestSg;
|
|
import com.huimv.video.dhicc.test.request.Video.VideoRecordRequestSg;
|
|
@@ -43,13 +45,7 @@ public class VideoRecorControllerSg {
|
|
String channelId = (String) params1.get("nodeCode");
|
|
String channelId = (String) params1.get("nodeCode");
|
|
Integer farmId = (Integer) params1.get("farmId");
|
|
Integer farmId = (Integer) params1.get("farmId");
|
|
|
|
|
|
- Map<String, Object> value = new HashMap<>();
|
|
|
|
- value.put("nvrId", "");
|
|
|
|
- value.put("optional", "/evo-apigw/admin/API/SS/Playback/StartPlaybackByTime");
|
|
|
|
- value.put("recordType", "1");
|
|
|
|
- value.put("streamType", "1");
|
|
|
|
- value.put("recordSource", "2");
|
|
|
|
- value.put("channelId", channelId);
|
|
|
|
|
|
+
|
|
|
|
|
|
//开始结束时间代为处理
|
|
//开始结束时间代为处理
|
|
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
@@ -59,17 +55,35 @@ public class VideoRecorControllerSg {
|
|
Date GapAfter = new Date(Time.getTime() + 1000 * 60 * 5);// end 事件五分钟之后
|
|
Date GapAfter = new Date(Time.getTime() + 1000 * 60 * 5);// end 事件五分钟之后
|
|
String befor = String.valueOf(GapTimeBefor_gap.getTime() / 1000);
|
|
String befor = String.valueOf(GapTimeBefor_gap.getTime() / 1000);
|
|
String after = String.valueOf(GapAfter.getTime() / 1000);
|
|
String after = String.valueOf(GapAfter.getTime() / 1000);
|
|
- value.put("endTime", after);
|
|
|
|
- value.put("startTime", befor);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ Map<String, Object> test = new HashMap<>();
|
|
|
|
+ test.put("channelId", channelId);
|
|
|
|
+ test.put("recordSource", "2");
|
|
|
|
+ test.put("startTime", befor);
|
|
|
|
+ test.put("endTime", after);
|
|
|
|
+ test.put("streamType", "0");
|
|
|
|
+ test.put("recordType", "0");
|
|
|
|
+ VideoRecordQueryRequestSg queryRequestSg = new VideoRecordQueryRequestSg(oauthConfigBaseInfo);
|
|
|
|
+ queryRequestSg.setData(test);
|
|
|
|
+ System.out.println(queryRequestSg);
|
|
|
|
+ com.alibaba.fastjson.JSONObject jsonObject2 = queryRequestSg.doAction();
|
|
|
|
+ System.out.println(jsonObject2);
|
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray(jsonObject2.get("records").toString());
|
|
|
|
+ System.out.println(jsonArray);
|
|
|
|
+ com.alibaba.fastjson.JSONObject json = (com.alibaba.fastjson.JSONObject) jsonArray.get(0);
|
|
|
|
+ System.out.println(json);
|
|
|
|
+
|
|
|
|
+ Map<String, Object> value = new HashMap<>();
|
|
|
|
+ value.put("recordType", json.get("recordType"));
|
|
|
|
+ value.put("streamType", json.get("streamType"));
|
|
|
|
+ value.put("recordSource",json.get("recordSource"));
|
|
|
|
+ value.put("channelId", channelId);
|
|
|
|
+ value.put("endTime", json.get("startTime"));
|
|
|
|
+ value.put("startTime", json.get("endTime"));
|
|
if (farmId == 1) {
|
|
if (farmId == 1) {
|
|
System.out.println("曙光");
|
|
System.out.println("曙光");
|
|
VideoRecordRequestSg requestSg = new VideoRecordRequestSg(oauthConfigBaseInfo);
|
|
VideoRecordRequestSg requestSg = new VideoRecordRequestSg(oauthConfigBaseInfo);
|
|
- requestSg.setClientMac("30:9c:23:79:40:08");
|
|
|
|
- requestSg.setClientPushId("");
|
|
|
|
- requestSg.setProject("PSDK");
|
|
|
|
- requestSg.setMethod("SS.Playback.StartPlaybackByTime");
|
|
|
|
requestSg.setData(value);
|
|
requestSg.setData(value);
|
|
Object jsonObject1 = requestSg.doAction();
|
|
Object jsonObject1 = requestSg.doAction();
|
|
System.out.println(jsonObject1);
|
|
System.out.println(jsonObject1);
|