一件代发拣货

This commit is contained in:
2026-09-01 13:41:00 +08:00
parent ffed9bf898
commit 8b0c99593e
29 changed files with 910 additions and 29 deletions
@@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS fl_inbound_order (
order_id BIGINT UNSIGNED NOT NULL COMMENT '订单服务订单ID,不建立跨库外键',
order_no VARCHAR(32) NOT NULL COMMENT '订单号快照',
inbound_code VARCHAR(40) NOT NULL COMMENT '全平台唯一入仓码',
process_status VARCHAR(24) NOT NULL DEFAULT 'WAIT_MEASURE' COMMENT '入库流程状态:WAIT_MEASURE待测量、MEASURING测量中、MEASURE_PENDING待审核、MEASURE_REJECTED测量驳回、WAIT_PRICING待计费、FEE_CONFIRMING费用确认中、INBOUNDING入库收口中、WAIT_SPLIT待分柜',
process_status VARCHAR(24) NOT NULL DEFAULT 'WAIT_MEASURE' COMMENT '入库流程状态:WAIT_MEASURE待测量、MEASURE_PENDING待审核、WAIT_PALLETIZE一件代发待合托、WAIT_SPLIT待分柜',
order_status_snapshot VARCHAR(24) NOT NULL COMMENT '订单状态快照',
measure_review_status VARCHAR(24) NOT NULL DEFAULT 'NOT_SUBMITTED' COMMENT '测量审核状态:NOT_SUBMITTED未提交、PENDING待审核、APPROVED已通过、REJECTED已驳回',
fee_status VARCHAR(24) NOT NULL DEFAULT 'UNPRICED' COMMENT '费用状态:UNPRICED未计费、CALCULATED已计算、CONFIRMED已确认、SENT已发送、VOIDED已作废',
@@ -847,3 +847,81 @@ CREATE TABLE IF NOT EXISTS fl_customer_dimension_config (
CONSTRAINT chk_customer_dimension_edge_addition
CHECK (edge_addition_cm >= 0.001 AND edge_addition_cm <= 100.000)
) ENGINE=InnoDB COMMENT='客户固定四箱规尺寸配置';
-- 一件代发测量完成后进入 WAIT_PALLETIZE,完成合托后才进入 WAIT_SPLIT。
-- 一件代发测量完成后的独立 PDA 合托;不代表国内仓库存入库。
CREATE TABLE IF NOT EXISTS fl_dropship_pallet_task (
id BIGINT UNSIGNED NOT NULL COMMENT '合托任务ID',
tenant_id BIGINT UNSIGNED NOT NULL COMMENT '客户隔离键',
inbound_id BIGINT UNSIGNED NOT NULL COMMENT '一件代发入仓单ID',
warehouse_id BIGINT UNSIGNED NOT NULL COMMENT '作业仓库ID',
task_status VARCHAR(24) NOT NULL COMMENT 'PENDING/CLAIMED/COMPLETED',
total_cartons INT UNSIGNED NOT NULL COMMENT '测量确认总箱数',
allocated_cartons INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '已上托箱数',
assignee_id BIGINT UNSIGNED NULL,
assignee_name VARCHAR(64) NULL,
claimed_at DATETIME(3) NULL,
completed_at DATETIME(3) NULL,
version INT NOT NULL DEFAULT 1,
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_dropship_task_inbound (tenant_id,inbound_id),
KEY idx_dropship_task_operator (task_status,assignee_id,warehouse_id,created_at),
CONSTRAINT fk_dropship_task_inbound FOREIGN KEY (inbound_id) REFERENCES fl_inbound_order(id),
CONSTRAINT chk_dropship_task_status CHECK (task_status IN ('PENDING','CLAIMED','COMPLETED')),
CONSTRAINT chk_dropship_task_cartons CHECK (allocated_cartons<=total_cartons)
) ENGINE=InnoDB COMMENT='一件代发测量后PDA合托任务';
CREATE TABLE IF NOT EXISTS fl_dropship_pallet (
id BIGINT UNSIGNED NOT NULL COMMENT '合托托盘ID',
task_id BIGINT UNSIGNED NOT NULL,
tenant_id BIGINT UNSIGNED NOT NULL,
inbound_id BIGINT UNSIGNED NOT NULL,
warehouse_id BIGINT UNSIGNED NOT NULL,
pallet_no VARCHAR(32) NULL COMMENT '封托时生成的DP托盘号',
pallet_status VARCHAR(16) NOT NULL COMMENT 'OPEN/COMPLETED',
open_operation_id VARCHAR(128) NOT NULL,
seal_operation_id VARCHAR(128) NULL,
created_by BIGINT UNSIGNED NOT NULL,
created_by_name VARCHAR(64) NULL,
completed_by BIGINT UNSIGNED NULL,
completed_by_name VARCHAR(64) NULL,
completed_at DATETIME(3) NULL,
version INT NOT NULL DEFAULT 1,
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_dropship_pallet_no (pallet_no),
UNIQUE KEY uk_dropship_pallet_open_op (open_operation_id),
UNIQUE KEY uk_dropship_pallet_seal_op (seal_operation_id),
KEY idx_dropship_pallet_inbound (tenant_id,inbound_id,pallet_status),
CONSTRAINT fk_dropship_pallet_task FOREIGN KEY (task_id) REFERENCES fl_dropship_pallet_task(id),
CONSTRAINT chk_dropship_pallet_status CHECK (pallet_status IN ('OPEN','COMPLETED'))
) ENGINE=InnoDB COMMENT='一件代发合托形成的可打印托盘';
CREATE TABLE IF NOT EXISTS fl_dropship_pallet_carton (
id BIGINT UNSIGNED NOT NULL,
task_id BIGINT UNSIGNED NOT NULL,
pallet_id BIGINT UNSIGNED NOT NULL,
tenant_id BIGINT UNSIGNED NOT NULL,
inbound_id BIGINT UNSIGNED NOT NULL,
inbound_detail_id BIGINT UNSIGNED NOT NULL,
carton_label_id BIGINT UNSIGNED NOT NULL,
sku_code VARCHAR(128) NOT NULL,
cargo_name VARCHAR(255) NULL,
box_code VARCHAR(64) NOT NULL,
operation_id VARCHAR(128) NOT NULL,
bound_by BIGINT UNSIGNED NOT NULL,
bound_by_name VARCHAR(64) NULL,
bound_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
PRIMARY KEY (id),
UNIQUE KEY uk_dropship_carton_task_label (task_id,carton_label_id),
KEY idx_dropship_carton_pallet_sku (pallet_id,sku_code,id),
KEY idx_dropship_carton_inbound (tenant_id,inbound_id,pallet_id),
KEY idx_dropship_carton_operation (operation_id),
CONSTRAINT fk_dropship_carton_task FOREIGN KEY (task_id) REFERENCES fl_dropship_pallet_task(id),
CONSTRAINT fk_dropship_carton_pallet FOREIGN KEY (pallet_id) REFERENCES fl_dropship_pallet(id),
CONSTRAINT fk_dropship_carton_label FOREIGN KEY (carton_label_id) REFERENCES fl_inbound_carton_label(id)
) ENGINE=InnoDB COMMENT='一件代发托盘内逐箱SKU和入仓单明细';
@@ -0,0 +1,54 @@
openapi: 3.0.3
info:
title: 一件代发 PDA 合托 API
version: 1.0.0
description: 测量完成后独立下发;不创建国内库存。PDA 扫箱唛识别 SKU,并按箱数合托。
paths:
/api/platform/v1/first-leg/pda-dropship/tasks/pending:
get:
summary: 查询待领取或本人已领取的一件代发合托任务
responses: { '200': { description: OK } }
/api/platform/v1/first-leg/pda-dropship/tasks/{taskId}:
get:
summary: 查询任务、托盘、入仓单、SKU 和箱数明细
parameters:
- { name: taskId, in: path, required: true, schema: { type: integer, format: int64 } }
- { name: warehouseId, in: query, required: true, schema: { type: integer, format: int64 } }
responses: { '200': { description: OK } }
/api/platform/v1/first-leg/pda-dropship/tasks/{taskId}/claim:
post:
summary: 领取合托任务
parameters: [{ name: taskId, in: path, required: true, schema: { type: integer, format: int64 } }]
responses: { '200': { description: OK } }
/api/platform/v1/first-leg/pda-dropship/tasks/{taskId}/pallets/open:
post:
summary: 开启一个现场托盘
parameters: [{ name: taskId, in: path, required: true, schema: { type: integer, format: int64 } }]
responses: { '200': { description: OK } }
/api/platform/v1/first-leg/pda-dropship/tasks/{taskId}/pallets/{palletId}/scan:
post:
summary: 扫箱唛识别 SKU 并填写上托箱数
parameters:
- { name: taskId, in: path, required: true, schema: { type: integer, format: int64 } }
- { name: palletId, in: path, required: true, schema: { type: integer, format: int64 } }
responses: { '200': { description: OK } }
/api/platform/v1/first-leg/pda-dropship/tasks/{taskId}/pallets/{palletId}/seal:
post:
summary: 完成合托并生成 DP 托盘号
parameters:
- { name: taskId, in: path, required: true, schema: { type: integer, format: int64 } }
- { name: palletId, in: path, required: true, schema: { type: integer, format: int64 } }
responses: { '200': { description: OK } }
/api/platform/v1/first-leg/pda-dropship/inbound-orders/{inboundId}/pallets:
get:
summary: 入仓单查看绑定的一个或多个托盘及各自箱数
parameters: [{ name: inboundId, in: path, required: true, schema: { type: integer, format: int64 } }]
responses: { '200': { description: OK } }
/api/platform/v1/first-leg/pda-dropship/inbound-orders/{inboundId}/pallets/{palletId}/print:
get:
summary: 打印托盘号、入仓码和 SKU 箱数托盘唛
parameters:
- { name: inboundId, in: path, required: true, schema: { type: integer, format: int64 } }
- { name: palletId, in: path, required: true, schema: { type: integer, format: int64 } }
responses:
'200': { description: PDF, content: { application/pdf: { schema: { type: string, format: binary } } } }
@@ -1140,7 +1140,7 @@ components:
orderId: {type: integer, format: int64, nullable: true}
orderNo: {type: string, nullable: true}
inboundCode: {type: string, nullable: true}
processStatus: {type: string, nullable: true, description: Firstleg 内部状态;入库完成记录进入 WAIT_SPLIT}
processStatus: {type: string, nullable: true, description: Firstleg 内部状态;一件代发测量后先进入 WAIT_PALLETIZE,合托完成再进入 WAIT_SPLIT}
orderStatusSnapshot: {type: string, nullable: true}
measureReviewStatus: {type: string, nullable: true}
feeStatus: {type: string, nullable: true}