Commit 2a8b4f72 by huangjy

fix:跌倒和空间设备读取10秒内数据问题

parent ca97e359
...@@ -232,7 +232,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService { ...@@ -232,7 +232,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
boolean spaceNoPersonFlag = false; boolean spaceNoPersonFlag = false;
for (PlatDevice device : spaceDeviceList) { for (PlatDevice device : spaceDeviceList) {
Set<String> dataSet = redisTemplate.opsForZSet().rangeByScore(DEVICE_SPACE_TEMP_DATA + device.getOriDeviceId(), -10,-1); Set<String> dataSet = redisTemplate.opsForZSet().rangeByScore(DEVICE_SPACE_TEMP_DATA + device.getOriDeviceId(), currentSecond - 10,currentSecond);
if (CollectionUtils.isEmpty(dataSet)) { if (CollectionUtils.isEmpty(dataSet)) {
log.info("空间设备当前没有上报数据直接返回"); log.info("空间设备当前没有上报数据直接返回");
spaceNoPersonFlag = true; spaceNoPersonFlag = true;
...@@ -278,7 +278,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService { ...@@ -278,7 +278,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
} }
boolean fallNoPersonFlag = false; boolean fallNoPersonFlag = false;
for (PlatDevice device : fallDeviceList) { for (PlatDevice device : fallDeviceList) {
Set<String> dataSet = redisTemplate.opsForZSet().rangeByScore(DEVICE_FALL_TEMP_DATA + device.getOriDeviceId(), -10,-1); Set<String> dataSet = redisTemplate.opsForZSet().rangeByScore(DEVICE_FALL_TEMP_DATA + device.getOriDeviceId(), currentSecond -10,currentSecond);
if (CollectionUtils.isEmpty(dataSet)) { if (CollectionUtils.isEmpty(dataSet)) {
log.info("跌倒设备当前没有上报数据直接返回"); log.info("跌倒设备当前没有上报数据直接返回");
fallNoPersonFlag = true; fallNoPersonFlag = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment