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
f31e88ca
authored
Nov 14, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:房态查询问题
parent
d185576e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomDynamicServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
f31e88ca
...
...
@@ -612,6 +612,10 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
LambdaQueryWrapper
<
PlatDevice
>
removeQw
=
new
LambdaQueryWrapper
<
PlatDevice
>()
.
in
(
PlatDevice:
:
getId
,
deviceIdList
)
.
eq
(
BaseBusEntity:
:
getTenantId
,
platTenant
.
getId
());
platDeviceOtherService
.
remove
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
.
in
(
PlatDeviceOther:
:
getDeviceId
,
deviceIdList
)
.
eq
(
BaseBusEntity:
:
getTenantId
,
platTenant
.
getId
()));
remove
(
removeQw
);
// 同时删除关联的设备
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomDynamicServiceImpl.java
View file @
f31e88ca
...
...
@@ -68,6 +68,15 @@ public class PlatRoomDynamicServiceImpl implements PlatRoomDynamicService {
//空间下的房间
List
<
PlatRoom
>
rooms
=
platRoomService
.
list
(
new
QueryWrapper
<
PlatRoom
>().
lambda
()
.
in
(
PlatRoom:
:
getSpaceId
,
spaceIds
));
if
(
CollectionUtils
.
isEmpty
(
rooms
))
{
spaces
=
platSpaceService
.
list
(
new
QueryWrapper
<
PlatSpace
>().
lambda
()
.
in
(
PlatSpace:
:
getParentId
,
spaceIds
));
if
(
CollectionUtils
.
isNotEmpty
(
spaces
))
{
spaceIds
=
spaces
.
stream
().
map
(
PlatSpace:
:
getId
).
collect
(
Collectors
.
toList
());
rooms
=
platRoomService
.
list
(
new
QueryWrapper
<
PlatRoom
>().
lambda
()
.
in
(
PlatRoom:
:
getSpaceId
,
spaceIds
));
}
}
Map
<
String
,
List
<
PlatRoom
>>
spaceRoomMap
=
rooms
.
stream
().
collect
(
Collectors
.
groupingBy
(
PlatRoom:
:
getSpaceId
));
List
<
String
>
roomIds
=
rooms
.
stream
().
map
(
PlatRoom:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
PlatBed
>
beds
=
platBedService
.
list
(
new
QueryWrapper
<
PlatBed
>().
lambda
()
...
...
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