zhangnaisong
2024-02-02 b08492fcb6706124bef6e86cd6914c8eba54599a
ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
@@ -960,6 +960,15 @@
                    Map<String, Map<String, Object>> map = new HashMap();
                    map.put(carId, new HashMap());
                    PositionContainer.getUserPositionMap().put(usersId, map);
                    Map<String, Object> position = PositionContainer.getCarPositionMap().get(carId);//查询当前车辆位置
                    if (position != null) {
                        if (position.size() != 0) {
                            Map<String, Map<String, Object>> data = new HashMap();
                            data.put("31000", position);
                            WebSocketUtils.sendMessage(ONLINE_USER_SESSIONS.get(sessionId), JSON.toJSONString(data));
                        }
                    }
                    Date date = new Date();
                    Timer carPositionTimer = new Timer(sessionId);//定时推送实时位置
                    TimerTask carPositionTask = new TimerTask() {
@@ -991,6 +1000,15 @@
                    Map<String, Map<String, Object>> map = new HashMap();
                    map.put(carId, new HashMap());
                    PositionContainer.getUserPositionMap().put(usersId, map);
                    Map<String, Object> position = PositionContainer.getCarPositionMap().get(carId);//查询当前车辆位置
                    if (position != null) {
                        if (position.size() != 0) {
                            Map<String, Map<String, Object>> data = new HashMap();
                            data.put("31000", position);
                            WebSocketUtils.sendMessage(ONLINE_USER_SESSIONS.get(sessionId), JSON.toJSONString(data));
                        }
                    }
                    Date date = new Date();
                    Timer carPositionTimer = new Timer(sessionId);//定时推送实时位置
                    TimerTask carPositionTask = new TimerTask() {