Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
aaa553b3
Commit
aaa553b3
authored
Jul 30, 2025
by
yangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(编辑企业信息): 新增手动刷新用户组的接口
parent
ee96ab85
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
TzsUserInfoServiceImpl.java
...t/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
+54
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
View file @
aaa553b3
...
@@ -2405,6 +2405,58 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
...
@@ -2405,6 +2405,58 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}
}
}
}
public
void
refreshAdminUserRole
(
List
<
TzsUserInfo
>
userInfos
,
List
<
String
>
userId
)
{
List
<
String
>
adminUserIdList
;
if
(
ValidationUtil
.
isEmpty
(
userInfos
))
{
adminUserIdList
=
userId
;
}
else
{
List
<
String
>
amosUserIdList
=
userInfos
.
stream
().
map
(
TzsUserInfo:
:
getAmosUserId
).
collect
(
Collectors
.
toList
());
adminUserIdList
=
userId
.
stream
().
filter
(
id
->
!
amosUserIdList
.
contains
(
id
)).
collect
(
Collectors
.
toList
());
}
List
<
RegUnitInfo
>
regUnitInfos
=
regUnitInfoService
.
lambdaQuery
().
in
(
RegUnitInfo:
:
getAdminUserId
,
adminUserIdList
).
list
();
for
(
RegUnitInfo
regUnitInfo
:
regUnitInfos
)
{
String
useCode
=
regUnitInfo
.
getUnitCode
();
CompanyModel
companyInfo
=
Privilege
.
companyClient
.
queryByCompanyCode
(
useCode
).
getResult
();
Set
<
String
>
appCodesSet
=
new
HashSet
<>();
Map
<
Long
,
List
<
Long
>>
roleSeqMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
Set
<
String
>
roleNameSet
=
new
HashSet
<>();
FeignClientResult
<
List
<
RoleModel
>>
roleListResult
=
Privilege
.
roleClient
.
queryRoleList
(
null
,
null
);
List
<
RoleModel
>
roleModels
=
roleListResult
.
getResult
();
List
<
DataDictionary
>
unitTypeList
=
regUnitInfoService
.
setAndGetUnitTypeList
();
String
[]
unitTypeCodes
=
regUnitInfo
.
getUnitTypeCode
().
split
(
","
);
FeignClientResult
<
AgencyUserModel
>
userResult
=
Privilege
.
agencyUserClient
.
queryByUserId
(
regUnitInfo
.
getAdminUserId
());
AgencyUserModel
agencyUserModel
=
userResult
.
getResult
();
Map
<
String
,
DataDictionary
>
dataDictionaryMap
=
unitTypeList
.
stream
().
collect
(
Collectors
.
toMap
(
DataDictionary:
:
getCode
,
Function
.
identity
(),
(
k1
,
k2
)
->
k1
));
for
(
String
typeCode
:
unitTypeCodes
)
{
DataDictionary
unitType
=
dataDictionaryMap
.
get
(
typeCode
);
String
appCode
=
unitType
.
getTypeDesc
()
!=
null
?
unitType
.
getTypeDesc
()
:
""
;
String
[]
appCodes
=
appCode
.
split
(
","
);
Collections
.
addAll
(
appCodesSet
,
appCodes
);
roleNameSet
.
add
(
unitType
.
getName
());
userRoleList
.
addAll
(
roleModels
.
stream
()
.
filter
(
r
->
unitType
.
getExtend
().
contains
(
r
.
getSequenceNbr
().
toString
())).
collect
(
Collectors
.
toList
()));
userRoleList
.
forEach
(
r
->
{
if
(!
roleIds
.
contains
(
r
.
getSequenceNbr
()))
{
roleIds
.
add
(
r
.
getSequenceNbr
());
}
});
roleSeqMap
.
put
(
companyInfo
.
getSequenceNbr
(),
roleIds
);
orgRoles
.
put
(
companyInfo
.
getSequenceNbr
(),
userRoleList
);
}
agencyUserModel
.
setAppCodes
(
new
ArrayList
<>(
appCodesSet
));
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqMap
);
userResult
=
Privilege
.
agencyUserClient
.
update
(
agencyUserModel
,
regUnitInfo
.
getAdminUserId
());
System
.
out
.
println
(
userResult
);
}
}
public
void
refreshUserGroupInfo
(
List
<
String
>
userId
)
{
public
void
refreshUserGroupInfo
(
List
<
String
>
userId
)
{
if
(
ObjectUtils
.
isEmpty
(
userId
))
{
if
(
ObjectUtils
.
isEmpty
(
userId
))
{
return
;
return
;
...
@@ -2412,9 +2464,11 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
...
@@ -2412,9 +2464,11 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
// 根据userId获取用户
// 根据userId获取用户
List
<
TzsUserInfo
>
userInfos
=
tzsUserInfoMapper
.
selectList
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
List
<
TzsUserInfo
>
userInfos
=
tzsUserInfoMapper
.
selectList
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
in
(
TzsUserInfo:
:
getAmosUserId
,
userId
));
.
in
(
TzsUserInfo:
:
getAmosUserId
,
userId
));
refreshAdminUserRole
(
userInfos
,
userId
);
if
(
ObjectUtils
.
isEmpty
(
userInfos
))
{
if
(
ObjectUtils
.
isEmpty
(
userInfos
))
{
return
;
return
;
}
}
List
<
String
>
unitCodes
=
userInfos
.
stream
().
map
(
TzsUserInfo:
:
getUnitCode
).
collect
(
Collectors
.
toList
());
List
<
String
>
unitCodes
=
userInfos
.
stream
().
map
(
TzsUserInfo:
:
getUnitCode
).
collect
(
Collectors
.
toList
());
List
<
RegUnitInfo
>
regUnitInfos
=
regUnitInfoService
.
lambdaQuery
().
in
(
RegUnitInfo:
:
getUnitCode
,
unitCodes
).
list
();
List
<
RegUnitInfo
>
regUnitInfos
=
regUnitInfoService
.
lambdaQuery
().
in
(
RegUnitInfo:
:
getUnitCode
,
unitCodes
).
list
();
...
...
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