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
b9b4e623
Commit
b9b4e623
authored
Nov 01, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限优化-同一个人不能重复加
parent
92bffdfd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
TCutsomerDataPermissonController.java
...archives/controller/TCutsomerDataPermissonController.java
+17
-7
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TCutsomerDataPermissonController.java
View file @
b9b4e623
...
...
@@ -3,10 +3,12 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCutsomerDataPermisson
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TCutsomerDataPermissonService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService
;
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.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
...
...
@@ -82,10 +84,9 @@ public class TCutsomerDataPermissonController {
**/
@Operation
(
description
=
"权限复制 权限同项目分配客服(wxhr:tsettledomain_assign_customerservice)"
)
@GetMapping
(
"/copy"
)
//@PreAuthorize("@pms.hasPermission('tsettledomain_assign_customerservice')")
public
R
<
String
>
insertForCopyCutsomerDataPermisson
(
String
[]
srcUser
,
String
[]
beUser
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
R
result
=
tCutsomerDataPermissonService
.
insertForCopyCutsomerDataPermisson
(
srcUser
,
beUser
,
user
);
R
<
String
>
result
=
tCutsomerDataPermissonService
.
insertForCopyCutsomerDataPermisson
(
srcUser
,
beUser
,
user
);
if
(
CommonConstants
.
SUCCESS
.
equals
(
result
.
getCode
())){
//权限刷新
settleDomainService
.
removeSettleCache
(
user
,
Arrays
.
asList
(
beUser
));
}
...
...
@@ -111,11 +112,22 @@ public class TCutsomerDataPermissonController {
@Operation
(
description
=
"新增"
)
@SysLog
(
"新增客户数据权限表"
)
@PostMapping
//@PreAuthorize("@pms.hasPermission('tcutsomerdatapermisson_add')")
public
R
<
Boolean
>
save
(
@RequestBody
TCutsomerDataPermisson
tCutsomerDataPermisson
){
public
R
<
String
>
save
(
@RequestBody
TCutsomerDataPermisson
tCutsomerDataPermisson
){
YifuUser
user
=
SecurityUtils
.
getUser
();
settleDomainService
.
removeSettleCache
(
user
,
Arrays
.
asList
(
tCutsomerDataPermisson
.
getUserId
()));
return
new
R
<>(
tCutsomerDataPermissonService
.
save
(
tCutsomerDataPermisson
));
if
(
Common
.
isNotNull
(
tCutsomerDataPermisson
.
getUserId
())
&&
Common
.
isNotNull
(
tCutsomerDataPermisson
.
getSettleDomainId
()))
{
List
<
TCutsomerDataPermisson
>
list
=
tCutsomerDataPermissonService
.
list
(
Wrappers
.<
TCutsomerDataPermisson
>
query
().
lambda
()
.
eq
(
TCutsomerDataPermisson:
:
getUserId
,
tCutsomerDataPermisson
.
getUserId
())
.
eq
(
TCutsomerDataPermisson:
:
getSettleDomainId
,
tCutsomerDataPermisson
.
getSettleDomainId
())
);
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
return
R
.
failed
(
"该用户已存在该项目"
);
}
tCutsomerDataPermissonService
.
save
(
tCutsomerDataPermisson
);
return
R
.
ok
();
}
else
{
return
R
.
failed
(
"用户id与项目id必填"
);
}
}
/**
...
...
@@ -126,7 +138,6 @@ public class TCutsomerDataPermissonController {
@Operation
(
description
=
"修改"
)
@SysLog
(
"修改客户数据权限表"
)
@PutMapping
//@PreAuthorize("@pms.hasPermission('tcutsomerdatapermisson_edit')")
public
R
<
Boolean
>
update
(
@RequestBody
TCutsomerDataPermisson
tCutsomerDataPermisson
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
settleDomainService
.
removeSettleCache
(
user
,
Arrays
.
asList
(
tCutsomerDataPermisson
.
getUserId
()));
...
...
@@ -141,7 +152,6 @@ public class TCutsomerDataPermissonController {
@Operation
(
description
=
"删除(tcutsomerdatapermisson_del)"
)
@SysLog
(
"删除客户数据权限表"
)
@DeleteMapping
(
"/{id}"
)
//@PreAuthorize("@pms.hasPermission('tcutsomerdatapermisson_del')")
public
R
<
Boolean
>
removeById
(
@PathVariable
String
id
){
YifuUser
user
=
SecurityUtils
.
getUser
();
TCutsomerDataPermisson
tdp
=
tCutsomerDataPermissonService
.
getById
(
id
);
...
...
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