diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskhub/TaskHubItemDTO.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskhub/TaskHubItemDTO.java
index 427da2ed08..9051854fb3 100644
--- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskhub/TaskHubItemDTO.java
+++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskhub/TaskHubItemDTO.java
@@ -1,7 +1,11 @@
package io.metersphere.system.dto.taskhub;
import io.metersphere.system.domain.ExecTaskItem;
+import io.metersphere.validation.groups.Created;
+import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Size;
import lombok.Data;
/**
@@ -31,5 +35,9 @@ public class TaskHubItemDTO extends ExecTaskItem {
@Schema(description = "线程id")
private String threadId;
+ @Schema(description = "项目名称")
+ private String projectName;
+ @Schema(description = "组织名称")
+ private String organizationName;
}
diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.xml
index e6638ee243..bf5a8a2ba6 100644
--- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.xml
+++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.xml
@@ -110,6 +110,16 @@
and exec_task.trigger_mode in
+
+
+ and exec_task_item.organization_id in
+
+
+
+
+ and exec_task_item.project_id in
+
+
diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.xml
index aaef053319..6714387fbd 100644
--- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.xml
+++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.xml
@@ -90,6 +90,16 @@
and exec_task.result in
+
+
+ and exec_task.organization_id in
+
+
+
+
+ and exec_task.project_id in
+
+
diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtScheduleMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtScheduleMapper.xml
index 87f29a45c5..9fc4d97ddf 100644
--- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtScheduleMapper.xml
+++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtScheduleMapper.xml
@@ -407,13 +407,13 @@
and task.resource_type in
-
+
and task.project_id in
#{value}
-
+
and task.organization_id in
#{value}
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 32863e853a..f849618699 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
@@ -389,11 +389,17 @@ public class BaseTaskHubService {
}
List userIds = list.stream().map(TaskHubItemDTO::getExecutor).distinct().toList();
List resourcePoolIds = list.stream().map(TaskHubItemDTO::getResourcePoolId).distinct().toList();
+ List projectIds = list.stream().map(TaskHubItemDTO::getProjectId).distinct().toList();
+ List organizationIds = list.stream().map(TaskHubItemDTO::getOrganizationId).distinct().toList();
+ Map projectMaps = getProjectMaps(projectIds);
+ Map organizationMaps = getOrganizationMaps(organizationIds);
Map userMaps = getUserMaps(userIds);
Map resourcePoolMaps = getResourcePoolMaps(resourcePoolIds);
list.forEach(item -> {
item.setUserName(userMaps.getOrDefault(item.getExecutor(), StringUtils.EMPTY));
item.setResourcePoolName(resourcePoolMaps.getOrDefault(item.getResourcePoolId(), StringUtils.EMPTY));
+ item.setProjectName(projectMaps.getOrDefault(item.getProjectId(), StringUtils.EMPTY));
+ item.setOrganizationName(organizationMaps.getOrDefault(item.getOrganizationId(), StringUtils.EMPTY));
});
}