|
|
|
|
@ -49,6 +49,8 @@ public class CarInfoTask { |
|
|
|
|
private static final String WEB = "web"; |
|
|
|
|
private static final String CURRENT_CAR_INFO = "current_car_info"; |
|
|
|
|
private static final String SPEED = "speed"; |
|
|
|
|
private static final String ONLINE = "online"; |
|
|
|
|
private static final String OFFLINE = "offline"; |
|
|
|
|
|
|
|
|
|
private final ICarInfoService carInfoService; |
|
|
|
|
|
|
|
|
|
@ -83,7 +85,7 @@ public class CarInfoTask { |
|
|
|
|
String carNo = CarInfoCache.getPushCarNo(); |
|
|
|
|
HashMap<String, Object> statusMap = new HashMap<>(); |
|
|
|
|
if (Func.isEmpty(carNo)) { |
|
|
|
|
statusMap.put("status","offline"); |
|
|
|
|
statusMap.put("status",OFFLINE); |
|
|
|
|
message.setContent(JSON.toJSONString(statusMap)); |
|
|
|
|
websocketService.broadcast(message); |
|
|
|
|
return; |
|
|
|
|
@ -97,7 +99,7 @@ public class CarInfoTask { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (Func.isEmpty(info)) { |
|
|
|
|
statusMap.put("status","offline"); |
|
|
|
|
statusMap.put("status",OFFLINE); |
|
|
|
|
message.setContent(JSON.toJSONString(statusMap)); |
|
|
|
|
websocketService.broadcast(message); |
|
|
|
|
return; |
|
|
|
|
@ -240,7 +242,7 @@ public class CarInfoTask { |
|
|
|
|
WebSocketMessage message = new WebSocketMessage(); |
|
|
|
|
HashMap<String, Object> statusMap = new HashMap<>(); |
|
|
|
|
if (Func.isEmpty(info)) { |
|
|
|
|
statusMap.put("status","offline"); |
|
|
|
|
statusMap.put("status",OFFLINE); |
|
|
|
|
message.setContent(JSON.toJSONString(statusMap)); |
|
|
|
|
websocketService.broadcast(message); |
|
|
|
|
return; |
|
|
|
|
|