refactor(shipping-notice): 重构货代发货通知状态管理,移除废弃的process_status字段

统一货代发货通知的业务阶段为四个标准阶段:接收解析、订单复核、发货准备、上传完成
设置 ui_state 为前端唯一状态数据源,不再依赖 process_status 驱动业务流程
删除 shipping_notices 表的废弃 process_status 列及对应复合索引,新增数据库迁移脚本
替换全栈代码中所有对 process_status 的引用为生命周期、上传状态等领域字段
更新相关文档、测试用例与前端展示逻辑适配新的状态管理规则
This commit is contained in:
hugo committed 2026-08-15 10:19:10 +08:00
1 parent 6684e7181a
commit 5ef8329bd8
178 files changed
+5091 -1734

No files matched your search

@@ -95,16 +95,11 @@ def _should_requeue_waiting_external_result(task_no: str) -> bool:
if not task_is_active(task):
return False
process_status = str(task.process_status or '').strip()
pending_reason = str(task.pending_human_reason or '').strip()
return (
process_status == 'waiting_inventory'
and pending_reason == PH_RPA_PENDING
pending_reason == PH_RPA_PENDING
and not task.inventory_lines_json
) or (
process_status == 'waiting_upload'
and pending_reason == PH_UPLOAD_RPA_PENDING
)
) or pending_reason == PH_UPLOAD_RPA_PENDING
def _requeue_external_wait_job(task_no: str, *, job: Job | None = None) -> None:
@@ -280,7 +275,7 @@ def run_shipping_notice_job(payload: dict[str, Any], logger: logging.Logger | No
hang_created = bool(
refreshed is not None
and getattr(refreshed, 'current_order_extraction_id', None)
and str(getattr(refreshed, 'process_status', None) or '').strip().lower() in {'', 'created'}
and not getattr(refreshed, 'order_snapshot_id', None)
and status in {'ok', 'needs_human', 'skipped'}
)
if hang_created: