Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
4de4763b
Commit
4de4763b
authored
Dec 06, 2021
by
疯狂的狮子li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 优化查询用户的角色组、岗位组代码
parent
2c3f1c28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
...ava/com/ruoyi/system/service/impl/SysUserServiceImpl.java
+9
-16
No files found.
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
View file @
4de4763b
...
...
@@ -2,6 +2,8 @@ package com.ruoyi.system.service.impl;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -25,6 +27,7 @@ import com.ruoyi.system.mapper.SysUserPostMapper;
import
com.ruoyi.system.mapper.SysUserRoleMapper
;
import
com.ruoyi.system.service.ISysConfigService
;
import
com.ruoyi.system.service.ISysUserService
;
import
org.springframework.util.CollectionUtils
;
/**
* 用户 业务层处理
...
...
@@ -127,16 +130,11 @@ public class SysUserServiceImpl implements ISysUserService
public
String
selectUserRoleGroup
(
String
userName
)
{
List
<
SysRole
>
list
=
roleMapper
.
selectRolesByUserName
(
userName
);
StringBuffer
idsStr
=
new
StringBuffer
();
for
(
SysRole
role
:
list
)
{
idsStr
.
append
(
role
.
getRoleName
()).
append
(
","
);
}
if
(
StringUtils
.
isNotEmpty
(
idsStr
.
toString
()))
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
idsStr
.
substring
(
0
,
idsStr
.
length
()
-
1
)
;
return
StringUtils
.
EMPTY
;
}
return
idsStr
.
toString
(
);
return
list
.
stream
().
map
(
SysRole:
:
getRoleName
).
collect
(
Collectors
.
joining
(
","
)
);
}
/**
...
...
@@ -149,16 +147,11 @@ public class SysUserServiceImpl implements ISysUserService
public
String
selectUserPostGroup
(
String
userName
)
{
List
<
SysPost
>
list
=
postMapper
.
selectPostsByUserName
(
userName
);
StringBuffer
idsStr
=
new
StringBuffer
();
for
(
SysPost
post
:
list
)
{
idsStr
.
append
(
post
.
getPostName
()).
append
(
","
);
}
if
(
StringUtils
.
isNotEmpty
(
idsStr
.
toString
()))
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
idsStr
.
substring
(
0
,
idsStr
.
length
()
-
1
)
;
return
StringUtils
.
EMPTY
;
}
return
idsStr
.
toString
(
);
return
list
.
stream
().
map
(
SysPost:
:
getPostName
).
collect
(
Collectors
.
joining
(
","
)
);
}
/**
...
...
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