From 0bb14f062e64fd67e6707d3f95b5df11373d326a Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 27 Dec 2022 10:54:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=8A=9F=E8=83=BD=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E4=B8=8D=E5=B1=95=E7=A4=BA=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021234 --user=陈建星 【测试跟踪】测试计划-执行功能用例-多值输入框类型的字段不显示值 https://www.tapd.cn/55049933/s/1319557 --- .../metersphere/plan/service/TestPlanTestCaseService.java | 5 +++++ .../main/java/io/metersphere/service/TestCaseService.java | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanTestCaseService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanTestCaseService.java index 26a1c718b7..683b96fd87 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanTestCaseService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanTestCaseService.java @@ -303,9 +303,14 @@ public class TestPlanTestCaseService { List testCaseTestDTOS = extTestPlanTestCaseMapper.listTestCaseTest(testPlanCaseDTO.getCaseId()); testCaseTestDTOS.forEach(this::setTestName); testPlanCaseDTO.setList(testCaseTestDTOS); + buildCustomField(testPlanCaseDTO); return testPlanCaseDTO; } + private void buildCustomField(TestPlanCaseDTO data) { + data.setFields(testCaseService.getCustomFieldByCaseId(data.getCaseId())); + } + private void setTestName(TestCaseTestDTO dto) { String type = dto.getTestType(); String id = dto.getTestId(); diff --git a/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java b/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java index 58acf5443b..77ac453e20 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java @@ -770,8 +770,12 @@ public class TestCaseService { } private void buildCustomField(TestCaseDTO data) { + data.setFields(getCustomFieldByCaseId(data.getId())); + } + + public List getCustomFieldByCaseId(String caseId) { CustomFieldTestCaseExample example = new CustomFieldTestCaseExample(); - example.createCriteria().andResourceIdEqualTo(data.getId()); + example.createCriteria().andResourceIdEqualTo(caseId); List customFieldTestCases = customFieldTestCaseMapper.selectByExampleWithBLOBs(example); List fields = new ArrayList<>(); customFieldTestCases.forEach(i -> { @@ -781,7 +785,7 @@ public class TestCaseService { customFieldDao.setTextValue(i.getTextValue()); fields.add(customFieldDao); }); - data.setFields(fields); + return fields; } private void buildProjectInfoWithoutProject(List resList) {