Commit ee3d59e7 by huangjy

fix:修改bug

parent e68c8873
......@@ -238,21 +238,23 @@ public class IotProductDeviceService extends IotCommonService {
int br = 0;
int hr = 0;
long timestamp = 0;
int noPersonCount = 0;
for (DeviceInfoContentBreathe deviceInfoContentBreathe : deviceInfoContentBreathes) {
timestamp = deviceInfoContentBreathe.getTimestamp();
breatheProperties = deviceInfoContentBreathe.getProperties();
if (breatheProperties.getPerson() == 0) {
noPersonCount++;
continue;
}
hr += breatheProperties.getHr();
br += breatheProperties.getBr();
bodymove += breatheProperties.getBodymove();
timestamp = deviceInfoContentBreathe.getTimestamp();
}
temp = new DeviceInfoContentBreathe();
tempProperties = new DeviceInfoContentBreathe.Properties();
tempProperties.setHr(hr / 60);
tempProperties.setBr(br / 60);
tempProperties.setBodymove(bodymove / 60);
tempProperties.setHr(noPersonCount == 60 ? 0 : hr / (60 - noPersonCount));
tempProperties.setBr(noPersonCount == 60 ? 0 : br / (60 - noPersonCount));
tempProperties.setBodymove(noPersonCount == 60 ? 0 : bodymove / (60- noPersonCount));
temp.setTimestamp(timestamp);
temp.setProperties(tempProperties);
tempList.add(temp);
......
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