Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
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
daa119d8
authored
Nov 01, 2023
by
李小龙
Committed by
huangjy
Nov 08, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:29939 平台端-人员管理-导入:导入的角色要与组织相关联,非组织的角色需要提示,不允许导入成功
parent
af264d7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatUserServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatUserServiceImpl.java
View file @
daa119d8
...
@@ -1133,10 +1133,11 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
...
@@ -1133,10 +1133,11 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
orgLambdaQueryWrapper
.
select
(
BaseEntity:
:
getId
,
PlatOrg:
:
getName
);
orgLambdaQueryWrapper
.
select
(
BaseEntity:
:
getId
,
PlatOrg:
:
getName
);
List
<
PlatOrg
>
orgList
=
platOrgService
.
list
(
orgLambdaQueryWrapper
);
List
<
PlatOrg
>
orgList
=
platOrgService
.
list
(
orgLambdaQueryWrapper
);
LambdaQueryWrapper
<
PlatRole
>
roleLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PlatRole
>
roleLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
roleLambdaQueryWrapper
.
select
(
BaseEntity:
:
getId
,
PlatRole:
:
getName
);
roleLambdaQueryWrapper
.
select
(
BaseEntity:
:
getId
,
PlatRole:
:
getName
,
PlatRole:
:
getOrgId
);
List
<
PlatRole
>
roleList
=
platRoleService
.
list
(
roleLambdaQueryWrapper
);
List
<
PlatRole
>
roleList
=
platRoleService
.
list
(
roleLambdaQueryWrapper
);
Map
<
String
,
PlatOrg
>
orgNameMap
=
orgList
.
stream
().
collect
(
Collectors
.
toMap
(
PlatOrg:
:
getName
,
vo
->
vo
,
(
a
,
b
)
->
a
));
Map
<
String
,
PlatOrg
>
orgNameMap
=
orgList
.
stream
().
collect
(
Collectors
.
toMap
(
PlatOrg:
:
getName
,
vo
->
vo
,
(
a
,
b
)
->
a
));
Map
<
String
,
String
>
roleNameMap
=
roleList
.
stream
().
collect
(
Collectors
.
toMap
(
PlatRole:
:
getName
,
BaseEntity:
:
getId
,
(
a
,
b
)
->
a
));
//要区分每个组织下的角色
Map
<
String
,
String
>
roleNameMap
=
roleList
.
stream
().
collect
(
Collectors
.
toMap
(
vo
->
vo
.
getOrgId
()+
vo
.
getName
(),
BaseEntity:
:
getId
,
(
a
,
b
)
->
a
));
LambdaQueryWrapper
<
PlatUser
>
userLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PlatUser
>
userLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
userLambdaQueryWrapper
.
select
(
PlatUser:
:
getMobile
,
PlatUser:
:
getEmail
,
BaseEntity:
:
getId
);
userLambdaQueryWrapper
.
select
(
PlatUser:
:
getMobile
,
PlatUser:
:
getEmail
,
BaseEntity:
:
getId
);
...
@@ -1155,7 +1156,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
...
@@ -1155,7 +1156,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
ExcelErrorVo
.
isNotNull
(
dto
.
getOrgName
(),
errorVoList
,
start
+
i
,
"*所属组织"
);
ExcelErrorVo
.
isNotNull
(
dto
.
getOrgName
(),
errorVoList
,
start
+
i
,
"*所属组织"
);
PlatOrg
platOrg
=
Optional
.
ofNullable
(
orgNameMap
.
get
(
dto
.
getOrgName
())).
orElse
(
new
PlatOrg
());
PlatOrg
platOrg
=
Optional
.
ofNullable
(
orgNameMap
.
get
(
dto
.
getOrgName
())).
orElse
(
new
PlatOrg
());
ExcelErrorVo
.
notExists
(
platOrg
.
getId
(),
errorVoList
,
start
+
i
,
"*所属组织"
);
ExcelErrorVo
.
notExists
(
platOrg
.
getId
(),
errorVoList
,
start
+
i
,
"*所属组织"
);
ExcelErrorVo
.
notExists
(
roleNameMap
.
get
(
dto
.
getRoleName
()),
errorVoList
,
start
+
i
,
"*角色"
);
ExcelErrorVo
.
notExists
(
roleNameMap
.
get
(
platOrg
.
getId
()+
dto
.
getRoleName
()),
errorVoList
,
start
+
i
,
"*角色"
);
ExcelErrorVo
.
exists
(
mobileMap
,
dto
.
getMobile
(),
errorVoList
,
start
+
i
,
"手机号*"
);
ExcelErrorVo
.
exists
(
mobileMap
,
dto
.
getMobile
(),
errorVoList
,
start
+
i
,
"手机号*"
);
ExcelErrorVo
.
exists
(
emailMap
,
dto
.
getEmail
(),
errorVoList
,
start
+
i
,
"邮箱"
);
ExcelErrorVo
.
exists
(
emailMap
,
dto
.
getEmail
(),
errorVoList
,
start
+
i
,
"邮箱"
);
}
}
...
@@ -1176,7 +1177,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
...
@@ -1176,7 +1177,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
platUsers
.
add
(
platUser
);
platUsers
.
add
(
platUser
);
PlatUserRole
platUserRole
=
new
PlatUserRole
();
PlatUserRole
platUserRole
=
new
PlatUserRole
();
platUserRole
.
setUserId
(
platUser
.
getId
());
platUserRole
.
setUserId
(
platUser
.
getId
());
String
roleId
=
roleNameMap
.
get
(
vo
.
getRoleName
());
String
roleId
=
roleNameMap
.
get
(
platOrg
.
getId
()+
vo
.
getRoleName
());
platUserRole
.
setRoleId
(
roleId
);
platUserRole
.
setRoleId
(
roleId
);
platUserRoles
.
add
(
platUserRole
);
platUserRoles
.
add
(
platUserRole
);
});
});
...
...
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