Commit b6c995de by huangjy

feat:非空判断

parent 546058a2
......@@ -51,7 +51,7 @@ public class OffBedAlarm implements IAlarm {
public void checkConfig(PlatAlarmCheckDTO platAlarmCheckDTO) {
PlatDevice platDevice = platAlarmCheckDTO.getPlatDevice();
platAlarmRecordService.getElderListByDeviceId(platAlarmCheckDTO);
log.info("执行离床checkConfig方法:");
//log.info("执行离床checkConfig方法:");
List<PlatElder> platElderList = platAlarmCheckDTO.getPlatElderList();
if (CollectionUtils.isEmpty(platElderList)) {
log.error("离床告警心率设备未关联长者,设备plat_id:" + platAlarmCheckDTO.getPlatDevice().getId());
......
......@@ -27,6 +27,7 @@ import com.makeit.service.saas.PlatTenantService;
import com.makeit.service.saas.SaasSleepAnalysisModelService;
import com.makeit.utils.AlarmConfigCacheUtil;
import com.makeit.utils.DeviceCacheUtil;
import com.makeit.utils.old.StringUtils;
import com.makeit.utils.redis.RedisUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
......@@ -195,7 +196,7 @@ public class PushCallback implements MqttCallback {
String messageType = device.getMessageType();
//更新设备状态
platDeviceService.updateDeviceStatus(messageType, deviceId, "");
if (org.apache.commons.lang3.StringUtils.equalsAnyIgnoreCase(messageType, DeviceState.online.getValue())) {
if (StringUtils.equalsAnyIgnoreCase(messageType, DeviceState.online.getValue())) {
return;
}
for (HeaderInfo.Bind binding : bindings) {
......@@ -238,7 +239,9 @@ public class PushCallback implements MqttCallback {
platAlarmCheckDTO.setProperties(properties);
//设备状态
platAlarmCheckDTO.setMessageType(messageType);
platAlarmCheckDTO.setDeviceTime(properties.getString("alarmId"));
if (properties != null) {
platAlarmCheckDTO.setDeviceTime(properties.getString("alarmId"));
}
alarm.checkConfig(platAlarmCheckDTO);
}
}
......
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