diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCoverageDTO.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCoverageDTO.java index d52385909c..e8ac358c7d 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCoverageDTO.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCoverageDTO.java @@ -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++; } } } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanManagementService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanManagementService.java index 73f8235818..1690ab2a0f 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanManagementService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanManagementService.java @@ -359,6 +359,16 @@ public class TestPlanManagementService { List statusSelectParam = null; List 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;