openapi: 3.0.3 info: title: 客户来源头程订单尾程进度内部查询 version: 1.0.0 paths: /internal/lastleg/v1/customer-order-progress: post: summary: Order按认证客户读取排车和实际派送进度 description: >- 只读内部接口,无公网路由。customerId由Order认证上下文提供,所有业务表在Lastleg自身Schema内按客户读取。 已排车scheduled按有效待出库单的不可变来源明细及箱数计算,与平台出库单节点一致;仅生成排车单号、审核中、审核通过但未生成出库单均不计入。 取消的出库单及已实际出库的单据不计入scheduled;排车审核、真实拣货核平、装车确认及安排派送仍按原流程执行。 派送必须排车单ACTIVE且处于DELIVERING阶段、具有实际发车时间、出库OUTBOUNDED且对应目的地派送单仍WAIT_DELIVERY/DELIVERING。 混托使用全部不可变出库及拣货来源,不使用代表orderId;数量覆盖不完整或异常时标记partial,不签发派送完成事实。 security: [{internalServiceToken: []}] requestBody: required: true content: application/json: schema: type: object required: [customerId] properties: customerId: {type: integer, format: int64, minimum: 1} orderIds: type: array nullable: true minItems: 1 maxItems: 200 items: {type: integer, format: int64, minimum: 1} description: 省略或null查询当前客户全部进度;传入时仅在SQL内查询这些来源Order订单,空数组拒绝,不允许扩大到全客户。 responses: '200': description: ApiResponse,只有code为200表示成功;progress为空表示客户当前无有效排车或派送 content: application/json: schema: type: object properties: code: {type: string} data: type: object required: [progress] properties: progress: type: array items: type: object required: [orderId, stage, partial] properties: orderId: {type: string, pattern: '^[1-9][0-9]*$'} stage: {type: string, enum: [scheduled, delivering]} partial: {type: boolean} '400': {description: 客户参数无效} '401': {description: 内部服务令牌缺失或无效} '503': {description: 内部令牌未配置} components: securitySchemes: internalServiceToken: type: apiKey in: header name: X-Internal-Service-Token