remove: 移除无用mongo字段

This commit is contained in:
2026-09-01 19:50:12 +08:00
parent 67ed4d2ffe
commit abcf1894db
10 changed files with 21 additions and 71 deletions
@@ -298,7 +298,7 @@ RoutingKey:
"channelOrderId": 101,
"shopDelta": { "salesAmount": 12.3, "dealOrderCount": 1, "...": "..." },
"productDeltas": [
{ "productId": 1, "categoryId": 2, "metrics": { "salesAmount": 12.3 } }
{ "productId": 1, "metrics": { "salesAmount": 12.3 } }
],
"skuDeltas": [
{ "productId": 1, "productSkuId": 9, "metrics": { "salesAmount": 12.3 } }
@@ -387,16 +387,16 @@ RoutingKey:
| 集合名 | 唯一键 |
|--------|--------|
| `bi_order_stat_daily_shop` | `(companyId, shopId, statDate)` |
| `bi_order_stat_daily_product` | `(companyId, shopId, productId, categoryId, statDate)` |
| `bi_order_stat_daily_product` | `(companyId, shopId, productId, statDate)` |
| `bi_order_stat_daily_sku` | `(companyId, shopId, productSkuId, statDate)` |
`productId=0` 表示未匹配商品;`categoryId=0` 表示未分类;`productSkuId=0` 表示未绑定 SKU。
`categoryId` 为订单写入时快照,商品改类目不回算历史(与旧设计一致)。
`productId=0` 表示未匹配商品;`productSkuId=0` 表示未绑定 SKU。
品类不落日文档,读侧按商品主数据实时解析 `categoryId`。
建议索引:
- shop:`{ companyId: 1, shopId: 1, statDate: 1 }` unique;`{ companyId: 1, statDate: 1 }`;`{ companyId: 1, platformCode: 1, statDate: 1 }`
- product:unique 复合键如上;`{ companyId: 1, categoryId: 1, statDate: 1 }`;`{ companyId: 1, productId: 1, statDate: 1 }`
- product:unique 复合键如上;`{ companyId: 1, productId: 1, statDate: 1 }`
- sku:unique 复合键如上;`{ companyId: 1, productId: 1, statDate: 1 }`
`spring.data.mongodb.auto-index-creation=false`,索引由迁移脚本或启动显式创建。
@@ -439,7 +439,6 @@ RoutingKey:
"productCost": 0,
"freightCost": 0,
"otherCost": 0,
"statVersion": 0,
"dbSnapshotTime": "2026-07-28T16:02:00.123+08:00",
"computedAt": "2026-07-28T16:02:05.000+08:00",
"computeMode": "FULL"
@@ -448,7 +447,7 @@ RoutingKey:
#### 商品日文档额外键
`productId`, `categoryId`(其余指标字段同上)。
`productId`(其余指标字段同上)。
#### SKU 日文档额外键
@@ -459,7 +458,6 @@ RoutingKey:
| 字段 | 说明 |
|------|------|
| `dbSnapshotTime` | **最新一次全量计算**开启 MySQL 事务快照的时刻;增量用 `internalOrderUpdateTime` 与之比较。**仅全量写入/更新**;增量 `$inc` 不抬高该字段 |
| `statVersion` | 与 `OrderStatusStatSets` 重算批次对齐;配置变更全量 rebuild 时递增 |
| `computedAt` | 本次写入完成时间 |
| `computeMode` | `FULL` / `INC` |