|
|
@ -196,11 +196,20 @@ public class DeviceDataBaStatusServiceImpl implements DeviceDataBaStatusService |
|
|
List<Object> yCommon = new ArrayList<>(); |
|
|
List<Object> yCommon = new ArrayList<>(); |
|
|
|
|
|
|
|
|
//** 获取昨日最新数据 **//
|
|
|
//** 获取昨日最新数据 **//
|
|
|
|
|
|
|
|
|
String redisKey = Constants.REDIS_BA_STATUS_LATEST_VALUE + DateUtil.getYesterdayInJapan(); |
|
|
String redisKey = Constants.REDIS_BA_STATUS_LATEST_VALUE + DateUtil.getYesterdayInJapan(); |
|
|
|
|
|
|
|
|
|
|
|
boolean cacheExist = redisUtil.existsKey(redisKey); |
|
|
|
|
|
|
|
|
Object cacheLastValue = redisUtil.HGet(redisKey, lineDataSearchParams.getDeviceId().toLowerCase()); |
|
|
Object cacheLastValue = redisUtil.HGet(redisKey, lineDataSearchParams.getDeviceId().toLowerCase()); |
|
|
if (null != cacheLastValue) { |
|
|
if (null != cacheLastValue) { |
|
|
try { |
|
|
try { |
|
|
LatestValueBO latestValueBO = objectMapper.readValue(JSONObject.toJSONString(cacheLastValue), LatestValueBO.class); |
|
|
String value = cacheLastValue.toString(); |
|
|
|
|
|
// 如果是被双引号包住的 JSON(双层 JSON)
|
|
|
|
|
|
if (value.startsWith("\"")) { |
|
|
|
|
|
value = objectMapper.readValue(value, String.class); |
|
|
|
|
|
} |
|
|
|
|
|
LatestValueBO latestValueBO = objectMapper.readValue(value, LatestValueBO.class); |
|
|
String dateFormatted = Instant.ofEpochMilli(latestValueBO.getUpdateTs()) |
|
|
String dateFormatted = Instant.ofEpochMilli(latestValueBO.getUpdateTs()) |
|
|
.atZone(Constants.ZONE_TOKYO) |
|
|
.atZone(Constants.ZONE_TOKYO) |
|
|
.format(Constants.FORMATTER_YMDHMS); |
|
|
.format(Constants.FORMATTER_YMDHMS); |
|
|
|