Commit a691ab18 by huangjy

fix: 无人直接返回0

parent b8fa3031
......@@ -360,10 +360,19 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
String result = redisTemplate.opsForValue().get(DEVICE_BR_DATA + platDevice.getOriDeviceId());
if (result != null) {
JSONObject jsonObject = JSON.parseObject(result);
vo.setTime(LocalDateTime.now());
vo.setHeartRate(Integer.valueOf(jsonObject.getString("hr")));
vo.setRespiratoryRate(Integer.valueOf(jsonObject.getString("br")));
vo.setBody(Integer.valueOf(jsonObject.getString("bodymove")));
String person = jsonObject.getString("person");
log.info("当前人员人员状态:{}",person);
if (StringUtils.equals(person,"0")) {
vo.setTime(LocalDateTime.now());
vo.setHeartRate(0);
vo.setRespiratoryRate(0);
vo.setBody(0);
} else {
vo.setTime(LocalDateTime.now());
vo.setHeartRate(Integer.valueOf(jsonObject.getString("hr")));
vo.setRespiratoryRate(Integer.valueOf(jsonObject.getString("br")));
vo.setBody(Integer.valueOf(jsonObject.getString("bodymove")));
}
return vo;
}
......
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