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
552f41fe
Commit
552f41fe
authored
Sep 08, 2023
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.5.8-hgw-权限-角色-账号
parent
567d6873
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
105 additions
and
2 deletions
+105
-2
SysRoleInfoController.java
.../plus/v1/permission/controller/SysRoleInfoController.java
+13
-0
SysUserInfoController.java
.../plus/v1/permission/controller/SysUserInfoController.java
+14
-0
SysRoleInfoMapper.java
...fu/cloud/plus/v1/permission/mapper/SysRoleInfoMapper.java
+23
-0
SysRoleInfoService.java
.../cloud/plus/v1/permission/service/SysRoleInfoService.java
+9
-0
SysUserInfoService.java
.../cloud/plus/v1/permission/service/SysUserInfoService.java
+3
-1
SysRoleInfoServiceImpl.java
...us/v1/permission/service/impl/SysRoleInfoServiceImpl.java
+17
-0
SysUserInfoServiceImpl.java
...us/v1/permission/service/impl/SysUserInfoServiceImpl.java
+15
-1
SysRoleInfoMapper.xml
...ssion-biz/src/main/resources/mapper/SysRoleInfoMapper.xml
+11
-0
No files found.
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/controller/SysRoleInfoController.java
View file @
552f41fe
...
...
@@ -74,6 +74,19 @@ public class SysRoleInfoController {
return
sysRoleInfoService
.
getInfoById
(
fdId
);
}
/**
* @param roleIdList 角色列表
* @Description: 给前端使用:根据角色id组合获取角色权限
* @Author: hgw
* @Date: 2023/9/8 9:29
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo>
**/
@Operation
(
summary
=
"给前端使用:根据角色id组合获取角色权限"
,
description
=
"给前端使用:根据角色id组合获取角色权限"
)
@PostMapping
(
"/getRoleDataAuthByRoleId"
)
public
R
<
String
>
getRoleDataAuthByRoleId
(
@RequestBody
List
<
String
>
roleIdList
)
{
return
R
.
ok
(
sysRoleInfoService
.
getRoleDataAuthByRoleId
(
roleIdList
));
}
/**
* 新增新权限-角色表
*
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/controller/SysUserInfoController.java
View file @
552f41fe
...
...
@@ -141,4 +141,18 @@ public class SysUserInfoController {
sysUserInfoService
.
doRefreshEkpUser
();
}
/**
* @Description: 手动同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/5 16:14
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation
(
summary
=
"测试权限sql"
,
description
=
"测试权限sql"
)
@SysLog
(
"测试权限sql"
)
@PostMapping
(
"/testPermission"
)
public
R
<
String
>
testPermission
(
@RequestParam
String
menuId
,
@RequestParam
(
required
=
false
)
String
userId
)
{
sysUserInfoService
.
testPermission
(
menuId
,
userId
);
return
R
.
ok
();
}
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysRoleInfoMapper.java
View file @
552f41fe
...
...
@@ -41,8 +41,31 @@ public interface SysRoleInfoMapper extends BaseMapper<SysRoleInfo> {
*/
IPage
<
SysRoleInfo
>
getSysRoleInfoPage
(
Page
<
SysRoleInfo
>
page
,
@Param
(
"sysRoleInfo"
)
SysRoleInfoSearchVo
sysRoleInfo
);
/**
* @Description: 给前端使用:根据角色id组合获取角色权限
* @Author: hgw
* @Date: 2023/9/8 9:21
* @return: java.util.List<java.lang.String>
**/
List
<
String
>
getRoleDataAuthByRoleId
(
@Param
(
"roleIdList"
)
List
<
String
>
roleIdList
);
/**
* @param userId
* @Description: 获取账号的所有权限
* @Author: hgw
* @Date: 2023/9/8 9:22
* @return: java.util.List<java.lang.String>
**/
List
<
String
>
getAllRoleDataAuthByUserId
(
@Param
(
"userId"
)
String
userId
);
/**
* @param roleName
* @param roleId
* @Description: 查找名称是否存在
* @Author: hgw
* @Date: 2023/9/8 9:22
* @return: int
**/
int
checkExistenceRole
(
@Param
(
"roleName"
)
String
roleName
,
@Param
(
"roleId"
)
String
roleId
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/SysRoleInfoService.java
View file @
552f41fe
...
...
@@ -69,4 +69,13 @@ public interface SysRoleInfoService extends IService<SysRoleInfo> {
**/
String
getAllRoleDataAuthByUserId
(
String
userId
);
/**
* @param roleIdList
* @Description: 给前端使用:根据角色id组合获取角色权限
* @Author: hgw
* @Date: 2023/9/8 9:25
* @return: java.lang.String
**/
String
getRoleDataAuthByRoleId
(
List
<
String
>
roleIdList
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/SysUserInfoService.java
View file @
552f41fe
...
...
@@ -20,7 +20,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSaveVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSearchVo
;
...
...
@@ -69,4 +68,7 @@ public interface SysUserInfoService extends IService<SysUserInfo> {
* @return: void
**/
void
doRefreshEkpUser
();
void
testPermission
(
String
menuId
,
String
userId
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysRoleInfoServiceImpl.java
View file @
552f41fe
...
...
@@ -137,6 +137,23 @@ public class SysRoleInfoServiceImpl extends ServiceImpl<SysRoleInfoMapper, SysRo
@Override
public
String
getAllRoleDataAuthByUserId
(
String
userId
)
{
List
<
String
>
authList
=
baseMapper
.
getAllRoleDataAuthByUserId
(
userId
);
return
this
.
getAuths
(
authList
);
}
/**
* @param roleIdList
* @Description: 给前端使用:根据角色id组合获取角色权限
* @Author: hgw
* @Date: 2023/9/8 9:25
* @return: java.lang.String
**/
@Override
public
String
getRoleDataAuthByRoleId
(
List
<
String
>
roleIdList
)
{
List
<
String
>
authList
=
baseMapper
.
getRoleDataAuthByRoleId
(
roleIdList
);
return
this
.
getAuths
(
authList
);
}
private
String
getAuths
(
List
<
String
>
authList
)
{
StringBuilder
auths
=
new
StringBuilder
();
if
(
authList
!=
null
&&
!
authList
.
isEmpty
())
{
String
[]
authArr
;
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysUserInfoServiceImpl.java
View file @
552f41fe
...
...
@@ -22,13 +22,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.permission.mapper.SysUserInfoMapper
;
import
com.yifu.cloud.plus.v1.permission.service.SysMenuService
;
import
com.yifu.cloud.plus.v1.permission.service.SysRoleInfoService
;
import
com.yifu.cloud.plus.v1.permission.service.SysUserInfoService
;
import
com.yifu.cloud.plus.v1.permission.service.SysUserRoleResService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.Sys
RoleMenuRes
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.Sys
Menu
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo
;
...
...
@@ -171,4 +172,17 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs
this
.
saveOrUpdateBatch
(
ekpUser
);
}
private
final
SysMenuService
sysMenuService
;
@Override
public
void
testPermission
(
String
menuId
,
String
userId
)
{
// 测试权限
SysMenu
menu
=
sysMenuService
.
getById
(
menuId
);
if
(
menu
!=
null
)
{
}
}
}
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysRoleInfoMapper.xml
View file @
552f41fe
...
...
@@ -113,6 +113,17 @@
where a.delete_flag = 0 and r.user_id = #{userId}
</select>
<!-- 根据角色Id获取所有的角色的权限-->
<select
id=
"getRoleDataAuthByRoleId"
resultType=
"java.lang.String"
>
SELECT
a.data_auth
FROM sys_role_info a
where a.delete_flag = 0 and a.fd_id in
<foreach
item=
"idStr"
index=
"index"
collection=
"roleIdList"
open=
"("
separator=
","
close=
")"
>
#{idStr}
</foreach>
</select>
<!-- 查找名称是否存在-->
<select
id=
"checkExistenceRole"
resultType=
"java.lang.Integer"
>
SELECT
...
...
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