Commit 5c4ab660 by huangjy

fix: 修复bug

parent fdf03315
......@@ -71,7 +71,7 @@ public class BreathAlarm implements IAlarm {
PlatAlarmConfig config = platAlarmCheckDTO.getPlatAlarmConfig();
String ruleConfigStr = config.getRuleConfig();
if (CommonEnum.NO.getValue().equals(config.getStatus())) {
log.error("呼吸告警配置为用,告警配置id:" + config.getId());
log.error("呼吸告警配置为用,告警配置id:" + config.getId());
return;
}
if (StringUtils.isBlank(ruleConfigStr)) {
......@@ -91,6 +91,12 @@ public class BreathAlarm implements IAlarm {
String deviceId = platDevice.getId();
String personState = Convert.toStr(properties.get("personState"));
int hasPerson = (int) properties.get("person");
if ("0".equals(hasPerson)) {
log.info("当前上报数据无人,不需要告警");
return;
}
//呼吸率
int br = (int) properties.get("br");
......
......@@ -123,7 +123,7 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
.in(CollectionUtils.isNotEmpty(orgIdList), PlatElder::getOrgId, orgIdList)
.like(StringUtils.isNotBlank(dto.getCertificateNumber()), PlatElder::getCertificateNumber, dto.getCertificateNumber())
.apply(StringUtils.isNotBlank(dto.getSpaceId()), "find_in_set('" + dto.getSpaceId() + "',space_path)")
.apply(StringUtils.isNotBlank(dto.getOrgId()), "find_in_set('" + dto.getOrgId() + "',org_path)")
//.apply(StringUtils.isNotBlank(dto.getOrgId()), "find_in_set('" + dto.getOrgId() + "',org_path)")
.orderByDesc(PlatElder::getId);
}
......
......@@ -10,6 +10,7 @@ import com.makeit.dto.platform.alarm.PlatAlarmCheckDTO;
import com.makeit.entity.platform.alarm.PlatAlarmConfig;
import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.entity.saas.PlatTenant;
import com.makeit.enums.CommonEnum;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.module.iot.enums.DeviceState;
import com.makeit.module.iot.vo.DeviceInfo;
......@@ -144,6 +145,10 @@ public class PushCallback implements MqttCallback {
return;
}
for (PlatAlarmConfig config : deviceAlarmConfigList) {
if (CommonEnum.NO.getValue().equals(config.getStatus())) {
logger.error("告警配置为禁用,告警配置id:" + config.getId());
continue;
}
String alarmType = config.getAlarmType();
for (IAlarm alarm : alarmList) {
......
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