Commit a514541a by 杨林龙

打印消费日志

1 parent 98bdb8b6
......@@ -3,6 +3,7 @@ package cn.com.glsx.kafka.service;
import cn.com.glsx.kafka.queue.remote.RemoteDeviceLocationService;
import cn.com.glsx.stdinterface.dto.DeviceLocationDto;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.glsx.plat.redis.utils.RedisUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -53,6 +54,7 @@ public class TransitHandleService {
// 缓存中没有 就是第一次插入数据 设置创建时间同步更新时间
deviceLocationDto.setCreatedTime(new Date());
deviceLocationDto.setUpdatedTime(new Date());
log.info("报警消费数据===" + JSONUtil.toJsonStr(deviceLocationDto));
redisUtils.set(setKey(deviceLocationDto.getSn()), deviceLocationDto);
deviceLocationMap.put(deviceLocationDto.getSn(), deviceLocationDto);
} else {
......@@ -77,6 +79,7 @@ public class TransitHandleService {
if (flag) {
// 同步更新时间
deviceLocationCache.setUpdatedTime(new Date());
log.info("报警消费数据===" + JSONUtil.toJsonStr(deviceLocationDto));
redisUtils.set(setKey(deviceLocationDto.getSn()), deviceLocationCache);
deviceLocationMap.put(deviceLocationDto.getSn(), deviceLocationCache);
}
......
......@@ -36,7 +36,6 @@ public class RemoteDeviceLocationServiceTest {
deviceLocationDto.setSn("123456789");
deviceLocationDto.setLastGpsTime(new Date());
deviceLocationDto.setLastBsTime(new Date());
deviceLocationDto.setCreatedTime(new Date());
deviceLocationDto.setUpdatedTime(new Date());
deviceLocationDtos.add(deviceLocationDto);
remoteDeviceLocationService.saveOrUpdateDeviceLocationData(deviceLocationDtos);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!