Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
edafdbd8
authored
Dec 15, 2023
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:bug修复
parent
ba675772
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
View file @
edafdbd8
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment