fix: support manual FBA quote fallback

This commit is contained in:
2026-09-21 10:44:23 +08:00
parent 8f2f485402
commit 9147190d67
9 changed files with 196 additions and 6 deletions
@@ -2286,8 +2286,8 @@ CREATE TABLE fl_inbound_fee (
fee_version int unsigned NOT NULL DEFAULT '1' COMMENT '费用快照版本',
charge_rule_id bigint unsigned DEFAULT NULL COMMENT '历史客户计费规则ID;渠道价格可为空',
charge_rule_version int unsigned DEFAULT NULL COMMENT '历史客户规则版本快照',
carrier_rate_id bigint unsigned NOT NULL COMMENT '船司FBA价格ID',
carrier_rate_version int unsigned NOT NULL COMMENT '船司价格版本快照',
carrier_rate_id bigint unsigned DEFAULT NULL COMMENT '船司FBA价格ID;人工报价为空',
carrier_rate_version int unsigned DEFAULT NULL COMMENT '船司价格版本快照;人工报价为空',
price_book_version_id bigint unsigned DEFAULT NULL COMMENT '整表价格版本ID快照',
rule_code varchar(50) DEFAULT NULL COMMENT '历史客户规则编码快照',
customer_id bigint unsigned DEFAULT NULL COMMENT '客户ID快照',
@@ -2309,7 +2309,7 @@ CREATE TABLE fl_inbound_fee (
destination_warehouse_id bigint unsigned DEFAULT NULL COMMENT '海外仓或FBA目的仓ID快照',
destination_name varchar(128) DEFAULT NULL COMMENT '目的仓名称快照',
destination_code varchar(32) DEFAULT NULL COMMENT 'FBA仓编码快照;海外仓可为空',
rate_effective_from datetime(3) NOT NULL COMMENT '价格生效开始快照',
rate_effective_from datetime(3) DEFAULT NULL COMMENT '价格生效开始快照;人工报价为空',
rate_effective_to datetime(3) DEFAULT NULL COMMENT '价格生效结束快照',
charge_mode varchar(16) DEFAULT NULL COMMENT '计费口径:KG或CBM',
conversion_factor decimal(18,6) DEFAULT NULL COMMENT '历史客户规则使用的换算系数快照',
@@ -2350,6 +2350,11 @@ CREATE TABLE fl_inbound_fee (
CONSTRAINT fk_fee_inbound FOREIGN KEY (inbound_id) REFERENCES fl_inbound_order (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='入库头程费用计算和确认快照';
ALTER TABLE fl_inbound_fee
MODIFY COLUMN carrier_rate_id bigint unsigned DEFAULT NULL COMMENT '船司FBA价格ID;人工报价为空',
MODIFY COLUMN carrier_rate_version int unsigned DEFAULT NULL COMMENT '船司价格版本快照;人工报价为空',
MODIFY COLUMN rate_effective_from datetime(3) DEFAULT NULL COMMENT '价格生效开始快照;人工报价为空';
CREATE TABLE fl_inbound_fee_detail (
id bigint unsigned NOT NULL COMMENT '入库费用明细ID',
tenant_id bigint unsigned NOT NULL COMMENT '客户ID(客户隔离键);费用明细引用平台公共费用项目',