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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 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,13 +10,13 @@ import java.util.List;
/**
* 资源表 用户对某种具体权限或者功能的描述(Resource)表数据库访问层
*
*/
public
interface
ResourceDao
extends
JpaRepository
<
ResourceEntity
,
String
>,
JpaSpecificationExecutor
<
ResourceEntity
>,
CrudRepository
<
ResourceEntity
,
String
>
{
/**
* 根据IDs查询多个资源
*
* @param ids 资源ID集合
* @return
*/
...
...
@@ -31,5 +31,5 @@ public interface ResourceDao extends JpaRepository<ResourceEntity, String>,
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 {
if
(
StringUtils
.
isNotBlank
(
redisValue
))
{
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
());
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