Browse Source

心跳接口修改

gao.qiang 1 năm trước cách đây
mục cha
commit
1f3cfe2f34

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

@@ -858,15 +858,13 @@ public class GeoHazardMonitorTokenController {
 //                                log.info("-----add3----" + add3);
                             }
                             //获取缓冲
-                            String code = redisCache.getCacheObject("heartbeat");
-                            if (StringUtils.isNotEmpty(code)) {
-                                log.info("--------------code--------------:" + code);
-                                List<String> stringList = JSON.parseArray(code, List.class);
-                                log.info("--------------list--------------:" + stringList);
+                            List<String> heartbeat = redisCache.getCacheObject("heartbeat");
+                            if (!ObjectUtils.isEmpty(heartbeat)) {
+                                log.info("--------------heartbeat--------------:" + heartbeat);
                                 List<String> rtspApiList = cameraUtil.rtspApiList();
                                 log.info("--------------rtspApiList1111--------------:" + rtspApiList);
                                 if (!ObjectUtils.isEmpty(rtspApiList)) {
-                                    rtspApiList.removeAll(stringList);
+                                    rtspApiList.removeAll(heartbeat);
                                 }
                                 log.info("--------------rtspApiList2222--------------:" + rtspApiList);
                                 if (!ObjectUtils.isEmpty(rtspApiList)) {
@@ -891,15 +889,13 @@ public class GeoHazardMonitorTokenController {
 //                                log.info("-----add4----" + add4);
                             }
                             //获取缓冲
-                            String code = redisCache.getCacheObject("heartbeat");
-                            if (StringUtils.isNotEmpty(code)) {
-                                log.info("--------------code--------------:" + code);
-                                List<String> stringList = JSON.parseArray(code, List.class);
-                                log.info("--------------list--------------:" + stringList);
+                            List<String> heartbeat = redisCache.getCacheObject("heartbeat");
+                            if (!ObjectUtils.isEmpty(heartbeat)) {
+                                log.info("--------------heartbeat--------------:" + heartbeat);
                                 List<String> rtspApiList = cameraUtil.rtspApiList();
                                 log.info("--------------rtspApiList1111--------------:" + rtspApiList);
                                 if (!ObjectUtils.isEmpty(rtspApiList)) {
-                                    rtspApiList.removeAll(stringList);
+                                    rtspApiList.removeAll(heartbeat);
                                 }
                                 log.info("--------------rtspApiList2222--------------:" + rtspApiList);
                                 if (!ObjectUtils.isEmpty(rtspApiList)) {
@@ -966,15 +962,13 @@ public class GeoHazardMonitorTokenController {
 //                            log.info("-----add5----" + add5);
                         }
                         //获取缓冲
-                        String code = redisCache.getCacheObject("heartbeat");
-                        if (StringUtils.isNotEmpty(code)) {
-                            log.info("--------------code--------------:" + code);
-                            List<String> list = JSON.parseArray(code, List.class);
-                            log.info("--------------list--------------:" + list);
+                        List<String> heartbeat = redisCache.getCacheObject("heartbeat");
+                        if (!ObjectUtils.isEmpty(heartbeat)) {
+                            log.info("--------------heartbeat--------------:" + heartbeat);
                             List<String> rtspApiList = cameraUtil.rtspApiList();
                             log.info("--------------rtspApiList1111--------------:" + rtspApiList);
                             if (!ObjectUtils.isEmpty(rtspApiList)) {
-                                rtspApiList.removeAll(list);
+                                rtspApiList.removeAll(heartbeat);
                             }
                             log.info("--------------rtspApiList2222--------------:" + rtspApiList);
                             if (!ObjectUtils.isEmpty(rtspApiList)) {
@@ -1015,7 +1009,7 @@ public class GeoHazardMonitorTokenController {
                         }
                         //获取缓冲
                         List<String> heartbeat = redisCache.getCacheObject("heartbeat");
-                        if (StringUtils.isNotEmpty(heartbeat)) {
+                        if (!ObjectUtils.isEmpty(heartbeat)) {
                             log.info("--------------heartbeat--------------:" + heartbeat);
                             List<String> rtspApiList = cameraUtil.rtspApiList();
                             log.info("--------------rtspApiList1111--------------:" + rtspApiList);