fix(测试跟踪): 修复选中关联单个模块用例实际上关联整个项目的用例缺陷

This commit is contained in:
fit2-zhao 2020-10-20 14:44:07 +08:00
parent 51e67a0b3c
commit c44b72e5fa
6 changed files with 31 additions and 14 deletions

View File

@ -9,7 +9,18 @@ import java.util.List;
@Getter
@Setter
public class PlanCaseRelevanceRequest {
/**
* 测试计划ID
*/
private String planId;
private String projectId;
/**
* 当选择关联全部用例时把加载条件送到后台从后台查询
*/
private QueryTestCaseRequest request;
/**
* 具体要关联的用例
*/
private List<String> testCaseIds = new ArrayList<>();
}

View File

@ -1,5 +1,6 @@
package io.metersphere.track.request.testreview;
import io.metersphere.track.request.testcase.QueryTestCaseRequest;
import lombok.Getter;
import lombok.Setter;
@ -9,7 +10,18 @@ import java.util.List;
@Getter
@Setter
public class ReviewRelevanceRequest {
/**
* 评审ID
*/
private String reviewId;
private String projectId;
/**
* 当选择关联全部用例时把加载条件送到后台从后台查询
*/
private QueryTestCaseRequest request;
/**
* 具体选择要关联的用例
*/
private List<String> testCaseIds = new ArrayList<>();
}

View File

@ -326,12 +326,9 @@ public class TestCaseReviewService {
if (testCaseIds.isEmpty()) {
return;
}
// 如果是关联全部指令则从新查询未关联的案例
// 如果是关联全部指令则根据条件查询未关联的案例
if (testCaseIds.get(0).equals("all")) {
QueryTestCaseRequest req = new QueryTestCaseRequest();
req.setReviewId(request.getReviewId());
req.setProjectId(request.getProjectId());
List<TestCase> testCases = extTestCaseMapper.getTestCaseByNotInReview(req);
List<TestCase> testCases = extTestCaseMapper.getTestCaseByNotInReview(request.getRequest());
if (!testCases.isEmpty()) {
testCaseIds = testCases.stream().map(testCase -> testCase.getId()).collect(Collectors.toList());
}

View File

@ -211,12 +211,9 @@ public class TestPlanService {
return;
}
// 如果是关联全部指令则从新查询未关联的案例
// 如果是关联全部指令则根据条件查询未关联的案例
if (testCaseIds.get(0).equals("all")) {
QueryTestCaseRequest req = new QueryTestCaseRequest();
req.setPlanId(request.getPlanId());
req.setProjectId(request.getProjectId());
List<TestCase> testCases = extTestCaseMapper.getTestCaseByNotInPlan(req);
List<TestCase> testCases = extTestCaseMapper.getTestCaseByNotInPlan(request.getRequest());
if (!testCases.isEmpty()) {
testCaseIds = testCases.stream().map(testCase -> testCase.getId()).collect(Collectors.toList());
}

View File

@ -176,7 +176,7 @@
let param = {};
param.planId = this.planId;
param.testCaseIds = [...this.selectIds];
param.projectId = this.projectId;
param.request = this.condition;
//
if (this.testCases.length === param.testCaseIds.length) {
param.testCaseIds = ['all'];

View File

@ -185,7 +185,7 @@
let param = {};
param.reviewId = this.reviewId;
param.testCaseIds = [...this.selectIds];
param.projectId = this.projectId;
param.request = this.condition;
//
if (this.testReviews.length === param.testCaseIds.length) {
param.testCaseIds = ['all'];