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
80541317
Commit
80541317
authored
Sep 08, 2023
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.5.8-hgw-权限-角色-账号
parent
18e092d7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
3 deletions
+38
-3
SysUserRoleRes.java
.../cloud/plus/v1/yifu/permission/entity/SysUserRoleRes.java
+4
-0
SysUserInfoMapper.java
...fu/cloud/plus/v1/permission/mapper/SysUserInfoMapper.java
+9
-0
SysUserInfoServiceImpl.java
...us/v1/permission/service/impl/SysUserInfoServiceImpl.java
+3
-3
SysUserInfoMapper.xml
...ssion-biz/src/main/resources/mapper/SysUserInfoMapper.xml
+22
-0
No files found.
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/entity/SysUserRoleRes.java
View file @
80541317
...
...
@@ -17,6 +17,7 @@ package com.yifu.cloud.plus.v1.yifu.permission.entity;/*
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
...
...
@@ -63,4 +64,7 @@ public class SysUserRoleRes {
@Schema
(
description
=
"角色ID"
)
private
String
roleId
;
@TableField
(
exist
=
false
)
private
String
roleName
;
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysUserInfoMapper.java
View file @
80541317
...
...
@@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -49,4 +50,12 @@ public interface SysUserInfoMapper extends BaseMapper<SysUserInfo> {
**/
List
<
SysUserInfo
>
getEkpUser
();
List
<
SysUserRoleRes
>
getResAndRoleNameUserId
(
@Param
(
"userId"
)
String
userId
);
List
<
SysUserInfo
>
getAuthByUserAndMenu
(
@Param
(
"menuId"
)
String
menuId
,
@Param
(
"userId"
)
String
userId
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysUserInfoServiceImpl.java
View file @
80541317
...
...
@@ -120,9 +120,7 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs
SysUserInfoSaveVo
vo
=
new
SysUserInfoSaveVo
();
SysUserInfo
user
=
this
.
getById
(
fdId
);
if
(
user
!=
null
&&
Common
.
isNotNull
(
user
.
getFdId
()))
{
SysUserRoleResSearchVo
sysRoleMenuRes
=
new
SysUserRoleResSearchVo
();
sysRoleMenuRes
.
setUserId
(
user
.
getFdId
());
List
<
SysUserRoleRes
>
resList
=
sysUserRoleResService
.
noPageDiy
(
sysRoleMenuRes
);
List
<
SysUserRoleRes
>
resList
=
baseMapper
.
getResAndRoleNameUserId
(
user
.
getFdId
());
vo
.
setUser
(
user
);
if
(
resList
!=
null
&&
!
resList
.
isEmpty
())
{
// 各种角色的权限融合
...
...
@@ -180,6 +178,8 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs
// 测试权限
SysMenu
menu
=
sysMenuService
.
getById
(
menuId
);
if
(
menu
!=
null
)
{
// TODO
baseMapper
.
getAuthByUserAndMenu
(
menuId
,
userId
);
}
...
...
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysUserInfoMapper.xml
View file @
80541317
...
...
@@ -126,4 +126,26 @@
where e.fd_is_available = '1'
</select>
<!--list-->
<select
id=
"getResAndRoleNameUserId"
resultType=
"com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes"
>
SELECT
a.fd_id as fdId
,a.user_id as userId
,a.role_id as roleId
,r.role_name as roleName
FROM sys_user_role_res a
LEFT JOIN sys_role_info r on a.role_id=r.fd_id and r.delete_flag = 0 and r.status = 0
where a.user_id=#{userId}
</select>
<!--list-->
<select
id=
"getAuthByUserAndMenu"
resultMap=
"sysUserInfoMap"
>
SELECT
a.*
FROM sys_user_info a
LEFT JOIN sys_user_role_res res on a.fd_id=res.user_id
LEFT JOIN sys_role_info r on res.role_id=r.fd_id and r.delete_flag = 0 and r.status = 0
where a.fd_id=#{userId} and a.fd_id=#{menuId}
</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