feat(in-transit-transfer): 落地证据流重解析并纳入货代与排程配套改动
外部单号进入异动档自然键,圈档按 T-2 成熟封顶,当前归档可单独重解析。同批带上 Crane 禁整页刷新、ODM 白名单降级、排程抽屉与执行记录日期窗,以及 YAML 库存源下线。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
911afa0f73
commit
4c2a7e2a23
145 files changed
+11695
-4214
No files matched your search
@@ -141,9 +141,20 @@ def validate_rpa_callback_not_replayed(task: Any, run_no: str) -> str | None:
|
||||
return None
|
||||
|
||||
|
||||
def validate_schedule_batch_callback_run_no(schedule_run_id: int | None, callback_run_no: str) -> str | None:
|
||||
def validate_schedule_batch_callback_run_no(
|
||||
schedule_run_id: int | None,
|
||||
callback_run_no: str,
|
||||
*,
|
||||
require_awaiting: bool = True,
|
||||
) -> str | None:
|
||||
"""校验定时 batch 回调 run_no 与排程 run 记录一致,防止错绑终态。
|
||||
|
||||
Args:
|
||||
schedule_run_id: 排程 run 主键;None 表示非排程回调,直接通过。
|
||||
callback_run_no: Worker 上报的 batch_run_no / run_no。
|
||||
require_awaiting: True(进度/收件终态)要求仍处于 awaiting_rpa;
|
||||
False(解析 Job)只校验身份,允许排程已按「文件返回」终态化。
|
||||
|
||||
Returns:
|
||||
None 校验通过;否则返回拒绝原因码(schedule_run_not_found / schedule_run_no_missing /
|
||||
schedule_run_no_mismatch / schedule_run_not_awaiting)。
|
||||
@@ -159,6 +170,8 @@ def validate_schedule_batch_callback_run_no(schedule_run_id: int | None, callbac
|
||||
return "schedule_run_no_missing"
|
||||
if provided != expected:
|
||||
return "schedule_run_no_mismatch"
|
||||
if not require_awaiting:
|
||||
return None
|
||||
summary = run.response_summary_json if isinstance(run.response_summary_json, dict) else {}
|
||||
if run.status != "running" or not summary.get("awaiting_rpa"):
|
||||
return "schedule_run_not_awaiting"
|
||||
|
||||
Reference in new issue
Block a user