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
bfe68181
authored
Sep 20, 2023
by
杨伟程
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev' of
http://git.xmmakeit.com/huangjiay/iot-platform-server
into dev
parents
5c46e321
4f6e42f6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
3 deletions
server-module/src/main/java/com/makeit/module/controller/space/PlatSpaceController.java
server-service/src/main/java/com/makeit/service/platform/space/PlatSpaceService.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/workstation/impl/WorkStationServiceImpl.java
server-service/src/main/resources/mappers/PlatBedMapper.xml
server-module/src/main/java/com/makeit/module/controller/space/PlatSpaceController.java
View file @
bfe68181
...
...
@@ -92,4 +92,11 @@ public class PlatSpaceController {
}
@ApiOperation
(
"树-上级空间"
)
@PostMapping
(
"parentListTree"
)
public
ApiResponseEntity
<
List
<
PlatSpaceVO
>>
parentListTree
(
@RequestBody
PlatSpaceQueryDTO
dto
)
{
List
<
PlatSpaceVO
>
data
=
spaceService
.
parentListTree
(
dto
);
return
ApiResponseUtils
.
success
(
data
);
}
}
server-service/src/main/java/com/makeit/service/platform/space/PlatSpaceService.java
View file @
bfe68181
...
...
@@ -76,4 +76,5 @@ public interface PlatSpaceService extends IService<PlatSpace> {
*/
public
ExcelImportVo
importSpaceExcel
(
MultipartFile
excelFile
);
List
<
PlatSpaceVO
>
parentListTree
(
PlatSpaceQueryDTO
dto
);
}
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
View file @
bfe68181
...
...
@@ -471,5 +471,44 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
return
excelImportVo
;
}
@Override
public
List
<
PlatSpaceVO
>
parentListTree
(
PlatSpaceQueryDTO
dto
)
{
//查询用户权限组织id
List
<
PlatOrg
>
orgs
=
platOrgService
.
belongToScopeList
(
new
PlatOrg
());
if
(
orgs
.
isEmpty
()){
return
new
ArrayList
<>();
}
//房间
List
<
PlatRoom
>
listRoom
=
platRoomService
.
list
(
new
LambdaQueryWrapper
<>());
List
<
String
>
spaceIds
=
listRoom
.
stream
().
map
(
PlatRoom:
:
getSpaceId
).
collect
(
Collectors
.
toList
());
List
<
String
>
orgIds
=
orgs
.
stream
().
map
(
PlatOrg:
:
getId
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
PlatSpace
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
like
(
StringUtil
.
isNotEmpty
(
dto
.
getName
()),
PlatSpace:
:
getName
,
dto
.
getName
());
queryWrapper
.
in
(
PlatSpace:
:
getOrgId
,
orgIds
);
if
(!
spaceIds
.
isEmpty
()){
queryWrapper
.
notIn
(
PlatSpace:
:
getId
,
spaceIds
);
}
List
<
PlatSpace
>
list
=
this
.
list
(
queryWrapper
);
list
=
list
.
stream
()
.
filter
(
s
->(
StringUtil
.
isNotEmpty
(
s
.
getParentPath
())
&&
s
.
getParentPath
().
split
(
","
).
length
<
3
)
||
StringUtil
.
isEmpty
(
s
.
getParentPath
()))
.
collect
(
Collectors
.
toList
());
//父级
List
<
PlatSpace
>
listParent
=
list
.
stream
().
filter
(
item
->
StringUtil
.
isEmpty
(
item
.
getParentId
())).
collect
(
Collectors
.
toList
());
//子集
List
<
PlatSpace
>
listChild
=
list
.
stream
().
filter
(
item
->
item
.
getParentId
()
!=
null
).
collect
(
Collectors
.
toList
());
Map
<
String
,
List
<
PlatSpace
>>
map
=
listChild
.
stream
().
collect
(
Collectors
.
groupingBy
(
PlatSpace:
:
getParentId
));
List
<
PlatSpaceVO
>
data
=
new
ArrayList
<>();
for
(
PlatSpace
space:
listParent
){
PlatSpaceVO
vo
=
convertToVO
(
space
);
vo
=
child
(
vo
,
map
);
data
.
add
(
vo
);
}
return
data
;
}
}
server-service/src/main/java/com/makeit/service/platform/workstation/impl/WorkStationServiceImpl.java
View file @
bfe68181
...
...
@@ -230,8 +230,11 @@ public class WorkStationServiceImpl implements WorkStationService {
||
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
BREATHE
.
getValue
().
equals
(
a
.
getAlarmType
())
){
if
(
typeMap
.
containsKey
(
a
.
getAlarmType
())){
typeMap
.
get
(
a
.
getAlarmType
()).
add
(
a
.
getRemark
());
typeMap
.
put
(
a
.
getAlarmType
(),
typeMap
.
get
(
a
.
getAlarmType
()));
if
(
StringUtil
.
isNotEmpty
(
a
.
getRemark
())){
typeMap
.
get
(
a
.
getAlarmType
()).
add
(
a
.
getRemark
());
typeMap
.
put
(
a
.
getAlarmType
(),
typeMap
.
get
(
a
.
getAlarmType
()));
}
}
else
{
if
(
StringUtil
.
isNotEmpty
(
a
.
getRemark
())){
List
<
String
>
stautsList
=
new
ArrayList
<>();
...
...
server-service/src/main/resources/mappers/PlatBedMapper.xml
View file @
bfe68181
...
...
@@ -50,7 +50,7 @@
</select>
<select
id=
"selectByRoomIds"
resultType=
"com.makeit.vo.platform.workstation.WorkStationInstitutionBedVO"
>
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id as roomId , pe.id as elderId, p
b
.name as elderName, prbd.device_id as deviceId,pb.status
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id as roomId , pe.id as elderId, p
e
.name as elderName, prbd.device_id as deviceId,pb.status
FROM plat_bed pb
LEFT JOIN plat_elder pe ON pe.bed_id = pb.id and pe.del_flag = 0
LEFT JOIN plat_room_bed_device prbd ON prbd.bed_id = pb.id and prbd.del_flag = 0
...
...
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