diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseTaskHubService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseTaskHubService.java index 1179711700..640ed7990f 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseTaskHubService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseTaskHubService.java @@ -193,8 +193,9 @@ public class BaseTaskHubService { * @param tasks 任务集合 */ private void setTaskReportId(List tasks) { - List 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 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 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 noIntegratedTasks = reportTasks.stream().map(ExecTask::getId).filter(id -> !integratedTaskIds.contains(id)).toList();