diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index aec3ae6311..9ed9bbc813 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -1554,9 +1554,22 @@ public class TestCaseService { return listTestCase(request.getCondition(), true); } + public List getExportData(TestCaseBatchRequest request) { + ServiceUtils.getSelectAllIds(request, request.getCondition(), + (query) -> extTestCaseMapper.selectIds(query)); + this.initRequest(request.getCondition(), true); + setDefaultOrder(request.getCondition()); + Map> filters = request.getCondition().getFilters(); + if (filters != null && !filters.containsKey("status")) { + filters.put("status", new ArrayList<>(0)); + } + List testCaseList = extTestCaseMapper.listByTestCaseIds(request); + return testCaseList; + } + private List generateTestCaseExcel(TestCaseBatchRequest request) { request.getCondition().setStatusIsNot("Trash"); - List testCaseList = this.findByBatchRequest(request); + List testCaseList = this.getExportData(request); boolean isUseCustomId = projectService.useCustomNum(request.getProjectId()); List list = new ArrayList<>(); StringBuilder step = new StringBuilder("");