diff --git a/backend/src/main/java/com/designhub/entity/TaskItem.java b/backend/src/main/java/com/designhub/entity/TaskItem.java index 955c85a..47ba4ee 100644 --- a/backend/src/main/java/com/designhub/entity/TaskItem.java +++ b/backend/src/main/java/com/designhub/entity/TaskItem.java @@ -248,4 +248,28 @@ public class TaskItem implements Serializable { */ @TableField(exist = false) private Integer subTaskTotal; + + /** + * 是否一级需求任务(非数据库字段,从主任务关联) + */ + @TableField(exist = false) + private Integer isPrimaryTask; + + /** + * 一级需求发起人姓名(非数据库字段,从主任务关联) + */ + @TableField(exist = false) + private String primaryPublisherName; + + /** + * 一级需求发起人部门名称(非数据库字段,从主任务关联) + */ + @TableField(exist = false) + private String primaryPublisherDeptName; + + /** + * 明细完善人姓名(非数据库字段,从主任务关联) + */ + @TableField(exist = false) + private String detailCompleterName; } diff --git a/backend/src/main/java/com/designhub/mapper/TaskItemMapper.java b/backend/src/main/java/com/designhub/mapper/TaskItemMapper.java index 667bf42..8aabdd8 100644 --- a/backend/src/main/java/com/designhub/mapper/TaskItemMapper.java +++ b/backend/src/main/java/com/designhub/mapper/TaskItemMapper.java @@ -32,7 +32,11 @@ public interface TaskItemMapper extends BaseMapper { " t.task_sub_type AS taskSubType, " + " t.attachment_url AS attachmentUrl, " + " t.preview_image AS previewImage, " + + " t.is_primary_task AS isPrimaryTask, " + " u.real_name AS publisherName, " + + " pp.real_name AS primaryPublisherName, " + + " ppd.dept_name AS primaryPublisherDeptName, " + + " dc.real_name AS detailCompleterName, " + " b.brand_name AS brandName, " + " c.category_name AS categoryName, " + " p.platform_name AS platformName, " + @@ -41,6 +45,9 @@ public interface TaskItemMapper extends BaseMapper { "FROM task_item ti " + "LEFT JOIN task t ON ti.task_id = t.id " + "LEFT JOIN sys_user u ON t.publisher_id = u.id " + + "LEFT JOIN sys_user pp ON t.primary_publisher_id = pp.id " + + "LEFT JOIN sys_dept ppd ON t.primary_publisher_dept_id = ppd.id " + + "LEFT JOIN sys_user dc ON t.detail_completer_id = dc.id " + "LEFT JOIN brand b ON t.brand_id = b.id " + "LEFT JOIN category c ON t.category_id = c.id " + "LEFT JOIN platform p ON t.platform_id = p.id " + @@ -74,7 +81,11 @@ public interface TaskItemMapper extends BaseMapper { " t.task_sub_type AS taskSubType, " + " t.attachment_url AS attachmentUrl, " + " t.preview_image AS previewImage, " + + " t.is_primary_task AS isPrimaryTask, " + " u.real_name AS publisherName, " + + " pp.real_name AS primaryPublisherName, " + + " ppd.dept_name AS primaryPublisherDeptName, " + + " dc.real_name AS detailCompleterName, " + " b.brand_name AS brandName, " + " c.category_name AS categoryName, " + " p.platform_name AS platformName, " + @@ -83,6 +94,9 @@ public interface TaskItemMapper extends BaseMapper { "FROM task_item ti " + "LEFT JOIN task t ON ti.task_id = t.id " + "LEFT JOIN sys_user u ON t.publisher_id = u.id " + + "LEFT JOIN sys_user pp ON t.primary_publisher_id = pp.id " + + "LEFT JOIN sys_dept ppd ON t.primary_publisher_dept_id = ppd.id " + + "LEFT JOIN sys_user dc ON t.detail_completer_id = dc.id " + "LEFT JOIN brand b ON t.brand_id = b.id " + "LEFT JOIN category c ON t.category_id = c.id " + "LEFT JOIN platform p ON t.platform_id = p.id " + @@ -122,11 +136,15 @@ public interface TaskItemMapper extends BaseMapper { " t.task_sub_type AS taskSubType, " + " t.attachment_url AS attachmentUrl, " + " t.preview_image AS previewImage, " + + " t.is_primary_task AS isPrimaryTask, " + " b.brand_name AS brandName, " + " c.category_name AS categoryName, " + " p.platform_name AS platformName, " + " dt.type_name AS taskTypeName, " + " u.real_name AS publisherName, " + + " pp.real_name AS primaryPublisherName, " + + " ppd.dept_name AS primaryPublisherDeptName, " + + " dc.real_name AS detailCompleterName, " + " r.real_name AS receiverName, " + " (SELECT COUNT(*) FROM task_item WHERE task_id = ti.task_id) AS totalItems " + "FROM task_item ti " + @@ -136,6 +154,9 @@ public interface TaskItemMapper extends BaseMapper { "LEFT JOIN platform p ON t.platform_id = p.id " + "LEFT JOIN task_type dt ON ti.task_type_id = dt.id " + "LEFT JOIN sys_user u ON t.publisher_id = u.id " + + "LEFT JOIN sys_user pp ON t.primary_publisher_id = pp.id " + + "LEFT JOIN sys_dept ppd ON t.primary_publisher_dept_id = ppd.id " + + "LEFT JOIN sys_user dc ON t.detail_completer_id = dc.id " + "LEFT JOIN sys_user r ON ti.receiver_id = r.id " + "WHERE ti.status = 'in_progress' " + " AND t.deleted = 0 " + @@ -168,11 +189,15 @@ public interface TaskItemMapper extends BaseMapper { " t.task_sub_type AS taskSubType, " + " t.attachment_url AS attachmentUrl, " + " t.preview_image AS previewImage, " + + " t.is_primary_task AS isPrimaryTask, " + " b.brand_name AS brandName, " + " c.category_name AS categoryName, " + " p.platform_name AS platformName, " + " dt.type_name AS taskTypeName, " + " u.real_name AS publisherName, " + + " pp.real_name AS primaryPublisherName, " + + " ppd.dept_name AS primaryPublisherDeptName, " + + " dc.real_name AS detailCompleterName, " + " r.real_name AS receiverName, " + " (SELECT COUNT(*) FROM task_item WHERE task_id = ti.task_id) AS totalItems " + "FROM task_item ti " + @@ -182,6 +207,9 @@ public interface TaskItemMapper extends BaseMapper { "LEFT JOIN platform p ON t.platform_id = p.id " + "LEFT JOIN task_type dt ON ti.task_type_id = dt.id " + "LEFT JOIN sys_user u ON t.publisher_id = u.id " + + "LEFT JOIN sys_user pp ON t.primary_publisher_id = pp.id " + + "LEFT JOIN sys_dept ppd ON t.primary_publisher_dept_id = ppd.id " + + "LEFT JOIN sys_user dc ON t.detail_completer_id = dc.id " + "LEFT JOIN sys_user r ON ti.receiver_id = r.id " + "WHERE ti.status = 'completed' " + " AND t.deleted = 0 " + @@ -211,11 +239,15 @@ public interface TaskItemMapper extends BaseMapper { " t.task_sub_type AS taskSubType, " + " t.attachment_url AS attachmentUrl, " + " t.preview_image AS previewImage, " + + " t.is_primary_task AS isPrimaryTask, " + " b.brand_name AS brandName, " + " c.category_name AS categoryName, " + " p.platform_name AS platformName, " + " dt.type_name AS taskTypeName, " + " u.real_name AS publisherName, " + + " pp.real_name AS primaryPublisherName, " + + " ppd.dept_name AS primaryPublisherDeptName, " + + " dc.real_name AS detailCompleterName, " + " r.real_name AS receiverName, " + " (SELECT COUNT(*) FROM task_item WHERE task_id = ti.task_id) AS totalItems " + "FROM task_item ti " + @@ -225,6 +257,9 @@ public interface TaskItemMapper extends BaseMapper { "LEFT JOIN platform p ON t.platform_id = p.id " + "LEFT JOIN task_type dt ON ti.task_type_id = dt.id " + "LEFT JOIN sys_user u ON t.publisher_id = u.id " + + "LEFT JOIN sys_user pp ON t.primary_publisher_id = pp.id " + + "LEFT JOIN sys_dept ppd ON t.primary_publisher_dept_id = ppd.id " + + "LEFT JOIN sys_user dc ON t.detail_completer_id = dc.id " + "LEFT JOIN sys_user r ON ti.receiver_id = r.id " + "WHERE ti.status = 'in_progress' " + " AND t.deleted = 0 " + @@ -255,11 +290,15 @@ public interface TaskItemMapper extends BaseMapper { " t.task_sub_type AS taskSubType, " + " t.attachment_url AS attachmentUrl, " + " t.preview_image AS previewImage, " + + " t.is_primary_task AS isPrimaryTask, " + " b.brand_name AS brandName, " + " c.category_name AS categoryName, " + " p.platform_name AS platformName, " + " dt.type_name AS taskTypeName, " + " u.real_name AS publisherName, " + + " pp.real_name AS primaryPublisherName, " + + " ppd.dept_name AS primaryPublisherDeptName, " + + " dc.real_name AS detailCompleterName, " + " r.real_name AS receiverName, " + " (SELECT COUNT(*) FROM task_item WHERE task_id = ti.task_id) AS totalItems " + "FROM task_item ti " + @@ -269,6 +308,9 @@ public interface TaskItemMapper extends BaseMapper { "LEFT JOIN platform p ON t.platform_id = p.id " + "LEFT JOIN task_type dt ON ti.task_type_id = dt.id " + "LEFT JOIN sys_user u ON t.publisher_id = u.id " + + "LEFT JOIN sys_user pp ON t.primary_publisher_id = pp.id " + + "LEFT JOIN sys_dept ppd ON t.primary_publisher_dept_id = ppd.id " + + "LEFT JOIN sys_user dc ON t.detail_completer_id = dc.id " + "LEFT JOIN sys_user r ON ti.receiver_id = r.id " + "WHERE ti.status = 'completed' " + " AND t.deleted = 0 " + diff --git a/frontend/src/views/TaskHall.vue b/frontend/src/views/TaskHall.vue index 479d8d3..95b3ea6 100644 --- a/frontend/src/views/TaskHall.vue +++ b/frontend/src/views/TaskHall.vue @@ -4897,7 +4897,12 @@ const mapTaskItemToTask = (item: any) => { startTime: item.createTime, // 使用创建时间作为开始时间 isPipeline: item.isPipeline, // 是否流水线任务(从主任务获取) subTasks: item.subTasks, // 同一主任务的所有子任务列表 - subTaskTotal: item.subTaskTotal || (item.subTasks ? item.subTasks.length : 0) // 子任务总数 + subTaskTotal: item.subTaskTotal || (item.subTasks ? item.subTasks.length : 0), // 子任务总数 + // 🔥 一级需求任务相关字段 + isPrimaryTask: item.isPrimaryTask, // 是否一级需求任务 + primaryPublisherName: item.primaryPublisherName, // 一级需求发起人姓名 + primaryPublisherDeptName: item.primaryPublisherDeptName, // 一级需求发起人部门名称 + detailCompleterName: item.detailCompleterName // 明细完善人姓名 } }