fix(任务中心): 子计划执行结果无法查看

--bug=1044136 --user=宋昌昌 【项目任务中心】计划组下子计划无法点击查看执行结果 https://www.tapd.cn/55049933/s/1549870
This commit is contained in:
song-cc-rock 2024-07-17 17:18:42 +08:00 committed by 刘瑞斌
parent 1fd7e09b1b
commit 390f1f0e66
1 changed files with 8 additions and 3 deletions

View File

@ -129,16 +129,21 @@ public class TestPlanTaskCenterService {
if (CollectionUtils.isNotEmpty(projectIds)) { if (CollectionUtils.isNotEmpty(projectIds)) {
Map<String, ExecuteReportDTO> historyDeletedMap = new HashMap<>(); Map<String, ExecuteReportDTO> historyDeletedMap = new HashMap<>();
list = extTestPlanReportMapper.taskCenterlist(request, isSystem ? new ArrayList<>() : projectIds, DateUtils.getDailyStartTime(), DateUtils.getDailyEndTime()); list = extTestPlanReportMapper.taskCenterlist(request, isSystem ? new ArrayList<>() : projectIds, DateUtils.getDailyStartTime(), DateUtils.getDailyEndTime());
// 执行历史ID集合
List<String> reportIds = list.stream().map(TaskCenterDTO::getId).collect(Collectors.toList());
// 查询计划组的任务的子计划任务 // 查询计划组的任务的子计划任务
List<String> groupReportIds = list.stream().filter(TaskCenterDTO::isIntegrated).map(TaskCenterDTO::getId).toList(); List<String> groupReportIds = list.stream().filter(TaskCenterDTO::isIntegrated).map(TaskCenterDTO::getId).toList();
if (CollectionUtils.isNotEmpty(groupReportIds)) { if (CollectionUtils.isNotEmpty(groupReportIds)) {
List<TaskCenterDTO> childTaskCenterList = extTestPlanReportMapper.getChildTaskCenter(groupReportIds); List<TaskCenterDTO> childTaskCenterList = extTestPlanReportMapper.getChildTaskCenter(groupReportIds);
Map<String, List<TaskCenterDTO>> childTaskMap = childTaskCenterList.stream().collect(Collectors.groupingBy(TaskCenterDTO::getParent)); Map<String, List<TaskCenterDTO>> 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<String> reportIds = list.stream().map(TaskCenterDTO::getId).toList();
if (CollectionUtils.isNotEmpty(reportIds)) { if (CollectionUtils.isNotEmpty(reportIds)) {
List<ExecuteReportDTO> historyDeletedList = extTestPlanReportMapper.getHistoryDeleted(reportIds); List<ExecuteReportDTO> historyDeletedList = extTestPlanReportMapper.getHistoryDeleted(reportIds);
historyDeletedMap = historyDeletedList.stream().collect(Collectors.toMap(ExecuteReportDTO::getId, Function.identity())); historyDeletedMap = historyDeletedList.stream().collect(Collectors.toMap(ExecuteReportDTO::getId, Function.identity()));