Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # deploy/sql/海外区域统一增量-MySQL8.sql # lastleg-service/src/main/java/com/baiyue/lastleg/relabel/service/RelabelApplicationService.java # lastleg-service/src/main/resources/db/lastleg.sql # lastleg-service/src/main/resources/openapi/overseas-business-v1.yaml # lastleg-service/src/test/java/com/baiyue/lastleg/relabel/service/RelabelApplicationServiceTest.java # scripts/README.md
This commit is contained in:
@@ -19,7 +19,7 @@ CREATE TABLE IF NOT EXISTS ll_loading_event_inbox (
|
||||
) ENGINE=InnoDB COMMENT='头程装柜完成事件接收幂等箱';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ll_container_shipping_gate (
|
||||
container_booking_id VARCHAR(128) NOT NULL COMMENT '来源头程柜预订ID', customer_id VARCHAR(128) NOT NULL COMMENT '客户标识',
|
||||
container_booking_id VARCHAR(128) NOT NULL COMMENT '来源头程柜预订ID',
|
||||
ocean_booking_id VARCHAR(128) NOT NULL COMMENT '来源海运订舱ID', container_no VARCHAR(64) NOT NULL COMMENT '实际集装箱号',
|
||||
status VARCHAR(32) NOT NULL DEFAULT 'AWAITING_PICKUP_READY' COMMENT '海外收货门禁状态:AWAITING_PICKUP_READY、RECEIVING_AVAILABLE',
|
||||
standard_node VARCHAR(64) NULL COMMENT '最新有效标准船节点', node_sequence INT NOT NULL DEFAULT 0 COMMENT '最新有效节点单调序号',
|
||||
@@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS ll_container_shipping_gate (
|
||||
handover_version BIGINT NOT NULL DEFAULT 1 COMMENT '跨区交接版本', last_event_id VARCHAR(128) NULL COMMENT '最近采纳的跨区事件ID',
|
||||
payload_hash VARCHAR(71) NULL COMMENT '最近采纳事件规范化负载摘要', created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '更新时间',
|
||||
PRIMARY KEY(container_booking_id), KEY idx_ll_shipping_gate_candidate(customer_id,container_no,status),
|
||||
PRIMARY KEY(container_booking_id), KEY idx_ll_shipping_gate_candidate(container_no,status),
|
||||
KEY idx_ll_shipping_gate_version(container_booking_id,aggregate_version,node_sequence)
|
||||
) ENGINE=InnoDB COMMENT='海外PDA柜号船节点收货资格快照';
|
||||
|
||||
@@ -58,9 +58,9 @@ CREATE TABLE IF NOT EXISTS ll_order (
|
||||
customer_name VARCHAR(255) COMMENT '货主名称',
|
||||
source_warehouse_id VARCHAR(128) COMMENT '来源国内装柜仓 ID 快照',
|
||||
source_warehouse_name VARCHAR(255) COMMENT '来源国内装柜仓名称快照',
|
||||
overseas_warehouse_id VARCHAR(128) NOT NULL DEFAULT '193000000000200003' COMMENT '海外接柜仓ID,新产生普通尾程整柜默认洛杉矶仓',
|
||||
overseas_warehouse_code VARCHAR(128) NOT NULL DEFAULT 'US-LAX-01' COMMENT '海外接柜仓业务编码快照',
|
||||
overseas_warehouse_name VARCHAR(255) NOT NULL DEFAULT '洛杉矶仓' COMMENT '海外接柜仓名称快照',
|
||||
overseas_warehouse_id VARCHAR(128) NULL COMMENT '海外接柜仓ID;新建尾程订单由业务服务预分配',
|
||||
overseas_warehouse_code VARCHAR(128) NULL COMMENT '海外接柜仓业务编码快照',
|
||||
overseas_warehouse_name VARCHAR(255) NULL COMMENT '海外接柜仓名称快照',
|
||||
receiving_warehouse_version INT NOT NULL DEFAULT 0 COMMENT '柜级接柜仓分配乐观锁版本',
|
||||
transfer_warehouse_id VARCHAR(128) COMMENT '转入目的仓 ID',
|
||||
transfer_warehouse_code VARCHAR(128) COMMENT '转入目的仓编码',
|
||||
@@ -112,6 +112,22 @@ CREATE TABLE IF NOT EXISTS ll_order (
|
||||
KEY idx_ll_order_container_progress(source_container_booking_id,estimated_warehouse_at,created_at,id)
|
||||
) ENGINE=InnoDB COMMENT='尾程订单主表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ll_order_source_pallet (
|
||||
id BIGINT NOT NULL COMMENT '来源托盘快照ID',
|
||||
customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
|
||||
order_id BIGINT NOT NULL COMMENT '尾程订单ID',
|
||||
source_pallet_no VARCHAR(128) NOT NULL COMMENT '头程冻结托盘码',
|
||||
sequence_no INT NOT NULL COMMENT '订单内稳定顺序',
|
||||
source_event_id VARCHAR(128) NOT NULL COMMENT '来源装柜完成事件ID',
|
||||
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||
PRIMARY KEY(id),
|
||||
UNIQUE KEY uk_ll_source_pallet_no(source_pallet_no),
|
||||
UNIQUE KEY uk_ll_source_pallet_sequence(customer_id,order_id,sequence_no),
|
||||
KEY idx_ll_source_pallet_order(customer_id,order_id),
|
||||
CONSTRAINT fk_ll_source_pallet_order FOREIGN KEY(order_id) REFERENCES ll_order(id)
|
||||
) ENGINE=InnoDB COMMENT='头程交接的不可变托盘码快照';
|
||||
|
||||
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_order' AND column_name='pallet_merge_batch_id'), 'SELECT 1', 'ALTER TABLE ll_order ADD COLUMN pallet_merge_batch_id VARCHAR(64) NULL COMMENT ''平台预标记合托分组号'' AFTER pallet_merge_flag'));
|
||||
PREPARE ll_order_merge_batch_ddl FROM @ddl; EXECUTE ll_order_merge_batch_ddl; DEALLOCATE PREPARE ll_order_merge_batch_ddl;
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_order' AND column_name='hold_chargeable'), 'SELECT 1', 'ALTER TABLE ll_order ADD COLUMN hold_chargeable TINYINT NOT NULL DEFAULT 0 COMMENT ''当前暂扣是否计费:0否1是'' AFTER detained'));
|
||||
@@ -163,22 +179,6 @@ CREATE TABLE IF NOT EXISTS ll_loading_order_status_history (
|
||||
KEY idx_ll_loading_history_customer_order(customer_id,order_id,created_at)
|
||||
) ENGINE=InnoDB COMMENT='尾程订单状态变更历史';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ll_order_fee (
|
||||
id BIGINT NOT NULL COMMENT '费用明细主键',
|
||||
customer_id VARCHAR(128) NOT NULL COMMENT '客户数据隔离键',
|
||||
order_id BIGINT NOT NULL COMMENT '尾程订单ID',
|
||||
fee_item VARCHAR(128) NOT NULL COMMENT '费用项目',
|
||||
currency VARCHAR(3) NOT NULL COMMENT '币种代码',
|
||||
amount DECIMAL(18,2) NOT NULL COMMENT '费用金额',
|
||||
status VARCHAR(32) NOT NULL DEFAULT 'PENDING_REVIEW' COMMENT '费用状态:PENDING_REVIEW待审核、APPROVED审核通过、REJECTED已驳回',
|
||||
supplier_description VARCHAR(500) NULL COMMENT '供应商或费用说明',
|
||||
created_by VARCHAR(128) NOT NULL COMMENT '创建操作人',
|
||||
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '更新时间',
|
||||
PRIMARY KEY(id),
|
||||
KEY idx_ll_order_fee_customer_order(customer_id,order_id,created_at)
|
||||
) ENGINE=InnoDB COMMENT='尾程订单费用明细';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ll_order_operation_log (
|
||||
id BIGINT NOT NULL COMMENT '操作记录主键',
|
||||
customer_id VARCHAR(128) NOT NULL COMMENT '客户数据隔离键',
|
||||
@@ -302,12 +302,6 @@ SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE tab
|
||||
PREPARE delivery_detail_stmt FROM @ddl; EXECUTE delivery_detail_stmt; DEALLOCATE PREPARE delivery_detail_stmt;
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_delivery_order' AND column_name='total_weight_kg'), 'SELECT 1', 'ALTER TABLE ll_delivery_order ADD COLUMN total_weight_kg DECIMAL(18,4) NOT NULL DEFAULT 0 COMMENT ''总重量(千克)'', ADD COLUMN total_volume_cbm DECIMAL(18,4) NOT NULL DEFAULT 0 COMMENT ''总体积(立方米)'', ADD COLUMN planned_delivery_at DATETIME(3) NULL COMMENT ''预计派送时间'', ADD COLUMN dispatched_at DATETIME(3) NULL COMMENT ''实际派送时间'', ADD COLUMN expected_arrival_at DATETIME(3) NULL COMMENT ''预计到达时间'', ADD COLUMN signed_at DATETIME(3) NULL COMMENT ''签收时间'', ADD COLUMN remark VARCHAR(1000) NULL COMMENT ''派送备注'' AFTER pallet_count'));
|
||||
PREPARE delivery_detail_stmt FROM @ddl; EXECUTE delivery_detail_stmt; DEALLOCATE PREPARE delivery_detail_stmt;
|
||||
CREATE TABLE IF NOT EXISTS ll_delivery_fee (
|
||||
id BIGINT NOT NULL COMMENT '派送费用主键', customer_id VARCHAR(128) NOT NULL COMMENT '客户数据隔离键', delivery_order_id BIGINT NOT NULL COMMENT '派送单ID',
|
||||
fee_direction VARCHAR(16) NOT NULL DEFAULT 'PAYABLE' COMMENT '应收应付方向', fee_type VARCHAR(64) NOT NULL COMMENT '费用类型', currency VARCHAR(8) NOT NULL COMMENT '币种',
|
||||
amount DECIMAL(18,2) NOT NULL COMMENT '费用金额', remark VARCHAR(500) NULL COMMENT '费用备注', created_by VARCHAR(128) NULL COMMENT '创建人ID',
|
||||
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间', PRIMARY KEY(id), KEY idx_ll_delivery_fee_order(customer_id,delivery_order_id,id)
|
||||
) ENGINE=InnoDB COMMENT='派送单费用明细';
|
||||
CREATE TABLE IF NOT EXISTS ll_delivery_document_revision (
|
||||
id BIGINT NOT NULL COMMENT '派送资料历史ID',
|
||||
customer_id VARCHAR(128) NOT NULL COMMENT '派送所属客户隔离键',
|
||||
@@ -444,9 +438,9 @@ ALTER TABLE ll_order
|
||||
MODIFY COLUMN source_order_no VARCHAR(128) NULL COMMENT '来源订单号',
|
||||
MODIFY COLUMN root_order_id VARCHAR(128) NULL COMMENT '根订单 ID',
|
||||
MODIFY COLUMN customer_name VARCHAR(255) NULL COMMENT '货主名称',
|
||||
MODIFY COLUMN overseas_warehouse_id VARCHAR(128) NOT NULL DEFAULT '193000000000200003' COMMENT '海外接柜仓ID,新产生普通尾程整柜默认洛杉矶仓',
|
||||
MODIFY COLUMN overseas_warehouse_code VARCHAR(128) NOT NULL DEFAULT 'US-LAX-01' COMMENT '海外接柜仓业务编码快照',
|
||||
MODIFY COLUMN overseas_warehouse_name VARCHAR(255) NOT NULL DEFAULT '洛杉矶仓' COMMENT '海外接柜仓名称快照',
|
||||
MODIFY COLUMN overseas_warehouse_id VARCHAR(128) NULL COMMENT '海外接柜仓ID;新建尾程订单由业务服务预分配',
|
||||
MODIFY COLUMN overseas_warehouse_code VARCHAR(128) NULL COMMENT '海外接柜仓业务编码快照',
|
||||
MODIFY COLUMN overseas_warehouse_name VARCHAR(255) NULL COMMENT '海外接柜仓名称快照',
|
||||
MODIFY COLUMN receiving_warehouse_version INT NOT NULL DEFAULT 0 COMMENT '柜级接柜仓分配乐观锁版本',
|
||||
MODIFY COLUMN fba_warehouse_code VARCHAR(128) NULL COMMENT 'FBA 仓库编码',
|
||||
MODIFY COLUMN container_no VARCHAR(64) NULL COMMENT '集装箱号',
|
||||
@@ -832,8 +826,13 @@ CREATE TABLE IF NOT EXISTS ll_finance_fee_source (
|
||||
supplier_category VARCHAR(32) NULL COMMENT '应付供应商类别约束', settlement_mode VARCHAR(16) NULL COMMENT 'ON_ACCOUNT账期应付或DIRECT_PAID业务已付',
|
||||
paid_at DATETIME(3) NULL COMMENT '直接已付时间', payment_method VARCHAR(32) NULL COMMENT '直接已付方式',
|
||||
payment_reference_no VARCHAR(128) NULL COMMENT '直接已付流水号', payment_voucher_file_ids JSON NULL COMMENT '直接已付凭证文件ID快照',
|
||||
business_date DATE NOT NULL COMMENT '费用业务日期', currency CHAR(3) NOT NULL DEFAULT 'CNY' COMMENT '财务结算币种,当前固定CNY',
|
||||
amount DECIMAL(20,6) NOT NULL COMMENT '费用金额', review_status VARCHAR(16) NOT NULL COMMENT 'DRAFT、PENDING、APPROVED或REJECTED',
|
||||
business_date DATE NOT NULL COMMENT '费用业务日期', currency CHAR(3) NOT NULL DEFAULT 'CNY' COMMENT '财务结算币种,固定CNY',
|
||||
amount DECIMAL(20,6) NOT NULL COMMENT '人民币结算金额', original_currency CHAR(3) NOT NULL COMMENT '业务原币种,支持CNY或USD',
|
||||
original_amount DECIMAL(20,6) NOT NULL COMMENT '业务原币金额', exchange_rate DECIMAL(20,6) NOT NULL COMMENT '原币折算人民币汇率,人民币固定为1',
|
||||
exchange_rate_month CHAR(7) NOT NULL COMMENT '汇率月份yyyy-MM', chargeable_quantity DECIMAL(20,6) NULL COMMENT '计费数量,如箱数、托数、体积或天数',
|
||||
quantity_unit VARCHAR(32) NULL COMMENT '计费数量单位', unit_price DECIMAL(20,6) NULL COMMENT '原币计费单价',
|
||||
period_start DATE NULL COMMENT '仓租等期间费用开始日期', period_end DATE NULL COMMENT '仓租等期间费用结束日期',
|
||||
review_status VARCHAR(16) NOT NULL COMMENT 'DRAFT、PENDING、APPROVED或REJECTED',
|
||||
publication_status VARCHAR(16) NOT NULL COMMENT 'UNPUBLISHED或PUBLISHED', source_status VARCHAR(16) NOT NULL COMMENT 'ACTIVE、SUPERSEDED或VOIDED',
|
||||
review_reason VARCHAR(500) NULL COMMENT '审核或作废原因', reviewer_id VARCHAR(128) NULL COMMENT '审核人ID', reviewed_at DATETIME(3) NULL COMMENT '审核时间',
|
||||
created_by VARCHAR(128) NOT NULL COMMENT '创建人ID', updated_by VARCHAR(128) NOT NULL COMMENT '最后更新人ID',
|
||||
@@ -842,6 +841,8 @@ CREATE TABLE IF NOT EXISTS ll_finance_fee_source (
|
||||
KEY idx_ll_finance_fee_customer(customer_id,source_status,created_at), KEY idx_ll_finance_fee_business(business_type,business_no,created_at),
|
||||
KEY idx_ll_finance_fee_container_customer(container_booking_id,customer_id,source_status,created_at),
|
||||
CONSTRAINT chk_ll_finance_fee_amount CHECK(amount>0), CONSTRAINT chk_ll_finance_fee_currency CHECK(currency='CNY'),
|
||||
CONSTRAINT chk_ll_finance_fee_original_currency CHECK(original_currency IN('CNY','USD')),
|
||||
CONSTRAINT chk_ll_finance_fee_period CHECK((period_start IS NULL AND period_end IS NULL) OR (period_start IS NOT NULL AND period_end IS NOT NULL AND period_start<=period_end)),
|
||||
CONSTRAINT chk_ll_finance_fee_direction CHECK(direction IN('RECEIVABLE','PAYABLE')),
|
||||
CONSTRAINT chk_ll_finance_fee_review CHECK(review_status IN('DRAFT','PENDING','APPROVED','REJECTED')),
|
||||
CONSTRAINT chk_ll_finance_fee_publication CHECK(publication_status IN('UNPUBLISHED','PUBLISHED')),
|
||||
@@ -951,7 +952,7 @@ CREATE TABLE IF NOT EXISTS ll_inbound_pallet_merge (
|
||||
KEY idx_ll_inbound_merge_task (customer_id, task_id), KEY idx_ll_inbound_merge_group (merge_group_no)
|
||||
) ENGINE=InnoDB COMMENT='入仓托盘合托记录';
|
||||
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_inbound_plan_line' AND column_name='fba_warehouse_code'), 'SELECT 1', 'ALTER TABLE ll_inbound_plan_line ADD COLUMN fba_warehouse_code VARCHAR(128) NULL AFTER inbound_code'));
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_inbound_plan_line' AND column_name='fba_warehouse_code'), 'SELECT 1', 'ALTER TABLE ll_inbound_plan_line ADD COLUMN fba_warehouse_code VARCHAR(128) NULL COMMENT ''FBA仓库编码'' AFTER inbound_code'));
|
||||
PREPARE inbound_schema_stmt FROM @ddl; EXECUTE inbound_schema_stmt; DEALLOCATE PREPARE inbound_schema_stmt;
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_inbound_plan_line' AND column_name='customer_id'), 'SELECT 1', 'ALTER TABLE ll_inbound_plan_line ADD COLUMN customer_id VARCHAR(128) NOT NULL DEFAULT '''' COMMENT ''客户账号标识'' AFTER id'));
|
||||
PREPARE receiving_container_line_stmt FROM @ddl; EXECUTE receiving_container_line_stmt; DEALLOCATE PREPARE receiving_container_line_stmt;
|
||||
@@ -991,7 +992,7 @@ WHERE (l.fba_warehouse_code IS NULL AND o.fba_warehouse_code IS NOT NULL)
|
||||
OR l.destination_type IS NULL OR l.destination_type='' OR l.destination_type='OVERSEAS';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ll_receiving_container_session (
|
||||
id BIGINT NOT NULL COMMENT '柜号签收会话ID', customer_id VARCHAR(128) NOT NULL COMMENT '所选柜解析出的客户标识',
|
||||
id BIGINT NOT NULL COMMENT '柜号签收会话ID',
|
||||
source_container_booking_id VARCHAR(128) NOT NULL COMMENT '稳定来源柜预订ID', container_fact_hash VARCHAR(64) NOT NULL COMMENT '领取时整柜订单与计划事实摘要',
|
||||
container_no VARCHAR(64) NOT NULL COMMENT '集装箱号', overseas_warehouse_id BIGINT NOT NULL COMMENT '平台预分配并由操作员Token匹配的海外接柜仓ID', overseas_warehouse_code VARCHAR(128) NOT NULL COMMENT '海外接柜仓业务编码快照', overseas_warehouse_name VARCHAR(255) NOT NULL COMMENT '仓库服务校验后的海外接柜仓名称快照', operator_key VARCHAR(128) NOT NULL COMMENT '操作账号唯一标识',
|
||||
operator_name VARCHAR(255) NULL COMMENT '操作账号名称', active_operator_key VARCHAR(255) NULL COMMENT '未完成会话平台操作账号全局唯一锁键',
|
||||
@@ -1001,7 +1002,7 @@ CREATE TABLE IF NOT EXISTS ll_receiving_container_session (
|
||||
completed_at DATETIME(3) NULL COMMENT '完成时间', created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '更新时间', version INT NOT NULL DEFAULT 0 COMMENT '乐观锁版本',
|
||||
PRIMARY KEY(id), UNIQUE KEY uk_ll_receiving_active_operator(active_operator_key), UNIQUE KEY uk_ll_receiving_active_container(active_container_key),
|
||||
KEY idx_ll_receiving_container(customer_id,container_no,status), KEY idx_ll_receiving_operator(customer_id,operator_key,created_at)
|
||||
KEY idx_ll_receiving_container(container_no,status), KEY idx_ll_receiving_operator(operator_key,created_at)
|
||||
) ENGINE=InnoDB COMMENT='海外PDA柜号签收收货会话';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ll_receiving_sku_receipt (
|
||||
@@ -1019,7 +1020,7 @@ CREATE TABLE IF NOT EXISTS ll_receiving_sku_receipt (
|
||||
) ENGINE=InnoDB COMMENT='海外PDA柜号FBA SKU实收进度';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ll_receiving_container_operation (
|
||||
id BIGINT NOT NULL COMMENT '柜号收货操作ID', session_id BIGINT NOT NULL COMMENT '柜号签收会话ID', customer_id VARCHAR(128) NOT NULL COMMENT '客户账号标识',
|
||||
id BIGINT NOT NULL COMMENT '柜号收货操作ID', session_id BIGINT NOT NULL COMMENT '柜号签收会话ID',
|
||||
operator_key VARCHAR(128) NOT NULL COMMENT '操作账号唯一标识', action VARCHAR(32) NOT NULL COMMENT '操作动作', idempotency_key VARCHAR(255) NOT NULL COMMENT '客户端幂等键',
|
||||
request_hash VARCHAR(128) NOT NULL COMMENT '请求内容哈希', request_json LONGTEXT NOT NULL COMMENT '请求内容快照', result_json LONGTEXT NOT NULL COMMENT '响应内容快照',
|
||||
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间', PRIMARY KEY(id),
|
||||
@@ -1362,7 +1363,7 @@ PREPARE dispatch_schema_stmt FROM @ddl; EXECUTE dispatch_schema_stmt; DEALLOCATE
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_dispatch_pallet_lock' AND column_name='dispatch_order_id' AND is_nullable='YES'), 'SELECT 1', 'ALTER TABLE ll_dispatch_pallet_lock MODIFY COLUMN dispatch_order_id BIGINT NULL COMMENT ''正式派车单ID,草稿锁阶段为空'''));
|
||||
PREPARE dispatch_schema_stmt FROM @ddl; EXECUTE dispatch_schema_stmt; DEALLOCATE PREPARE dispatch_schema_stmt;
|
||||
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_dispatch_item' AND column_name='order_refs'), 'SELECT 1', 'ALTER TABLE ll_dispatch_item ADD COLUMN order_refs VARCHAR(2000) NULL AFTER order_no'));
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_dispatch_item' AND column_name='order_refs'), 'SELECT 1', 'ALTER TABLE ll_dispatch_item ADD COLUMN order_refs VARCHAR(2000) NULL COMMENT ''关联订单信息'' AFTER order_no'));
|
||||
PREPARE dispatch_schema_stmt FROM @ddl; EXECUTE dispatch_schema_stmt; DEALLOCATE PREPARE dispatch_schema_stmt;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ll_dispatch_pda_task (
|
||||
@@ -1459,8 +1460,6 @@ CREATE TABLE IF NOT EXISTS ll_outbound_pda_pick (
|
||||
inventory_position_id BIGINT NOT NULL COMMENT '库存仓位ID', packages BIGINT NOT NULL COMMENT '拣货箱数', idempotency_key VARCHAR(255) NOT NULL COMMENT '拣货幂等键',
|
||||
picked_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '拣货时间', PRIMARY KEY(id), UNIQUE KEY uk_ll_outbound_pda_pick_key(customer_id,idempotency_key)
|
||||
) ENGINE=InnoDB COMMENT='一件代发出库PDA托盘拣货记录';
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_outbound_pda_pick' AND column_name='inventory_position_id' AND is_nullable='YES'), 'SELECT 1', 'ALTER TABLE ll_outbound_pda_pick MODIFY COLUMN inventory_position_id BIGINT NULL COMMENT ''库存仓位ID,退货箱唛出库为空'''));
|
||||
PREPARE outbound_pda_pick_position_stmt FROM @ddl; EXECUTE outbound_pda_pick_position_stmt; DEALLOCATE PREPARE outbound_pda_pick_position_stmt;
|
||||
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_outbound_order' AND column_name='outbound_type'), 'SELECT 1', 'ALTER TABLE ll_outbound_order ADD COLUMN outbound_type VARCHAR(32) NOT NULL DEFAULT ''DISPATCH_DELIVERY'' COMMENT ''出库类型'' AFTER status'));
|
||||
PREPARE outbound_upgrade_stmt FROM @ddl; EXECUTE outbound_upgrade_stmt; DEALLOCATE PREPARE outbound_upgrade_stmt;
|
||||
@@ -1613,9 +1612,6 @@ CREATE TABLE IF NOT EXISTS ll_relabel_application (
|
||||
customer_confirmation_key VARCHAR(255) NULL COMMENT '客户确认完成幂等键',
|
||||
customer_confirmed_at DATETIME(3) NULL COMMENT '客户确认换标完成时间',
|
||||
remark VARCHAR(1000) NULL COMMENT '备注',
|
||||
total_file_id VARCHAR(128) NULL COMMENT '总换标PDF文件ID',
|
||||
total_file_name VARCHAR(255) NULL COMMENT '总换标PDF文件名',
|
||||
total_file_url VARCHAR(1000) NULL COMMENT '总换标PDF预览地址',
|
||||
status VARCHAR(32) NOT NULL DEFAULT 'PENDING_PROCESSING' COMMENT '业务状态',
|
||||
item_count INT NOT NULL DEFAULT 0 COMMENT '明细数量',
|
||||
total_package_count INT NOT NULL DEFAULT 0 COMMENT '总箱数',
|
||||
@@ -1674,7 +1670,7 @@ CREATE TABLE IF NOT EXISTS ll_relabel_item (
|
||||
relabel_file_url VARCHAR(1000) NULL COMMENT '换标文件地址',
|
||||
carton_mark VARCHAR(255) NULL COMMENT '客户自有箱唛',
|
||||
fba_carton_mark VARCHAR(255) NULL COMMENT '关联FBA箱唛',
|
||||
destination_warehouse_id VARCHAR(128) NOT NULL COMMENT '该箱目的海外仓ID',
|
||||
destination_warehouse_id VARCHAR(128) NULL COMMENT '该箱目的海外仓ID',
|
||||
destination_fba_warehouse_code VARCHAR(128) NULL COMMENT '可选FBA目的仓编码(与海外操作仓分离)',
|
||||
operation_type VARCHAR(32) NOT NULL DEFAULT 'CARTON_LABEL' COMMENT '换标模式:箱唛、SKU或组合换标',
|
||||
sku_relabel_items_json JSON NULL COMMENT '同箱SKU换标子明细快照(数量按件)',
|
||||
@@ -1690,7 +1686,7 @@ CREATE TABLE IF NOT EXISTS ll_relabel_item (
|
||||
PRIMARY KEY (id),
|
||||
KEY idx_ll_relabel_item_application (customer_id,application_id),
|
||||
KEY idx_ll_relabel_item_sku (customer_id,sku_code),
|
||||
KEY idx_ll_relabel_item_source_position (customer_id,source_inventory_position_id)
|
||||
KEY idx_ll_relabel_item_destination (customer_id,destination_warehouse_id,application_id)
|
||||
) ENGINE=InnoDB COMMENT='换标货物冻结明细';
|
||||
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_relabel_item' AND column_name IN ('shipment_no','destination_fba_warehouse_code','source_inventory_balance_id','source_inventory_position_id','source_inbound_order_id') AND is_nullable='NO'), 'ALTER TABLE ll_relabel_item MODIFY COLUMN shipment_no VARCHAR(128) NULL COMMENT ''货件编号(无FBA去向时为空)'', MODIFY COLUMN destination_fba_warehouse_code VARCHAR(128) NULL COMMENT ''可选FBA目的仓编码(与海外操作仓分离)'', MODIFY COLUMN source_inventory_balance_id BIGINT NULL COMMENT ''原库存余额ID(预入仓换标任务可为空)'', MODIFY COLUMN source_inventory_position_id BIGINT NULL COMMENT ''原库存库位ID(预入仓换标任务可为空)'', MODIFY COLUMN source_inbound_order_id BIGINT NULL COMMENT ''原入仓单ID(预入仓换标任务可为空)''', 'SELECT 1'));
|
||||
@@ -2077,17 +2073,6 @@ CREATE TABLE IF NOT EXISTS ll_exception_order_command (
|
||||
KEY idx_ll_exception_command_order(customer_id,exception_order_id,created_at)
|
||||
) ENGINE=InnoDB COMMENT='异常处理命令幂等审计';
|
||||
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_exception_order' AND column_name='handling_result'), 'SELECT 1', 'ALTER TABLE ll_exception_order ADD COLUMN handling_result VARCHAR(2000) NULL COMMENT ''异常处理结果'' AFTER handling_action'));
|
||||
PREPARE exception_lifecycle_stmt FROM @ddl; EXECUTE exception_lifecycle_stmt; DEALLOCATE PREPARE exception_lifecycle_stmt;
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_exception_order' AND column_name='evidence_file_ids_json'), 'SELECT 1', 'ALTER TABLE ll_exception_order ADD COLUMN evidence_file_ids_json JSON NULL COMMENT ''异常处理证据文件ID列表'' AFTER handling_result'));
|
||||
PREPARE exception_lifecycle_stmt FROM @ddl; EXECUTE exception_lifecycle_stmt; DEALLOCATE PREPARE exception_lifecycle_stmt;
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_exception_order' AND column_name='inventory_adjustment_id'), 'SELECT 1', 'ALTER TABLE ll_exception_order ADD COLUMN inventory_adjustment_id BIGINT NULL COMMENT ''退回库存恢复操作ID'' AFTER evidence_file_ids_json'));
|
||||
PREPARE exception_lifecycle_stmt FROM @ddl; EXECUTE exception_lifecycle_stmt; DEALLOCATE PREPARE exception_lifecycle_stmt;
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_exception_order' AND column_name='completed_at'), 'SELECT 1', 'ALTER TABLE ll_exception_order ADD COLUMN completed_at DATETIME(3) NULL COMMENT ''异常处理完成时间'' AFTER exception_at'));
|
||||
PREPARE exception_lifecycle_stmt FROM @ddl; EXECUTE exception_lifecycle_stmt; DEALLOCATE PREPARE exception_lifecycle_stmt;
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_exception_order' AND column_name='version'), 'SELECT 1', 'ALTER TABLE ll_exception_order ADD COLUMN version BIGINT NOT NULL DEFAULT 0 COMMENT ''异常订单乐观锁版本'' AFTER completed_at'));
|
||||
PREPARE exception_lifecycle_stmt FROM @ddl; EXECUTE exception_lifecycle_stmt; DEALLOCATE PREPARE exception_lifecycle_stmt;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ll_customer_visit (
|
||||
id BIGINT NOT NULL COMMENT '客户回访记录ID',
|
||||
customer_id VARCHAR(128) NOT NULL COMMENT '客户数据隔离键',
|
||||
@@ -2148,7 +2133,7 @@ CREATE TABLE IF NOT EXISTS ll_security_projection (
|
||||
KEY idx_security_projection_permission (aggregate_id,permission_version)
|
||||
) ENGINE=InnoDB COMMENT='海外IAM安全状态与权限版本投影';
|
||||
|
||||
-- 兼容已有的旧版投影表:CREATE TABLE IF NOT EXISTS 不会补充后续新增字段。
|
||||
-- 收敛尚未具备授权快照字段的开发/测试库,CREATE TABLE IF NOT EXISTS 不会补充已存在表的字段。
|
||||
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE()
|
||||
AND table_name='ll_security_projection' AND column_name='roles_json'), 'SELECT 1',
|
||||
'ALTER TABLE ll_security_projection ADD COLUMN roles_json JSON NULL COMMENT ''IAM投影的当前角色快照'' AFTER permission_version'));
|
||||
@@ -2163,16 +2148,133 @@ ALTER TABLE ll_security_projection
|
||||
MODIFY COLUMN roles_json JSON NOT NULL COMMENT 'IAM投影的当前角色快照',
|
||||
MODIFY COLUMN authorities_json JSON NOT NULL COMMENT 'IAM投影的当前海外权限快照';
|
||||
|
||||
-- 开发基线固定管理员;后续真实 IAM 事件从 aggregate_version=1 单调覆盖该 version=0 投影。
|
||||
-- 空库基线固定管理员必须携带当前海外授权快照;后续真实 IAM 事件从 aggregate_version=1 单调覆盖该 version=0 投影。
|
||||
SET @platform_admin_overseas_roles = JSON_ARRAY('PLATFORM_ADMIN');
|
||||
SET @platform_admin_overseas_authorities = JSON_ARRAY(
|
||||
'platform:finance:bill:adjust',
|
||||
'platform:finance:bill:update',
|
||||
'platform:finance:bill:void',
|
||||
'platform:finance:cost:create',
|
||||
'platform:finance:cost:view',
|
||||
'platform:finance:customer-account:adjust',
|
||||
'platform:finance:customer-account:export',
|
||||
'platform:finance:customer-account:list',
|
||||
'platform:finance:customer-arap:export',
|
||||
'platform:finance:customer-arap:list',
|
||||
'platform:finance:customer-statement:export',
|
||||
'platform:finance:customer-statement:list',
|
||||
'platform:finance:customer-terms:update',
|
||||
'platform:finance:customer-terms:view',
|
||||
'platform:finance:fee-source:edit',
|
||||
'platform:finance:fee-source:review',
|
||||
'platform:finance:payment:create',
|
||||
'platform:finance:receipt:create',
|
||||
'platform:finance:receipt:view',
|
||||
'platform:finance:receivable-statistics:export',
|
||||
'platform:finance:receivable-statistics:list',
|
||||
'platform:finance:recharge:review',
|
||||
'platform:finance:reconciliation:adjust',
|
||||
'platform:finance:reconciliation:create',
|
||||
'platform:finance:reconciliation:issue',
|
||||
'platform:finance:reconciliation:review',
|
||||
'platform:finance:reconciliation:void',
|
||||
'platform:finance:settlement-ap:create',
|
||||
'platform:finance:settlement-ap:export',
|
||||
'platform:finance:settlement-ap:list',
|
||||
'platform:finance:settlement-ar:create',
|
||||
'platform:finance:settlement-ar:export',
|
||||
'platform:finance:settlement-ar:list',
|
||||
'platform:finance:settlement:void',
|
||||
'platform:overseas-business:looseboard:create',
|
||||
'platform:overseas-business:looseboard:edit',
|
||||
'platform:overseas-business:looseboard:list',
|
||||
'platform:overseas-business:looseboard:status',
|
||||
'platform:overseas-business:purchase:edit',
|
||||
'platform:overseas-business:purchase:list',
|
||||
'platform:overseas-business:purchase:review',
|
||||
'platform:overseas-business:truck:create',
|
||||
'platform:overseas-business:truck:edit',
|
||||
'platform:overseas-business:truck:list',
|
||||
'platform:overseas-business:truck:status',
|
||||
'platform:overseas-master-data:exchange-rate:create',
|
||||
'platform:overseas-master-data:exchange-rate:edit',
|
||||
'platform:overseas-master-data:exchange-rate:export',
|
||||
'platform:overseas-master-data:exchange-rate:list',
|
||||
'platform:overseas-master-data:exchange-rate:status',
|
||||
'platform:overseas-master-data:quote:create',
|
||||
'platform:overseas-master-data:quote:edit',
|
||||
'platform:overseas-master-data:quote:export',
|
||||
'platform:overseas-master-data:quote:list',
|
||||
'platform:overseas-master-data:quote:status',
|
||||
'platform:overseas-master-data:vehicle:create',
|
||||
'platform:overseas-master-data:vehicle:edit',
|
||||
'platform:overseas-master-data:vehicle:export',
|
||||
'platform:overseas-master-data:vehicle:list',
|
||||
'platform:overseas-master-data:vehicle:status',
|
||||
'platform:overseas-warehouse:customer-visit:edit',
|
||||
'platform:overseas-warehouse:customer-visit:list',
|
||||
'platform:overseas-warehouse:delivery:documents',
|
||||
'platform:overseas-warehouse:delivery:list',
|
||||
'platform:overseas-warehouse:delivery:return',
|
||||
'platform:overseas-warehouse:delivery:status',
|
||||
'platform:overseas-warehouse:dispatch:cancel',
|
||||
'platform:overseas-warehouse:dispatch:edit',
|
||||
'platform:overseas-warehouse:dispatch:list',
|
||||
'platform:overseas-warehouse:dispatch:transfer-delivery',
|
||||
'platform:overseas-warehouse:exception-order:create',
|
||||
'platform:overseas-warehouse:exception-order:list',
|
||||
'platform:overseas-warehouse:exception-order:process',
|
||||
'platform:overseas-warehouse:inbound-order:create',
|
||||
'platform:overseas-warehouse:inbound-order:edit',
|
||||
'platform:overseas-warehouse:inbound-order:fba-appointment',
|
||||
'platform:overseas-warehouse:inbound-order:list',
|
||||
'platform:overseas-warehouse:inbound-order:smart-dispatch',
|
||||
'platform:overseas-warehouse:inventory:adjust',
|
||||
'platform:overseas-warehouse:inventory:edit',
|
||||
'platform:overseas-warehouse:inventory:export',
|
||||
'platform:overseas-warehouse:inventory:list',
|
||||
'platform:overseas-warehouse:last-mile-order:edit',
|
||||
'platform:overseas-warehouse:last-mile-order:export',
|
||||
'platform:overseas-warehouse:last-mile-order:list',
|
||||
'platform:overseas-warehouse:location:create',
|
||||
'platform:overseas-warehouse:location:delete',
|
||||
'platform:overseas-warehouse:location:edit',
|
||||
'platform:overseas-warehouse:location:list',
|
||||
'platform:overseas-warehouse:outbound:cancel',
|
||||
'platform:overseas-warehouse:outbound:create',
|
||||
'platform:overseas-warehouse:outbound:list',
|
||||
'platform:overseas-warehouse:pallet:create',
|
||||
'platform:overseas-warehouse:pallet:delete',
|
||||
'platform:overseas-warehouse:pallet:edit',
|
||||
'platform:overseas-warehouse:pallet:list',
|
||||
'platform:overseas-warehouse:relabel-order:create',
|
||||
'platform:overseas-warehouse:relabel-order:list',
|
||||
'platform:overseas-warehouse:relabel-order:status',
|
||||
'platform:overseas-warehouse:return-cartons:list',
|
||||
'platform:overseas-warehouse:return-inventory:list',
|
||||
'platform:overseas-warehouse:warehouse:create',
|
||||
'platform:overseas-warehouse:warehouse:edit',
|
||||
'platform:overseas-warehouse:warehouse:list',
|
||||
'platform:overseas-warehouse:warehouse:status'
|
||||
);
|
||||
INSERT IGNORE INTO ll_security_projection (
|
||||
aggregate_type,aggregate_id,tenant_id,security_status,permission_version,roles_json,authorities_json,aggregate_version,
|
||||
payload_hash,last_event_id,changed_at,updated_at
|
||||
) VALUES
|
||||
('USER','1000001',0,'ACTIVE',0,JSON_ARRAY(),JSON_ARRAY(),0,SHA2('lastleg-baseline:platform_admin:USER:0',256),
|
||||
'baseline-platform-admin-user-v0','1970-01-01 00:00:00.000','1970-01-01 00:00:00.000'),
|
||||
('AUTHORIZATION','1000001',0,NULL,0,JSON_ARRAY(),JSON_ARRAY(),0,SHA2('lastleg-baseline:platform_admin:AUTHORIZATION:0',256),
|
||||
('AUTHORIZATION','1000001',0,NULL,0,@platform_admin_overseas_roles,@platform_admin_overseas_authorities,0,
|
||||
SHA2('lastleg-baseline:platform_admin:AUTHORIZATION:0:current-authorities',256),
|
||||
'baseline-platform-admin-authorization-v0','1970-01-01 00:00:00.000','1970-01-01 00:00:00.000');
|
||||
|
||||
UPDATE ll_security_projection
|
||||
SET roles_json=@platform_admin_overseas_roles,
|
||||
authorities_json=@platform_admin_overseas_authorities,
|
||||
payload_hash=SHA2('lastleg-baseline:platform_admin:AUTHORIZATION:0:current-authorities',256),
|
||||
updated_at=CURRENT_TIMESTAMP(3)
|
||||
WHERE aggregate_type='AUTHORIZATION' AND aggregate_id='1000001' AND tenant_id=0
|
||||
AND aggregate_version=0 AND last_event_id='baseline-platform-admin-authorization-v0';
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ll_wallet_event_inbox (
|
||||
event_id VARCHAR(64) NOT NULL COMMENT '国内Finance资金结果事件ID',
|
||||
|
||||
@@ -29,8 +29,8 @@ paths:
|
||||
'409': { description: 入仓码跨客户或快照关系不一致 }
|
||||
/api/pda/v1/last-leg/receiving-containers/candidates:
|
||||
get:
|
||||
summary: 查询当前客户待签收柜号
|
||||
description: 权限 lastleg:pda:operate;仅 PLATFORM OVERSEAS_WAREHOUSE_PDA_OPERATOR 可用;仅返回已单调消费 PICKUP_READY(80) 或更高实际船节点、状态为 RECEIVING_AVAILABLE 的柜,不接收 customerId。
|
||||
summary: 查询当前仓待签收柜号
|
||||
description: 权限 lastleg:pda:operate;仅 PLATFORM OVERSEAS_WAREHOUSE_PDA_OPERATOR 可用;按来源柜跨客户聚合,仅返回已单调消费 PICKUP_READY(80) 或更高实际船节点、状态为 RECEIVING_AVAILABLE 的柜,不接收 customerId。
|
||||
security: [{ bearerAuth: [] }]
|
||||
responses: { '200': { description: 柜号候选及箱数进度, content: { application/json: { schema: { $ref: '#/components/schemas/ReceivingCandidateListApiResponse' } } } }, '403': { description: 缺少 PDA 操作权限 } }
|
||||
/api/pda/v1/last-leg/receiving-containers/warehouse-profile:
|
||||
@@ -42,7 +42,7 @@ paths:
|
||||
/api/pda/v1/last-leg/receiving-containers/{containerNo}:
|
||||
get:
|
||||
summary: 查询待签收柜号详情
|
||||
description: 权限 lastleg:pda:operate;按柜号唯一解析客户并返回柜内全部入仓码、目的类型、目的仓、托数和实收进度。
|
||||
description: 权限 lastleg:pda:operate;按来源柜返回跨客户的全部入仓码、目的类型、目的仓、托数和实收进度;每个入仓码仍按自身客户隔离。
|
||||
security: [{ bearerAuth: [] }]
|
||||
parameters: [{ name: containerNo, in: path, required: true, schema: { type: string } }]
|
||||
responses: { '200': { description: 柜号详情, content: { application/json: { schema: { $ref: '#/components/schemas/ReceivingSessionApiResponse' } } } }, '409': { description: 当前账号已锁定其他柜号 } }
|
||||
@@ -121,6 +121,13 @@ paths:
|
||||
security: [{ bearerAuth: [] }]
|
||||
requestBody: { required: true, content: { application/json: { schema: { $ref: '#/components/schemas/ReceivingCarton' } } } }
|
||||
responses: { '200': { description: 本次与累计实收进度, content: { application/json: { schema: { $ref: '#/components/schemas/ReceivingReceiptApiResponse' } } } }, '409': { description: FBA逐箱、跨柜、重复箱或托盘不匹配 } }
|
||||
/api/pda/v1/last-leg/receiving-containers/current/receipts/pallet:
|
||||
post:
|
||||
summary: 一件代发按完整来源托盘收货
|
||||
description: 权限 lastleg:pda:operate;只允许 ONE_CLICK_DROPSHIP,扫描国内封托后冻结的来源托盘号,一次接收该托全部箱和 SKU 快照;不允许逐箱或拆分接收。
|
||||
security: [{ bearerAuth: [] }]
|
||||
requestBody: { required: true, content: { application/json: { schema: { $ref: '#/components/schemas/ReceivingWholePallet' } } } }
|
||||
responses: { '200': { description: 本次与累计实收进度, content: { application/json: { schema: { $ref: '#/components/schemas/ReceivingReceiptApiResponse' } } } }, '404': { description: 来源托盘不属于当前柜 }, '409': { description: 非一件代发、来源托盘重复或已操作 } }
|
||||
/api/pda/v1/last-leg/receiving-containers/current/complete:
|
||||
post:
|
||||
summary: 完成当前柜收货并入库存
|
||||
@@ -194,11 +201,12 @@ paths:
|
||||
/api/platform/v1/last-leg/orders/{id}/fees:
|
||||
post:
|
||||
summary: 新增尾程订单费用
|
||||
description: 权限 platform:overseas-warehouse:last-mile-order:edit;在订单客户范围内新增费用并记录操作人和处理结果。
|
||||
description: 权限 platform:overseas-warehouse:last-mile-order:edit;在订单客户范围内创建统一费用来源并提交财务审核。
|
||||
security: [{ bearerAuth: [] }]
|
||||
parameters:
|
||||
- { name: id, in: path, required: true, schema: { type: integer, format: int64 } }
|
||||
- { name: customerId, in: query, required: false, schema: { type: string, pattern: '^[1-9][0-9]*$' } }
|
||||
- { name: Idempotency-Key, in: header, required: true, schema: { type: string, minLength: 1, maxLength: 128 } }
|
||||
requestBody:
|
||||
required: true
|
||||
content: { application/json: { schema: { $ref: '#/components/schemas/LastMileFeeCreate' } } }
|
||||
@@ -346,7 +354,15 @@ paths:
|
||||
application/json:
|
||||
schema: { $ref: '#/components/schemas/ChangeReceivingWarehouseRequest' }
|
||||
responses:
|
||||
'200': { description: 更新后的柜级摘要, content: { application/json: { schema: { type: object, properties: { code: { type: string, enum: ['200'] }, data: { $ref: '#/components/schemas/ContainerPlanProgressSummary' } } } } } }
|
||||
'200':
|
||||
description: 更新后的柜级摘要
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
code: { type: string, enum: ['200'] }
|
||||
data: { $ref: '#/components/schemas/ContainerPlanProgressSummary' }
|
||||
'400': { description: 请求无效或目标不是有效 OVERSEAS 仓 }
|
||||
'409': { description: 版本冲突、幂等键冲突或PDA接柜会话已建立 }
|
||||
/api/platform/v1/last-leg/orders/{id}/destination:
|
||||
@@ -624,7 +640,7 @@ paths:
|
||||
description: 权限 platform:overseas-warehouse:outbound:list;只按全局唯一 outboundNo 定位并从记录解析客户范围,不接收 customerId。
|
||||
security: [{ bearerAuth: [] }]
|
||||
parameters: [{ name: outboundNo, in: path, required: true, schema: { type: string } }]
|
||||
responses: { '200': { description: "出库单、出库托盘及关联派送单详情;pallets[].palletNo 为 Warehouse 权威实物托盘码" }, '404': { description: 出库单不存在 } }
|
||||
responses: { '200': { description: '出库单、出库托盘及关联派送单详情;pallets[].palletNo 为 Warehouse 权威实物托盘码' }, '404': { description: 出库单不存在 } }
|
||||
/api/platform/v1/last-leg/outbound-orders/{outboundNo}/cancel:
|
||||
post:
|
||||
summary: 取消未执行出库单
|
||||
@@ -1620,28 +1636,44 @@ components:
|
||||
plannedArrivalAt: { type: string, format: date-time, nullable: true, description: ll_order.estimated_warehouse_at }
|
||||
LastMileFeeCreate:
|
||||
type: object
|
||||
required: [feeItem, currency, amount, status]
|
||||
required: [feeItemCode, feeItemName, direction, currency, amount, businessDate]
|
||||
properties:
|
||||
feeItem: { type: string, minLength: 1, maxLength: 128 }
|
||||
currency: { type: string, pattern: '^[A-Z]{3}$', example: USD }
|
||||
feeItemCode: { type: string, minLength: 1, maxLength: 64 }
|
||||
feeItemName: { type: string, minLength: 1, maxLength: 128 }
|
||||
direction: { type: string, enum: [RECEIVABLE, PAYABLE] }
|
||||
currency: { type: string, enum: [CNY, USD] }
|
||||
amount: { type: number, format: decimal, minimum: 0.01 }
|
||||
status: { type: string, enum: [PENDING_REVIEW, APPROVED, REJECTED] }
|
||||
supplierDescription: { type: string, maxLength: 500 }
|
||||
businessDate: { type: string, format: date }
|
||||
supplierId: { type: string, pattern: '^[1-9][0-9]*$' }
|
||||
supplierName: { type: string, maxLength: 200 }
|
||||
supplierCategory: { type: string, maxLength: 32 }
|
||||
settlementMode: { type: string, enum: [ON_ACCOUNT, DIRECT_PAID] }
|
||||
chargeableQuantity: { type: number, minimum: 0, exclusiveMinimum: true }
|
||||
quantityUnit: { type: string, maxLength: 32 }
|
||||
unitPrice: { type: number, minimum: 0, exclusiveMinimum: true }
|
||||
periodStart: { type: string, format: date }
|
||||
periodEnd: { type: string, format: date }
|
||||
LastMileFee:
|
||||
type: object
|
||||
required: [id, customerId, orderId, feeItem, currency, amount, status, createdBy, createdAt, updatedAt]
|
||||
required: [id, sourceFeeId, sourceVersion, customerId, feeItemCode, feeItemName, direction, currency, amount, originalCurrency, originalAmount, reviewStatus, publicationStatus, sourceStatus]
|
||||
properties:
|
||||
id: { type: integer, format: int64 }
|
||||
id: { type: string, pattern: '^[1-9][0-9]*$' }
|
||||
sourceFeeId: { type: string, pattern: '^[1-9][0-9]*$' }
|
||||
sourceVersion: { type: integer, minimum: 1 }
|
||||
customerId: { type: string }
|
||||
orderId: { type: integer, format: int64 }
|
||||
feeItem: { type: string }
|
||||
currency: { type: string }
|
||||
orderId: { type: string, pattern: '^[1-9][0-9]*$' }
|
||||
feeItemCode: { type: string }
|
||||
feeItemName: { type: string }
|
||||
direction: { type: string, enum: [RECEIVABLE, PAYABLE] }
|
||||
currency: { type: string, enum: [CNY] }
|
||||
amount: { type: number, format: decimal }
|
||||
status: { type: string }
|
||||
supplierDescription: { type: string, nullable: true }
|
||||
createdBy: { type: string }
|
||||
createdAt: { type: string, format: date-time }
|
||||
updatedAt: { type: string, format: date-time }
|
||||
originalCurrency: { type: string, enum: [CNY, USD] }
|
||||
originalAmount: { type: number, format: decimal }
|
||||
exchangeRate: { type: number, format: decimal }
|
||||
exchangeRateMonth: { type: string, pattern: '^\\d{4}-\\d{2}$' }
|
||||
reviewStatus: { type: string, enum: [DRAFT, PENDING, APPROVED, REJECTED] }
|
||||
publicationStatus: { type: string }
|
||||
sourceStatus: { type: string }
|
||||
LastMileFeeApiResponse:
|
||||
type: object
|
||||
required: [code, message, data]
|
||||
@@ -1782,6 +1814,12 @@ components:
|
||||
cartonMark: { type: string, minLength: 1 }
|
||||
palletCode: { type: string, minLength: 1 }
|
||||
idempotencyKey: { type: string, minLength: 1, maxLength: 255 }
|
||||
ReceivingWholePallet:
|
||||
type: object
|
||||
required: [sourcePalletNo, idempotencyKey]
|
||||
properties:
|
||||
sourcePalletNo: { type: string, minLength: 1 }
|
||||
idempotencyKey: { type: string, minLength: 1, maxLength: 255 }
|
||||
ReceivingApiResponseBase:
|
||||
type: object
|
||||
required: [code, message, timestamp]
|
||||
@@ -1793,7 +1831,7 @@ components:
|
||||
timestamp: { type: string, format: date-time }
|
||||
ReceivingInbound:
|
||||
type: object
|
||||
required: [inboundCode, destinationType, plannedPalletCount, totalPackages, receivedPackages, pendingPackages, assigned, mergeAllowed, urgent]
|
||||
required: [inboundCode, destinationType, plannedPalletCount, totalPackages, receivedPackages, pendingPackages, assigned, mergeAllowed, urgent, wholePalletInbound]
|
||||
properties:
|
||||
inboundCode: { type: string }
|
||||
destinationType: { type: string, enum: [FBA, OVERSEAS] }
|
||||
@@ -1905,6 +1943,8 @@ components:
|
||||
mergeAllowed: { type: boolean, description: 现场可选择合托,不作为实收或完成门禁 }
|
||||
urgent: { type: boolean }
|
||||
mergeHint: { type: string, nullable: true }
|
||||
orderType: { type: string, nullable: true }
|
||||
wholePalletInbound: { type: boolean, description: 一件代发必须按完整来源托盘扫描收货 }
|
||||
ReceivingCandidateListApiResponse:
|
||||
allOf:
|
||||
- { $ref: '#/components/schemas/ReceivingApiResponseBase' }
|
||||
@@ -2131,11 +2171,22 @@ components:
|
||||
enum: [START_PROCESSING, COMPLETE_EXCEPTION, CANCEL_EXCEPTION]
|
||||
DeliveryFeeInput:
|
||||
type: object
|
||||
required: [feeType, currency, amount]
|
||||
required: [feeType, feeName, direction, currency, amount]
|
||||
properties:
|
||||
feeType: { type: string, maxLength: 64 }
|
||||
currency: { type: string, maxLength: 8 }
|
||||
amount: { type: number, minimum: 0 }
|
||||
feeName: { type: string, maxLength: 128 }
|
||||
direction: { type: string, enum: [RECEIVABLE, PAYABLE] }
|
||||
currency: { type: string, enum: [CNY, USD] }
|
||||
amount: { type: number, minimum: 0, exclusiveMinimum: true }
|
||||
supplierId: { type: string, pattern: '^[1-9][0-9]*$' }
|
||||
supplierName: { type: string, maxLength: 200 }
|
||||
supplierCategory: { type: string, maxLength: 32 }
|
||||
settlementMode: { type: string, enum: [ON_ACCOUNT, DIRECT_PAID] }
|
||||
chargeableQuantity: { type: number, minimum: 0, exclusiveMinimum: true }
|
||||
quantityUnit: { type: string, maxLength: 32 }
|
||||
unitPrice: { type: number, minimum: 0, exclusiveMinimum: true }
|
||||
periodStart: { type: string, format: date }
|
||||
periodEnd: { type: string, format: date }
|
||||
remark: { type: string, nullable: true, maxLength: 500 }
|
||||
OneClickOutboundCreate:
|
||||
type: object
|
||||
@@ -2317,7 +2368,7 @@ components:
|
||||
required: [customerOrderNo, labelDeadline, contactName, contactPhone, chargeAmount, idempotencyKey, items]
|
||||
properties:
|
||||
customerOrderNo: { type: string, maxLength: 128 }
|
||||
operationWarehouseId: { type: string, maxLength: 128, description: 换标操作所在海外中转仓,和FBA目的仓分离 }
|
||||
overseasWarehouseId: { type: string, nullable: true, maxLength: 128, description: 统一目的海外仓;明细未填写目的仓时使用 }
|
||||
labelDeadline: { type: string, format: date-time }
|
||||
contactName: { type: string, maxLength: 128 }
|
||||
contactPhone: { type: string, maxLength: 64 }
|
||||
@@ -2329,11 +2380,8 @@ components:
|
||||
items: { type: array, minItems: 1, maxItems: 500, items: { $ref: '#/components/schemas/RelabelItem' } }
|
||||
RelabelItem:
|
||||
type: object
|
||||
required: [sourceInventoryBalanceId, sourceInventoryPositionId, sourceInboundOrderId, productNameZh, totalPackageCount, notifiedPackageCount, shipmentNo, cartonMark]
|
||||
required: [productNameZh, totalPackageCount, notifiedPackageCount, shipmentNo, newSkuCode, cartonMark, fbaCartonMark]
|
||||
properties:
|
||||
sourceInventoryBalanceId: { type: string, pattern: '^[0-9]+$', description: 来源库存余额ID }
|
||||
sourceInventoryPositionId: { type: string, pattern: '^[0-9]+$', description: 来源库存仓位ID;同箱任务唯一冻结依据 }
|
||||
sourceInboundOrderId: { type: string, pattern: '^[0-9]+$', description: 来源历史入仓单ID }
|
||||
skuCode: { type: string, nullable: true, maxLength: 128, description: 商品 SKU(选填) }
|
||||
productImageFileId: { type: string, nullable: true, maxLength: 128 }
|
||||
productImageFileName: { type: string, nullable: true, maxLength: 255 }
|
||||
@@ -2343,24 +2391,14 @@ components:
|
||||
notifiedPackageCount: { type: integer, minimum: 1 }
|
||||
shipmentNo: { type: string, maxLength: 128 }
|
||||
trackingCode: { type: string, nullable: true, maxLength: 255 }
|
||||
newSkuCode: { type: string, nullable: true, maxLength: 128, description: 箱唛换标时的单个新SKU兼容字段 }
|
||||
newSkuCode: { type: string, maxLength: 128 }
|
||||
labelRequirement: { type: string, nullable: true, maxLength: 1000 }
|
||||
relabelFileId: { type: string, nullable: true, maxLength: 128 }
|
||||
relabelFileName: { type: string, nullable: true, maxLength: 255 }
|
||||
relabelFileUrl: { type: string, nullable: true, maxLength: 1000 }
|
||||
cartonMark: { type: string, maxLength: 255, description: 我方箱唛;同一申请内不可重复,整箱库存只冻结一次 }
|
||||
fbaCartonMark: { type: string, nullable: true, maxLength: 255, description: 新FBA箱唛;箱唛或组合换标必填 }
|
||||
destinationFbaWarehouseCode: { type: string, nullable: true, maxLength: 128, description: FBA目的仓编码;箱唛或组合换标必填 }
|
||||
operationType: { type: string, enum: [CARTON_LABEL, SKU_LABEL, CARTON_AND_SKU], description: 箱唛换标、SKU换标或组合换标 }
|
||||
skuItems: { type: array, maxItems: 100, description: 同一箱唛内SKU换标子明细,数量按件;SKU或组合换标必填, items: { $ref: '#/components/schemas/RelabelSkuItem' } }
|
||||
RelabelSkuItem:
|
||||
type: object
|
||||
required: [skuCode, newSkuCode, quantity]
|
||||
properties:
|
||||
skuCode: { type: string, maxLength: 128, description: 原SKU }
|
||||
newSkuCode: { type: string, maxLength: 128, description: 换标后SKU }
|
||||
quantity: { type: integer, minimum: 1, description: 换标件数 }
|
||||
remark: { type: string, nullable: true, maxLength: 1000 }
|
||||
cartonMark: { type: string, maxLength: 255, description: 客户自有箱唛(不在编辑列表展示) }
|
||||
fbaCartonMark: { type: string, maxLength: 255, description: 关联 FBA 箱唛 }
|
||||
destinationWarehouseId: { type: string, nullable: true, maxLength: 128, description: 该箱目的海外仓;为空时使用申请统一目的仓 }
|
||||
RelabelStatusChange:
|
||||
type: object
|
||||
required: [status]
|
||||
|
||||
@@ -42,7 +42,7 @@ paths:
|
||||
responses: { '200': { description: 当前费用来源版本 }, '409': { description: 状态、版本或幂等冲突 } }
|
||||
components:
|
||||
schemas:
|
||||
BusinessType: { type: string, enum: [OVERSEAS_INBOUND, OVERSEAS_PROCUREMENT, US_TRUCK, LOCAL_LOOSEBOARD, WAREHOUSE_SERVICE, OVERSEAS_CONTAINER] }
|
||||
BusinessType: { type: string, enum: [OVERSEAS_INBOUND, OVERSEAS_PROCUREMENT, PROCUREMENT_FEE, US_TRUCK, LOCAL_LOOSEBOARD, WAREHOUSE_SERVICE, OVERSEAS_CONTAINER, LASTLEG_ORDER, DELIVERY_ORDER, RELABEL_ORDER] }
|
||||
OverseasContainerFeeItem:
|
||||
type: string
|
||||
description: 海外阶段柜级费用项目:港口费、堆存费、修箱费、吊机费、码头拖车费、其他。
|
||||
@@ -70,7 +70,7 @@ components:
|
||||
required: [customerId, sourceType, businessType, businessNo, feeItemCode, feeItemName, direction, businessDate, currency, amount]
|
||||
properties:
|
||||
customerId: { type: string }
|
||||
sourceType: { type: string, enum: [OVERSEAS_INBOUND_FEE, OVERSEAS_PROCUREMENT_FEE, OVERSEAS_TRUCK_FEE, OVERSEAS_LOOSEBOARD_FEE, OVERSEAS_WAREHOUSE_FEE, OVERSEAS_CONTAINER_FEE] }
|
||||
sourceType: { type: string, enum: [OVERSEAS_INBOUND_FEE, OVERSEAS_PROCUREMENT_FEE, OVERSEAS_TRUCK_FEE, OVERSEAS_LOOSEBOARD_FEE, OVERSEAS_WAREHOUSE_FEE, OVERSEAS_CONTAINER_FEE, OVERSEAS_ORDER_FEE, OVERSEAS_DELIVERY_FEE, OVERSEAS_RELABEL_FEE] }
|
||||
businessType: { $ref: '#/components/schemas/BusinessType' }
|
||||
businessId: { type: string, pattern: '^[1-9][0-9]*$', nullable: true }
|
||||
businessNo: { type: string, maxLength: 128 }
|
||||
@@ -85,6 +85,11 @@ components:
|
||||
feeItemName: { type: string }
|
||||
direction: { type: string, enum: [RECEIVABLE, PAYABLE] }
|
||||
businessDate: { type: string, format: date }
|
||||
currency: { type: string, enum: [CNY] }
|
||||
amount: { type: number, format: decimal, minimum: 0, exclusiveMinimum: true }
|
||||
currency: { type: string, enum: [CNY, USD], description: 业务原币;USD由服务端按业务月份有效汇率折算为CNY入池 }
|
||||
amount: { type: number, format: decimal, minimum: 0, exclusiveMinimum: true, description: 业务原币金额 }
|
||||
chargeableQuantity: { type: number, format: decimal, minimum: 0, exclusiveMinimum: true, nullable: true }
|
||||
quantityUnit: { type: string, maxLength: 32, nullable: true }
|
||||
unitPrice: { type: number, format: decimal, minimum: 0, exclusiveMinimum: true, nullable: true }
|
||||
periodStart: { type: string, format: date, nullable: true }
|
||||
periodEnd: { type: string, format: date, nullable: true }
|
||||
securitySchemes: { bearerAuth: { type: http, scheme: bearer, bearerFormat: JWT } }
|
||||
|
||||
Reference in New Issue
Block a user