Commit eb151a19 by 汪志阳

fix:模拟测试时间

parent 7ace2a21
...@@ -57,12 +57,8 @@ public class OffBedAlarm implements IAlarm { ...@@ -57,12 +57,8 @@ public class OffBedAlarm implements IAlarm {
log.error("离床告警心率设备未关联长者,设备plat_id:" + platAlarmCheckDTO.getPlatDevice().getId()); log.error("离床告警心率设备未关联长者,设备plat_id:" + platAlarmCheckDTO.getPlatDevice().getId());
return; return;
} }
if(!platDevice.getId().equals("1732609639364812805")){
return;
}
PlatAlarmConfig config = alarmConfigCacheUtil.get(platDevice.getOrgId(), PlatAlarmConfigEnum.AlarmTypeEnum.OFF_BED.getValue()); PlatAlarmConfig config = alarmConfigCacheUtil.get(platDevice.getOrgId(), PlatAlarmConfigEnum.AlarmTypeEnum.OFF_BED.getValue());
offBedCheckAlarm(config, platAlarmCheckDTO, platDevice); offBedCheckAlarm(config, platAlarmCheckDTO, platDevice);
} }
...@@ -75,7 +71,6 @@ public class OffBedAlarm implements IAlarm { ...@@ -75,7 +71,6 @@ public class OffBedAlarm implements IAlarm {
// log.error("离床告警配置为禁用,告警配置id:" + config.getId()); // log.error("离床告警配置为禁用,告警配置id:" + config.getId());
return; return;
} }
// String ruleConfigStr = "{\"offBedStart\":\"23:07:00\",\"offBedEnd\":\"00:00:00\",\"duration\":\"1\"}";
String ruleConfigStr = config.getRuleConfig(); String ruleConfigStr = config.getRuleConfig();
if (StringUtils.isBlank(ruleConfigStr)) { if (StringUtils.isBlank(ruleConfigStr)) {
// log.error("离床告警配置未配置,告警配置id:" + config.getId()); // log.error("离床告警配置未配置,告警配置id:" + config.getId());
...@@ -241,11 +236,10 @@ public class OffBedAlarm implements IAlarm { ...@@ -241,11 +236,10 @@ public class OffBedAlarm implements IAlarm {
return; return;
} }
LocalDateTime now = currentTime(); LocalTime localTime = LocalTime.now().plusHours(7).plusMinutes(30);
LocalTime localTime = LocalTime.now().plusHours(8);
if (!isInTime && localTime.isAfter(startTime) && localTime.isBefore(endTime)) { if (!isInTime && localTime.isAfter(startTime) && localTime.isBefore(endTime)) {
LocalDateTime dateTime = LocalDateTime.of(LocalDate.now(), startTime); LocalDateTime dateTime = LocalDateTime.of(LocalDate.now(), startTime);
long mills = Duration.between(dateTime, now).toMillis() / 1000; long mills = Duration.between(dateTime, currentTime()).toMillis() / 1000;
boolean noInOverTime = mills >= duration * 60; boolean noInOverTime = mills >= duration * 60;
if (noInOverTime) { if (noInOverTime) {
platAlarmCheckDTO.setAbnormalValue(String.valueOf(currentTimeMillis - firstOffBedLong)); platAlarmCheckDTO.setAbnormalValue(String.valueOf(currentTimeMillis - firstOffBedLong));
...@@ -330,7 +324,7 @@ public class OffBedAlarm implements IAlarm { ...@@ -330,7 +324,7 @@ public class OffBedAlarm implements IAlarm {
} }
private static LocalDateTime currentTime() { private static LocalDateTime currentTime() {
return LocalDateTime.now().plusHours(8); return LocalDateTime.now().plusHours(7).plusMinutes(30);
// return LocalDateTime.now(); // return LocalDateTime.now();
} }
......
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