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
f7fd3c33
authored
Dec 20, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
5e74ba07
95d30d50
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 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 @
f7fd3c33
...
@@ -212,9 +212,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -212,9 +212,7 @@ public class OffBedAlarm implements IAlarm {
log
.
info
(
"deviceId:{},uncross_config:{},第一次离床时间:{}"
,
deviceId
,
config
.
getRuleConfig
(),
longToTime
(
alarmRedisDTO
.
getStartLong
()));
log
.
info
(
"deviceId:{},uncross_config:{},第一次离床时间:{}"
,
deviceId
,
config
.
getRuleConfig
(),
longToTime
(
alarmRedisDTO
.
getStartLong
()));
Integer
duration
=
ruleConfig
.
getDuration
();
Integer
duration
=
ruleConfig
.
getDuration
();
LocalTime
startTime
=
ruleConfig
.
getOffBedStart
();
LocalTime
startTime
=
ruleConfig
.
getOffBedStart
();
// LocalDateTime startLocalDteTime = LocalDateTime.of(LocalDate.now(), startTime);
LocalTime
endTime
=
ruleConfig
.
getOffBedEnd
();
LocalTime
endTime
=
ruleConfig
.
getOffBedEnd
();
// LocalDateTime endLocalDteTime = LocalDateTime.of(LocalDate.now(), endTime);
Long
firstOffBedLong
=
alarmRedisDTO
.
getStartLong
();
Long
firstOffBedLong
=
alarmRedisDTO
.
getStartLong
();
long
currentTimeMillis
=
currentLong
();
long
currentTimeMillis
=
currentLong
();
...
@@ -236,7 +234,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -236,7 +234,7 @@ public class OffBedAlarm implements IAlarm {
return
;
return
;
}
}
LocalTime
localTime
=
LocalTime
.
now
().
plusHours
(
6
);
LocalTime
localTime
=
LocalTime
.
now
().
plusHours
(
6
)
.
plusMinutes
(
25
)
;
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
,
currentTime
()).
toMillis
()
/
1000
;
long
mills
=
Duration
.
between
(
dateTime
,
currentTime
()).
toMillis
()
/
1000
;
...
@@ -334,7 +332,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -334,7 +332,7 @@ public class OffBedAlarm implements IAlarm {
}
}
private
static
LocalDateTime
currentTime
()
{
private
static
LocalDateTime
currentTime
()
{
return
LocalDateTime
.
now
().
plusHours
(
6
);
return
LocalDateTime
.
now
().
plusHours
(
6
)
.
plusMinutes
(
25
)
;
// return LocalDateTime.now();
// return LocalDateTime.now();
}
}
...
...
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