Commit 8be6c5a8 by 汪志阳

fix:离床预警配置缓存设置

parent 58fd41e3
......@@ -14,6 +14,7 @@ import com.makeit.enums.CommonEnum;
import com.makeit.enums.platform.alarm.PlatAlarmConfigEnum;
import com.makeit.enums.redis.RedisConst;
import com.makeit.service.platform.alarm.PlatAlarmRecordService;
import com.makeit.utils.AlarmConfigCacheUtil;
import com.makeit.utils.AlarmRedisDTO;
import com.makeit.utils.data.convert.JsonUtil;
import com.makeit.utils.redis.RedisUtil;
......@@ -36,10 +37,9 @@ public class OffBedAlarm implements IAlarm {
@Resource
private PlatAlarmRecordService platAlarmRecordService;
private final String CURRENT_DAY = "1";
private final PlatAlarmConfigEnum.AlarmTypeEnum alarmTypeEnum = PlatAlarmConfigEnum.AlarmTypeEnum.OFF_BED;
@Resource
private AlarmConfigCacheUtil alarmConfigCacheUtil;
@Override
public boolean support(String alarmType) {
......@@ -53,6 +53,7 @@ public class OffBedAlarm implements IAlarm {
*/
@Override
public void checkConfig(PlatAlarmCheckDTO platAlarmCheckDTO) {
PlatDevice platDevice = platAlarmCheckDTO.getPlatDevice();
platAlarmRecordService.getElderListByDeviceId(platAlarmCheckDTO);
log.info("执行离床checkConfig方法:");
List<PlatElder> platElderList = platAlarmCheckDTO.getPlatElderList();
......@@ -60,8 +61,9 @@ public class OffBedAlarm implements IAlarm {
log.error("离床告警心率设备未关联长者,设备plat_id:" + platAlarmCheckDTO.getPlatDevice().getId());
return;
}
PlatAlarmConfig config = platAlarmCheckDTO.getPlatAlarmConfig();
if (!"5".equals(config.getAlarmType())) {
PlatAlarmConfig config = alarmConfigCacheUtil.get(platDevice.getOrgId(), PlatAlarmConfigEnum.AlarmTypeEnum.OFF_BED.getValue());
log.info("离床预警配置:{},orgid:{}", JSONUtil.toJsonStr(config), platDevice.getOrgId());
if (config == null || StringUtils.isBlank(config.getRuleConfig()) || !"5".equals(config.getAlarmType())) {
log.error("离床告警配置不存在,config:{}", JSONUtil.toJsonStr(config));
return;
}
......@@ -87,7 +89,6 @@ public class OffBedAlarm implements IAlarm {
if (properties == null) {
properties = new JSONObject();
}
PlatDevice platDevice = platAlarmCheckDTO.getPlatDevice();
String deviceId = platDevice.getId();
List<LocalDateTime> timeRange = getOffTimeRange(ruleConfig);
if (CollUtil.isEmpty(timeRange)) {
......
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