贴标申请,仓储转运

This commit is contained in:
2026-10-14 11:36:35 +08:00
parent 83dc6dea3f
commit e14bdb4f49
37 changed files with 884 additions and 32 deletions
@@ -0,0 +1,121 @@
openapi: 3.0.3
info:
title: Cargo discard PDA photo evidence
version: 1.0.0
description: >-
Each approved pallet requires 1–20 JPG/PNG photos before actual disposal confirmation.
Uploads persist as drafts and recover through the PDA list endpoint. Confirmation binds
selected photos in the same transaction as inventory deduction. Completed quantities and
photo sets are immutable; identical replay does not deduct stock or create evidence again.
Platform and merchant details expose only submitted photos, including photos of completed
pallets while other pallets are still pending. Historic applications are not backfilled.
security:
- bearerAuth: []
paths:
/api/pda/v1/last-leg/cargo-discards/{discardNo}/pallets/{palletNo}/photos/files:
parameters:
- $ref: '#/components/parameters/DiscardNo'
- $ref: '#/components/parameters/PalletNo'
post:
summary: Upload an approved, unfinished pallet photo (PDA bound warehouse only)
x-permissions: [lastleg:pda:operate, ROLE_OVERSEAS_WAREHOUSE_PDA_OPERATOR]
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required: [file]
properties:
file: { type: string, format: binary, description: Non-empty JPG/PNG up to 10 MiB with image signature validation }
responses:
'200': { description: ApiResponse with uploaded Photo metadata; business errors use body code }
get:
summary: Recover all uploaded photos for this application and pallet
x-permissions: [lastleg:pda:operate, ROLE_OVERSEAS_WAREHOUSE_PDA_OPERATOR]
responses:
'200': { description: ApiResponse with a Photo array, including unsubmitted uploads }
/api/pda/v1/last-leg/cargo-discards/{discardNo}/pallets/{palletNo}/photos/files/{fileId}/download:
parameters:
- $ref: '#/components/parameters/DiscardNo'
- $ref: '#/components/parameters/PalletNo'
- $ref: '#/components/parameters/FileId'
get:
summary: Download a photo associated with this pallet in the PDA bound warehouse
x-permissions: [lastleg:pda:operate, ROLE_OVERSEAS_WAREHOUSE_PDA_OPERATOR]
responses:
'200': { description: Inline JPG/PNG bytes with Cache-Control no-store }
/api/pda/v1/last-leg/cargo-discards/{discardNo}/pallets/{palletNo}/confirm:
parameters:
- $ref: '#/components/parameters/DiscardNo'
- $ref: '#/components/parameters/PalletNo'
post:
summary: Confirm actual disposal with owned pallet photos
x-permissions: [lastleg:pda:operate, ROLE_OVERSEAS_WAREHOUSE_PDA_OPERATOR]
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [lines, photoFileIds]
properties:
lines:
type: array
minItems: 1
items:
type: object
required: [itemId, actualPackages]
properties:
itemId: { type: string, pattern: '^[1-9][0-9]*$' }
actualPackages: { type: integer, minimum: 0 }
photoFileIds:
type: array
minItems: 1
maxItems: 20
uniqueItems: true
items: { type: string, pattern: '^[1-9][0-9]*$' }
responses:
'200': { description: ApiResponse containing the completed PalletTask; conflicts use business body code }
/api/platform/v1/last-leg/cargo-discards/{discardNo}/photos/files/{fileId}/download:
parameters:
- $ref: '#/components/parameters/DiscardNo'
- $ref: '#/components/parameters/FileId'
- name: customerId
in: query
required: true
schema: { type: string, pattern: '^[1-9][0-9]*$' }
get:
summary: Download a submitted photo after application/customer ownership validation
x-permissions: [platform:overseas-warehouse:discard:list]
responses:
'200': { description: Inline JPG/PNG bytes with Cache-Control no-store }
/api/merchant/v1/last-leg/cargo-discards/{discardNo}/photos/files/{fileId}/download:
parameters:
- $ref: '#/components/parameters/DiscardNo'
- $ref: '#/components/parameters/FileId'
get:
summary: Download a submitted photo belonging to the authenticated customer only
x-permissions: [merchant:overseas-warehouse:discard:list]
responses:
'200': { description: Inline JPG/PNG bytes with Cache-Control no-store; no customer override allowed }
components:
securitySchemes:
bearerAuth: { type: http, scheme: bearer, bearerFormat: JWT }
parameters:
DiscardNo: { name: discardNo, in: path, required: true, schema: { type: string } }
PalletNo: { name: palletNo, in: path, required: true, schema: { type: string } }
FileId: { name: fileId, in: path, required: true, schema: { type: string, pattern: '^[1-9][0-9]*$' } }
schemas:
Photo:
type: object
required: [fileId, palletNo, fileName, contentType, sizeBytes, operatorId, createdAt]
properties:
fileId: { type: string }
palletNo: { type: string }
fileName: { type: string }
contentType: { type: string, enum: [image/jpeg, image/png] }
sizeBytes: { type: integer, format: int64, maximum: 10485760 }
operatorId: { type: string }
createdAt: { type: string, format: date-time }
submittedAt: { type: string, format: date-time, nullable: true }
@@ -8,7 +8,7 @@ paths:
/api/platform/v1/last-leg/return-packing-plans:
get:
summary: 合箱计划分页
description: return-inventory:list;page/size/status/planNo 查询,planNo 去除首尾空格后按字面包含匹配,统计与分页使用相同条件。每条计划返回 createdAt 和 completedAt(实际合箱完成时间);已完成计划 resultCartons 返回实际箱唛、SKU数量及当前库位、载体托盘。完成时间不使用箱子的 putawayAt,原箱多次合箱时仍显示本次计划完成时间。
description: return-inventory:list;page/size/status/planNo 查询,planNo 去除首尾空格后按字面包含匹配,统计与分页使用相同条件。每条计划返回 createdAt 和 completedAt(实际合箱完成时间);sources 返回来源箱唛、sourceReturnNo、创建时 originalItems、计划取出 items 和 participation(FULL/PARTIAL/UNKNOWN)。已完成计划 completionCartons 为不可变完成时标签及箱内数量快照,transfers 为来源单/来源箱/SKU/目标箱的本次流向,completedBy 为操作员名称;resultCartons 仅返回当前库存及库位,不替代历史结果。完成时间不使用箱子的 putawayAt,原箱多次合箱时仍显示本次计划完成时间。
parameters:
- { name: planNo, in: query, schema: { type: string, maxLength: 128 }, description: 合箱计划号,支持部分编号查询 }
- { name: customerId, in: query, schema: { type: string, maxLength: 64 }, description: 客户筛选 }
@@ -40,13 +40,13 @@ paths:
/api/pda/v1/last-leg/return-inventory/packing/plans/{planNo}:
get:
summary: 读取精确锁定的来源和数量
description: 绑定仓范围;sources含来源箱逐SKU锁定件数,boxes含汇总数量。
description: 绑定仓范围;sources含来源单、原箱内容快照、参与方式及逐SKU锁定件数,boxes含汇总数量。业务详情currentCartons显示当前实物箱及ownership逐来源单SKU贡献,整箱库存只计一次;packingDetails带planNo。跨来源单同SKU的部分移箱或部分贴标须先现场分拣确认,不自动猜测实物归属。
parameters: [{ name: planNo, in: path, required: true, schema: { type: string } }]
responses: { '200': { description: 业务响应信封 code为200成功,A0400/A0404/A0409校验或状态错误,requestId及traceId保留 }, '403': { description: 权限或角色不符 } }
/api/pda/v1/last-leg/return-inventory/packing/plans/{planNo}/complete:
post:
summary: 多箱分配并完成计划
description: SKU目标总量须等于锁定量。SKU仅支持新增目标箱;BOX整箱可扫描已有目标箱,部分扣除仅支持新增目标箱,sourceDeductions逐来源箱及SKU指定实际扣除量(不超过锁定量),未使用预占释放;目标原库存不扣减,新箱须填写箱规并生成系统箱唛。全事务、同载荷重放标签快照。
description: SKU目标总量须等于锁定量。SKU仅支持新增目标箱;BOX整箱可扫描已有目标箱,部分扣除仅支持新增目标箱,sourceDeductions逐来源箱及SKU必须与计划锁定量完全一致(作为目标的计划原箱除外);目标原库存不扣减,新箱须填写箱规并生成系统箱唛。全事务、同载荷重放标签快照。
parameters: [{ name: planNo, in: path, required: true, schema: { type: string } }]
requestBody: { required: true, content: { application/json: { schema: { $ref: '#/components/schemas/Complete' } } } }
responses: { '200': { description: 业务响应信封 code为200成功,A0400/A0404/A0409校验或状态错误,requestId及traceId保留 }, '403': { description: 权限或角色不符 } }