feat: 详细日志(分页/映射/批次进度)+ Artifacts 摘要(sync-summary/verify-report)

This commit is contained in:
yeuimu
2026-07-23 09:01:39 +00:00
parent 367168bcdc
commit 4ec7cf2dd6
18 changed files with 154 additions and 22 deletions
+2 -1
View File
@@ -9,7 +9,7 @@ from prefect import flow, task
from api.riin.models import OrderPageRequest
from flows.riin._pipeline import sync_riin_records
from flows.shared import SyncDB, create_riin_client
from flows.shared import SyncDB, build_stats_rows, create_riin_client, emit_sync_summary
RIIN_FINISHED_STATUSES = ["已退款", "已关闭", "已发货"]
ORDER_BATCH = 500
@@ -51,6 +51,7 @@ def riin_refresh_pending() -> dict:
raw = fetch_pending(order_nos)
stats = upsert_records(raw)
print(f"完成: 匹配 {len(raw)} | {stats}")
emit_sync_summary("RIIN 刷新未完结", build_stats_rows("RIIN", stats, [("未完结订单", len(order_nos)), ("匹配", len(raw))]))
return {"pendingCount": len(order_nos), "matchedCount": len(raw), **stats}