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
e4d2bc68
authored
Nov 24, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat:设备同步问题
parent
c5e9c399
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
server-common/src/main/java/com/makeit/module/iot/service/IotOrgService.java
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatOrgServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
server-common/src/main/java/com/makeit/module/iot/service/IotOrgService.java
View file @
e4d2bc68
...
@@ -147,8 +147,9 @@ public class IotOrgService extends IotCommonService{
...
@@ -147,8 +147,9 @@ public class IotOrgService extends IotCommonService{
List
<
DeviceInstanceEntity
>
deviceInstanceEntityList
=
JSONArray
.
parseArray
(
pagerResult
.
getData
().
toString
()).
toJavaList
(
DeviceInstanceEntity
.
class
);
List
<
DeviceInstanceEntity
>
deviceInstanceEntityList
=
JSONArray
.
parseArray
(
pagerResult
.
getData
().
toString
()).
toJavaList
(
DeviceInstanceEntity
.
class
);
return
deviceInstanceEntityList
;
return
deviceInstanceEntityList
;
}
else
{
throw
new
RuntimeException
(
"获取设备接口失败:{},responseMessage.getMessage()"
);
}
}
log
.
error
(
"获取设备接口失败:{}"
,
responseMessage
.
getMessage
());
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"调用:{}接口异常:{}"
,
url
,
e
.
getMessage
());
log
.
error
(
"调用:{}接口异常:{}"
,
url
,
e
.
getMessage
());
}
}
...
...
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatOrgServiceImpl.java
View file @
e4d2bc68
...
@@ -412,7 +412,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
...
@@ -412,7 +412,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
.
eq
(
statusFlag
,
PlatOrg:
:
getStatus
,
param
.
getStatus
())
.
eq
(
statusFlag
,
PlatOrg:
:
getStatus
,
param
.
getStatus
())
.
eq
(
PlatOrg:
:
getStatus
,
CommonEnum
.
YES
.
getValue
())
.
eq
(
PlatOrg:
:
getStatus
,
CommonEnum
.
YES
.
getValue
())
);
);
if
(
typeFlag
||
nameFlag
||
statusFlag
)
{
if
(
typeFlag
||
nameFlag
)
{
Map
<
String
,
List
<
PlatOrg
>>
parentIdMap
=
orgList
.
stream
().
collect
(
Collectors
.
groupingBy
(
PlatOrg:
:
getParentId
));
Map
<
String
,
List
<
PlatOrg
>>
parentIdMap
=
orgList
.
stream
().
collect
(
Collectors
.
groupingBy
(
PlatOrg:
:
getParentId
));
orgList
.
forEach
(
vo
->
{
orgList
.
forEach
(
vo
->
{
List
<
PlatOrg
>
childList
=
parentIdMap
.
get
(
vo
.
getId
());
List
<
PlatOrg
>
childList
=
parentIdMap
.
get
(
vo
.
getId
());
...
...
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
e4d2bc68
...
@@ -600,6 +600,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -600,6 +600,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
}
}
//查询iot设备
//查询iot设备
List
<
DeviceInstanceEntity
>
iotDeviceList
=
iotOrgService
.
getOrgDevice
(
iotOrgId
);
List
<
DeviceInstanceEntity
>
iotDeviceList
=
iotOrgService
.
getOrgDevice
(
iotOrgId
);
if
(
CollectionUtils
.
isEmpty
(
iotDeviceList
))
{
continue
;
}
//查询平台设备
//查询平台设备
Set
<
String
>
iotDeviceIdSet
=
iotDeviceList
.
stream
().
map
(
DeviceInstanceEntity:
:
getId
).
collect
(
Collectors
.
toSet
());
Set
<
String
>
iotDeviceIdSet
=
iotDeviceList
.
stream
().
map
(
DeviceInstanceEntity:
:
getId
).
collect
(
Collectors
.
toSet
());
...
...
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