From 3568d17865301543c2ba2910041c3f7030976a35 Mon Sep 17 00:00:00 2001 From: duxingchen Date: Mon, 14 Sep 2026 14:49:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BD=AC=E4=BA=A4=E6=97=B6=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=8E=A8=E5=AF=BCtask=5Ftype,=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E5=8D=8F=E5=8A=A9=E5=88=86=E6=94=AF=E8=BD=AC=E4=BA=A4=E8=A2=AB?= =?UTF-8?q?=E8=AF=AF=E5=8D=87=E4=B8=BA=E4=B8=BB=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/services/task_service.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/app/services/task_service.py b/backend/app/services/task_service.py index 8da022c..c47c3a6 100644 --- a/backend/app/services/task_service.py +++ b/backend/app/services/task_service.py @@ -792,12 +792,16 @@ async def transfer_task( created_tasks: list[Task] = [] for task_name, assignee_id in real_branches: + # 🔧 动态推导 task_type:禁止分支任务转交被硬编码为 TRANSFER(否则 is_main 判定误升为主线) if is_fission: new_parent_task_id = task.id + new_task_type = "SPAWN" # 裂变产生新分支 elif is_child_task: new_parent_task_id = task.parent_task_id + new_task_type = task.task_type or "SPAWN" # 继承父任务的分支血统 else: new_parent_task_id = task.id + new_task_type = "TRANSFER" # 主干常规流转 new_task = Task( product_id=task.product_id, @@ -805,7 +809,7 @@ async def transfer_task( task_name=task_name, assignee_id=assignee_id, status=TASK_STATUS_PENDING, - task_type="TRANSFER", + task_type=new_task_type, # ← 使用动态推导的类型 notify_parent_on_complete=False, is_rework=False, remark=request.note or None,