Commit 75baeac4 by huangjy

fix: 状态bug

parent c07c639d
......@@ -305,17 +305,22 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
return vo;
}).collect(Collectors.toList());
boolean xFlag = false;
fallNoPersonFlag = voList.stream().allMatch(e -> e.getPersonState() == 0);
Double[] doubleArrX = voList.stream().map(PlatElderCoordinateVO::getX).filter(Objects::nonNull).toArray(Double[]::new);
if (doubleArrX.length > 0) {
double x = StandardDeviationUtil.variance(doubleArrX);
boolean xFlag = new BigDecimal(x + "").compareTo(new BigDecimal(2)) > 0;
xFlag = new BigDecimal(x + "").compareTo(new BigDecimal(2)) > 0;
log.info("跌倒设备算出来X方差为:{},是否大于2:{},设备id:{}",x,xFlag,device.getOriDeviceId());
}
boolean yFlag = false;
Double[] doubleArrY = voList.stream().map(PlatElderCoordinateVO::getY).filter(Objects::nonNull).toArray(Double[]::new);
if (doubleArrY.length > 0) {
double y = StandardDeviationUtil.variance(doubleArrY);
boolean yFlag = new BigDecimal(y + "").compareTo(new BigDecimal(2)) > 0;
yFlag = new BigDecimal(y + "").compareTo(new BigDecimal(2)) > 0;
log.info("跌倒设备算出来Y方差为:{},是否大于2:{},设备id:{}",y,yFlag,device.getOriDeviceId());
}
if (xFlag && yFlag) {
log.info("当前属于跌倒设备离床运动:" + platElderIdDTO.getElderId());
......
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