Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hg-smart
Commits
05f2d2c5
Commit
05f2d2c5
authored
Jun 26, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-06-26 获取登录用户所有角色的公司列表去重复
parent
3bc38b2d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
UserSessionUtils.java
...ava/com/baosight/hggp/core/security/UserSessionUtils.java
+6
-1
No files found.
src/main/java/com/baosight/hggp/core/security/UserSessionUtils.java
View file @
05f2d2c5
...
...
@@ -22,6 +22,7 @@ import java.util.List;
import
java.util.Optional
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -157,7 +158,11 @@ public class UserSessionUtils extends UserSession {
Optional
.
ofNullable
(
companyCodes
).
orElse
(
new
ArrayList
<>()).
stream
().
forEach
(
code
->
{
orgs
.
addAll
(
HGXSTools
.
XsOrg
.
queryByParent
(
code
,
OrgTypeEnum
.
COMPANY
.
getCode
()));
});
return
orgs
.
stream
().
filter
(
o
->
StringUtils
.
equals
(
o
.
getOrgType
(),
OrgTypeEnum
.
COMPANY
.
getCode
())).
map
(
item
->
new
Company
(
item
.
getOrgId
(),
item
.
getOrgCname
())).
collect
(
Collectors
.
toList
());
return
orgs
.
stream
().
filter
(
o
->
StringUtils
.
equals
(
o
.
getOrgType
(),
OrgTypeEnum
.
COMPANY
.
getCode
())).
map
(
item
->
new
Company
(
item
.
getOrgId
(),
item
.
getOrgCname
())).
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toMap
(
Company:
:
getCompanyCode
,
Function
.
identity
(),
(
oldValue
,
newValue
)
->
oldValue
),
// 将Map转回List
m
->
new
ArrayList
<>(
m
.
values
())
));
}
/**
...
...
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