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
263093e5
authored
Sep 13, 2023
by
lzy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
已绑定设备列表
parent
dbe536d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
server-service/src/main/java/com/makeit/dto/platform/device/PlatDeviceDTO.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomBedDeviceServiceImpl.java
server-service/src/main/java/com/makeit/dto/platform/device/PlatDeviceDTO.java
View file @
263093e5
...
@@ -33,4 +33,8 @@ public class PlatDeviceDTO {
...
@@ -33,4 +33,8 @@ public class PlatDeviceDTO {
@ApiModelProperty
(
value
=
"床位名称"
)
@ApiModelProperty
(
value
=
"床位名称"
)
private
String
bedName
;
private
String
bedName
;
@ApiModelProperty
(
value
=
"床位Id"
)
private
String
bedId
;
}
}
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomBedDeviceServiceImpl.java
View file @
263093e5
...
@@ -119,10 +119,12 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
...
@@ -119,10 +119,12 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
queryWrapper2
.
in
(
PlatBed:
:
getId
,
listBedIds
);
queryWrapper2
.
in
(
PlatBed:
:
getId
,
listBedIds
);
List
<
PlatBed
>
listBeds
=
platBedService
.
list
(
queryWrapper2
);
List
<
PlatBed
>
listBeds
=
platBedService
.
list
(
queryWrapper2
);
Map
<
String
,
String
>
map
=
listBeds
.
stream
().
collect
(
Collectors
.
toMap
(
PlatBed:
:
getId
,
PlatBed:
:
getName
,(
k1
,
k2
)->
k1
));
Map
<
String
,
String
>
map
=
listBeds
.
stream
().
collect
(
Collectors
.
toMap
(
PlatBed:
:
getId
,
PlatBed:
:
getName
,(
k1
,
k2
)->
k1
));
Map
<
String
,
String
>
mapName
=
new
HashMap
<>();
Map
<
String
,
String
>
mapName
=
new
HashMap
<>(
20
);
Map
<
String
,
String
>
mapBedId
=
new
HashMap
<>(
20
);
list
.
forEach
(
item
->{
list
.
forEach
(
item
->{
if
(
map
.
containsKey
(
item
.
getBedId
())){
if
(
map
.
containsKey
(
item
.
getBedId
())){
mapName
.
put
(
item
.
getDeviceId
(),
map
.
get
(
item
.
getBedId
()));
mapName
.
put
(
item
.
getDeviceId
(),
map
.
get
(
item
.
getBedId
()));
mapBedId
.
put
(
item
.
getDeviceId
(),
item
.
getBedId
());
}
}
});
});
...
@@ -136,6 +138,7 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
...
@@ -136,6 +138,7 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
data
.
forEach
(
item
->{
data
.
forEach
(
item
->{
item
.
setBedName
(
mapName
.
get
(
item
.
getId
()));
item
.
setBedName
(
mapName
.
get
(
item
.
getId
()));
item
.
setBedId
(
mapBedId
.
get
(
item
.
getId
()));
});
});
}
}
return
data
;
return
data
;
...
...
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