master
tangwenkang 2023-12-05 11:02:09 +08:00
parent 7c5a2e4f2c
commit ce10ed1784
1 changed files with 3 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import com.dragon.vehicle.history.server.mapper.FenceMapper;
import com.dragon.vehicle.history.server.service.CarService; import com.dragon.vehicle.history.server.service.CarService;
import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -40,8 +41,7 @@ public class CarServiceImpl implements CarService {
@Autowired @Autowired
private RedisService redisService; private RedisService redisService;
@Autowired @Autowired
private RedisTemplate<String,String> redisTemplate; private RabbitTemplate rabbitTemplate;
/** /**
* *
* @param reqCar * @param reqCar
@ -143,6 +143,7 @@ public class CarServiceImpl implements CarService {
List<String> cacheList = redisService.getCacheList("event_"+vin);//根据vin查询出车辆的事件列表 List<String> cacheList = redisService.getCacheList("event_"+vin);//根据vin查询出车辆的事件列表
cacheList.add("runtimeTraceEvent");//添加实时轨迹事件 cacheList.add("runtimeTraceEvent");//添加实时轨迹事件
redisService.setCacheList("event_"+vin,cacheList);//将事件列表存入redis redisService.setCacheList("event_"+vin,cacheList);//将事件列表存入redis
rabbitTemplate.convertAndSend("eventChange_queue",vin);
return Result.success("添加事件成功!"); return Result.success("添加事件成功!");
} }