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;