feat(任务中心): 批量执行生成集合报告任务报告ID缺失

--bug=1047912 --user=宋昌昌 【项目任务中心】用例执行任务列表-场景批量执行生成集合报告任务-查看报告-抽屉展示报告列表 https://www.tapd.cn/55049933/s/1596721
This commit is contained in:
song-cc-rock 2024-10-23 17:28:20 +08:00 committed by Craftsman
parent 03f384ab49
commit 5a88c4efd7
1 changed files with 3 additions and 2 deletions

View File

@ -193,8 +193,9 @@ public class BaseTaskHubService {
* @param tasks 任务集合
*/
private void setTaskReportId(List<TaskHubDTO> tasks) {
List<TaskHubDTO> reportTasks = tasks.stream().filter(task -> !StringUtils.equals(task.getTaskType(), ExecTaskType.API_SCENARIO_BATCH.name()) && !StringUtils.equals(task.getTaskType(), ExecTaskType.API_CASE_BATCH.name())
&& !StringUtils.equals(task.getTaskType(), ExecTaskType.TEST_PLAN_API_CASE_BATCH.name()) && !StringUtils.equals(task.getTaskType(), ExecTaskType.TEST_PLAN_API_SCENARIO_BATCH.name())).toList();
// 集成报告, 独立报告(非批量任务&&非测试计划批量任务)
List<TaskHubDTO> reportTasks = tasks.stream().filter(task -> task.getIntegrated() || (!StringUtils.equals(task.getTaskType(), ExecTaskType.API_SCENARIO_BATCH.name()) && !StringUtils.equals(task.getTaskType(), ExecTaskType.API_CASE_BATCH.name())
&& !StringUtils.equals(task.getTaskType(), ExecTaskType.TEST_PLAN_API_CASE_BATCH.name()) && !StringUtils.equals(task.getTaskType(), ExecTaskType.TEST_PLAN_API_SCENARIO_BATCH.name()))).toList();
List<String> integratedTaskIds = reportTasks.stream().filter(task ->
StringUtils.equalsAny(task.getTaskType(), ExecTaskType.TEST_PLAN.name(), ExecTaskType.TEST_PLAN_GROUP.name()) || task.getIntegrated()).map(ExecTask::getId).toList();
List<String> noIntegratedTasks = reportTasks.stream().map(ExecTask::getId).filter(id -> !integratedTaskIds.contains(id)).toList();