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
f94df309
Commit
f94df309
authored
Jan 30, 2024
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提供角色类表接口
parent
8138bbb3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
1 deletion
+70
-1
HcmRoleInfoVo.java
...m/yifu.cloud.plus.v1/yifu/admin/api/vo/HcmRoleInfoVo.java
+18
-0
RoleController.java
...u/cloud/plus/v1/yifu/admin/controller/RoleController.java
+14
-1
SysRoleMapper.java
...m/yifu/cloud/plus/v1/yifu/admin/mapper/SysRoleMapper.java
+7
-0
SysRoleService.java
...yifu/cloud/plus/v1/yifu/admin/service/SysRoleService.java
+7
-0
SysRoleServiceImpl.java
...d/plus/v1/yifu/admin/service/impl/SysRoleServiceImpl.java
+10
-0
SysRoleMapper.xml
...yifu-upms-biz/src/main/resources/mapper/SysRoleMapper.xml
+14
-0
No files found.
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/HcmRoleInfoVo.java
0 → 100644
View file @
f94df309
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
HcmRoleInfoVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Schema
(
description
=
"角色编号"
)
private
Long
role_id
;
@Schema
(
description
=
"角色名称"
)
private
String
role_name
;
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/controller/RoleController.java
View file @
f94df309
...
...
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.pig4cloud.plugin.excel.annotation.RequestExcel
;
import
com.pig4cloud.plugin.excel.annotation.ResponseExcel
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.HcmRoleInfoVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysRoleMenuService
;
...
...
@@ -31,9 +32,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.log.annotation.SysLog
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.boot.autoconfigure.integration.IntegrationProperties
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -125,6 +126,18 @@ public class RoleController {
.
eq
(
SysRole:
:
getDelFlag
,
CommonConstants
.
ZERO_STRING
)));
}
/**
* 获取角色列表
* @return 角色列表
*/
@Operation
(
description
=
"HCM获取角色列表"
)
@SysLog
(
"HCM获取角色列表--HCM调用接口"
)
@GetMapping
(
"/getRoleList"
)
public
R
<
List
<
HcmRoleInfoVo
>>
getRoleList
()
{
return
R
.
ok
(
sysRoleService
.
getRoleList
());
}
/**
* 分页查询角色信息
* @param page 分页对象
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/mapper/SysRoleMapper.java
View file @
f94df309
...
...
@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessRoleMenuVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.HcmRoleInfoVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -46,4 +47,10 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
List
<
BusinessRoleMenuVo
>
getRoleAndMenu
(
@Param
(
"type"
)
String
type
);
Set
<
String
>
getRoleByUserIdAndClient
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"clientId"
)
String
clientId
);
/**
* hcm查询角色信息
* @return
*/
List
<
HcmRoleInfoVo
>
getRoleList
();
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/SysRoleService.java
View file @
f94df309
...
...
@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessRoleMenuVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.HcmRoleInfoVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.validation.BindingResult
;
...
...
@@ -58,6 +59,12 @@ public interface SysRoleService extends IService<SysRole> {
*/
List
<
RoleExcelVO
>
listRole
();
/**
* hcm查询全部的角色列表
* @return list
*/
List
<
HcmRoleInfoVo
>
getRoleList
();
Page
<
SysRole
>
getSysRoleByPage
(
Page
page
,
SysRole
sysRole
);
/**
* 更新角色信息
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysRoleServiceImpl.java
View file @
f94df309
...
...
@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRoleMenu
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessRoleMenuVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.HcmRoleInfoVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysRoleMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysRoleMenuMapper
;
...
...
@@ -153,6 +154,15 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
}).
collect
(
Collectors
.
toList
());
}
/**
* hcm查询全部的角色
* @return list
*/
@Override
public
List
<
HcmRoleInfoVo
>
getRoleList
()
{
return
baseMapper
.
getRoleList
();
}
@Override
public
Page
<
SysRole
>
getSysRoleByPage
(
Page
page
,
SysRole
sysRole
)
{
return
baseMapper
.
selectPage
(
page
,
buildQueryWrapper
(
sysRole
));
...
...
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysRoleMapper.xml
View file @
f94df309
...
...
@@ -31,6 +31,11 @@
<result
column=
"update_by"
property=
"updateBy"
/>
</resultMap>
<resultMap
id=
"HcmRoleMap"
type=
"com.yifu.cloud.plus.v1.yifu.admin.api.vo.HcmRoleInfoVo"
>
<result
column=
"role_id"
property=
"role_id"
/>
<result
column=
"role_name"
property=
"role_name"
/>
</resultMap>
<!-- 通过用户ID,查询角色信息-->
<select
id=
"listRolesByUserId"
resultMap=
"BaseResultMap"
>
SELECT r.role_id,
...
...
@@ -74,4 +79,13 @@
left join sys_role b on a.role_id = b.role_id
where a.user_id = #{userId} and b.client_id = #{clientId} and b.del_flag = '0'
</select>
<select
id=
"getRoleList"
resultMap=
"HcmRoleMap"
>
SELECT
a.role_id,
a.role_name
FROM
sys_role a
where a.client_id = 'yifu-mvp' 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