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
39264af7
authored
Sep 27, 2023
by
lzy
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev' of git.xmmakeit.com:huangjiay/iot-platform-server into dev
parents
5f4b2e09
a9a4f371
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
6 deletions
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomServiceImpl.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/java/com/makeit/service/platform/space/impl/PlatRoomServiceImpl.java
View file @
39264af7
...
@@ -117,6 +117,10 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i
...
@@ -117,6 +117,10 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i
throw
new
BusinessException
(
CodeMessageEnum
.
PLATFORM_ERROR_ROOM_EXIT_BAD
);
throw
new
BusinessException
(
CodeMessageEnum
.
PLATFORM_ERROR_ROOM_EXIT_BAD
);
}
}
removeByIds
(
ids
);
removeByIds
(
ids
);
//删除床位
platBedService
.
remove
(
new
QueryWrapper
<
PlatBed
>().
lambda
()
.
in
(
PlatBed:
:
getRoomId
,
ids
));
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
View file @
39264af7
...
@@ -3,6 +3,7 @@ package com.makeit.service.platform.space.impl;
...
@@ -3,6 +3,7 @@ package com.makeit.service.platform.space.impl;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.xiaoymin.knife4j.core.util.CollectionUtils
;
import
com.makeit.common.dto.BaseIdDTO
;
import
com.makeit.common.dto.BaseIdDTO
;
import
com.makeit.common.vo.ExcelErrorVo
;
import
com.makeit.common.vo.ExcelErrorVo
;
import
com.makeit.common.vo.ExcelImportVo
;
import
com.makeit.common.vo.ExcelImportVo
;
...
@@ -107,7 +108,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
...
@@ -107,7 +108,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
space
.
setLatitude
(
dto
.
getLatitude
());
space
.
setLatitude
(
dto
.
getLatitude
());
space
.
setLongitude
(
dto
.
getLongitude
());
space
.
setLongitude
(
dto
.
getLongitude
());
space
.
setParentId
(
dto
.
getParentId
());
space
.
setParentId
(
dto
.
getParentId
());
space
.
setParentPath
(
dto
.
getParentPath
());
if
(
StringUtil
.
isEmpty
(
dto
.
getParentPath
())){
space
.
setParentPath
(
null
);
}
else
{
space
.
setParentPath
(
dto
.
getParentPath
());
}
//上级空间
//上级空间
PlatSpace
parentSpace
=
this
.
getById
(
dto
.
getParentId
());
PlatSpace
parentSpace
=
this
.
getById
(
dto
.
getParentId
());
...
@@ -150,11 +155,38 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
...
@@ -150,11 +155,38 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
queryWrapper
.
in
(
PlatSpace:
:
getOrgId
,
orgIds
);
queryWrapper
.
in
(
PlatSpace:
:
getOrgId
,
orgIds
);
List
<
PlatSpace
>
list
=
this
.
list
(
queryWrapper
);
List
<
PlatSpace
>
list
=
this
.
list
(
queryWrapper
);
List
<
PlatSpace
>
spaceList
=
new
ArrayList
<>();
Set
<
Long
>
parentIds
=
new
HashSet
<>();
if
(
StringUtil
.
isNotEmpty
(
dto
.
getName
())){
List
<
PlatSpace
>
arrayList
=
new
ArrayList
<>();
for
(
PlatSpace
space
:
list
){
//非一级空间的获取上级空间
if
(
StringUtil
.
isNotEmpty
(
space
.
getParentId
()))
{
List
<
String
>
parentIdList
=
new
ArrayList
<>();
parentIdList
.
addAll
(
Arrays
.
asList
(
space
.
getParentPath
().
split
(
","
)));
parentIdList
.
add
(
space
.
getId
());
Set
<
Long
>
set
=
new
HashSet
(
parentIdList
);
parentIds
.
addAll
(
set
);
}
else
{
arrayList
.
add
(
space
);
}
}
parentIds
.
add
(-
1L
);
arrayList
=
arrayList
.
stream
().
filter
(
e
->
!
parentIds
.
contains
(
Long
.
valueOf
(
e
.
getId
()))).
collect
(
Collectors
.
toList
());
spaceList
=
list
(
new
QueryWrapper
<
PlatSpace
>().
lambda
()
.
in
(
PlatSpace:
:
getId
,
parentIds
));
if
(
CollectionUtils
.
isNotEmpty
(
arrayList
))
{
spaceList
.
addAll
(
arrayList
);
}
}
else
{
spaceList
=
list
;
}
//父级
//父级
List
<
PlatSpace
>
listParent
=
l
ist
.
stream
().
filter
(
item
->
StringUtil
.
isEmpty
(
item
.
getParentId
())).
collect
(
Collectors
.
toList
());
List
<
PlatSpace
>
listParent
=
spaceL
ist
.
stream
().
filter
(
item
->
StringUtil
.
isEmpty
(
item
.
getParentId
())).
collect
(
Collectors
.
toList
());
//子集
//子集
List
<
PlatSpace
>
listChild
=
l
ist
.
stream
().
filter
(
item
->
item
.
getParentId
()
!=
null
).
collect
(
Collectors
.
toList
());
List
<
PlatSpace
>
listChild
=
spaceL
ist
.
stream
().
filter
(
item
->
item
.
getParentId
()
!=
null
).
collect
(
Collectors
.
toList
());
Map
<
String
,
List
<
PlatSpace
>>
map
=
listChild
.
stream
().
collect
(
Collectors
.
groupingBy
(
PlatSpace:
:
getParentId
));
Map
<
String
,
List
<
PlatSpace
>>
map
=
listChild
.
stream
().
collect
(
Collectors
.
groupingBy
(
PlatSpace:
:
getParentId
));
List
<
PlatSpaceVO
>
data
=
new
ArrayList
<>();
List
<
PlatSpaceVO
>
data
=
new
ArrayList
<>();
...
...
server-service/src/main/java/com/makeit/service/platform/workstation/impl/WorkStationServiceImpl.java
View file @
39264af7
...
@@ -175,7 +175,8 @@ public class WorkStationServiceImpl implements WorkStationService {
...
@@ -175,7 +175,8 @@ public class WorkStationServiceImpl implements WorkStationService {
}
else
{
}
else
{
//获取父级的所有子级空间
//获取父级的所有子级空间
spaces
=
platSpaceService
.
listChild
(
dto
.
getSpaceIds
());
spaces
=
platSpaceService
.
listChild
(
dto
.
getSpaceIds
());
List
<
String
>
spaceIds
=
spaces
.
stream
().
map
(
PlatSpace:
:
getId
).
collect
(
Collectors
.
toList
());
dto
.
setSpaceIds
(
spaceIds
);
}
}
List
<
String
>
elderIdList
=
new
ArrayList
<>();
List
<
String
>
elderIdList
=
new
ArrayList
<>();
...
@@ -218,8 +219,7 @@ public class WorkStationServiceImpl implements WorkStationService {
...
@@ -218,8 +219,7 @@ public class WorkStationServiceImpl implements WorkStationService {
//查询睡眠质量分析模型
//查询睡眠质量分析模型
// SaasModelManage modelManage = saasModelManageService.getOne(new QueryWrapper<SaasModelManage>().lambda()
// SaasModelManage modelManage = saasModelManageService.getOne(new QueryWrapper<SaasModelManage>().lambda()
// .eq(SaasModelManage::getModelType, ModelManageTypeEnum.SLEEP.getCode())
// .eq(SaasModelManage::getModelType, ModelManageTypeEnum.SLEEP.getCode());
// .last(" limit 1"));
// Integer turnedComparison = 0;
// Integer turnedComparison = 0;
// if(modelManage != null){
// if(modelManage != null){
// SaasSleepAnalysisModel model = saasSleepAnalysisModelService.view(modelManage.getModelId());
// SaasSleepAnalysisModel model = saasSleepAnalysisModelService.view(modelManage.getModelId());
...
@@ -396,6 +396,8 @@ public class WorkStationServiceImpl implements WorkStationService {
...
@@ -396,6 +396,8 @@ public class WorkStationServiceImpl implements WorkStationService {
}
else
{
}
else
{
//获取父级的所有子级空间
//获取父级的所有子级空间
spaces
=
platSpaceService
.
listChild
(
dto
.
getSpaceIds
());
spaces
=
platSpaceService
.
listChild
(
dto
.
getSpaceIds
());
List
<
String
>
spaceIds
=
spaces
.
stream
().
map
(
PlatSpace:
:
getId
).
collect
(
Collectors
.
toList
());
dto
.
setSpaceIds
(
spaceIds
);
}
}
List
<
String
>
elderIdList
=
new
ArrayList
<>();
List
<
String
>
elderIdList
=
new
ArrayList
<>();
...
...
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