新增透传:91 编码与 affiliate_dash sku 一致时自动命中
- resolveAffiliateDashSkuByProductNo 改 async,匹配两级:①指定映射(skuMapping 归一命中) ②透传(productNo == affiliate_dash 商品 sku) - 商品列表内存缓存 5 分钟,拉取失败返回上次缓存/空集合,匹配 miss 走其他通道不阻塞下单 - 两层命中均触发指定匹配最高优先(preferredExecutorKey) - 测试 +3(224 全绿);线上验证 suit_alan_walker/suit_cloud_bear 透传命中,乱码回退
This commit is contained in:
@@ -688,3 +688,27 @@ order_site 处理要求:
|
||||
| 神秘新商品(未映射) | (无)回退 | — |
|
||||
|
||||
**验证**:typecheck 通过;后端全量 221 测试通过(新增 9 个)。
|
||||
|
||||
---
|
||||
|
||||
## 23. 透传优化:91 编码 == affiliate_dash sku 自动命中(v2.8 · 已完成)
|
||||
|
||||
**需求**:91 商品编码可直接设置为英文(= affiliate_dash sku,如 `suit_alan_walker`),映射表未命中时**自动透传**,无需在 order_site 维护映射表。
|
||||
|
||||
### 23.1 匹配层级(`resolveAffiliateDashSkuByProductNo`,改为 async)
|
||||
|
||||
1. **① 指定映射**(`matchAffiliateDashSku`):skuMapping 精确/归一命中 → `matchMode='affiliate_dash_sku_mapping'`
|
||||
2. **② 透传**(`matchAffiliateDashSkuPassthrough`):映射未命中时,productNo 与 affiliate_dash 商品 sku 完全一致 → `matchMode='affiliate_dash_sku_passthrough'`
|
||||
3. 两层任一命中都触发「指定匹配最高优先」(`preferredExecutorKey=affiliate_dash`),规则/全局优先级不抢占
|
||||
|
||||
**商品列表缓存**:`getAffiliateDashSkuSet()` 内存缓存 5 分钟(`listAllAffiliateDashProducts` 拉全量 33 个 sku);拉取失败返回上次缓存或空集合——匹配 miss 走其他通道,**不阻塞下单**。
|
||||
|
||||
### 23.2 行为验证(线上商品列表)
|
||||
|
||||
| 输入(91 编码) | executor | sku | matchMode |
|
||||
| --- | --- | --- | --- |
|
||||
| `suit_alan_walker`(真实商品) | affiliate_dash | suit_alan_walker | affiliate_dash_sku_passthrough |
|
||||
| `suit_cloud_bear`(真实商品) | affiliate_dash | suit_cloud_bear | affiliate_dash_sku_passthrough |
|
||||
| `not_a_real_sku` | (无)回退 | — | — |
|
||||
|
||||
**验证**:typecheck 通过;后端全量 224 测试通过(透传纯函数测试 +3)。
|
||||
|
||||
Reference in New Issue
Block a user