From 06c77d40c7d71e521dec4196289ca05dfc0f016c Mon Sep 17 00:00:00 2001 From: caohuipeng Date: Wed, 14 Oct 2026 23:18:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(shipping-notice):=20=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E6=8A=95=E5=BD=B1=E6=94=B6=E6=95=9B=E9=9C=80=E4=BA=BA=E5=B7=A5?= =?UTF-8?q?=E6=9C=AA=E7=89=A9=E5=8C=96=E8=AF=86=E5=88=AB=20Run=20=E5=B9=B6?= =?UTF-8?q?=E4=B8=8B=E5=8F=91=E9=87=8D=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 收口 completed 且最新 Run review_required、但未物化 Case/OT 的附件 (如 XFA 身份门禁在唯一命中后拒绝、候选从未创建)原先落入兜底 running,批次进度中心误显示「处理中」且无任何动作入口。 - 文档级裁决新增 review_required 无 Task/Case 分支:waiting_human + candidate_creating(回归 SNER-20261014-E27D657F) - 重解析入口与 failed 分支同源:无 OT/无 Case 且最新 Run 失败或 需人工,均下发 reparse 动作 --- .../shipping_processing_projection.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/backend/app/services/shipping_notice/shipping_processing_projection.py b/backend/app/services/shipping_notice/shipping_processing_projection.py index ca0b597f..4018b62f 100644 --- a/backend/app/services/shipping_notice/shipping_processing_projection.py +++ b/backend/app/services/shipping_notice/shipping_processing_projection.py @@ -4473,13 +4473,19 @@ def project_conversation_processing_summary( # 非订单处置是唯一无 OT 的合法业务完成出口。 return 'completed', 'completed', None latest_intake_run = latest_run_by_intake_id.get(int(document.intake_id)) or {} - if str(latest_intake_run.get('status') or '').strip().lower() == 'failed': + latest_run_status = str(latest_intake_run.get('status') or '').strip().lower() + if latest_run_status == 'failed': # 收口 completed 但最新 Run 失败(含历史脏数据):按失败裁决并提供重解析。 return ( 'failed', stage, str(latest_intake_run.get('error_code') or '') or 'SHIPPING_NOTICE.ORDER_EXTRACTION_FAILED', ) + if latest_run_status == 'review_required' and task is None and case is None: + # 收口 completed 但最新 Run 需人工且未物化 Case/OT(如 XFA 身份门禁 + # 在命中后拒绝、候选从未创建):停「需处理」并下发重解析入口, + # 禁止落到处理中(回归 SNER-20261014-E27D657F)。 + return ('waiting_human', stage or 'candidate_creating', 'run_review_required') # 无 OT/无处置的收口完成与全量视图同判词:停接收解析(处理中)。 return 'running', stage, None if raw in {'cancelled', 'archived'}: @@ -4525,9 +4531,10 @@ def project_conversation_processing_summary( stage = 'candidate_creating' case_status = str(getattr(case, 'status', None) or '').strip().lower() terminal_case = case_status in {'confirmed', 'non_order', 'superseded', 'reparse_pending'} - # 抽取失败事实除文档级状态外,还认「无 OT/无 Case 且最新 Run 失败」: - # 历史/并发脏数据可能把 Unit 全失败的附件写成 completed(抽取收口语义), - # 此时仍必须下发重解析入口,与 _status 的失败裁决同源。 + # 抽取需人工事实除文档级状态外,还认「无 OT/无 Case 且最新 Run 失败或需人工」: + # 历史/并发脏数据可能把 Unit 全失败的附件写成 completed(抽取收口语义); + # Run 收口 review_required 但未物化 Case/OT(XFA 门禁拒绝)同理, + # 此时仍必须下发重解析入口,与 _status 的裁决同源。 latest_intake_run_status = str( (latest_run_by_intake_id.get(int(document.intake_id)) or {}).get('status') or '' ).strip().lower() @@ -4538,7 +4545,7 @@ def project_conversation_processing_summary( or ( task is None and case is None - and latest_intake_run_status == 'failed' + and latest_intake_run_status in {'failed', 'review_required'} ) ) task_no = str(task.task_no).strip() if task is not None else None