Commit 41ae3a8c by 罗志长

fix: 设备日志数据过滤

parent 7743fead
......@@ -256,17 +256,21 @@ public class IotProductDeviceService extends IotCommonService {
for (DeviceInfoContentBreathe deviceInfoContentBreathe : deviceInfoContentBreathes) {
timestamp = deviceInfoContentBreathe.getTimestamp();
breatheProperties = deviceInfoContentBreathe.getProperties();
if (breatheProperties == null || breatheProperties.getPerson() == null
|| breatheProperties.getBr() == null || breatheProperties.getHr() == null) {
continue;
}
if (breatheProperties.getPerson() == 0) {
noPersonCount++;
continue;
}
// 0和255直接跳过
Integer propertiesHr = breatheProperties.getHr() != null ? breatheProperties.getHr() : 0;
Integer propertiesHr = breatheProperties.getHr();
if (propertiesHr == 255 || propertiesHr == 0 ) {
noPersonCount++;
continue;
}
Integer propertiesBr = breatheProperties.getBr() != null ? breatheProperties.getBr() : 0;
Integer propertiesBr = breatheProperties.getBr();
if (propertiesBr == 255 || propertiesBr == 0) {
noPersonCount++;
continue;
......
......@@ -159,6 +159,10 @@ public class PlatElderBreatheAnalysisServiceImpl extends ServiceImpl<PlatElderBr
deviceInfoContentBreatheList.forEach(deviceInfo -> {
DeviceInfoContentBreathe.Properties deviceProperties = deviceInfo.getProperties();
if (deviceProperties == null || deviceProperties.getPerson() == null
|| deviceProperties.getHr() == null || deviceProperties.getBr() == null) {
return;
}
int br = deviceProperties.getBr();
int hr = deviceProperties.getHr();
Integer hasPerson = deviceProperties.getPerson(); // 0无人,1有人
......
......@@ -123,6 +123,10 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
for (DeviceInfoContentBreathe infoContentBreathe : deviceInfoContentBreathes) {
// 体动指数
breatheProperties = infoContentBreathe.getProperties();
if (breatheProperties == null || breatheProperties.getPerson() == null
|| breatheProperties.getBr() == null || breatheProperties.getHr() == null) {
continue;
}
Integer bodyMove = breatheProperties.getBodymove();
int br = breatheProperties.getBr();
int hr = breatheProperties.getHr();
......
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