From 37098287c8b602ec4d34aa4e1f655adf9a9c0878 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Thu, 30 May 2024 17:57:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E8=AE=A1=E5=88=92=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/dto/response/TestPlanBugPageResponse.java | 4 +++- .../io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml | 7 ++++--- .../io/metersphere/plan/service/TestPlanBugService.java | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanBugPageResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanBugPageResponse.java index 3a4f052843..8149bc3189 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanBugPageResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanBugPageResponse.java @@ -17,8 +17,10 @@ public class TestPlanBugPageResponse { private String num; @Schema(description = "缺陷标题") private String title; + @Schema(description = "缺陷内容(预览)") + private String content; @Schema(description = "关联用例集合") - private List relateCase; + private List relateCases; @Schema(description = "处理人") private String handleUser; @Schema(description = "状态") diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml index 2f0c029c5f..8802573791 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml @@ -2,8 +2,9 @@ select brc.test_plan_case_id as id, fc.num as num, brc.bug_id as bugId, fc.name as name from bug_relation_case brc - join functional_case fc on brc.test_plan_case_id = fc.id - # 后续会有其他用例, 根据关联用例类型, 取不同用例表 + join functional_case fc on brc.case_id = fc.id + where brc.test_plan_id = #{planId} and brc.bug_id in diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanBugService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanBugService.java index a787071868..9b2ba746d6 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanBugService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanBugService.java @@ -105,7 +105,7 @@ public class TestPlanBugService extends TestPlanResourceService { List bugRelatedCases = extTestPlanBugMapper.getBugRelatedCase(bugIds, planId); Map> bugRelateCaseMap = bugRelatedCases.stream().collect(Collectors.groupingBy(TestPlanBugCaseDTO::getBugId)); bugList.forEach(bug -> { - bug.setRelateCase(bugRelateCaseMap.get(bug.getId())); + bug.setRelateCases(bugRelateCaseMap.get(bug.getId())); bug.setCreateUser(userMap.get(bug.getCreateUser())); }); return bugList;