|
|
|
@ -212,6 +212,9 @@ public class CarInfoTask { |
|
|
|
websocketService.broadcast(message); |
|
|
|
websocketService.broadcast(message); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 每秒向web推送当前推流车辆的车速和推流状态信息 |
|
|
|
|
|
|
|
*/ |
|
|
|
@Scheduled(cron = "0/1 * * * * ?") |
|
|
|
@Scheduled(cron = "0/1 * * * * ?") |
|
|
|
public void getCarSpeed() { |
|
|
|
public void getCarSpeed() { |
|
|
|
String carNo = CarInfoCache.getPushCarNo(); |
|
|
|
String carNo = CarInfoCache.getPushCarNo(); |
|
|
|
@ -222,6 +225,7 @@ public class CarInfoTask { |
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> speedMap = new HashMap<>(); |
|
|
|
Map<String, String> speedMap = new HashMap<>(); |
|
|
|
speedMap.put("speed", info.getSpeed()); |
|
|
|
speedMap.put("speed", info.getSpeed()); |
|
|
|
|
|
|
|
speedMap.put("status", CarInfoCache.getPushStatus()); |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> dataMap = new HashMap<>(); |
|
|
|
Map<String, Object> dataMap = new HashMap<>(); |
|
|
|
dataMap.put("msgType", SPEED); |
|
|
|
dataMap.put("msgType", SPEED); |
|
|
|
|