Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
cash-loan-flow-boss
Commits
fd3266f7
Commit
fd3266f7
authored
Dec 07, 2020
by
suntao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户 角色mapping 修改
parent
60ddfd96
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
UserServiceImpl.java
...up/cashloanflowboss/api/user/service/UserServiceImpl.java
+6
-1
Primary.java
...quantgroup/cashloanflowboss/core/persistence/Primary.java
+1
-0
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/user/service/UserServiceImpl.java
View file @
fd3266f7
...
@@ -32,6 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -32,6 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Predicate
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
/**
* Created by WeiWei on 2019/7/22.
* Created by WeiWei on 2019/7/22.
...
@@ -290,6 +291,10 @@ public class UserServiceImpl implements UserService {
...
@@ -290,6 +291,10 @@ public class UserServiceImpl implements UserService {
return
Result
.
buildFail
(
"不存在对应的角色"
);
return
Result
.
buildFail
(
"不存在对应的角色"
);
}
}
Role
role
=
roleRepository
.
getOne
(
roleId
);
Role
role
=
roleRepository
.
getOne
(
roleId
);
List
<
Long
>
idList
=
exist
.
getRoles
().
stream
().
map
(
Role:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
idList
.
contains
(
roleId
))
{
exist
.
getRoles
().
add
(
role
);
}
if
(
roleId
==
1L
)
{
if
(
roleId
==
1L
)
{
// 将普通用户设置成超级管理,需要级联设置用户级别
// 将普通用户设置成超级管理,需要级联设置用户级别
exist
.
setRank
(
UserRank
.
SUPER_ADMINISTRATOR
);
exist
.
setRank
(
UserRank
.
SUPER_ADMINISTRATOR
);
...
@@ -299,7 +304,7 @@ public class UserServiceImpl implements UserService {
...
@@ -299,7 +304,7 @@ public class UserServiceImpl implements UserService {
exist
.
setRank
(
UserRank
.
OPERATOR
);
exist
.
setRank
(
UserRank
.
OPERATOR
);
}
}
}
}
exist
.
setRoles
(
Collections
.
singletonList
(
role
));
}
}
Long
channelId
=
exist
.
getChannelId
();
Long
channelId
=
exist
.
getChannelId
();
...
...
src/main/java/cn/quantgroup/cashloanflowboss/core/persistence/Primary.java
View file @
fd3266f7
...
@@ -15,6 +15,7 @@ public class Primary implements Serializable {
...
@@ -15,6 +15,7 @@ public class Primary implements Serializable {
@Id
@Id
@Column
(
name
=
"id"
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
private
Long
id
;
...
...
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