fix(firstleg): align coload group eligibility
This commit is contained in:
@@ -6,9 +6,6 @@ CREATE TABLE IF NOT EXISTS fl_coload_group (
|
||||
group_status VARCHAR(16) NOT NULL COMMENT '组状态:ACTIVE、LOCKED、CONSUMED、CANCELLED',
|
||||
warehouse_id BIGINT UNSIGNED NOT NULL COMMENT '国内收货仓ID快照',
|
||||
channel_code VARCHAR(64) NOT NULL COMMENT '物流渠道编码快照',
|
||||
destination_type VARCHAR(32) NOT NULL COMMENT '目的类型快照',
|
||||
destination_warehouse_id BIGINT UNSIGNED NULL COMMENT '目的仓ID快照',
|
||||
destination_code VARCHAR(64) NULL COMMENT '目的仓或目的港编码快照',
|
||||
locked_plan_id BIGINT UNSIGNED NULL COMMENT 'LOCKED/CONSUMED绑定装柜计划ID',
|
||||
version INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '乐观版本',
|
||||
created_by BIGINT UNSIGNED NOT NULL COMMENT '创建人ID',
|
||||
@@ -30,8 +27,6 @@ CREATE TABLE IF NOT EXISTS fl_coload_group (
|
||||
KEY idx_coload_group_plan (locked_plan_id,group_status),
|
||||
CONSTRAINT fk_coload_group_plan FOREIGN KEY (locked_plan_id) REFERENCES fl_loading_plan(id),
|
||||
CONSTRAINT chk_coload_group_status CHECK (group_status IN ('ACTIVE','LOCKED','CONSUMED','CANCELLED')),
|
||||
CONSTRAINT chk_coload_group_destination CHECK (
|
||||
destination_warehouse_id IS NOT NULL OR destination_code IS NOT NULL),
|
||||
CONSTRAINT chk_coload_group_lock CHECK (
|
||||
(group_status IN ('ACTIVE','CANCELLED') AND locked_plan_id IS NULL)
|
||||
OR (group_status IN ('LOCKED','CONSUMED') AND locked_plan_id IS NOT NULL))
|
||||
|
||||
@@ -2,14 +2,14 @@ openapi: 3.0.3
|
||||
info:
|
||||
title: Firstleg Coload Group API
|
||||
version: 1.0.0
|
||||
description: 同柜且不可拆组平台管理契约;跨客户成组,但仓库、渠道和目的仓港必须一致。
|
||||
description: 同柜且不可拆组平台管理契约;允许跨客户及不同目的仓港成组,仅要求国内仓和渠道一致。
|
||||
paths:
|
||||
/api/platform/v1/first-leg/coload-groups:
|
||||
post:
|
||||
summary: 创建同柜不可拆组
|
||||
description: >-
|
||||
需要 platform:firstleg:smart-loading:assign。orderIds 至少2项;服务端解析每个订单唯一当前权威入库单,
|
||||
要求 WAIT_SPLIT、原始MASTER、未拆分、未分配、无子单或拆分批次,并冻结全部成员满箱数。
|
||||
需要 platform:firstleg:smart-loading:assign。orderIds 至少2项;服务端解析每个订单全部 WAIT_SPLIT、
|
||||
未分配且未属于其他活动组的可用入库片段,要求国内仓和渠道一致,并冻结全部片段及其满箱数。
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/IdempotencyKey'
|
||||
requestBody:
|
||||
@@ -130,23 +130,19 @@ components:
|
||||
ColoadGroup:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required: [groupId, groupNo, status, warehouseId, channelCode, destinationType,
|
||||
version, members, fullPackageCount, createdAt, updatedAt]
|
||||
required: [groupId, groupNo, status, warehouseId, channelCode, version, members,
|
||||
fullPackageCount, createdAt, updatedAt]
|
||||
properties:
|
||||
groupId: {type: string, pattern: '^[1-9][0-9]*$'}
|
||||
groupNo: {type: string, pattern: '^CLG-[1-9][0-9]*$'}
|
||||
status: {type: string, enum: [ACTIVE, LOCKED, CONSUMED, CANCELLED]}
|
||||
warehouseId: {type: string, pattern: '^[1-9][0-9]*$'}
|
||||
channelCode: {type: string}
|
||||
destinationType: {type: string}
|
||||
destinationWarehouseId: {type: string, nullable: true}
|
||||
destinationCode: {type: string, nullable: true}
|
||||
lockedPlanId: {type: string, nullable: true}
|
||||
version: {type: integer, minimum: 0}
|
||||
members:
|
||||
type: array
|
||||
minItems: 2
|
||||
maxItems: 100
|
||||
items: {$ref: '#/components/schemas/ColoadGroupMember'}
|
||||
fullPackageCount: {type: integer, minimum: 2, description: 全部成员满箱数之和}
|
||||
createdAt: {type: string, format: date-time}
|
||||
@@ -154,8 +150,7 @@ components:
|
||||
OrderColoadGroupInfo:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required: [orderId, inboundId, group]
|
||||
required: [orderId, group]
|
||||
properties:
|
||||
orderId: {type: string, pattern: '^[1-9][0-9]*$'}
|
||||
inboundId: {type: string, pattern: '^[1-9][0-9]*$'}
|
||||
group: {$ref: '#/components/schemas/ColoadGroup'}
|
||||
|
||||
Reference in New Issue
Block a user