Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
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 e91d8816
authored
Oct 07, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:构建资源树去掉组织
1 parent
f51b511e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
project-user/src/main/java/com/dituhui/pea/user/dao/ResourceDao.java
project-user/src/main/java/com/dituhui/pea/user/service/RoleService.java
project-user/src/main/java/com/dituhui/pea/user/dao/ResourceDao.java
View file @
e91d881
...
@@ -10,26 +10,26 @@ import java.util.List;
...
@@ -10,26 +10,26 @@ import java.util.List;
/**
/**
* 资源表 用户对某种具体权限或者功能的描述(Resource)表数据库访问层
* 资源表 用户对某种具体权限或者功能的描述(Resource)表数据库访问层
*
*/
*/
public
interface
ResourceDao
extends
JpaRepository
<
ResourceEntity
,
String
>,
public
interface
ResourceDao
extends
JpaRepository
<
ResourceEntity
,
String
>,
JpaSpecificationExecutor
<
ResourceEntity
>,
CrudRepository
<
ResourceEntity
,
String
>
{
JpaSpecificationExecutor
<
ResourceEntity
>,
CrudRepository
<
ResourceEntity
,
String
>
{
/**
/**
* 根据IDs查询多个资源
* 根据IDs查询多个资源
*
* @param ids 资源ID集合
* @param ids 资源ID集合
* @return
* @return
*/
*/
List
<
ResourceEntity
>
findByIdIn
(
List
<
String
>
ids
);
List
<
ResourceEntity
>
findByIdIn
(
List
<
String
>
ids
);
/**
/**
* 查询子资源
* 查询子资源
*
*
* @param parentIds
* @param parentIds
* @return
* @return
*/
*/
List
<
ResourceEntity
>
findByParentId
(
String
parentId
);
List
<
ResourceEntity
>
findByParentId
(
String
parentId
);
List
<
ResourceEntity
>
findByTypeNot
(
Integer
type
);
}
}
project-user/src/main/java/com/dituhui/pea/user/service/RoleService.java
View file @
e91d881
...
@@ -279,7 +279,7 @@ public class RoleService {
...
@@ -279,7 +279,7 @@ public class RoleService {
if
(
StringUtils
.
isNotBlank
(
redisValue
))
{
if
(
StringUtils
.
isNotBlank
(
redisValue
))
{
return
JSONObject
.
parseObject
(
redisValue
,
List
.
class
);
return
JSONObject
.
parseObject
(
redisValue
,
List
.
class
);
}
}
List
<
ResourceEntity
>
all
=
resourceDao
.
find
All
(
);
List
<
ResourceEntity
>
all
=
resourceDao
.
find
ByTypeNot
(
3
);
List
<
ResourceInfo
>
collect
=
all
.
stream
().
filter
(
resourceEntity
->
StringUtils
.
isBlank
(
resourceEntity
.
getParentId
())).
map
(
entity
->
BeanUtil
.
copyProperties
(
entity
,
ResourceInfo
.
class
)).
collect
(
Collectors
.
toList
());
List
<
ResourceInfo
>
collect
=
all
.
stream
().
filter
(
resourceEntity
->
StringUtils
.
isBlank
(
resourceEntity
.
getParentId
())).
map
(
entity
->
BeanUtil
.
copyProperties
(
entity
,
ResourceInfo
.
class
)).
collect
(
Collectors
.
toList
());
for
(
ResourceInfo
entity
:
collect
)
{
for
(
ResourceInfo
entity
:
collect
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment