Просмотр исходного кода

开发调取天网相机接口

gao.qiang 8 месяцев назад
Родитель
Сommit
b8e7d5d149

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

@@ -752,7 +752,11 @@ public class GeoHazardMonitorTokenController {
                                 });
                             } else {
                                 cameraVos.setCameraCode("");
-                                cameraVos.setCurrentStream("");
+                                if (list.get(0).getAlarmType()==2){
+                                    cameraVos.setCurrentStream("https://rtmp01open.ys7.com:9188/v3/openlive/K38316196_1_1.flv?expire=1745409016&id=704781554165264384&t=477265ab4d36debe072836e0b16755ba50303c3b8eb165a628bc9c0a0328afb5&ev=100");
+                                }else {
+                                    cameraVos.setCurrentStream("");
+                                }
                             }
                             List<CameraVos> cameraVosList = new ArrayList<>();
                             cameraVosList.add(cameraVos);
@@ -824,7 +828,11 @@ public class GeoHazardMonitorTokenController {
                                 }
                             } else {
                                 if (i == 0) {
-                                    alarmListVo.setCameraStream("");
+                                    if (list.get(0).getAlarmType()==2){
+                                        alarmListVo.setCameraStream("https://rtmp01open.ys7.com:9188/v3/openlive/K38316196_1_1.flv?expire=1745409016&id=704781554165264384&t=477265ab4d36debe072836e0b16755ba50303c3b8eb165a628bc9c0a0328afb5&ev=100");
+                                    }else {
+                                        alarmListVo.setCameraStream("");
+                                    }
                                     alarmListVo.setCameraCode("");
                                 }
                             }
@@ -1100,10 +1108,12 @@ public class GeoHazardMonitorTokenController {
                                         });
                                     }
                                 }
-                                BaseCameraManagement idOne = baseCameraManagementService.getById(list1.get(0).getId());
-                                BaseCameraManagement idTwo = baseCameraManagementService.getById(list1.get(1).getId());
-                                if (idOne.getGrou().equals(idTwo.getGrou())) {
-                                    break;
+                                if (list1.size() >= 2) {
+                                    BaseCameraManagement idOne = baseCameraManagementService.getById(list1.get(0).getId());
+                                    BaseCameraManagement idTwo = baseCameraManagementService.getById(list1.get(1).getId());
+                                    if (idOne.getGrou().equals(idTwo.getGrou())) {
+                                        break;
+                                    }
                                 }
                             }
 //                            CompletableFuture.runAsync(() -> {
@@ -1377,10 +1387,12 @@ public class GeoHazardMonitorTokenController {
                                     });
                                 }
                             }
-                            BaseCameraManagement idOne = baseCameraManagementService.getById(list1.get(0).getId());
-                            BaseCameraManagement idTwo = baseCameraManagementService.getById(list1.get(1).getId());
-                            if (idOne.getGrou().equals(idTwo.getGrou())) {
-                                break;
+                            if (list1.size() >= 2) {
+                                BaseCameraManagement idOne = baseCameraManagementService.getById(list1.get(0).getId());
+                                BaseCameraManagement idTwo = baseCameraManagementService.getById(list1.get(1).getId());
+                                if (idOne.getGrou().equals(idTwo.getGrou())) {
+                                    break;
+                                }
                             }
                         }
                     } else {