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
97a45a95
authored
Feb 07, 2024
by
罗志长
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: DeviceCacheUtil
parent
a0242a68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
server-service/src/main/java/com/makeit/utils/DeviceCacheUtil.java
server-service/src/main/java/com/makeit/utils/DeviceCacheUtil.java
View file @
97a45a95
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.entity.saas.PlatTenant
;
import
com.makeit.entity.saas.PlatTenant
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.enums.redis.RedisConst
;
import
com.makeit.enums.redis.RedisConst
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.global.aspect.tenant.TenantIdIgnoreUtil
;
import
com.makeit.global.aspect.tenant.TenantIdIgnoreUtil
;
...
@@ -43,7 +44,9 @@ public class DeviceCacheUtil implements ApplicationRunner {
...
@@ -43,7 +44,9 @@ public class DeviceCacheUtil implements ApplicationRunner {
PlatTenant
platTenant
=
platTenantService
.
getById
(
platDevice
.
getTenantId
());
PlatTenant
platTenant
=
platTenantService
.
getById
(
platDevice
.
getTenantId
());
if
(
StringUtils
.
equals
(
platDevice
.
getStatus
(),
DeviceState
.
online
.
getValue
()))
{
if
(
StringUtils
.
equals
(
platDevice
.
getStatus
(),
DeviceState
.
online
.
getValue
()))
{
RedisUtil
.
set
(
RedisConst
.
PLAT_IOT_DEVICE_PREFIX
+
platDevice
.
getOriDeviceId
()+
":"
+
platTenant
.
getIotOrgId
(),
platDevice
);
RedisUtil
.
set
(
RedisConst
.
PLAT_IOT_DEVICE_PREFIX
+
platDevice
.
getOriDeviceId
()+
":"
+
platTenant
.
getIotOrgId
(),
platDevice
);
RedisUtil
.
set
(
RedisConst
.
PLAT_OWN_IOT_DEVICE_ID
+
platDevice
.
getOriDeviceId
(),
platDevice
);
if
(
CommonEnum
.
YES
.
getValue
().
equals
(
platTenant
.
getStatus
()))
{
RedisUtil
.
set
(
RedisConst
.
PLAT_OWN_IOT_DEVICE_ID
+
platDevice
.
getOriDeviceId
(),
platDevice
);
}
}
else
{
}
else
{
String
key
=
RedisConst
.
PLAT_IOT_DEVICE_PREFIX
+
platDevice
.
getOriDeviceId
()+
":"
+
platTenant
.
getIotOrgId
();
String
key
=
RedisConst
.
PLAT_IOT_DEVICE_PREFIX
+
platDevice
.
getOriDeviceId
()+
":"
+
platTenant
.
getIotOrgId
();
if
(
RedisUtil
.
exist
(
key
)){
if
(
RedisUtil
.
exist
(
key
)){
...
...
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