优化
This commit is contained in:
+4
-20
@@ -186,27 +186,11 @@ SELECT
|
||||
|
||||
上述三个结果 `public_scope_violations`、`customer_scope_violations`、`parent_child_scope_mismatches` 必须都为 `0`。
|
||||
|
||||
## 船司 FBA 价格公共作用域迁移
|
||||
## 船司 FBA 价格公共作用域
|
||||
|
||||
- `fl_carrier_fba_rate` 的船司 FBA 价格固定归平台作用域 `tenant_id = 0`;客户计费规则仍按客户 `tenant_id > 0` 隔离。
|
||||
- 固定入口会先检查存量价格的 `(rate_code, rate_version)` 重复,以及相同匹配维度的有效期重叠;发现冲突时通过 `SQLSTATE 45000` 中止,不会自动覆盖价格。
|
||||
- 无冲突时,固定入口才会把存量船司价格迁移到 `tenant_id = 0`,并在末尾验证不存在非平台价格作用域。迁移完成后再启动或重启 `firstleg-service`。
|
||||
|
||||
执行前可只读盘点:
|
||||
|
||||
```sql
|
||||
SELECT tenant_id, COUNT(*) AS total
|
||||
FROM baiyue_firstleg.fl_carrier_fba_rate
|
||||
GROUP BY tenant_id
|
||||
ORDER BY tenant_id;
|
||||
|
||||
SELECT rate_code, rate_version, COUNT(*) AS total
|
||||
FROM baiyue_firstleg.fl_carrier_fba_rate
|
||||
GROUP BY rate_code, rate_version
|
||||
HAVING COUNT(*) > 1;
|
||||
```
|
||||
|
||||
如果固定入口因价格冲突中止,应先由业务确认保留版本、有效期和价格金额,再清理冲突后重新完整执行脚本;不要直接手工把冲突记录改为 `0`。
|
||||
- 当前测试环境 `fl_carrier_fba_rate` 为空表,不执行存量价格迁移。
|
||||
- 初始化表结构将船司 FBA 价格定义为平台公共价格,Firstleg 创建、查询和计费匹配固定使用 `tenant_id = 0`;客户计费规则仍按客户 `tenant_id > 0` 隔离。
|
||||
- 初始化或重建测试库后,再启动或重启 `firstleg-service`。
|
||||
|
||||
## 海外仓阶梯费用增量
|
||||
|
||||
|
||||
Reference in New Issue
Block a user