Explorar o código

报警回放代码修改

gao.qiang hai 9 meses
pai
achega
c1a1418a9c

+ 12 - 4
business-service/src/main/java/com/ozs/utils/CameraUtil.java

@@ -1346,7 +1346,7 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
             OffsetDateTime beforeTenMinutes = currentTime.minusMinutes(Long.parseLong(frontValue));
             log.info("beforeTenMinutes------------->" + beforeTenMinutes);
             // 获取报警后的时间
-            OffsetDateTime afterTenMinutes = currentTime.plusMinutes(Long.parseLong("0"));
+            OffsetDateTime afterTenMinutes = currentTime.plusMinutes(Long.parseLong(laterValue));
             log.info("afterTenMinutes------------->" + afterTenMinutes);
             // 格式化时间
             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
@@ -1646,12 +1646,20 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
      *
      * @param baseCameraManagement
      */
-    public String getQueryRecords(String streamPath, String date) {
+    public String getQueryRecords(String streamPath, String date,String type) {
+        
         log.info("-----getQueryRecords------streamPath-----" + streamPath);
         log.info("-----getQueryRecords-------date----" + date);
+        log.info("-----getQueryRecords-------type----" + type);
+        try {
+            TimeUnit.SECONDS.sleep(120);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
         String param = "{\n" +
                 "    \"streamPath\":\"" + streamPath + "\",\n" +
-                "    \"date\":\"" + date + "\"\n" +
+                "    \"date\":\"" + date + "\",\n" +
+                "    \"type\":\"" + type + "\"\n" +
                 "}";
 
         String jsonStr = HttpUtils.sendPost(httpUrl + "/recordpro/api/query/records", param);
@@ -1660,7 +1668,7 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
         log.info("-----getQueryRecords-------jsonObj----" + jsonObj);
         JSONArray resultArray = jsonObj.getJSONArray("result");
         log.info("-----getQueryRecords-------resultArray----" + resultArray);
-        JSONObject resultObj = resultArray.getJSONObject(0);
+        JSONObject resultObj = resultArray.getJSONObject(resultArray.size()-1);
         log.info("-----getQueryRecords-------resultObj----" + resultObj);
         String path = resultObj.getString("Path");
         log.info("-----getQueryRecords-------path----" + path);

+ 1 - 1
business-service/src/main/java/com/ozs/utils/CaneraConfig.java

@@ -47,7 +47,7 @@ public class CaneraConfig {
     @Value("${base.wsUrls:http://124.70.58.209:18891}")
     private String wsUrls;
 
-    @Value("${base.recordUrl:http://123.139.243.142:18084}")
+    @Value("${base.recordUrl:http://123.139.243.142:18082}")
     private String recordUrl;
 
     @Value("${base.hkUrl:http://10.48.253.21:1443}")

+ 1 - 1
vehicle-admin/src/main/resources/application.yml

@@ -28,7 +28,7 @@ base:
   historyUrl: http://10.48.31.84:9080
   httpUrl: http://10.48.31.84:9080
   httpUrls: http://10.48.31.85:9080
-  recordUrl: http://123.139.243.142:18084
+  recordUrl: http://123.139.243.142:18082
   env: 1
   hkUrl: http://10:122:1:22:1443
   rtmpUrl: rtmp://10.48.31.84:1935

+ 1 - 1
vehicle-sdk/src/main/java/com/ozs/controller/upload/GeoHazardMonitorTokenController.java

@@ -397,7 +397,7 @@ public class GeoHazardMonitorTokenController {
                         // 使用SimpleDateFormat将Date对象格式化为指定样式的字符串
                         String formattedDate = sdf.format(msgAlarmVice.getAlarmTime());
                         log.info("-----formattedDate-----------" + formattedDate);
-                        String records = cameraUtil.getQueryRecords(finalCode + "/playback", formattedDate);
+                        String records = cameraUtil.getQueryRecords(finalCode + "/playback", formattedDate,"mp4");
                         log.info("-----records-----------" + records);
                         MsgAlarm alarm1 = msgAlarmService.getById(msgAlarm.getId());
                         alarm1.setReleasedUrl(records);

+ 1 - 1
vehicle-sdk/src/main/resources/application.yml

@@ -29,7 +29,7 @@ base:
   historyUrl: http://10.48.31.84:9080
   httpUrl: http://10.48.31.84:9080
   httpUrls: http://10.48.31.85:9080
-  recordUrl: http://123.139.243.142:18084
+  recordUrl: http://123.139.243.142:18082
   env: 1
   hkUrl: http://10:122:1:22:1443
   rtmpUrl: rtmp://10.48.31.84:1935