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
b5f93060
authored
Dec 20, 2023
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:bug fix
parent
f7fd3c33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
View file @
b5f93060
...
...
@@ -234,7 +234,7 @@ public class OffBedAlarm implements IAlarm {
return
;
}
LocalTime
localTime
=
LocalTime
.
now
()
.
plusHours
(
6
).
plusMinutes
(
25
)
;
LocalTime
localTime
=
LocalTime
.
now
();
if
(!
isInTime
&&
localTime
.
isAfter
(
startTime
)
&&
localTime
.
isBefore
(
endTime
))
{
LocalDateTime
dateTime
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
startTime
);
long
mills
=
Duration
.
between
(
dateTime
,
currentTime
()).
toMillis
()
/
1000
;
...
...
@@ -332,7 +332,7 @@ public class OffBedAlarm implements IAlarm {
}
private
static
LocalDateTime
currentTime
()
{
return
LocalDateTime
.
now
()
.
plusHours
(
6
).
plusMinutes
(
25
)
;
return
LocalDateTime
.
now
();
// return LocalDateTime.now();
}
...
...
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
b5f93060
...
...
@@ -39,6 +39,7 @@ import com.makeit.entity.saas.SaasPidManage;
import
com.makeit.enums.CodeMessageEnum
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.enums.platform.device.PlatDeviceEnum
;
import
com.makeit.enums.redis.RedisConst
;
import
com.makeit.enums.report.DeviceNameEnum
;
import
com.makeit.exception.BusinessException
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
...
...
@@ -74,6 +75,7 @@ import com.makeit.utils.data.convert.JsonUtil;
import
com.makeit.utils.data.convert.PageUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
import
com.makeit.utils.old.StringUtils
;
import
com.makeit.utils.redis.RedisUtil
;
import
com.makeit.utils.sql.join.JoinUtil
;
import
com.makeit.vo.platform.device.PlatChildDeviceListVO
;
import
com.makeit.vo.platform.device.PlatDeviceListVO
;
...
...
@@ -906,7 +908,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
@TenantIdIgnore
public
boolean
updateDeviceStatus
(
String
messageType
,
String
deviceId
,
String
iot_tenantId
)
{
try
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
equalsAnyIgnoreCase
(
messageType
,
com
.
makeit
.
module
.
iot
.
enums
.
DeviceState
.
offline
.
getValue
(),
com
.
makeit
.
module
.
iot
.
enums
.
DeviceState
.
online
.
getValue
()))
{
boolean
isOffLine
=
com
.
makeit
.
module
.
iot
.
enums
.
DeviceState
.
offline
.
getValue
().
equalsIgnoreCase
(
messageType
);
boolean
isOnLine
=
com
.
makeit
.
module
.
iot
.
enums
.
DeviceState
.
online
.
getValue
().
equalsIgnoreCase
(
messageType
);
if
(
isOffLine
||
isOnLine
)
{
update
(
new
UpdateWrapper
<
PlatDevice
>().
lambda
()
.
set
(
PlatDevice:
:
getStatus
,
messageType
.
toLowerCase
())
...
...
@@ -918,6 +922,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if
(
CollectionUtils
.
isNotEmpty
(
deviceList
))
{
for
(
PlatDevice
platDevice
:
deviceList
)
{
platDevice
.
setStatus
(
messageType
.
toLowerCase
());
if
(
isOffLine
)
{
RedisUtil
.
delete
(
RedisConst
.
ALARM_DEVICE_OFF_BED_ID
+
platDevice
.
getId
());
}
}
deviceCacheUtil
.
putAll
(
deviceList
);
}
...
...
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