Commit edafdbd8 by 汪志阳

fix:bug修复

parent ba675772
......@@ -151,8 +151,7 @@ public class OffBedAlarm implements IAlarm {
Long firstOffBedLong = alarmRedisDTO.getStartLong();
long currentTimeMillis = System.currentTimeMillis();
LocalDateTime nowTest = LocalDateTime.now().plusHours(8)
.isAfter(LocalDateTime.of(2023, 12, 16, 0, 0, 0)) ? LocalDateTime.now().plusHours(7) : LocalDateTime.now().plusHours(8);
LocalDateTime nowTest = LocalDateTime.now().plusHours(7).plusMinutes(40);
currentTimeMillis = nowTest.toInstant(ZoneOffset.of("+8")).toEpochMilli();
log.info("handleCrossDay,测试当前的时间:{},时间戳:{}", nowTest, currentTimeMillis);
boolean isOverTime = (currentTimeMillis - firstOffBedLong) / 1000 >= duration * 60;
......@@ -175,8 +174,7 @@ public class OffBedAlarm implements IAlarm {
return;
}
// LocalDateTime now = LocalDateTime.now();
LocalDateTime now = LocalDateTime.now().plusHours(8)
.isAfter(LocalDateTime.of(2023, 12, 16, 0, 0, 0)) ? LocalDateTime.now().plusHours(7) : LocalDateTime.now().plusHours(8);
LocalDateTime now = LocalDateTime.now().plusHours(7).plusMinutes(40);;
LocalDateTime startLocalDteTime = LocalDateTime.of(LocalDate.now(), startTime);
if (!isInTime) {
long mills = Duration.between(startLocalDteTime, now).toMillis() / 1000;
......@@ -196,6 +194,11 @@ public class OffBedAlarm implements IAlarm {
}
public static void main(String[] args) {
LocalDateTime now = LocalDateTime.now().plusHours(7).plusMinutes(40);
System.out.println(now);
}
private void handleUnCrossDay(AlarmRedisDTO alarmRedisDTO, PlatAlarmConfigOffBedDTOVO ruleConfig,
PlatAlarmCheckDTO platAlarmCheckDTO,
PlatAlarmConfig config,
......
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