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
cfcd372d
Commit
cfcd372d
authored
Feb 26, 2025
by
chenyuxi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 权限相关接口
parent
311670c8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
1 deletion
+40
-1
SysUserDeptPermission.java
....plus.v1/yifu/admin/api/entity/SysUserDeptPermission.java
+1
-1
UserDeptPermissionController.java
...1/yifu/admin/controller/UserDeptPermissionController.java
+20
-0
SysUserDeptPermissionService.java
...s/v1/yifu/admin/service/SysUserDeptPermissionService.java
+10
-0
SysUserDeptPermissionServiceImpl.java
.../admin/service/impl/SysUserDeptPermissionServiceImpl.java
+9
-0
No files found.
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysUserDeptPermission.java
View file @
cfcd372d
...
...
@@ -57,7 +57,7 @@ public class SysUserDeptPermission extends Model<SysUserDeptPermission> {
@Schema
(
description
=
"关联项目名称"
)
private
String
projectName
;
@Schema
(
description
=
"归属系统
0 mvp 1 甲方客户端
"
)
@Schema
(
description
=
"归属系统
yifu-mvp、yifu-csp
"
)
private
String
client
;
@NotBlank
(
message
=
"账号类型 不能为空"
)
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/controller/UserDeptPermissionController.java
View file @
cfcd372d
...
...
@@ -50,6 +50,23 @@ public class UserDeptPermissionController {
private
final
SysUserDeptPermissionService
sysUserDeptPermissionService
;
/**
* 客户服务平台——获取用户权限
* @param sysUserDeptPermission 实体
* @return success/false
*/
@SysLog
(
"客户服务平台——用户权限控制"
)
@PostMapping
(
"/info"
)
public
R
<
SysUserDeptPermission
>
getInfo
(
@RequestBody
SysUserDeptPermission
sysUserDeptPermission
)
{
if
(
Common
.
isEmpty
(
sysUserDeptPermission
.
getProjectNo
())){
R
.
failed
(
"项目编码不能为空"
);
}
if
(
Common
.
isEmpty
(
sysUserDeptPermission
.
getUserId
())){
R
.
failed
(
"用户ID不能为空"
);
}
return
R
.
ok
(
sysUserDeptPermissionService
.
getInfo
(
sysUserDeptPermission
.
getProjectNo
(),
sysUserDeptPermission
.
getUserId
()));
}
/**
* 客户服务平台——用户权限控制
* @param sysUserDeptPermission 实体
...
...
@@ -86,6 +103,9 @@ public class UserDeptPermissionController {
if
(
Common
.
isEmpty
(
sysUserDeptPermission
.
getProjectNo
())){
R
.
failed
(
"项目编码不能为空"
);
}
if
(
Common
.
isEmpty
(
sysUserDeptPermission
.
getProjectName
())){
R
.
failed
(
"项目名称不能为空"
);
}
if
(
Common
.
isEmpty
(
sysUserDeptPermission
.
getUserId
())){
R
.
failed
(
"用户ID不能为空"
);
}
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/SysUserDeptPermissionService.java
View file @
cfcd372d
...
...
@@ -34,6 +34,16 @@ import java.util.Map;
*/
public
interface
SysUserDeptPermissionService
extends
IService
<
SysUserDeptPermission
>
{
/**
* 项目下用户数据权限
* @param projectNo 项目编号
* @param userId 用户ID
*
* @return UserPermissionVo 用户在指定项目下的权限
*/
SysUserDeptPermission
getInfo
(
String
projectNo
,
String
userId
);
/**
* 项目下用户数据权限
* @param projectNo 项目编号
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysUserDeptPermissionServiceImpl.java
View file @
cfcd372d
...
...
@@ -63,6 +63,15 @@ public class SysUserDeptPermissionServiceImpl extends ServiceImpl<SysUserDeptPer
private
static
final
PasswordEncoder
ENCODER
=
new
BCryptPasswordEncoder
();
@Override
public
SysUserDeptPermission
getInfo
(
String
projectNo
,
String
userId
)
{
LambdaQueryWrapper
<
SysUserDeptPermission
>
permissionQuery
=
Wrappers
.<
SysUserDeptPermission
>
lambdaQuery
()
.
eq
(
SysUserDeptPermission:
:
getUserId
,
userId
)
.
eq
(
SysUserDeptPermission:
:
getProjectNo
,
projectNo
)
.
last
(
" limit 1 "
);
return
baseMapper
.
selectOne
(
permissionQuery
);
}
@Override
public
UserPermissionVo
getUserPermissionVo
(
String
projectNo
,
String
userId
)
{
UserPermissionVo
authority
=
new
UserPermissionVo
();
...
...
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