优化
This commit is contained in:
@@ -18,14 +18,17 @@ DELIMITER ;
|
||||
|
||||
CALL phase2_fba_add_column('fl_inbound_order', 'carrier_id', "BIGINT UNSIGNED NULL COMMENT '计费船司逻辑ID' AFTER channel_name");
|
||||
CALL phase2_fba_add_column('fl_inbound_order', 'carrier_name', "VARCHAR(128) NULL COMMENT '计费船司名称快照' AFTER carrier_id");
|
||||
CALL phase2_fba_add_column('fl_inbound_order', 'pricing_tax_mode', "VARCHAR(16) NULL COMMENT '报价包税维度:TAX_INCLUDED/TAX_EXCLUDED' AFTER tax_mode");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'business_type', "VARCHAR(32) NOT NULL DEFAULT 'FBA' COMMENT '业务或计费类型' AFTER origin_warehouse_name");
|
||||
CALL phase2_fba_add_column('fl_customer_charge_rule', 'version', "INT NOT NULL DEFAULT 0 COMMENT '乐观锁版本号' AFTER deleted");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'version', "INT NOT NULL DEFAULT 0 COMMENT '乐观锁版本号' AFTER deleted");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'rule_code', "VARCHAR(50) NOT NULL DEFAULT '' COMMENT '客户规则编码快照' AFTER carrier_rate_version");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'price_book_version_id', "BIGINT UNSIGNED NULL COMMENT '整表价格版本ID快照' AFTER carrier_rate_version");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'customer_id', "BIGINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '客户ID快照' AFTER rule_code");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'customer_name', "VARCHAR(128) NOT NULL DEFAULT '' COMMENT '客户名称快照' AFTER customer_id");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'business_type', "VARCHAR(32) NOT NULL DEFAULT '' COMMENT '业务类型快照' AFTER customer_name");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'tax_mode', "VARCHAR(24) NULL COMMENT '包税模式快照' AFTER business_type");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'pricing_tax_mode', "VARCHAR(16) NULL COMMENT '报价包税维度快照' AFTER tax_mode");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'rounding_scale', "TINYINT UNSIGNED NOT NULL DEFAULT 3 COMMENT '计费量保留位数快照' AFTER tax_mode");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'rounding_mode', "VARCHAR(24) NOT NULL DEFAULT 'CEILING' COMMENT '舍入方式快照' AFTER rounding_scale");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'rule_effective_from', "DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '客户规则生效开始快照' AFTER rounding_mode");
|
||||
@@ -34,14 +37,41 @@ CALL phase2_fba_add_column('fl_inbound_fee', 'rate_code', "VARCHAR(50) NOT NULL
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'origin_warehouse_id', "BIGINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '起运仓ID快照' AFTER rate_code");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'origin_warehouse_name', "VARCHAR(128) NOT NULL DEFAULT '' COMMENT '起运仓名称快照' AFTER origin_warehouse_id");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'channel_code', "VARCHAR(64) NOT NULL DEFAULT '' COMMENT '渠道编码快照' AFTER origin_warehouse_name");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'carrier_id', "BIGINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '船司ID快照' AFTER channel_code");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'carrier_name', "VARCHAR(128) NOT NULL DEFAULT '' COMMENT '船司名称快照' AFTER carrier_id");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'destination_code', "VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'FBA仓编码快照' AFTER carrier_name");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'carrier_id', "BIGINT UNSIGNED NULL COMMENT '历史承运商ID;渠道价格可为空' AFTER channel_code");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'carrier_name', "VARCHAR(128) NULL COMMENT '历史承运商名称;渠道价格可为空' AFTER carrier_id");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'destination_type', "VARCHAR(16) NULL COMMENT '目的地类型快照:FBA或OVERSEAS' AFTER carrier_name");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'destination_warehouse_id', "BIGINT UNSIGNED NULL COMMENT '海外仓或FBA目的仓ID快照' AFTER destination_type");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'destination_name', "VARCHAR(128) NULL COMMENT '目的仓名称快照' AFTER destination_warehouse_id");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'destination_code', "VARCHAR(32) NULL COMMENT 'FBA仓编码快照;海外仓可为空' AFTER destination_name");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'rate_effective_from', "DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '价格生效开始快照' AFTER destination_code");
|
||||
CALL phase2_fba_add_column('fl_inbound_fee', 'rate_effective_to', "DATETIME(3) NULL COMMENT '价格生效结束快照' AFTER rate_effective_from");
|
||||
CALL phase2_fba_add_column('fl_inbound_idempotency', 'result_resource_id', "BIGINT UNSIGNED NULL COMMENT '成功结果资源ID' AFTER result_json");
|
||||
CALL phase2_fba_add_column('fl_inbound_pallet_allocation', 'warehouse_resource_tenant_id',
|
||||
"BIGINT UNSIGNED NULL COMMENT '平台公共仓储资源固定使用 0;tenant_id 仍是客户隔离键' AFTER warehouse_id");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'destination_type',
|
||||
"VARCHAR(16) NULL COMMENT '目的地类型:FBA或OVERSEAS;REGION_WEIGHT_TIER区域阶梯行为空' AFTER carrier_name");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'price_book_version_id',
|
||||
"BIGINT UNSIGNED NULL COMMENT '整表价格版本ID;历史兼容价格可为空' AFTER tenant_id");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'origin_warehouse_code',
|
||||
"VARCHAR(64) NULL COMMENT '起运仓稳定编码' AFTER origin_warehouse_id");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'destination_warehouse_id',
|
||||
"BIGINT UNSIGNED NULL COMMENT '平台海外仓稳定ID;不存环境专属ID' AFTER destination_code");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'destination_name',
|
||||
"VARCHAR(128) NULL COMMENT '目的仓名称快照' AFTER destination_warehouse_id");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'price_model',
|
||||
"VARCHAR(32) NOT NULL DEFAULT 'FBA_WAREHOUSE_RATE' COMMENT '价格模型' AFTER channel_code");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'region_code',
|
||||
"VARCHAR(16) NULL COMMENT '区域阶梯模型区域编码' AFTER destination_code");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'pricing_tax_mode',
|
||||
"VARCHAR(16) NULL COMMENT '报价包税维度;独立于订单tax_mode' AFTER region_code");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'weight_from_kg',
|
||||
"DECIMAL(18,6) NULL COMMENT '区域阶梯起始计费重量KG' AFTER pricing_tax_mode");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'source_sheet_name',
|
||||
"VARCHAR(128) NULL COMMENT '原始Excel Sheet' AFTER additional_fee");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'source_row_number',
|
||||
"INT UNSIGNED NULL COMMENT '原始Excel行号' AFTER source_sheet_name");
|
||||
CALL phase2_fba_add_column('fl_carrier_fba_rate', 'source_destination_text',
|
||||
"VARCHAR(1000) NULL COMMENT '原始组合仓库或区域文本' AFTER source_row_number");
|
||||
|
||||
-- 仓储资源是平台公共主数据;存量分配快照统一迁移到平台作用域 0,再收口非空约束。
|
||||
UPDATE fl_inbound_pallet_allocation
|
||||
@@ -56,6 +86,27 @@ SET @sql = IF(@resource_tenant_needs_modify > 0,
|
||||
'SELECT 1');
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
-- 价格上传确认前,起运仓和区域阶梯目的地可以暂未绑定;确认生效时由 Firstleg 完成映射和类型校验。
|
||||
ALTER TABLE fl_carrier_fba_rate
|
||||
MODIFY COLUMN origin_warehouse_id BIGINT UNSIGNED NULL COMMENT '确认前可为空;确认后绑定平台公共起运仓逻辑ID',
|
||||
MODIFY COLUMN carrier_id BIGINT UNSIGNED NULL COMMENT '历史承运商ID;渠道价格可为空',
|
||||
MODIFY COLUMN carrier_name VARCHAR(128) NULL COMMENT '历史承运商名称;渠道价格可为空',
|
||||
MODIFY COLUMN destination_type VARCHAR(16) NULL COMMENT '目的地类型:FBA或OVERSEAS;REGION_WEIGHT_TIER区域阶梯行为空',
|
||||
MODIFY COLUMN destination_code VARCHAR(32) NULL COMMENT 'FBA目的仓编码;区域阶梯模型为空';
|
||||
|
||||
ALTER TABLE fl_inbound_fee
|
||||
MODIFY COLUMN charge_rule_id BIGINT UNSIGNED NULL COMMENT '历史客户计费规则ID;渠道价格可为空',
|
||||
MODIFY COLUMN charge_rule_version INT UNSIGNED NULL COMMENT '历史客户规则版本快照',
|
||||
MODIFY COLUMN rule_code VARCHAR(50) NULL COMMENT '历史客户规则编码快照',
|
||||
MODIFY COLUMN rounding_scale TINYINT UNSIGNED NULL COMMENT '历史客户规则计费量保留位数快照',
|
||||
MODIFY COLUMN rounding_mode VARCHAR(24) NULL COMMENT '历史客户规则舍入方式快照',
|
||||
MODIFY COLUMN rule_effective_from DATETIME(3) NULL COMMENT '历史客户规则生效开始快照',
|
||||
MODIFY COLUMN carrier_id BIGINT UNSIGNED NULL COMMENT '历史承运商ID;渠道价格可为空',
|
||||
MODIFY COLUMN carrier_name VARCHAR(128) NULL COMMENT '历史承运商名称;渠道价格可为空',
|
||||
MODIFY COLUMN destination_code VARCHAR(32) NULL COMMENT 'FBA仓编码快照;海外仓可为空',
|
||||
MODIFY COLUMN charge_mode VARCHAR(16) NULL COMMENT '计费口径:KG或CBM',
|
||||
MODIFY COLUMN conversion_factor DECIMAL(18,6) NULL COMMENT '历史客户规则使用的换算系数快照';
|
||||
|
||||
DROP PROCEDURE IF EXISTS phase2_fba_add_column;
|
||||
|
||||
-- 旧索引可能缺少业务类型、船司和结束时间;用新索引名并存,避免破坏线上依赖。
|
||||
|
||||
@@ -32,6 +32,7 @@ CREATE TABLE IF NOT EXISTS fl_inbound_order (
|
||||
carrier_id BIGINT UNSIGNED NULL COMMENT '计费船司逻辑ID',
|
||||
carrier_name VARCHAR(128) NULL COMMENT '计费船司名称快照',
|
||||
tax_mode VARCHAR(24) NULL COMMENT '买单或退税模式',
|
||||
pricing_tax_mode VARCHAR(16) NULL COMMENT '报价包税维度:TAX_INCLUDED/TAX_EXCLUDED',
|
||||
container_mode VARCHAR(24) NULL COMMENT '整柜或散货模式',
|
||||
customs_inspection TINYINT(1) NULL COMMENT '是否商检',
|
||||
destination_type VARCHAR(24) NULL COMMENT '目的仓类型',
|
||||
@@ -310,19 +311,31 @@ CREATE TABLE IF NOT EXISTS fl_customer_charge_rule (
|
||||
CREATE TABLE IF NOT EXISTS fl_carrier_fba_rate (
|
||||
id BIGINT UNSIGNED NOT NULL COMMENT '船司FBA价格ID',
|
||||
tenant_id BIGINT UNSIGNED NOT NULL COMMENT '平台价格作用域ID,船司价格固定为0',
|
||||
price_book_version_id BIGINT UNSIGNED NULL COMMENT '整表价格版本ID;历史兼容价格可为空',
|
||||
rate_code VARCHAR(50) NOT NULL COMMENT '平台公共价格编码',
|
||||
rate_version INT UNSIGNED NOT NULL COMMENT '价格版本号',
|
||||
origin_warehouse_id BIGINT UNSIGNED NOT NULL COMMENT '起运仓逻辑ID',
|
||||
origin_warehouse_id BIGINT UNSIGNED NULL COMMENT '确认前可为空;确认后绑定平台公共起运仓逻辑ID',
|
||||
origin_warehouse_code VARCHAR(64) NULL COMMENT '起运仓稳定编码',
|
||||
origin_warehouse_name VARCHAR(128) NOT NULL COMMENT '起运仓名称快照',
|
||||
business_type VARCHAR(32) NOT NULL COMMENT '业务或计费类型',
|
||||
channel_code VARCHAR(64) NULL COMMENT '渠道编码',
|
||||
price_model VARCHAR(32) NOT NULL DEFAULT 'FBA_WAREHOUSE_RATE' COMMENT '价格模型',
|
||||
carrier_id BIGINT UNSIGNED NULL COMMENT '船司逻辑ID',
|
||||
carrier_name VARCHAR(128) NOT NULL COMMENT '船司名称快照',
|
||||
destination_code VARCHAR(32) NOT NULL COMMENT 'FBA目的仓编码',
|
||||
carrier_name VARCHAR(128) NULL COMMENT '历史承运商名称;渠道价格可为空',
|
||||
destination_type VARCHAR(16) NULL COMMENT '目的地类型:FBA或OVERSEAS;REGION_WEIGHT_TIER区域阶梯行为空',
|
||||
destination_code VARCHAR(32) NULL COMMENT 'FBA目的仓编码;区域阶梯模型为空',
|
||||
destination_warehouse_id BIGINT UNSIGNED NULL COMMENT '平台海外仓稳定ID;不存环境专属ID',
|
||||
destination_name VARCHAR(128) NULL COMMENT '目的仓名称快照',
|
||||
region_code VARCHAR(16) NULL COMMENT '区域阶梯模型区域编码',
|
||||
pricing_tax_mode VARCHAR(16) NULL COMMENT '报价包税维度;独立于订单tax_mode',
|
||||
weight_from_kg DECIMAL(18,6) NULL COMMENT '区域阶梯起始计费重量KG',
|
||||
charge_unit VARCHAR(16) NOT NULL COMMENT '计费单位:KG或CBM',
|
||||
unit_price DECIMAL(18,6) NOT NULL COMMENT '基础单价',
|
||||
currency CHAR(3) NOT NULL COMMENT '币种',
|
||||
additional_fee DECIMAL(18,2) NOT NULL DEFAULT 0 COMMENT '固定附加费',
|
||||
source_sheet_name VARCHAR(128) NULL COMMENT '原始Excel Sheet',
|
||||
source_row_number INT UNSIGNED NULL COMMENT '原始Excel行号',
|
||||
source_destination_text VARCHAR(1000) NULL COMMENT '原始组合仓库或区域文本',
|
||||
effective_from DATETIME(3) NOT NULL COMMENT '生效开始时间',
|
||||
effective_to DATETIME(3) NULL COMMENT '生效结束时间',
|
||||
status VARCHAR(16) NOT NULL DEFAULT 'ACTIVE' COMMENT '价格状态',
|
||||
@@ -335,39 +348,156 @@ CREATE TABLE IF NOT EXISTS fl_carrier_fba_rate (
|
||||
version INT NOT NULL DEFAULT 0 COMMENT '乐观锁版本号',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY uk_fba_rate_version (tenant_id, rate_code, rate_version),
|
||||
KEY idx_fba_rate_match (tenant_id, origin_warehouse_id, business_type, channel_code, carrier_id, destination_code, charge_unit, status, effective_from, effective_to)
|
||||
KEY idx_fba_rate_match (tenant_id, origin_warehouse_id, business_type, channel_code, carrier_id, destination_type, destination_code, destination_warehouse_id, charge_unit, status, effective_from, effective_to),
|
||||
KEY idx_fba_rate_book (price_book_version_id, channel_code, origin_warehouse_id, price_model, status),
|
||||
KEY idx_fba_rate_destination (price_book_version_id, channel_code, origin_warehouse_id, destination_type, destination_warehouse_id, destination_code),
|
||||
KEY idx_fba_rate_region (price_book_version_id, channel_code, origin_warehouse_id, region_code, weight_from_kg)
|
||||
) ENGINE=InnoDB COMMENT='船司FBA目的仓价格版本';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS fl_price_channel_catalog (
|
||||
id BIGINT UNSIGNED NOT NULL COMMENT '渠道目录ID',
|
||||
channel_code VARCHAR(64) NOT NULL COMMENT '稳定渠道编码',
|
||||
display_name VARCHAR(128) NOT NULL COMMENT '平台渠道名称',
|
||||
price_model VARCHAR(32) NOT NULL COMMENT '默认价格模型',
|
||||
source_sheet_name VARCHAR(128) NOT NULL COMMENT '来源Sheet名称;海派为同一Sheet',
|
||||
aliases_json JSON NOT NULL COMMENT '上传名称别名数组',
|
||||
status VARCHAR(16) NOT NULL DEFAULT 'ACTIVE' COMMENT '目录状态',
|
||||
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY uk_price_channel_code (channel_code),
|
||||
KEY idx_price_channel_status (status, price_model)
|
||||
) ENGINE=InnoDB COMMENT='平台公共船期价格固定渠道目录';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS fl_price_origin_alias (
|
||||
id BIGINT UNSIGNED NOT NULL COMMENT '起运仓别名ID',
|
||||
warehouse_code VARCHAR(64) NOT NULL COMMENT '平台仓库稳定编码,不存环境专属ID',
|
||||
alias_name VARCHAR(128) NOT NULL COMMENT 'Excel起运仓名称别名',
|
||||
status VARCHAR(16) NOT NULL DEFAULT 'ACTIVE',
|
||||
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY uk_price_origin_alias (warehouse_code, alias_name),
|
||||
KEY idx_price_origin_alias_name (alias_name, status)
|
||||
) ENGINE=InnoDB COMMENT='价格表起运仓名称别名映射';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS fl_price_book_version (
|
||||
id BIGINT UNSIGNED NOT NULL COMMENT '整表价格版本ID',
|
||||
tenant_id BIGINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '平台公共价格作用域固定为0',
|
||||
version_no INT UNSIGNED NOT NULL COMMENT '整表版本号',
|
||||
original_file_name VARCHAR(255) NOT NULL COMMENT '原始Excel文件名',
|
||||
source_file_id BIGINT UNSIGNED NULL COMMENT 'File服务原始文件ID',
|
||||
source_sha256 CHAR(64) NULL COMMENT '原始文件SHA-256',
|
||||
status VARCHAR(24) NOT NULL DEFAULT 'PENDING_CONFIRMATION' COMMENT '待确认上传记录;ACTIVE/SUPERSEDED/FAILED',
|
||||
blocking_error_count INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '阻断错误数',
|
||||
warning_count INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '警告数',
|
||||
parse_issues_json JSON NULL COMMENT '上传解析问题及待确认重新校验结果',
|
||||
channel_count INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '解析渠道数',
|
||||
rate_count INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '解析价格数',
|
||||
created_by BIGINT UNSIGNED NOT NULL,
|
||||
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
published_by BIGINT UNSIGNED NULL,
|
||||
published_at DATETIME(3) NULL COMMENT '确认并生效时间',
|
||||
superseded_at DATETIME(3) NULL COMMENT '被下一版本替换时间',
|
||||
updated_by BIGINT UNSIGNED NOT NULL,
|
||||
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
|
||||
deleted TINYINT(1) NOT NULL DEFAULT 0,
|
||||
version INT NOT NULL DEFAULT 0 COMMENT '乐观锁版本号',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY uk_price_book_version (tenant_id, version_no),
|
||||
KEY idx_price_book_status (tenant_id, status, published_at),
|
||||
KEY idx_price_book_source_hash (tenant_id, source_sha256)
|
||||
) ENGINE=InnoDB COMMENT='平台公共船期价格整表版本';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS fl_price_book_channel (
|
||||
id BIGINT UNSIGNED NOT NULL COMMENT '版本渠道快照ID',
|
||||
price_book_version_id BIGINT UNSIGNED NOT NULL COMMENT '整表价格版本ID',
|
||||
channel_code VARCHAR(64) NOT NULL COMMENT '固定渠道编码',
|
||||
channel_name VARCHAR(128) NOT NULL COMMENT '渠道名称快照',
|
||||
price_model VARCHAR(32) NOT NULL COMMENT '价格模型快照',
|
||||
source_sheet_name VARCHAR(128) NOT NULL COMMENT '原始Excel Sheet',
|
||||
estimated_departure_date DATE NULL COMMENT '标准预计开船日期',
|
||||
estimated_departure_text VARCHAR(128) NULL COMMENT '原始预计开船日期文本',
|
||||
latest_warehouse_entry VARCHAR(128) NULL COMMENT '最晚进仓时间',
|
||||
vessel_name VARCHAR(128) NULL COMMENT '船名',
|
||||
voyage_no VARCHAR(64) NULL COMMENT '航次',
|
||||
reference_transit VARCHAR(128) NULL COMMENT '参考时效',
|
||||
surcharge_description VARCHAR(2000) NULL COMMENT '附加费说明,仅展示',
|
||||
remark VARCHAR(2000) NULL COMMENT '渠道备注',
|
||||
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY uk_price_book_channel (price_book_version_id, channel_code),
|
||||
KEY idx_price_book_channel_code (channel_code, price_book_version_id)
|
||||
) ENGINE=InnoDB COMMENT='价格版本渠道及船期快照';
|
||||
|
||||
INSERT INTO fl_price_channel_catalog
|
||||
(id, channel_code, display_name, price_model, source_sheet_name, aliases_json, status)
|
||||
VALUES
|
||||
(1, 'MATSON_CLX_TRUCK', '美森正班海卡', 'FBA_WAREHOUSE_RATE', '美森正班海卡', JSON_ARRAY('美森正班海卡'), 'ACTIVE'),
|
||||
(2, 'MATSON_MAX_TRUCK', '美森加班海卡', 'FBA_WAREHOUSE_RATE', '美森加班海卡', JSON_ARRAY('美森加班海卡'), 'ACTIVE'),
|
||||
(3, 'EXX_TRUCK', 'EXX海卡', 'FBA_WAREHOUSE_RATE', 'EXX海卡', JSON_ARRAY('EXX海卡'), 'ACTIVE'),
|
||||
(4, 'HEDE_TRUCK', '合德海卡', 'FBA_WAREHOUSE_RATE', '合德海卡', JSON_ARRAY('合德海卡'), 'ACTIVE'),
|
||||
(5, 'EXX_RAIL_NY', '纽约EXX海铁', 'FBA_WAREHOUSE_RATE', '纽约EXX海铁', JSON_ARRAY('纽约EXX海铁'), 'ACTIVE'),
|
||||
(6, 'OA_LA_TRUCK', '洛杉矶普船海卡', 'FBA_WAREHOUSE_RATE', '洛杉矶普船海卡', JSON_ARRAY('洛杉矶普船海卡'), 'ACTIVE'),
|
||||
(7, 'OA_LA_FULL_TRUCK', '洛杉矶普船全卡', 'FBA_WAREHOUSE_RATE', '洛杉矶普船全卡', JSON_ARRAY('洛杉矶普船全卡'), 'ACTIVE'),
|
||||
(8, 'OA_CHICAGO_RAIL', '芝加哥普船海铁', 'FBA_WAREHOUSE_RATE', '芝加哥普船海铁', JSON_ARRAY('芝加哥普船海铁'), 'ACTIVE'),
|
||||
(9, 'OA_HOUSTON_TRUCK', '休斯顿普船海卡', 'FBA_WAREHOUSE_RATE', '休斯顿普船海卡', JSON_ARRAY('休斯顿普船海卡'), 'ACTIVE'),
|
||||
(10, 'OA_NEW_YORK_TRUCK', '纽约普船海卡', 'FBA_WAREHOUSE_RATE', '纽约普船海卡', JSON_ARRAY('纽约普船海卡'), 'ACTIVE'),
|
||||
(11, 'OA_SAVANNAH_TRUCK', '萨凡纳普船海卡', 'FBA_WAREHOUSE_RATE', '萨凡纳普船海卡', JSON_ARRAY('萨凡纳普船海卡'), 'ACTIVE'),
|
||||
(12, 'MATSON_CLX_PARCEL', '美森正班海派', 'REGION_WEIGHT_TIER', '海派', JSON_ARRAY('美森正班海派'), 'ACTIVE'),
|
||||
(13, 'MATSON_MAX_PARCEL', '美森加班海派', 'REGION_WEIGHT_TIER', '海派', JSON_ARRAY('美森加班海派'), 'ACTIVE'),
|
||||
(14, 'HEDE_PARCEL', '合德海派', 'REGION_WEIGHT_TIER', '海派', JSON_ARRAY('合德海派'), 'ACTIVE'),
|
||||
(15, 'OA_PARCEL', '普船海派', 'REGION_WEIGHT_TIER', '海派', JSON_ARRAY('普船海派'), 'ACTIVE')
|
||||
ON DUPLICATE KEY UPDATE
|
||||
display_name = VALUES(display_name), price_model = VALUES(price_model),
|
||||
source_sheet_name = VALUES(source_sheet_name), aliases_json = VALUES(aliases_json), status = VALUES(status);
|
||||
|
||||
INSERT INTO fl_price_origin_alias (id, warehouse_code, alias_name, status)
|
||||
VALUES
|
||||
(1, 'CN-YIWU-01', '华东仓(义乌)', 'ACTIVE'),
|
||||
(2, 'CN-YIWU-01', '义乌仓', 'ACTIVE'),
|
||||
(3, 'CN-YIWU-01', '义乌', 'ACTIVE'),
|
||||
(4, 'CN-DONGGUAN-01', '华南仓(深圳)', 'ACTIVE'),
|
||||
(5, 'CN-DONGGUAN-01', '东莞仓', 'ACTIVE'),
|
||||
(6, 'CN-DONGGUAN-01', '深圳仓', 'ACTIVE')
|
||||
ON DUPLICATE KEY UPDATE status = VALUES(status);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS fl_inbound_fee (
|
||||
id BIGINT UNSIGNED NOT NULL COMMENT '入库费用ID',
|
||||
tenant_id BIGINT UNSIGNED NOT NULL COMMENT '数据所属租户ID',
|
||||
inbound_id BIGINT UNSIGNED NOT NULL COMMENT '入库单ID',
|
||||
fee_no VARCHAR(40) NOT NULL COMMENT '租户内唯一费用单号',
|
||||
fee_version INT UNSIGNED NOT NULL DEFAULT 1 COMMENT '费用快照版本',
|
||||
charge_rule_id BIGINT UNSIGNED NOT NULL COMMENT '客户计费规则ID',
|
||||
charge_rule_version INT UNSIGNED NOT NULL COMMENT '客户规则版本快照',
|
||||
charge_rule_id BIGINT UNSIGNED NULL COMMENT '历史客户计费规则ID;渠道价格可为空',
|
||||
charge_rule_version INT UNSIGNED NULL COMMENT '历史客户规则版本快照',
|
||||
carrier_rate_id BIGINT UNSIGNED NOT NULL COMMENT '船司FBA价格ID',
|
||||
carrier_rate_version INT UNSIGNED NOT NULL COMMENT '船司价格版本快照',
|
||||
rule_code VARCHAR(50) NOT NULL COMMENT '客户规则编码快照',
|
||||
price_book_version_id BIGINT UNSIGNED NULL COMMENT '整表价格版本ID快照',
|
||||
rule_code VARCHAR(50) NULL COMMENT '历史客户规则编码快照',
|
||||
customer_id BIGINT UNSIGNED NOT NULL COMMENT '客户ID快照',
|
||||
customer_name VARCHAR(128) NOT NULL COMMENT '客户名称快照',
|
||||
business_type VARCHAR(32) NOT NULL COMMENT '业务类型快照',
|
||||
tax_mode VARCHAR(24) NULL COMMENT '包税模式快照',
|
||||
rounding_scale TINYINT UNSIGNED NOT NULL COMMENT '计费量保留位数快照',
|
||||
rounding_mode VARCHAR(24) NOT NULL COMMENT '舍入方式快照',
|
||||
rule_effective_from DATETIME(3) NOT NULL COMMENT '客户规则生效开始快照',
|
||||
tax_mode VARCHAR(24) NULL COMMENT '订单买单或退税模式快照',
|
||||
pricing_tax_mode VARCHAR(16) NULL COMMENT '报价包税维度快照',
|
||||
rounding_scale TINYINT UNSIGNED NULL COMMENT '历史客户规则计费量保留位数快照',
|
||||
rounding_mode VARCHAR(24) NULL COMMENT '历史客户规则舍入方式快照',
|
||||
rule_effective_from DATETIME(3) NULL COMMENT '历史客户规则生效开始快照',
|
||||
rule_effective_to DATETIME(3) NULL COMMENT '客户规则生效结束快照',
|
||||
rate_code VARCHAR(50) NOT NULL COMMENT '船司价格编码快照',
|
||||
origin_warehouse_id BIGINT UNSIGNED NOT NULL COMMENT '起运仓ID快照',
|
||||
origin_warehouse_name VARCHAR(128) NOT NULL COMMENT '起运仓名称快照',
|
||||
channel_code VARCHAR(64) NOT NULL COMMENT '渠道编码快照',
|
||||
carrier_id BIGINT UNSIGNED NOT NULL COMMENT '船司ID快照',
|
||||
carrier_name VARCHAR(128) NOT NULL COMMENT '船司名称快照',
|
||||
destination_code VARCHAR(32) NOT NULL COMMENT 'FBA仓编码快照',
|
||||
carrier_id BIGINT UNSIGNED NULL COMMENT '历史承运商ID;渠道价格可为空',
|
||||
carrier_name VARCHAR(128) NULL COMMENT '历史承运商名称;渠道价格可为空',
|
||||
destination_type VARCHAR(16) NULL COMMENT '目的地类型快照:FBA或OVERSEAS',
|
||||
destination_warehouse_id BIGINT UNSIGNED NULL COMMENT '海外仓或FBA目的仓ID快照',
|
||||
destination_name VARCHAR(128) NULL COMMENT '目的仓名称快照',
|
||||
destination_code VARCHAR(32) NULL COMMENT 'FBA仓编码快照;海外仓可为空',
|
||||
rate_effective_from DATETIME(3) NOT NULL COMMENT '价格生效开始快照',
|
||||
rate_effective_to DATETIME(3) NULL COMMENT '价格生效结束快照',
|
||||
charge_mode VARCHAR(16) NOT NULL COMMENT '计费口径:KG或CBM',
|
||||
conversion_factor DECIMAL(18,6) NOT NULL COMMENT '使用的换算系数快照',
|
||||
charge_mode VARCHAR(16) NULL COMMENT '计费口径:KG或CBM',
|
||||
conversion_factor DECIMAL(18,6) NULL COMMENT '历史客户规则使用的换算系数快照',
|
||||
actual_weight_kg DECIMAL(18,3) NOT NULL COMMENT '试算时实际重量kg',
|
||||
actual_volume_cbm DECIMAL(18,4) NOT NULL COMMENT '试算时实际体积m3',
|
||||
converted_quantity DECIMAL(18,4) NOT NULL COMMENT '换算后的重量或体积',
|
||||
|
||||
@@ -13,7 +13,13 @@ paths:
|
||||
parameters:
|
||||
- {$ref: '#/components/parameters/OptionalTenantId'}
|
||||
- {name: ruleCode, in: query, schema: {type: string, maxLength: 50}}
|
||||
responses: {'200': {description: 成功或业务失败}, '403': {description: 无权限}}
|
||||
responses:
|
||||
'200':
|
||||
description: 成功或业务失败
|
||||
content:
|
||||
application/json:
|
||||
schema: {$ref: '#/components/schemas/CustomerRuleVersionSummary'}
|
||||
'403': {description: 无权限}
|
||||
/api/platform/v1/fba-pricing/customer-rules/versions:
|
||||
post:
|
||||
summary: 新建客户计费规则版本
|
||||
@@ -51,10 +57,80 @@ paths:
|
||||
summary: 停用船司 FBA 价格版本
|
||||
parameters: [{$ref: '#/components/parameters/Id'}]
|
||||
responses: {'200': {description: 成功或业务失败}, '403': {description: 无权限}}
|
||||
/api/platform/v1/fba-pricing/carrier-rates/price-books:
|
||||
get:
|
||||
summary: 查询船期价格表版本
|
||||
description: 需要 firstleg:fba-pricing:rate:view 权限;返回待确认上传、当前生效和历史替换版本。
|
||||
parameters:
|
||||
- {name: status, in: query, schema: {$ref: '#/components/schemas/PriceBookStatus'}}
|
||||
responses:
|
||||
'200':
|
||||
description: 成功或业务失败
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items: {$ref: '#/components/schemas/PriceBookVersionSummary'}
|
||||
'403': {description: 无权限}
|
||||
post:
|
||||
summary: 上传船期价格表并生成待确认记录
|
||||
description: 仅上传和解析,生成待确认上传记录,不改变当前生效版本;需要 firstleg:fba-pricing:rate:edit 权限。
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema: {$ref: '#/components/schemas/PriceBookUploadRequest'}
|
||||
responses: {'200': {description: 成功或业务失败}, '403': {description: 无权限}}
|
||||
/api/platform/v1/fba-pricing/carrier-rates/price-books/{versionId}:
|
||||
get:
|
||||
summary: 查询船期价格表版本详情和解析结果
|
||||
parameters: [{$ref: '#/components/parameters/VersionId'}]
|
||||
responses:
|
||||
'200':
|
||||
description: 成功或业务失败
|
||||
content:
|
||||
application/json:
|
||||
schema: {$ref: '#/components/schemas/PriceBookVersionDetail'}
|
||||
'403': {description: 无权限}
|
||||
/api/platform/v1/fba-pricing/carrier-rates/price-books/{versionId}/publish:
|
||||
post:
|
||||
summary: 确认并立即生效船期价格表版本
|
||||
description: 只确认上传表中的仓库映射,不允许在线改价;阻断错误必须为零。发布事务将上一 ACTIVE 版本标记为 SUPERSEDED,始终只保留一份 ACTIVE。
|
||||
parameters: [{$ref: '#/components/parameters/VersionId'}]
|
||||
requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/PriceBookConfirmationRequest'}}}}
|
||||
responses: {'200': {description: 成功或业务失败}, '403': {description: 无权限}}
|
||||
/api/platform/v1/fba-pricing/carrier-rates/price-books/{versionId}/source:
|
||||
get:
|
||||
summary: 下载船期价格表原始文件
|
||||
description: 需要 firstleg:fba-pricing:rate:view 权限;由 Firstleg 代理 File 服务内部下载。
|
||||
parameters: [{$ref: '#/components/parameters/VersionId'}]
|
||||
responses:
|
||||
'200': {description: 原始 XLSX 附件, content: {application/octet-stream: {schema: {type: string, format: binary}}}}
|
||||
'403': {description: 无权限}
|
||||
/api/merchant/v1/first-leg/pricing/channels:
|
||||
get:
|
||||
summary: 查询当前起运仓可选船期渠道
|
||||
description: 客户只看到当前 ACTIVE 版本;不存在于当前版本的渠道不可选择。pricingTaxModes 来自当前起运仓下的生效价格行,前端不得写死包税选项。
|
||||
parameters:
|
||||
- {name: originWarehouseId, in: query, required: true, schema: {type: string, pattern: '^[1-9][0-9]*$'}}
|
||||
responses:
|
||||
'200':
|
||||
description: 成功或业务失败
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items: {$ref: '#/components/schemas/MerchantPricingChannel'}
|
||||
/api/merchant/v1/first-leg/pricing/estimate:
|
||||
post:
|
||||
summary: 计算头程参考费用
|
||||
description: 只返回基础参考费用,不包含复杂附加费和最终结算调整;pricingTaxMode 不复用订单 taxMode。
|
||||
requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/PriceEstimateRequest'}}}}
|
||||
responses: {'200': {description: 成功或业务失败}}
|
||||
/api/platform/v1/inbounds/{inboundId}/fees/calculate:
|
||||
post:
|
||||
summary: 按审核通过测量快照试算 FBA 费用
|
||||
description: 精确匹配唯一客户规则和唯一船司价格;测量审核后即使主流程已到 WAIT_SPLIT,也可独立试算且不回退主流程状态;需要 firstleg:fba-pricing:calculate 权限。
|
||||
description: 仅匹配当前唯一 ACTIVE 船期价格表中的 ACTIVE 价格行,按起运仓、渠道、目的仓、pricingTaxMode 和计费单位估价;不再以 carrierId 或客户计费规则作为前置。海派还需按FBA区域和重量阶梯匹配;测量审核后即使主流程已到 WAIT_SPLIT,也可独立试算且不回退主流程状态;需要 firstleg:fba-pricing:calculate 权限。
|
||||
parameters: [{$ref: '#/components/parameters/TenantId'}, {$ref: '#/components/parameters/InboundId'}, {$ref: '#/components/parameters/IdempotencyKey'}]
|
||||
requestBody: {content: {application/json: {schema: {$ref: '#/components/schemas/CalculateRequest'}}}}
|
||||
responses: {'200': {description: 成功或业务失败}, '403': {description: 无权限}}
|
||||
@@ -94,6 +170,7 @@ components:
|
||||
TenantId: {name: tenantId, in: query, required: true, description: 目标客户 ID;参数名为历史兼容, schema: {type: string, pattern: '^[1-9][0-9]*$'}}
|
||||
Id: {name: id, in: path, required: true, schema: {type: string, pattern: '^[1-9][0-9]*$'}}
|
||||
InboundId: {name: inboundId, in: path, required: true, schema: {type: string, pattern: '^[1-9][0-9]*$'}}
|
||||
VersionId: {name: versionId, in: path, required: true, schema: {type: string, pattern: '^[1-9][0-9]*$'}}
|
||||
IdempotencyKey: {name: Idempotency-Key, in: header, required: true, schema: {type: string, maxLength: 128}}
|
||||
schemas:
|
||||
AdjustFeeRequest:
|
||||
@@ -124,7 +201,7 @@ components:
|
||||
effectiveTo: {type: string, format: date-time, nullable: true}
|
||||
CarrierRateVersionRequest:
|
||||
type: object
|
||||
required: [rateCode, originWarehouseId, originWarehouseName, businessType, channelCode, carrierId, carrierName, destinationCode, chargeUnit, unitPrice, currency, additionalFee, effectiveFrom]
|
||||
required: [rateCode, originWarehouseId, originWarehouseName, businessType, channelCode, carrierId, carrierName, destinationType, chargeUnit, unitPrice, currency, additionalFee, effectiveFrom]
|
||||
properties:
|
||||
rateCode: {type: string, maxLength: 50}
|
||||
originWarehouseId: {type: string, pattern: '^[1-9][0-9]*$'}
|
||||
@@ -133,10 +210,170 @@ components:
|
||||
channelCode: {type: string}
|
||||
carrierId: {type: string, pattern: '^[1-9][0-9]*$'}
|
||||
carrierName: {type: string}
|
||||
destinationCode: {type: string}
|
||||
destinationType: {$ref: '#/components/schemas/PricingDestinationType'}
|
||||
destinationCode: {type: string, nullable: true}
|
||||
destinationWarehouseId: {type: string, pattern: '^[1-9][0-9]*$', nullable: true}
|
||||
destinationName: {type: string, maxLength: 128, nullable: true}
|
||||
chargeUnit: {type: string, enum: [KG, CBM]}
|
||||
unitPrice: {type: number, exclusiveMinimum: 0}
|
||||
currency: {type: string, pattern: '^[A-Z]{3}$'}
|
||||
additionalFee: {type: number, minimum: 0}
|
||||
effectiveFrom: {type: string, format: date-time}
|
||||
effectiveTo: {type: string, format: date-time, nullable: true}
|
||||
PriceBookStatus:
|
||||
type: string
|
||||
enum: [PENDING_CONFIRMATION, ACTIVE, SUPERSEDED, FAILED]
|
||||
PriceModel:
|
||||
type: string
|
||||
enum: [FBA_WAREHOUSE_RATE, REGION_WEIGHT_TIER]
|
||||
PricingTaxMode:
|
||||
type: string
|
||||
enum: [TAX_INCLUDED, TAX_EXCLUDED]
|
||||
PricingDestinationType:
|
||||
type: string
|
||||
description: 价格明细支持的目的地类型;PRIVATE 本期不参与自动估价
|
||||
enum: [FBA, OVERSEAS]
|
||||
PriceBookUploadRequest:
|
||||
type: object
|
||||
required: [file]
|
||||
properties:
|
||||
file: {type: string, format: binary, description: 原始 XLSX 文件}
|
||||
PriceBookVersionSummary:
|
||||
type: object
|
||||
properties:
|
||||
id: {type: string, pattern: '^[1-9][0-9]*$'}
|
||||
versionNo: {type: integer}
|
||||
originalFileName: {type: string, maxLength: 255}
|
||||
sourceFileId: {type: string, pattern: '^[1-9][0-9]*$', nullable: true}
|
||||
sourceSha256: {type: string, maxLength: 64, nullable: true}
|
||||
status: {$ref: '#/components/schemas/PriceBookStatus'}
|
||||
channelCount: {type: integer, minimum: 0}
|
||||
rateCount: {type: integer, minimum: 0}
|
||||
blockingErrorCount: {type: integer, minimum: 0}
|
||||
warningCount: {type: integer, minimum: 0}
|
||||
parseIssuesJson: {type: string, nullable: true, description: 上传解析问题及待确认重新校验结果JSON}
|
||||
createdBy: {type: string, pattern: '^[1-9][0-9]*$'}
|
||||
createdAt: {type: string, format: date-time}
|
||||
publishedBy: {type: string, pattern: '^[1-9][0-9]*$', nullable: true}
|
||||
publishedAt: {type: string, format: date-time, nullable: true}
|
||||
supersededAt: {type: string, format: date-time, nullable: true}
|
||||
PriceBookVersionDetail:
|
||||
type: object
|
||||
required: [version, channels, rates, issues]
|
||||
properties:
|
||||
version: {$ref: '#/components/schemas/PriceBookVersionSummary'}
|
||||
channels:
|
||||
type: array
|
||||
items: {$ref: '#/components/schemas/PriceBookParsedChannel'}
|
||||
rates:
|
||||
type: array
|
||||
items: {$ref: '#/components/schemas/PriceBookParsedRate'}
|
||||
issues:
|
||||
type: array
|
||||
items: {$ref: '#/components/schemas/PriceBookParseIssue'}
|
||||
PriceBookParseIssue:
|
||||
type: object
|
||||
properties:
|
||||
severity: {type: string}
|
||||
issueCode: {type: string}
|
||||
message: {type: string}
|
||||
sourceSheetName: {type: string, nullable: true}
|
||||
sourceRowNumber: {type: integer, minimum: 1, nullable: true}
|
||||
sourceCell: {type: string, nullable: true}
|
||||
PriceBookConfirmationRequest:
|
||||
type: object
|
||||
required: [originMappings]
|
||||
properties:
|
||||
originMappings:
|
||||
type: array
|
||||
minItems: 1
|
||||
maxItems: 2
|
||||
items: {$ref: '#/components/schemas/PriceBookOriginMapping'}
|
||||
overseasMappings:
|
||||
type: array
|
||||
maxItems: 2
|
||||
items: {$ref: '#/components/schemas/PriceBookOverseasMapping'}
|
||||
PriceBookOriginMapping:
|
||||
type: object
|
||||
required: [originWarehouseCode, warehouseId]
|
||||
properties:
|
||||
originWarehouseCode: {type: string, maxLength: 64, description: 上传表识别出的起运仓稳定编码}
|
||||
warehouseId: {type: string, pattern: '^[1-9][0-9]*$', description: 平台公共国内仓稳定ID}
|
||||
PriceBookOverseasMapping:
|
||||
type: object
|
||||
required: [sourceDestinationName, warehouseId]
|
||||
properties:
|
||||
sourceDestinationName: {type: string, maxLength: 128, description: 上传表中的海外仓名称}
|
||||
warehouseId: {type: string, pattern: '^[1-9][0-9]*$', description: 平台公共海外仓稳定ID}
|
||||
PriceBookParsedChannel:
|
||||
type: object
|
||||
required: [channelCode, channelName, priceModel, sourceSheetName]
|
||||
properties:
|
||||
channelCode: {type: string, maxLength: 64}
|
||||
channelName: {type: string, maxLength: 128}
|
||||
priceModel: {$ref: '#/components/schemas/PriceModel'}
|
||||
sourceSheetName: {type: string, maxLength: 128}
|
||||
estimatedDepartureDate: {type: string, format: date}
|
||||
estimatedDepartureText: {type: string, maxLength: 128}
|
||||
latestWarehouseEntry: {type: string, maxLength: 128}
|
||||
vesselName: {type: string, maxLength: 128}
|
||||
voyageNo: {type: string, maxLength: 64}
|
||||
referenceTransit: {type: string, maxLength: 128}
|
||||
surchargeDescription: {type: string, maxLength: 2000}
|
||||
remark: {type: string, maxLength: 2000}
|
||||
PriceBookParsedRate:
|
||||
type: object
|
||||
required: [channelCode, priceModel, originWarehouseCode, originWarehouseName, chargeUnit, unitPrice, currency, sourceSheetName, sourceRowNumber]
|
||||
properties:
|
||||
id: {type: string, pattern: '^[1-9][0-9]*$'}
|
||||
channelCode: {type: string, maxLength: 64}
|
||||
priceModel: {$ref: '#/components/schemas/PriceModel'}
|
||||
originWarehouseId: {type: string, pattern: '^[1-9][0-9]*$', nullable: true, description: 确认时绑定的平台公共国内仓稳定ID}
|
||||
originWarehouseCode: {type: string, maxLength: 64}
|
||||
originWarehouseName: {type: string, maxLength: 128}
|
||||
destinationType: {$ref: '#/components/schemas/PricingDestinationType', nullable: true, description: FBA_WAREHOUSE_RATE 必填;REGION_WEIGHT_TIER 为空}
|
||||
destinationCode: {type: string, maxLength: 32, nullable: true}
|
||||
destinationWarehouseId: {type: string, pattern: '^[1-9][0-9]*$', nullable: true, description: 确认时绑定的平台海外仓稳定ID}
|
||||
destinationName: {type: string, maxLength: 128, nullable: true, description: 目的仓名称快照}
|
||||
regionCode: {type: string, maxLength: 16, nullable: true}
|
||||
pricingTaxMode: {$ref: '#/components/schemas/PricingTaxMode'}
|
||||
chargeUnit: {type: string, enum: [KG, CBM]}
|
||||
weightFromKg: {type: number, minimum: 0, nullable: true}
|
||||
unitPrice: {type: number, exclusiveMinimum: 0}
|
||||
currency: {type: string, pattern: '^[A-Z]{3}$'}
|
||||
sourceSheetName: {type: string, maxLength: 128}
|
||||
sourceRowNumber: {type: integer, minimum: 1}
|
||||
sourceDestinationText: {type: string, maxLength: 1000}
|
||||
remark: {type: string, maxLength: 500}
|
||||
MerchantPricingChannel:
|
||||
type: object
|
||||
required: [priceBookVersionId, channelCode, channelName, priceModel, pricingTaxModes]
|
||||
properties:
|
||||
priceBookVersionId: {type: string, pattern: '^[1-9][0-9]*$'}
|
||||
channelCode: {type: string, maxLength: 64}
|
||||
channelName: {type: string, maxLength: 128}
|
||||
priceModel: {$ref: '#/components/schemas/PriceModel'}
|
||||
pricingTaxModes:
|
||||
type: array
|
||||
description: 当前起运仓、当前渠道的生效价格行支持的报价税模式;可能只包含包税或不包税其中一种。
|
||||
items: {$ref: '#/components/schemas/PricingTaxMode'}
|
||||
estimatedDepartureDate: {type: string, format: date, nullable: true}
|
||||
estimatedDepartureText: {type: string, maxLength: 128, nullable: true}
|
||||
latestWarehouseEntry: {type: string, maxLength: 128, nullable: true}
|
||||
referenceTransit: {type: string, maxLength: 128, nullable: true}
|
||||
surchargeDescription: {type: string, maxLength: 2000, nullable: true}
|
||||
remark: {type: string, maxLength: 2000, nullable: true}
|
||||
PriceEstimateRequest:
|
||||
type: object
|
||||
required: [originWarehouseId, channelCode, destinationType]
|
||||
properties:
|
||||
originWarehouseId: {type: string, pattern: '^[1-9][0-9]*$'}
|
||||
channelCode: {type: string, maxLength: 64}
|
||||
destinationType: {$ref: '#/components/schemas/PricingDestinationType'}
|
||||
destinationCode: {type: string, maxLength: 32}
|
||||
destinationWarehouseId: {type: string, pattern: '^[1-9][0-9]*$', nullable: true}
|
||||
destinationName: {type: string, maxLength: 128, nullable: true}
|
||||
destinationRegion: {type: string, enum: [WEST, CENTRAL, EAST]}
|
||||
pricingTaxMode: {$ref: '#/components/schemas/PricingTaxMode'}
|
||||
actualWeightKg: {type: number, minimum: 0}
|
||||
actualVolumeCbm: {type: number, minimum: 0}
|
||||
|
||||
@@ -9,7 +9,7 @@ paths:
|
||||
/internal/firstleg/v1/inbounds/order-approved:
|
||||
post:
|
||||
summary: 订单审核通过后幂等创建入库单
|
||||
description: 仅供订单服务调用;入仓码由订单提交时生成,Firstleg 必须原样沿用。承运商可在后续履约或计费前补充。
|
||||
description: 仅供订单服务调用;入仓码由订单提交时生成,Firstleg 必须原样沿用。
|
||||
security:
|
||||
- internalServiceToken: []
|
||||
requestBody:
|
||||
@@ -90,7 +90,9 @@ paths:
|
||||
签名body的 SHA-256 小写十六进制,六部分使用 LF(\n)连接且末尾不追加换行。
|
||||
签名body = data原始UTF-8文本 + LF + image文件内容SHA-256小写十六进制。
|
||||
三层语义:Nonce 防短时重放;Idempotency-Key 标识一次 HTTP 写操作;
|
||||
appKey + eventNo 标识第三方业务事件。
|
||||
appKey + eventNo 标识第三方业务事件。多台设备可共用同一 appKey/secret,
|
||||
但 deviceCode、eventNo 和 Idempotency-Key 必须由调用方生成全局唯一值,
|
||||
不得仅在单台设备内从 1 开始递增。
|
||||
security:
|
||||
- measurementAppKey: []
|
||||
measurementTimestamp: []
|
||||
@@ -294,9 +296,10 @@ components:
|
||||
businessType: {type: string, nullable: true}
|
||||
channelCode: {type: string, nullable: true}
|
||||
channelName: {type: string, nullable: true}
|
||||
carrierId: {type: string, pattern: '^[1-9][0-9]*$', nullable: true, description: 可选,可在后续履约或计费前补充}
|
||||
carrierId: {type: string, pattern: '^[1-9][0-9]*$', nullable: true, description: 历史兼容的内部运输供应商快照}
|
||||
carrierName: {type: string, nullable: true}
|
||||
taxMode: {type: string, nullable: true}
|
||||
pricingTaxMode: {type: string, enum: [TAX_INCLUDED, TAX_EXCLUDED], nullable: true, description: 报价包税维度;独立于订单taxMode}
|
||||
containerMode: {type: string, nullable: true}
|
||||
customsInspection: {type: boolean, nullable: true}
|
||||
destinationType: {type: string, nullable: true}
|
||||
@@ -391,6 +394,8 @@ components:
|
||||
processStatus: {type: string}
|
||||
customerId: {type: string, nullable: true}
|
||||
companyId: {type: string, nullable: true}
|
||||
taxMode: {type: string, nullable: true, description: 订单报关方式快照}
|
||||
pricingTaxMode: {type: string, enum: [TAX_INCLUDED, TAX_EXCLUDED], nullable: true, description: 下单时选择的报价包税维度快照}
|
||||
InboundMeasurementCallbackRequest:
|
||||
type: object
|
||||
required: [eventNo, externalDetailNo, warehouseCode, inboundCode, inboundDetailId, deviceCode, measuredAt, boxSpecification, packageCount, lengthCm, widthCm, heightCm]
|
||||
|
||||
Reference in New Issue
Block a user