Bläddra i källkod

预警添加预警时间

gao.qiang 8 månader sedan
förälder
incheckning
611f12eb39

+ 4 - 0
business-service/src/main/java/com/ozs/entity/response/PreAlarmListResponse.java

@@ -33,4 +33,8 @@ public class PreAlarmListResponse {
      * 当前播放的相机编码
      */
     private String cameraCode;
+    /**
+     * 预警时间
+     */
+    private Long  preAlarmTime;
 }

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

@@ -1019,6 +1019,8 @@ public class GeoHazardMonitorTokenController {
                                     } else {
                                         cameraVos.setCameraCode("");
                                         cameraVos.setCurrentStream("");
+                                        cameraVos.setCameraCode("该里程位置,没有可用的预警相机");
+                                        cameraVos.setCurrentStream("");
                                     }
                                     List<CameraVos> cameraVosList = new ArrayList<>();
                                     cameraVosList.add(cameraVos);
@@ -1029,16 +1031,10 @@ public class GeoHazardMonitorTokenController {
                                 } else {
                                     preAlarmListResponse.setCameraCode("");
                                     preAlarmListResponse.setCameraStream("");
-                                    CameraVos cameraVos = new CameraVos();
-                                    cameraVos.setCameraCode("该里程位置,没有可用的预警相机");
-                                    cameraVos.setCurrentStream("");
-                                    List<CameraVos> cameraVosList = new ArrayList<>();
-                                    cameraVosList.add(cameraVos);
-                                    respHeartbeatVo.setCameraList(cameraVosList);
-                                    respHeartbeatVo.setIsAlarm(1);
                                 }
                             }
                             BeanUtils.copyProperties(preAlarmList.get(i), preAlarmListResponse);
+                            preAlarmListResponse.setPreAlarmTime(preAlarm.getPreAlarmTime().getTime());
                             responseList.add(preAlarmListResponse);
                         }
                         respHeartbeatVo.setPreAlarmList(responseList);
@@ -1334,6 +1330,8 @@ public class GeoHazardMonitorTokenController {
                                 } else {
                                     cameraVos.setCameraCode("");
                                     cameraVos.setCurrentStream("");
+                                    cameraVos.setCameraCode("该里程位置,没有可用的预警相机");
+                                    cameraVos.setCurrentStream("");
                                 }
                                 List<CameraVos> cameraVosList = new ArrayList<>();
                                 cameraVosList.add(cameraVos);
@@ -1344,16 +1342,10 @@ public class GeoHazardMonitorTokenController {
                             } else {
                                 preAlarmListResponse.setCameraCode("");
                                 preAlarmListResponse.setCameraStream("");
-                                CameraVos cameraVos = new CameraVos();
-                                cameraVos.setCameraCode("该里程位置,没有可用的预警相机");
-                                cameraVos.setCurrentStream("");
-                                List<CameraVos> cameraVosList = new ArrayList<>();
-                                cameraVosList.add(cameraVos);
-                                respHeartbeatVo.setCameraList(cameraVosList);
-                                respHeartbeatVo.setIsAlarm(1);
                             }
                         }
                         BeanUtils.copyProperties(preAlarmList.get(i), preAlarmListResponse);
+                        preAlarmListResponse.setPreAlarmTime(preAlarm.getPreAlarmTime().getTime());
                         responseList.add(preAlarmListResponse);
                     }
                     respHeartbeatVo.setPreAlarmList(responseList);