From 84df53f1153230815e93bb720a2ee349a6ec3d16 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 2 Aug 2022 21:04:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E5=AF=BC=E5=87=BA=E7=BC=BA?= =?UTF-8?q?=E5=B0=91=E6=AD=A5=E9=AA=A4=E7=AD=89=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015638 --user=陈建星 【测试跟踪】【2.0分支】功能用例导出,步骤、期望、前置条件、备注都没有了 https://www.tapd.cn/55049933/s/1217893 --- .../track/service/TestCaseService.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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("");