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
2cf25453
authored
Nov 01, 2023
by
李小龙
Committed by
huangjy
Nov 08, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:29482 平台端-长者管理-新增:当前入住的数据源未与账号的所在组织匹配,目前还有下级组织的空间
parent
4170a3e7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
4 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-module/src/main/java/com/makeit/module/controller/space/PlatSpaceController.java
View file @
2cf25453
...
@@ -4,7 +4,6 @@ import com.makeit.common.dto.BaseIdDTO;
...
@@ -4,7 +4,6 @@ import com.makeit.common.dto.BaseIdDTO;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.common.vo.ExcelImportVo
;
import
com.makeit.common.vo.ExcelImportVo
;
import
com.makeit.dto.platform.elder.PlatElderImportDTO
;
import
com.makeit.dto.platform.space.PlatSpaceAddDTO
;
import
com.makeit.dto.platform.space.PlatSpaceAddDTO
;
import
com.makeit.dto.platform.space.PlatSpaceImportDTO
;
import
com.makeit.dto.platform.space.PlatSpaceImportDTO
;
import
com.makeit.dto.platform.space.PlatSpaceQueryDTO
;
import
com.makeit.dto.platform.space.PlatSpaceQueryDTO
;
...
@@ -12,14 +11,17 @@ import com.makeit.dto.platform.space.PlatSpaceVO;
...
@@ -12,14 +11,17 @@ import com.makeit.dto.platform.space.PlatSpaceVO;
import
com.makeit.enums.CodeMessageEnum
;
import
com.makeit.enums.CodeMessageEnum
;
import
com.makeit.enums.FileSuffixEnum
;
import
com.makeit.enums.FileSuffixEnum
;
import
com.makeit.exception.BusinessException
;
import
com.makeit.exception.BusinessException
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.service.platform.space.PlatSpaceService
;
import
com.makeit.service.platform.space.PlatSpaceService
;
import
com.makeit.utils.data.excel.ExcelUtil
;
import
com.makeit.utils.data.excel.ExcelUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -83,7 +85,7 @@ public class PlatSpaceController {
...
@@ -83,7 +85,7 @@ public class PlatSpaceController {
@ApiOperation
(
"树-到床位(未住人床位)"
)
@ApiOperation
(
"树-到床位(未住人床位)"
)
@PostMapping
(
"listTreeAuthIgnoreByBed"
)
@PostMapping
(
"listTreeAuthIgnoreByBed"
)
public
ApiResponseEntity
<
List
<
PlatSpaceVO
>>
listTreeAuthIgnoreByBed
(
@RequestBody
PlatSpaceQueryDTO
dto
)
{
public
ApiResponseEntity
<
List
<
PlatSpaceVO
>>
listTreeAuthIgnoreByBed
(
@RequestBody
PlatSpaceQueryDTO
dto
)
{
List
<
PlatSpaceVO
>
data
=
spaceService
.
list
BedTree
(
dto
,
true
);
List
<
PlatSpaceVO
>
data
=
spaceService
.
list
TreeAuthIgnoreByBed
(
dto
,
true
);
return
ApiResponseUtils
.
success
(
data
);
return
ApiResponseUtils
.
success
(
data
);
}
}
...
...
server-service/src/main/java/com/makeit/service/platform/space/PlatSpaceService.java
View file @
2cf25453
...
@@ -83,6 +83,8 @@ public interface PlatSpaceService extends IService<PlatSpace> {
...
@@ -83,6 +83,8 @@ public interface PlatSpaceService extends IService<PlatSpace> {
List
<
PlatSpaceVO
>
listBedTree
(
PlatSpaceQueryDTO
dto
,
boolean
flag
);
List
<
PlatSpaceVO
>
listBedTree
(
PlatSpaceQueryDTO
dto
,
boolean
flag
);
List
<
PlatSpaceVO
>
listTreeAuthIgnoreByBed
(
PlatSpaceQueryDTO
dto
,
boolean
flag
);
/**
/**
* 根据老人组织过滤空间
* 根据老人组织过滤空间
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
View file @
2cf25453
...
@@ -798,6 +798,79 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
...
@@ -798,6 +798,79 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
return
data
;
return
data
;
}
}
@Override
public
List
<
PlatSpaceVO
>
listTreeAuthIgnoreByBed
(
PlatSpaceQueryDTO
dto
,
boolean
flag
)
{
//29482 平台端-长者管理-新增:当前入住的数据源未与账号的所在组织匹配,目前还有下级组织的空间
PlatUserVO
userVO
=
PlatUserUtil
.
getUserVO
();
// List<PlatOrg> platOrgs = platOrgService.belongToScopeList(new PlatOrg());
// if(platOrgs.isEmpty()){
// return new ArrayList<>();
// }
// List<String> orgIds = platOrgs.stream().map(PlatOrg::getId).collect(Collectors.toList());
List
<
String
>
orgIds
=
new
ArrayList
<>();
orgIds
.
add
(
userVO
.
getOrgId
());
//床位
LambdaQueryWrapper
<
PlatBed
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
if
(
flag
){
queryWrapper1
.
eq
(
PlatBed:
:
getStatus
,
CommonEnum
.
YES
.
getValue
());
}
List
<
PlatBed
>
listBeds
=
platBedService
.
list
(
queryWrapper1
);
if
(
listBeds
.
isEmpty
()){
return
new
ArrayList
<>();
}
List
<
String
>
roomIds
=
listBeds
.
stream
().
map
(
PlatBed:
:
getRoomId
).
collect
(
Collectors
.
toList
());
List
<
PlatRoom
>
listRoom
=
platRoomService
.
list
(
new
QueryWrapper
<
PlatRoom
>().
lambda
()
.
in
(
PlatRoom:
:
getId
,
roomIds
));
List
<
String
>
spaceIds
=
listRoom
.
stream
().
map
(
PlatRoom:
:
getSpacePath
).
collect
(
Collectors
.
toList
());
Set
<
String
>
spaceIdList
=
new
HashSet
<>();
for
(
String
spaceId
:
spaceIds
){
spaceIdList
.
addAll
(
Arrays
.
asList
(
spaceId
.
split
(
","
)));
}
spaceIdList
.
add
(
"-1"
);
List
<
PlatSpaceVO
>
listRoomVo
=
new
ArrayList
<>();
listRoom
.
forEach
(
item
->
{
PlatSpaceVO
vo
=
new
PlatSpaceVO
();
vo
.
setId
(
item
.
getId
());
vo
.
setName
(
item
.
getName
());
vo
.
setParentId
(
item
.
getSpaceId
());
listRoomVo
.
add
(
vo
);
});
listBeds
.
forEach
(
item
->
{
PlatSpaceVO
vo
=
new
PlatSpaceVO
();
vo
.
setId
(
item
.
getId
());
vo
.
setName
(
item
.
getName
());
vo
.
setParentId
(
item
.
getRoomId
());
listRoomVo
.
add
(
vo
);
});
LambdaQueryWrapper
<
PlatSpace
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
like
(
StringUtil
.
isNotEmpty
(
dto
.
getName
()),
PlatSpace:
:
getName
,
dto
.
getName
());
queryWrapper
.
in
(
PlatSpace:
:
getId
,
spaceIdList
);
queryWrapper
.
in
(
PlatSpace:
:
getOrgId
,
orgIds
);
List
<
PlatSpace
>
list
=
this
.
list
(
queryWrapper
);
List
<
PlatSpaceVO
>
listSpaceVo
=
BeanDtoVoUtils
.
listVo
(
list
,
PlatSpaceVO
.
class
);
listSpaceVo
.
addAll
(
listRoomVo
);
//父级
List
<
PlatSpaceVO
>
listParent
=
listSpaceVo
.
stream
().
filter
(
item
->
StringUtil
.
isEmpty
(
item
.
getParentId
())).
collect
(
Collectors
.
toList
());
//子集
List
<
PlatSpaceVO
>
listChild
=
listSpaceVo
.
stream
().
filter
(
item
->
item
.
getParentId
()
!=
null
).
collect
(
Collectors
.
toList
());
Map
<
String
,
List
<
PlatSpaceVO
>>
map
=
listChild
.
stream
().
collect
(
Collectors
.
groupingBy
(
PlatSpaceVO:
:
getParentId
));
List
<
PlatSpaceVO
>
data
=
new
ArrayList
<>();
for
(
PlatSpaceVO
space
:
listParent
)
{
space
=
childVo
(
space
,
map
);
data
.
add
(
space
);
}
return
data
;
}
@Override
@Override
public
List
<
PlatSpaceVO
>
listBedTreeByElderGroup
(
PlatSpaceQueryDTO
dto
,
boolean
flag
)
{
public
List
<
PlatSpaceVO
>
listBedTreeByElderGroup
(
PlatSpaceQueryDTO
dto
,
boolean
flag
)
{
...
...
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