فهرست منبع

心跳逻辑修改

gao.qiang 9 ماه پیش
والد
کامیت
8615353956
1فایلهای تغییر یافته به همراه12 افزوده شده و 6 حذف شده
  1. 12 6
      vehicle-sdk/src/main/java/com/ozs/controller/upload/GeoHazardMonitorTokenController.java

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

@@ -807,6 +807,7 @@ public class GeoHazardMonitorTokenController {
                         //排序
                         preAlarmList.sort(distanceComparator);
                         for (int i = 0; i < preAlarmList.size(); i++) {
+                            PreAlarmListResponse preAlarmListResponse = new PreAlarmListResponse();
                             int mile=0;
                             LambdaQueryWrapper<BaseCameraManagement> wrapper1 = new LambdaQueryWrapper<BaseCameraManagement>();
                             if (heartbeatVo.getLineDir() == 1) {
@@ -844,11 +845,8 @@ public class GeoHazardMonitorTokenController {
                                         log.info("------------channel-------" + channel);
                                     }
                                     //添加预警信息
-                                    PreAlarmListResponse preAlarmListResponse = new PreAlarmListResponse();
-                                    BeanUtils.copyProperties(preAlarmList.get(i), preAlarmListResponse);
                                     preAlarmListResponse.setCameraCode(baseCameraManagement.getCameraCode());
                                     preAlarmListResponse.setCameraStream(CameraUtil.getPlayFlvRtsp(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel(), type));
-                                    responseList.add(preAlarmListResponse);
                                 }
                                 if (i == 0) {
                                     playFlv1 = CameraUtil.getPlayFlvRtsp(code, channel, type);
@@ -870,7 +868,12 @@ public class GeoHazardMonitorTokenController {
                                     twoMap.put("currentStream", playFlv1);
                                     twoMap.put("cameraCode", baseCameraManagementList.get(0).getCameraCode());
                                 }
+                            }else {
+                                preAlarmListResponse.setCameraCode("");
+                                preAlarmListResponse.setCameraStream("");
                             }
+                            BeanUtils.copyProperties(preAlarmList.get(i), preAlarmListResponse);
+                            responseList.add(preAlarmListResponse);
                         }
                         respHeartbeatVo.setPreAlarmList(responseList);
                     } else {
@@ -991,6 +994,7 @@ public class GeoHazardMonitorTokenController {
                     //排序
                     preAlarmList.sort(distanceComparator);
                     for (int i = 0; i < preAlarmList.size(); i++) {
+                        PreAlarmListResponse preAlarmListResponse = new PreAlarmListResponse();
                         int mile=0;
                         LambdaQueryWrapper<BaseCameraManagement> wrapper1 = new LambdaQueryWrapper<BaseCameraManagement>();
                         if (heartbeatVo.getLineDir() == 1) {
@@ -1028,11 +1032,8 @@ public class GeoHazardMonitorTokenController {
                                     log.info("------------channel-------" + channel);
                                 }
                                 //添加预警信息
-                                PreAlarmListResponse preAlarmListResponse = new PreAlarmListResponse();
-                                BeanUtils.copyProperties(preAlarmList.get(i), preAlarmListResponse);
                                 preAlarmListResponse.setCameraCode(baseCameraManagement.getCameraCode());
                                 preAlarmListResponse.setCameraStream(CameraUtil.getPlayFlvRtsp(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel(), type));
-                                responseList.add(preAlarmListResponse);
                             }
                             if (i == 0) {
                                 playFlv1 = CameraUtil.getPlayFlvRtsp(code, channel, type);
@@ -1054,7 +1055,12 @@ public class GeoHazardMonitorTokenController {
                                 twoMap.put("currentStream", playFlv1);
                                 twoMap.put("cameraCode", baseCameraManagementList.get(0).getCameraCode());
                             }
+                        }else {
+                            preAlarmListResponse.setCameraCode("");
+                            preAlarmListResponse.setCameraStream("");
                         }
+                        BeanUtils.copyProperties(preAlarmList.get(i), preAlarmListResponse);
+                        responseList.add(preAlarmListResponse);
                     }
                     respHeartbeatVo.setPreAlarmList(responseList);
                 } else {