Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huang.tao
/
jmai-platform
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
bfe2c0d7
authored
Dec 26, 2025
by
zhu.zewen
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复用户部门
parent
db633520
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
jmai-sys/src/main/java/com/jmai/sys/dto/FullUserDto.java
jmai-sys/src/main/java/com/jmai/sys/dto/PageReq.java
jmai-sys/src/main/java/com/jmai/sys/service/impl/UserServiceImpl.java
jmai-sys/src/main/java/com/jmai/sys/dto/FullUserDto.java
View file @
bfe2c0d7
...
...
@@ -17,6 +17,9 @@ import static com.jmai.sys.service.UserService.KEY_ALL;
@Data
@ApiModel
(
description
=
"用户信息"
)
public
class
FullUserDto
extends
UserDto
implements
IDataPerms
{
@ApiModelProperty
(
value
=
"组织名称"
)
private
String
deptName
;
@ApiModelProperty
(
value
=
"授权组织(编号)列表(逗号隔开)"
)
private
String
authDeptIdList
;
@ApiModelProperty
(
value
=
"授权组织(名称)列表(逗号隔开)"
)
...
...
jmai-sys/src/main/java/com/jmai/sys/dto/PageReq.java
View file @
bfe2c0d7
...
...
@@ -5,8 +5,8 @@ import lombok.Data;
@Data
public
class
PageReq
extends
BaseReq
{
@ApiModelProperty
(
value
=
"页码"
,
notes
=
"默认页码为1"
)
@ApiModelProperty
(
value
=
"页码"
,
notes
=
"默认页码为1"
,
example
=
"1"
)
private
Integer
pageNo
=
1
;
@ApiModelProperty
(
value
=
"大小"
,
notes
=
"默认分页大小为10"
)
@ApiModelProperty
(
value
=
"大小"
,
notes
=
"默认分页大小为10"
,
example
=
"10"
)
private
Integer
pageSize
=
10
;
}
jmai-sys/src/main/java/com/jmai/sys/service/impl/UserServiceImpl.java
View file @
bfe2c0d7
...
...
@@ -122,7 +122,10 @@ public class UserServiceImpl extends AbstractService implements UserService {
// 填充组织
List
<
Long
>
deptIdList
=
dtoList
.
stream
()
.
flatMap
(
user
->
user
.
getAuthDeptAsList
().
stream
())
.
flatMap
(
user
->
Stream
.
concat
(
Stream
.
of
(
user
.
getDeptId
()),
user
.
getAuthDeptAsList
().
stream
()
))
.
filter
(
ObjectUtil:
:
isNotEmpty
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
...
...
@@ -135,6 +138,8 @@ public class UserServiceImpl extends AbstractService implements UserService {
Map
<
Long
,
RoleTypeDTO
>
roleMap
=
roles
.
stream
().
collect
(
Collectors
.
toMap
(
RoleTypeDTO:
:
getId
,
Function
.
identity
()));
dtoList
.
forEach
(
dto
->
{
dto
.
setDeptName
(
extractDeptNameList
(
Optional
.
ofNullable
(
dto
.
getDeptId
()).
map
(
Object:
:
toString
).
orElse
(
""
),
deptMap
));
dto
.
setAuthDeptIdList
(
extractDeptIdList
(
dto
.
getAuthDeptList
(),
deptMap
));
dto
.
setAuthDeptNameList
(
extractDeptNameList
(
dto
.
getAuthDeptList
(),
deptMap
));
...
...
@@ -287,7 +292,7 @@ public class UserServiceImpl extends AbstractService implements UserService {
// 按组织ID列表查询
List
<
Long
>
deptList
=
extractLongList
(
req
.
getDeptList
());
query
.
eq
(
ObjectUtil
.
isNotEmpty
(
deptList
),
SysUser:
:
getDeptId
,
deptList
.
get
(
0
)
);
query
.
in
(
ObjectUtil
.
isNotEmpty
(
deptList
),
SysUser:
:
getDeptId
,
deptList
);
// 按角色ID列表查询
List
<
Long
>
roleList
=
extractLongList
(
req
.
getRoleList
());
...
...
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