Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
fdb593be
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 3 年多
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fdb593be
编写于
9月 24, 2020
作者:
S
shiziyuan9527
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(用例评审): 非用例评审人员不可取消或关联用例
上级
c0dd8586
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
48 addition
and
8 deletion
+48
-8
backend/src/main/java/io/metersphere/track/controller/TestReviewTestCaseController.java
...sphere/track/controller/TestReviewTestCaseController.java
+4
-3
backend/src/main/java/io/metersphere/track/request/testplancase/TestReviewCaseBatchRequest.java
...rack/request/testplancase/TestReviewCaseBatchRequest.java
+1
-0
backend/src/main/java/io/metersphere/track/request/testreview/DeleteRelevanceRequest.java
...here/track/request/testreview/DeleteRelevanceRequest.java
+11
-0
backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java
...a/io/metersphere/track/service/TestCaseReviewService.java
+14
-0
backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java
.../metersphere/track/service/TestReviewTestCaseService.java
+15
-2
frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue
...s/track/review/view/components/TestReviewTestCaseList.vue
+2
-2
frontend/src/business/components/xpack
frontend/src/business/components/xpack
+1
-1
未找到文件。
backend/src/main/java/io/metersphere/track/controller/TestReviewTestCaseController.java
浏览文件 @
fdb593be
...
...
@@ -8,6 +8,7 @@ import io.metersphere.commons.utils.PageUtils;
import
io.metersphere.commons.utils.Pager
;
import
io.metersphere.track.dto.TestReviewCaseDTO
;
import
io.metersphere.track.request.testplancase.TestReviewCaseBatchRequest
;
import
io.metersphere.track.request.testreview.DeleteRelevanceRequest
;
import
io.metersphere.track.request.testreview.QueryCaseReviewRequest
;
import
io.metersphere.track.service.TestReviewTestCaseService
;
import
org.apache.shiro.authz.annotation.Logical
;
...
...
@@ -30,10 +31,10 @@ public class TestReviewTestCaseController {
return
PageUtils
.
setPageInfo
(
page
,
testReviewTestCaseService
.
list
(
request
));
}
@PostMapping
(
"/delete
/{id}
"
)
@PostMapping
(
"/delete"
)
@RequiresRoles
(
value
=
{
RoleConstants
.
TEST_USER
,
RoleConstants
.
TEST_MANAGER
},
logical
=
Logical
.
OR
)
public
int
deleteTestCase
(
@
PathVariable
String
id
)
{
return
testReviewTestCaseService
.
deleteTestCase
(
id
);
public
int
deleteTestCase
(
@
RequestBody
DeleteRelevanceRequest
request
)
{
return
testReviewTestCaseService
.
deleteTestCase
(
request
);
}
@PostMapping
(
"/batch/delete"
)
...
...
backend/src/main/java/io/metersphere/track/request/testplancase/TestReviewCaseBatchRequest.java
浏览文件 @
fdb593be
...
...
@@ -9,5 +9,6 @@ import java.util.List;
@Getter
@Setter
public
class
TestReviewCaseBatchRequest
extends
TestCaseReviewTestCase
{
private
String
reviewId
;
private
List
<
String
>
ids
;
}
backend/src/main/java/io/metersphere/track/request/testreview/DeleteRelevanceRequest.java
0 → 100644
浏览文件 @
fdb593be
package
io.metersphere.track.request.testreview
;
import
lombok.Getter
;
import
lombok.Setter
;
@Getter
@Setter
public
class
DeleteRelevanceRequest
{
private
String
id
;
private
String
reviewId
;
}
backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java
浏览文件 @
fdb593be
...
...
@@ -275,6 +275,13 @@ public class TestCaseReviewService {
}
public
void
testReviewRelevance
(
ReviewRelevanceRequest
request
)
{
String
reviewId
=
request
.
getReviewId
();
List
<
String
>
userIds
=
getTestCaseReviewerIds
(
reviewId
);
String
currentId
=
SessionUtils
.
getUser
().
getId
();
if
(!
userIds
.
contains
(
currentId
))
{
MSException
.
throwException
(
"非用例评审人员,不能关联用例!"
);
}
List
<
String
>
testCaseIds
=
request
.
getTestCaseIds
();
if
(
testCaseIds
.
isEmpty
())
{
...
...
@@ -307,6 +314,13 @@ public class TestCaseReviewService {
testCaseReviewMapper
.
updateByPrimaryKey
(
testCaseReview
);
}
}
public
List
<
String
>
getTestCaseReviewerIds
(
String
reviewId
)
{
TestCaseReviewUsersExample
testCaseReviewUsersExample
=
new
TestCaseReviewUsersExample
();
testCaseReviewUsersExample
.
createCriteria
().
andReviewIdEqualTo
(
reviewId
);
List
<
TestCaseReviewUsers
>
testCaseReviewUsers
=
testCaseReviewUsersMapper
.
selectByExample
(
testCaseReviewUsersExample
);
return
testCaseReviewUsers
.
stream
().
map
(
TestCaseReviewUsers:
:
getUserId
).
collect
(
Collectors
.
toList
());
}
public
TestCaseReview
getTestReview
(
String
reviewId
)
{
return
Optional
.
ofNullable
(
testCaseReviewMapper
.
selectByPrimaryKey
(
reviewId
)).
orElse
(
new
TestCaseReview
());
...
...
backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java
浏览文件 @
fdb593be
...
...
@@ -12,6 +12,7 @@ import io.metersphere.controller.request.member.QueryMemberRequest;
import
io.metersphere.service.UserService
;
import
io.metersphere.track.dto.TestReviewCaseDTO
;
import
io.metersphere.track.request.testplancase.TestReviewCaseBatchRequest
;
import
io.metersphere.track.request.testreview.DeleteRelevanceRequest
;
import
io.metersphere.track.request.testreview.QueryCaseReviewRequest
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -35,6 +36,8 @@ public class TestReviewTestCaseService {
TestCaseReviewUsersMapper
testCaseReviewUsersMapper
;
@Resource
TestCaseReviewMapper
testCaseReviewMapper
;
@Resource
TestCaseReviewService
testCaseReviewService
;
public
List
<
TestReviewCaseDTO
>
list
(
QueryCaseReviewRequest
request
)
{
request
.
setOrders
(
ServiceUtils
.
getDefaultOrder
(
request
.
getOrders
()));
...
...
@@ -71,11 +74,21 @@ public class TestReviewTestCaseService {
return
name
;
}
public
int
deleteTestCase
(
String
id
)
{
return
testCaseReviewTestCaseMapper
.
deleteByPrimaryKey
(
id
);
public
int
deleteTestCase
(
DeleteRelevanceRequest
request
)
{
checkReviewer
(
request
.
getReviewId
());
return
testCaseReviewTestCaseMapper
.
deleteByPrimaryKey
(
request
.
getId
());
}
private
void
checkReviewer
(
String
reviewId
)
{
List
<
String
>
userIds
=
testCaseReviewService
.
getTestCaseReviewerIds
(
reviewId
);
String
currentId
=
SessionUtils
.
getUser
().
getId
();
if
(!
userIds
.
contains
(
currentId
))
{
MSException
.
throwException
(
"非用例评审人员,不能解除用例关联!"
);
}
}
public
void
deleteTestCaseBath
(
TestReviewCaseBatchRequest
request
)
{
checkReviewer
(
request
.
getReviewId
());
TestCaseReviewTestCaseExample
example
=
new
TestCaseReviewTestCaseExample
();
example
.
createCriteria
().
andIdIn
(
request
.
getIds
());
testCaseReviewTestCaseMapper
.
deleteByExample
(
example
);
...
...
frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue
浏览文件 @
fdb593be
...
...
@@ -322,7 +322,7 @@ export default {
callback
:
(
action
)
=>
{
if
(
action
===
'
confirm
'
)
{
let
ids
=
Array
.
from
(
this
.
selectRows
).
map
(
row
=>
row
.
id
);
this
.
$post
(
'
/test/review/case/batch/delete
'
,
{
ids
:
ids
},
()
=>
{
this
.
$post
(
'
/test/review/case/batch/delete
'
,
{
ids
:
ids
,
reviewId
:
this
.
reviewId
},
()
=>
{
this
.
selectRows
.
clear
();
this
.
$emit
(
"
refresh
"
);
this
.
$success
(
this
.
$t
(
'
test_track.cancel_relevance_success
'
));
...
...
@@ -333,7 +333,7 @@ export default {
},
_handleDelete
(
testCase
)
{
let
testCaseId
=
testCase
.
id
;
this
.
$post
(
'
/test/review/case/delete
/
'
+
testCaseId
,
{
},
()
=>
{
this
.
$post
(
'
/test/review/case/delete
'
,
{
id
:
testCaseId
,
reviewId
:
testCase
.
reviewId
},
()
=>
{
this
.
$emit
(
"
refresh
"
);
this
.
$success
(
this
.
$t
(
'
test_track.cancel_relevance_success
'
));
});
...
...
xpack
@
cc38137a
比较
06d935cd
...
cc38137a
Subproject commit
06d935cd1d22ab36f09763745c2aff8ad3fb08c1
Subproject commit
cc38137a69a0f20fadece9c0f9f50a9468c4ace9
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录