From fa0fdb1ee48b634fbeb30c326ee385a5493da2a8 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Thu, 23 May 2024 11:29:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=89=A7=E8=A1=8C=E5=8E=86=E5=8F=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1040923 --user=王旭 【测试计划】测试计划详情-功能用例列表-批量执行-批量执行成功后用例的步骤执行结果为空了 https://www.tapd.cn/55049933/s/1518912 --- .../ExtTestPlanCaseExecuteHistoryMapper.java | 3 +++ .../ExtTestPlanCaseExecuteHistoryMapper.xml | 20 +++++++++++++++++++ .../TestPlanFunctionalCaseService.java | 11 +++++----- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java index fa07ff3e3647..98a7aa521156 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java @@ -1,5 +1,6 @@ package io.metersphere.plan.mapper; +import io.metersphere.plan.domain.TestPlanCaseExecuteHistory; import io.metersphere.plan.dto.request.TestPlanCaseExecHistoryRequest; import io.metersphere.plan.dto.response.TestPlanCaseExecHistoryResponse; import org.apache.ibatis.annotations.Param; @@ -11,4 +12,6 @@ public interface ExtTestPlanCaseExecuteHistoryMapper { void updateDeleted(@Param("testPlanCaseIds") List testPlanCaseIds, @Param("deleted") boolean deleted); List getCaseExecHistory(@Param("request") TestPlanCaseExecHistoryRequest request); + + List selectSteps(@Param("testPlanCaseId") String testPlanCaseId, @Param("caseId") String caseId); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml index d5f1e138814f..d37ffef9626f 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml @@ -37,4 +37,24 @@ tpceh.create_time DESC + + + \ No newline at end of file diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java index c1ddea377a67..656bfb6046ee 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java @@ -16,7 +16,10 @@ import io.metersphere.functional.service.FunctionalCaseAttachmentService; import io.metersphere.functional.service.FunctionalCaseModuleService; import io.metersphere.functional.service.FunctionalCaseService; -import io.metersphere.plan.domain.*; +import io.metersphere.plan.domain.TestPlan; +import io.metersphere.plan.domain.TestPlanCaseExecuteHistory; +import io.metersphere.plan.domain.TestPlanFunctionalCase; +import io.metersphere.plan.domain.TestPlanFunctionalCaseExample; import io.metersphere.plan.dto.AssociationNodeSortDTO; import io.metersphere.plan.dto.ResourceLogInsertModule; import io.metersphere.plan.dto.TestPlanCaseRunResultCount; @@ -141,6 +144,7 @@ public Map caseExecResultCount(String testPlanId) { List runResultCounts = extTestPlanFunctionalCaseMapper.selectCaseExecResultCount(testPlanId); return runResultCounts.stream().collect(Collectors.toMap(TestPlanCaseRunResultCount::getResult, TestPlanCaseRunResultCount::getResultCount)); } + @Override public void refreshPos(String testPlanId) { List functionalCaseIdList = extTestPlanFunctionalCaseMapper.selectIdByTestPlanIdOrderByPos(testPlanId); @@ -550,10 +554,7 @@ public TestPlanCaseDetailResponse getFunctionalCaseDetail(String id, String user String caseId = planFunctionalCase.getFunctionalCaseId(); FunctionalCaseDetailDTO functionalCaseDetail = functionalCaseService.getFunctionalCaseDetail(caseId, userId); String caseDetailSteps = functionalCaseDetail.getSteps(); - TestPlanCaseExecuteHistoryExample testPlanCaseExecuteHistoryExample = new TestPlanCaseExecuteHistoryExample(); - testPlanCaseExecuteHistoryExample.createCriteria().andCaseIdEqualTo(caseId).andTestPlanCaseIdEqualTo(id); - testPlanCaseExecuteHistoryExample.setOrderByClause("create_time DESC"); - List testPlanCaseExecuteHistories = testPlanCaseExecuteHistoryMapper.selectByExampleWithBLOBs(testPlanCaseExecuteHistoryExample); + List testPlanCaseExecuteHistories = extTestPlanCaseExecuteHistoryMapper.selectSteps(id, caseId); Integer runListCount = 0; List functionalCaseStepDTOS = new ArrayList<>(); if (CollectionUtils.isNotEmpty(testPlanCaseExecuteHistories)) {