|
|
|
@ -11,6 +11,7 @@ import com.cjy.utils.RedisCache; |
|
|
|
|
import com.rabbitmq.client.Channel; |
|
|
|
|
import org.springframework.amqp.core.Message; |
|
|
|
|
import org.springframework.amqp.rabbit.annotation.*; |
|
|
|
|
import org.springframework.amqp.rabbit.annotation.Queue; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.data.mongodb.core.MongoTemplate; |
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
@ -22,8 +23,7 @@ import java.text.SimpleDateFormat; |
|
|
|
|
import java.time.Instant; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.ZoneOffset; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -69,7 +69,7 @@ public class DeviceReceiver { |
|
|
|
|
redisCache.setCacheObject(deviceInfo.getDeviceId(),deviceInfo.getDeviceId()); |
|
|
|
|
redisCache.expire(deviceInfo.getDeviceId(),180); |
|
|
|
|
redisCache.setCacheObject("level_"+deviceInfo.getDeviceId(),deviceInfo.getFuelLevel()+""); |
|
|
|
|
|
|
|
|
|
redisCache.setCacheMapValue("leveldevice",deviceInfo.getDeviceId(),deviceInfo); |
|
|
|
|
/** |
|
|
|
|
* 没有异常就确认消息 |
|
|
|
|
* basicAck(long deliveryTag, boolean multiple) |
|
|
|
|