|
|
|
|
@ -48,10 +48,6 @@ public class CarInfoTask { |
|
|
|
|
System.out.println("======存入实时车辆信息到redis成功========="); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0/1 * * * * ?") |
|
|
|
|
public void setCarInfo() { |
|
|
|
|
// redisTemplate.opsForValue().set("car-current-number", device);
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0/10 * * * * ?") |
|
|
|
|
public void parseCarInfo() { |
|
|
|
|
@ -103,7 +99,8 @@ public class CarInfoTask { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0/1 * * * * ?") |
|
|
|
|
public void getCarSpeed(String carNo) { |
|
|
|
|
public void getCarSpeed() { |
|
|
|
|
String carNo = (String) redisTemplate.opsForValue().get("car-current-number"); |
|
|
|
|
CarInfoVO info = carInfoService.getCarInfo(carNo); |
|
|
|
|
if (Func.isEmpty(info)) { |
|
|
|
|
throw new RuntimeException("未获取到车辆信息, 请检查车是否已掉线"); |
|
|
|
|
|