소스 검색

解除报警接口修改

gao.qiang 1 년 전
부모
커밋
dfcbb6494c
1개의 변경된 파일10개의 추가작업 그리고 7개의 파일을 삭제
  1. 10 7
      business-service/src/main/java/com/ozs/utils/CameraUtil.java

+ 10 - 7
business-service/src/main/java/com/ozs/utils/CameraUtil.java

@@ -1624,7 +1624,6 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
         int count = 0;
         boolean success = false;
         JSONArray streamArray = null;
-        List<BaseCameraManagementResponse> baseCameraManagementResponseList = new ArrayList<>();
         while (!success && retryCount < maxRetries) {
             try {
                 String data = HttpClientUtil.gets(url + "/api/summary");
@@ -1640,13 +1639,17 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
                 retryCount++;
             }
         }
-        for (int i = 0; i < streamArray.size(); i++) {
-            JSONObject subObj = streamArray.getJSONObject(i);
-            String PathValue = subObj.getString("Path");
-            if (PathValue.contains("/h264_720")) {
-                count++;
+        if (!ObjectUtils.isEmpty(streamArray)) {
+            for (int i = 0; i < streamArray.size(); i++) {
+                JSONObject subObj = streamArray.getJSONObject(i);
+                String PathValue = subObj.getString("Path");
+                if (PathValue.contains("/h264_720")) {
+                    count++;
+                }
             }
+            return count;
+        }else {
+            return count;
         }
-        return count;
     }
 }