Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
ab0cc9fe
Commit
ab0cc9fe
authored
Mar 04, 2025
by
chenyuxi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 部门添加清除缓存
parent
1e74e2d5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
SysUserMapper.java
...m/yifu/cloud/plus/v1/yifu/admin/mapper/SysUserMapper.java
+2
-0
SysDeptServiceImpl.java
...d/plus/v1/yifu/admin/service/impl/SysDeptServiceImpl.java
+3
-2
SysUserMapper.xml
...yifu-upms-biz/src/main/resources/mapper/SysUserMapper.xml
+8
-0
No files found.
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/mapper/SysUserMapper.java
View file @
ab0cc9fe
...
...
@@ -105,4 +105,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
@Param
(
"projectNo"
)
String
projectNo
);
List
<
String
>
getCspUserByDeptId
(
@Param
(
"deptId"
)
String
deptId
);
List
<
String
>
getCspUserByProjectNo
(
@Param
(
"projectNo"
)
String
projectNo
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysDeptServiceImpl.java
View file @
ab0cc9fe
...
...
@@ -511,8 +511,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
}
dept
.
setClient
(
ClientNameConstants
.
CLIENT_CSP
);
this
.
save
(
dept
);
// 清理用户权限,重新获取用户的部门权限
List
<
String
>
userNames
=
sysUserMapper
.
getCspUserByDeptId
(
dept
.
getDeptId
().
toString
());
// 清理用户权限,重新获取项目下的用户的部门权限
List
<
String
>
userNames
=
sysUserMapper
.
getCspUserByProjectNo
(
dept
.
getProjectNo
());
if
(
Common
.
isNotNull
(
userNames
)){
for
(
String
us:
userNames
){
redisUtil
.
remove
(
CacheConstants
.
USER_DETAILS
+
"::"
+
us
);
...
...
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysUserMapper.xml
View file @
ab0cc9fe
...
...
@@ -448,4 +448,12 @@
where c.project_no in (SELECT project_no from sys_user_dept_permission where dept_id=#{deptId})
) and a.del_flag='0'
</select>
<select
id=
"getCspUserByProjectNo"
resultType=
"java.lang.String"
>
SELECT a.username from sys_user a
where a.user_id in (
select c.user_id from sys_user_dept_permission c
where c.project_no in (#{projectNo})
) and a.del_flag='0'
</select>
</mapper>
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