mercury 原始层 → SaaS 中间表 → REST API → Web · 2026-09-18 · 财务源表化改造后
关键:清洗逻辑散落在两处——mercury 视图(①)和 ingest222 灌入 SQL(②)。口径没人统一管,是漂移根源。
| SaaS 中间表 | mercury 源 | 转换 | 消费方 |
|---|---|---|---|
| amazon_orders | raw v_onno_orders_unified 等视图 | 汇率fx→revenue_usd · days_waiting · is_abnormal · SKU聚合sku_list · 状态中文 | API 财务/订单/看板 |
| order_fees | raw spapi_finances + noon | 费用 abs() · 逐单 commission/fba/promo/other(USD) | API 财务 |
| finance_monthly | raw spapi_finances | SKU×marketplace×月聚合 · 汇率fx · 漏onno | 已弃用 财务已改源表 |
| monthly_pl | raw spapi_finances + settlements | 三方对账口径(posted_date)· 项目×月 P&L | API /finance/monthly(保留) |
| amazon_settlement_monthly | raw spapi_settlements | 按月聚合回款 payout_usd | API 财务 |
| amazon_refund_monthly | raw spapi_refunds | 按月/SKU 聚合退货 units | API 财务 |
| ads_daily / amazon_ads_daily / noon_ads_daily | raw ads_* 各表 | 按日/SKU/国家聚合 spend/sales | API 广告 |
| noon_orders / noon_inventory / noon_sku_* | raw noon_orders / inventory_aging / ads_skus | Noon 专用口径 · n2p SKU映射 · 库龄桶 | API Noon 模块 |
| sku_mapping / products | raw shared.mapping_* | 品牌映射(zipforce/onno/fittingirls)· 成本 cost_rmb | API 全站 |
| sales_hourly / rankings_daily / inventory_health | raw spapi_* / rankings / inventory_fba | 分时订单 · 排名 · 库存健康(stock_days/状态) | API 看板 |
| 口径 | 规则 | 位置 |
|---|---|---|
| 汇率折算 | revenue_usd = amount / fx(currency) | 222 官方 fx() 函数 |
| 有效订单 | order_status NOT IN ('Canceled','Cancelled') | ingest222 + 接口统一 |
| 品牌映射 | shared.mapping_{zipforce,onno,fittingirls} | sku_mapping |
| 净额 | net = revenue_usd − commission − fba − promo − other | order_fees(USD) |
| SKU 拆分 | 金额/费用按 sku_list 逗号展开平摊(多SKU单约9%) | 接口层 |
| country→marketplace | marketplaces 表映射(GB→UK 特例) | 接口层 |
| 灌入方式 | upsert(ON CONFLICT DO UPDATE)· amazon_orders 全量时 DELETE 幽灵行 | ingest222 · 每日 04:30 |
本页为盘点文档,供决策参考。具体改造范围与时机由用户拍板后执行。