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_archived = 0;
private int notPassed = 0;
private int notPassed_archived = 0;
/**
* 已完成
@ -39,52 +43,61 @@ public class TestPlanCoverageDTO {
public void notStartedAutoIncrement(boolean isArchived) {
this.unExecute++;
this.notPassed++;
if (isArchived) {
this.archived++;
this.notPassed_archived++;
} else {
this.prepared++;
this.notPassed++;
}
}
public void passAndFinishedAutoIncrement(boolean isArchived) {
this.executed++;
this.passed++;
if (isArchived) {
this.archived++;
this.passed_archived++;
} else {
this.finished++;
this.passed++;
}
}
public void unSuccessAutoIncrement(boolean isArchived) {
this.executed++;
this.notPassed++;
if (isArchived) {
this.archived++;
this.notPassed_archived++;
} else {
this.finished++;
this.notPassed++;
}
}
public void passAndNotFinishedAutoIncrement(boolean isArchived) {
this.executed++;
this.passed++;
if (isArchived) {
this.archived++;
this.passed_archived++;
} else {
this.running++;
this.passed++;
}
}
public void testPlanRunningAutoIncrement(boolean isArchived) {
this.executed++;
this.notPassed++;
if (isArchived) {
this.archived++;
this.notPassed_archived++;
} else {
this.running++;
this.notPassed++;
}
}
}

View File

@ -359,6 +359,16 @@ public class TestPlanManagementService {
List<String> statusSelectParam = 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.setFilter(new HashMap<>() {{
@ -372,10 +382,6 @@ public class TestPlanManagementService {
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 selectStatus = !selectArchived && CollectionUtils.isNotEmpty(statusSelectParam) && CollectionUtils.size(statusSelectParam) < 3;
boolean selectPassed = CollectionUtils.isNotEmpty(passedSelectParam) && CollectionUtils.size(passedSelectParam) == 1;