feat(order): add batch review preview
This commit is contained in:
@@ -491,6 +491,45 @@ paths:
|
||||
responses:
|
||||
'200': {description: 成功或业务失败,按响应体 code 判断}
|
||||
'403': {description: 需要 platform:order:create 权限}
|
||||
/api/platform/v1/orders/first-leg/batch-review-preview:
|
||||
post:
|
||||
tags: [Platform first-leg orders]
|
||||
summary: 批量审核预览
|
||||
description: >-
|
||||
在一个 HTTP 请求中按目标客户批量返回审核弹窗所需稳定快照。服务端固定使用订单与货物两次批量查询,
|
||||
中文品名按货物 itemNo 顺序去重;不得由前端逐票请求详情。orderId 仅供路由,主要展示使用 inboundCode;
|
||||
canApprove=false 时必须展示 blockReason。请求中的 orderVersion 用于识别列表快照是否过期。
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TenantId'
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema: {$ref: '#/components/schemas/BatchReviewRequest'}
|
||||
responses:
|
||||
'200':
|
||||
description: 返回请求顺序一致的批量审核预览
|
||||
content:
|
||||
application/json:
|
||||
schema: {$ref: '#/components/schemas/BatchReviewPreviewEnvelope'}
|
||||
'403': {description: 需要平台身份和 platform:order:approve 权限}
|
||||
/api/platform/v1/orders/first-leg/batch-approve:
|
||||
post:
|
||||
tags: [Platform first-leg orders]
|
||||
summary: 批量审核通过订单
|
||||
description: >-
|
||||
单客户范围内逐票重新校验权限、状态和 orderVersion,每票独立事务;允许部分成功,
|
||||
failedOrders 返回未成功订单及业务原因,成功订单不会因其他订单失败而回滚。
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TenantId'
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema: {$ref: '#/components/schemas/BatchReviewRequest'}
|
||||
responses:
|
||||
'200': {description: 返回部分成功语义的逐票处理汇总}
|
||||
'403': {description: 需要平台身份和 platform:order:approve 权限}
|
||||
/api/platform/v1/orders/first-leg/tenant-statistics:
|
||||
get:
|
||||
tags: [Platform first-leg orders]
|
||||
@@ -635,6 +674,54 @@ components:
|
||||
widthCm: {type: number, nullable: true}
|
||||
heightCm: {type: number, nullable: true}
|
||||
shipmentId: {type: string, nullable: true, description: 当前货物行的 FBA 货件号快照,不以订单级字段回退}
|
||||
BatchReviewRequest:
|
||||
type: object
|
||||
required: [items]
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
minItems: 1
|
||||
maxItems: 100
|
||||
uniqueItems: true
|
||||
items: {$ref: '#/components/schemas/BatchReviewRequestItem'}
|
||||
BatchReviewRequestItem:
|
||||
type: object
|
||||
required: [orderId, orderVersion]
|
||||
properties:
|
||||
orderId: {type: string, pattern: '^[1-9][0-9]*$', description: 仅供路由关联,不作为主要展示键}
|
||||
orderVersion: {type: integer, minimum: 0, description: 统一订单列表返回的 Order 乐观锁版本}
|
||||
BatchReviewPreviewEnvelope:
|
||||
type: object
|
||||
required: [code, data]
|
||||
properties:
|
||||
code: {type: string, example: "200"}
|
||||
message: {type: string, nullable: true}
|
||||
data: {$ref: '#/components/schemas/BatchReviewPreview'}
|
||||
BatchReviewPreview:
|
||||
type: object
|
||||
required: [total, approvableCount, items]
|
||||
properties:
|
||||
total: {type: integer, minimum: 1, maximum: 100}
|
||||
approvableCount: {type: integer, minimum: 0, maximum: 100}
|
||||
items:
|
||||
type: array
|
||||
items: {$ref: '#/components/schemas/BatchReviewPreviewItem'}
|
||||
BatchReviewPreviewItem:
|
||||
type: object
|
||||
required: [orderId, orderVersion, chineseGoodsNames, canApprove]
|
||||
properties:
|
||||
orderId: {type: string, pattern: '^[1-9][0-9]*$', description: 仅供路由关联,不作为主要展示键}
|
||||
orderVersion: {type: integer, minimum: 0}
|
||||
inboundCode: {type: string, nullable: true, description: 权威入仓码;缺失时为 null,不以内部 ID 回退}
|
||||
customerId: {type: string, nullable: true, pattern: '^[1-9][0-9]*$'}
|
||||
customerName: {type: string, nullable: true}
|
||||
chineseGoodsNames: {type: array, items: {type: string}, description: 按订单货物顺序去重的中文品名}
|
||||
channelCode: {type: string, nullable: true}
|
||||
channelName: {type: string, nullable: true}
|
||||
destinationWarehouseCode: {type: string, nullable: true, description: Order 保存的目的仓业务编码;缺失时不以内部 ID 回退}
|
||||
destinationWarehouseName: {type: string, nullable: true}
|
||||
canApprove: {type: boolean}
|
||||
blockReason: {type: string, nullable: true}
|
||||
DomesticWarehouseOrderExportBatchRequest:
|
||||
type: object
|
||||
required: [taskId, tenantId, appCode, requestedBy, dispatchVersion, parameters, limit]
|
||||
|
||||
Reference in New Issue
Block a user