Commit 2b0aecac by huangjy

fix:状态问题

parent f84bb85d
...@@ -192,7 +192,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService { ...@@ -192,7 +192,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
Integer sleepTimeActionThreshold = getSleepTimeActionThreshold(); Integer sleepTimeActionThreshold = getSleepTimeActionThreshold();
Long sleepTimeActionDuration = getSleepTimeActionDuration(); Long sleepTimeActionDuration = getSleepTimeActionDuration();
Set<String> dataSet = redisTemplate.opsForZSet().rangeByScore(DEVICE_BR_ANALYSIS + platDevice.getOriDeviceId(), 0, Integer.MAX_VALUE); Set<String> dataSet = redisTemplate.opsForZSet().rangeByScore(DEVICE_BR_ANALYSIS + platDevice.getOriDeviceId(), 0, Integer.MAX_VALUE);
if (CollectionUtils.isNotEmpty(dataSet) && dataSet.size() >= sleepTimeActionDuration) { if (CollectionUtils.isNotEmpty(dataSet) && sleepTimeActionDuration - dataSet.size() <= 2) {
boolean flag = dataSet.stream().anyMatch(s -> { boolean flag = dataSet.stream().anyMatch(s -> {
JSONObject result = JSON.parseObject(s); JSONObject result = JSON.parseObject(s);
JSONObject properties = (JSONObject)result.get("properties"); JSONObject properties = (JSONObject)result.get("properties");
...@@ -473,8 +473,10 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService { ...@@ -473,8 +473,10 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
if (jsonObject != null) { if (jsonObject != null) {
vo.setDeviceId(platDevice.getId()); vo.setDeviceId(platDevice.getId());
vo.setOriDeviceId(platDevice.getOriDeviceId()); vo.setOriDeviceId(platDevice.getOriDeviceId());
vo.setDistance(Integer.valueOf(jsonObject.getString("distance"))); if (Integer.parseInt(jsonObject.getString("mode")) != 0) {
vo.setAngle(Integer.valueOf(jsonObject.getString("angle"))); vo.setDistance(Integer.valueOf(jsonObject.getString("distance")));
vo.setAngle(Integer.valueOf(jsonObject.getString("angle")));
}
vo.setPersonState(Integer.valueOf(jsonObject.getString("personState"))); vo.setPersonState(Integer.valueOf(jsonObject.getString("personState")));
vo.setMount(Integer.valueOf(jsonObject.getString("mount"))); vo.setMount(Integer.valueOf(jsonObject.getString("mount")));
vo.setType(1); vo.setType(1);
......
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