From 390f1f0e66f036f7f510ba97eba677e078242185 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 17 Jul 2024 17:18:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83):=20?= =?UTF-8?q?=E5=AD=90=E8=AE=A1=E5=88=92=E6=89=A7=E8=A1=8C=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1044136 --user=宋昌昌 【项目任务中心】计划组下子计划无法点击查看执行结果 https://www.tapd.cn/55049933/s/1549870 --- .../plan/service/TestPlanTaskCenterService.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java index d5b60fcec1..148f25c219 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java @@ -129,16 +129,21 @@ public class TestPlanTaskCenterService { if (CollectionUtils.isNotEmpty(projectIds)) { Map historyDeletedMap = new HashMap<>(); list = extTestPlanReportMapper.taskCenterlist(request, isSystem ? new ArrayList<>() : projectIds, DateUtils.getDailyStartTime(), DateUtils.getDailyEndTime()); + // 执行历史ID集合 + List reportIds = list.stream().map(TaskCenterDTO::getId).collect(Collectors.toList()); // 查询计划组的任务的子计划任务 List groupReportIds = list.stream().filter(TaskCenterDTO::isIntegrated).map(TaskCenterDTO::getId).toList(); if (CollectionUtils.isNotEmpty(groupReportIds)) { List childTaskCenterList = extTestPlanReportMapper.getChildTaskCenter(groupReportIds); Map> childTaskMap = childTaskCenterList.stream().collect(Collectors.groupingBy(TaskCenterDTO::getParent)); - list.forEach(item -> item.setChildren(childTaskMap.get(item.getId()))); + list.forEach(item -> { + item.setChildren(childTaskMap.get(item.getId())); + if (CollectionUtils.isNotEmpty(item.getChildren())) { + reportIds.addAll(item.getChildren().stream().map(TaskCenterDTO::getId).toList()); + } + }); } - // 执行历史列表 - List reportIds = list.stream().map(TaskCenterDTO::getId).toList(); if (CollectionUtils.isNotEmpty(reportIds)) { List historyDeletedList = extTestPlanReportMapper.getHistoryDeleted(reportIds); historyDeletedMap = historyDeletedList.stream().collect(Collectors.toMap(ExecuteReportDTO::getId, Function.identity()));