feat(测试计划): 测试计划跳转时增加归档的处理

This commit is contained in:
Jianguo-Genius 2024-12-19 10:34:33 +08:00 committed by 建国
parent e834a02494
commit 0f3348c015
2 changed files with 28 additions and 9 deletions

View File

@ -14,10 +14,14 @@ public class TestPlanCoverageDTO {
/** /**
* 通过 * 通过
* 归档通过
* 未通过 * 未通过
* 归档未通过
*/ */
private int passed = 0; private int passed = 0;
private int passed_archived = 0;
private int notPassed = 0; private int notPassed = 0;
private int notPassed_archived = 0;
/** /**
* 已完成 * 已完成
@ -39,52 +43,61 @@ public class TestPlanCoverageDTO {
public void notStartedAutoIncrement(boolean isArchived) { public void notStartedAutoIncrement(boolean isArchived) {
this.unExecute++; this.unExecute++;
this.notPassed++;
if (isArchived) { if (isArchived) {
this.archived++; this.archived++;
this.notPassed_archived++;
} else { } else {
this.prepared++; this.prepared++;
this.notPassed++;
} }
} }
public void passAndFinishedAutoIncrement(boolean isArchived) { public void passAndFinishedAutoIncrement(boolean isArchived) {
this.executed++; this.executed++;
this.passed++;
if (isArchived) { if (isArchived) {
this.archived++; this.archived++;
this.passed_archived++;
} else { } else {
this.finished++; this.finished++;
this.passed++;
} }
} }
public void unSuccessAutoIncrement(boolean isArchived) { public void unSuccessAutoIncrement(boolean isArchived) {
this.executed++; this.executed++;
this.notPassed++;
if (isArchived) { if (isArchived) {
this.archived++; this.archived++;
this.notPassed_archived++;
} else { } else {
this.finished++; this.finished++;
this.notPassed++;
} }
} }
public void passAndNotFinishedAutoIncrement(boolean isArchived) { public void passAndNotFinishedAutoIncrement(boolean isArchived) {
this.executed++; this.executed++;
this.passed++;
if (isArchived) { if (isArchived) {
this.archived++; this.archived++;
this.passed_archived++;
} else { } else {
this.running++; this.running++;
this.passed++;
} }
} }
public void testPlanRunningAutoIncrement(boolean isArchived) { public void testPlanRunningAutoIncrement(boolean isArchived) {
this.executed++; this.executed++;
this.notPassed++;
if (isArchived) { if (isArchived) {
this.archived++; this.archived++;
this.notPassed_archived++;
} else { } else {
this.running++; this.running++;
this.notPassed++;
} }
} }
} }

View File

@ -359,6 +359,16 @@ public class TestPlanManagementService {
List<String> statusSelectParam = null; List<String> statusSelectParam = null;
List<String> passedSelectParam = null; List<String> passedSelectParam = null;
if (request.getFilter() != null && request.getFilter().containsKey("passed")) {
passedSelectParam = request.getFilter().get("passed");
} else if (request.getFilter() != null && request.getFilter().containsKey("archivedPassed")) {
passedSelectParam = request.getFilter().get("archivedPassed");
request.getFilter().put("status", new ArrayList<>() {{
this.add(TestPlanConstants.TEST_PLAN_STATUS_ARCHIVED);
}});
}
if (request.getFilter() == null || !request.getFilter().containsKey("status")) { if (request.getFilter() == null || !request.getFilter().containsKey("status")) {
if (request.getFilter() == null) { if (request.getFilter() == null) {
request.setFilter(new HashMap<>() {{ request.setFilter(new HashMap<>() {{
@ -372,10 +382,6 @@ public class TestPlanManagementService {
request.getFilter().put("status", defaultStatusList); request.getFilter().put("status", defaultStatusList);
} }
if (request.getFilter() != null && request.getFilter().containsKey("passed")) {
passedSelectParam = request.getFilter().get("passed");
}
boolean selectArchived = CollectionUtils.isNotEmpty(statusSelectParam) && statusSelectParam.contains(TestPlanConstants.TEST_PLAN_STATUS_ARCHIVED); boolean selectArchived = CollectionUtils.isNotEmpty(statusSelectParam) && statusSelectParam.contains(TestPlanConstants.TEST_PLAN_STATUS_ARCHIVED);
boolean selectStatus = !selectArchived && CollectionUtils.isNotEmpty(statusSelectParam) && CollectionUtils.size(statusSelectParam) < 3; boolean selectStatus = !selectArchived && CollectionUtils.isNotEmpty(statusSelectParam) && CollectionUtils.size(statusSelectParam) < 3;
boolean selectPassed = CollectionUtils.isNotEmpty(passedSelectParam) && CollectionUtils.size(passedSelectParam) == 1; boolean selectPassed = CollectionUtils.isNotEmpty(passedSelectParam) && CollectionUtils.size(passedSelectParam) == 1;