From 0aa632dd28c62bb2579fd63165679d07899d974b Mon Sep 17 00:00:00 2001 From: ymq Date: Fri, 4 Sep 2026 16:33:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(kb-ingest):=20=E5=BE=85=E5=8A=9E=E7=BD=AE?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=94=B9=E7=94=A8suggestion=5Fid=E7=B2=BE?= =?UTF-8?q?=E7=A1=AE=E5=8C=B9=E9=85=8D(=E9=98=B2=E5=90=8C=E5=90=8D?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=AF=AF=E4=BC=A4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_service/kb_ingest_capability.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pipeline_service/kb_ingest_capability.py b/pipeline_service/kb_ingest_capability.py index 15d4cd2..f4d45af 100644 --- a/pipeline_service/kb_ingest_capability.py +++ b/pipeline_service/kb_ingest_capability.py @@ -169,14 +169,15 @@ async def decide_kb_ingest(suggestion_id, approve, operator_id, comment=""): if owner and str(operator_id) != str(owner): return False, "仅项目 owner 可批准/驳回入库建议" - # 关联人工待办置为已处理(避免待办重复出现) + # 关联人工待办置为已处理(避免待办重复出现)——用 form_schema 里唯一的 + # suggestion_id 精确匹配(description LIKE 文件名会误伤同名文件的待办) await sor.sqlExe( "UPDATE pipeline_human_tasks SET status='done', submitted_by=${o}$, submitted_at=NOW(), " "result_data=${rd}$ WHERE task_type='kb_ingest_confirm' AND status='pending' " - "AND description LIKE ${pat}$", + "AND form_schema LIKE ${pat}$", {"o": operator_id, "rd": json.dumps({"suggestion_id": suggestion_id, "approve": bool(approve)}, ensure_ascii=False), - "pat": "%" + str(sg.get("file_name", "")) + "%"}) + "pat": "%\"suggestion_id\": \"" + str(suggestion_id) + "\"%"}) await sor.sqlExe("COMMIT", {}) if not approve: