Compare commits

..

2 Commits

Author SHA1 Message Date
masong f4cd3e444e Merge remote-tracking branch 'origin/master' 2 years ago
masong 2c70a1238f 增加记录 2 years ago
  1. 6
      src/main/java/com/cjy/receiver/DeviceReceiver.java

@ -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)

Loading…
Cancel
Save