openapi: "3.0.3" info: title: "原排车未拼车业务运营视图" version: "1.0.0" description: "未实际接入拼车货物的装车后排车;按需求池已实收绑定及本车真实货物组成判定。车辆OWNED/DISPATCHED只表示装车时归属,不决定业务分类;所有主单事实来自原dispatch。新增数据仅附加运营记录、命令、历史及归属证据。油耗L/100km手工登记,金额CNY/USD不默认、不换汇;零与未登记不同。响应遵循NON_NULL:可空属性可省略,省略与null均表示空值,0仍是明确登记值;请求必填项仍以required及DTO校验为准。" security: - bearerAuth: [] paths: "/api/platform/v1/last-leg/fleet/owned-business": get: operationId: "listOwnedBusiness" summary: "未接入拼车货物的装车后视图及同筛选四项统计" description: "权限:platform:fleet:owned-business:list。仅可信平台主体;只读原排车事实,不改变其状态/版本,不发布费用。" x-permission-code: "platform:fleet:owned-business:list" responses: 200: description: "统一ApiResponse:成功code=200;业务错误保留A0400/A0403/A0404/A0409及诊断requestId/traceId。" content: "application/json": schema: type: "object" properties: code: type: "string" message: type: "string" data: allOf: - "$ref": "#/components/schemas/ListResult" nullable: true parameters: - name: "page" in: "query" required: false schema: type: "integer" minimum: 1 default: 1 - name: "size" in: "query" required: false schema: type: "integer" minimum: 1 maximum: 200 default: 20 - name: "plannedDepartureFrom" in: "query" required: false schema: type: "string" format: "date-time" - name: "plannedDepartureTo" in: "query" required: false schema: type: "string" format: "date-time" - name: "keyword" in: "query" required: false schema: type: "string" maxLength: 128 - name: "stage" in: "query" required: false schema: "$ref": "#/components/schemas/Stage" - name: "warehouseId" in: "query" required: false schema: type: "string" maxLength: 64 x-filter-contract: "plannedDepartureAt [from,to),统计同全部过滤、不带分页;无归属快照不降级按当前主档推断。" "/api/platform/v1/last-leg/fleet/owned-business/{dispatchNo}": parameters: - name: "dispatchNo" in: "path" required: true schema: type: "string" maxLength: 128 get: operationId: "getOwnedBusiness" summary: "组合原排车详情及附加运营信息" description: "权限:platform:fleet:owned-business:list。仅可信平台主体;只读原排车事实,不改变其状态/版本,不发布费用。" x-permission-code: "platform:fleet:owned-business:list" responses: 200: description: "统一ApiResponse:成功code=200;业务错误保留A0400/A0403/A0404/A0409及诊断requestId/traceId。" content: "application/json": schema: type: "object" properties: code: type: "string" message: type: "string" data: allOf: - "$ref": "#/components/schemas/Detail" nullable: true "/api/platform/v1/last-leg/fleet/owned-business/{dispatchNo}/history": parameters: - name: "dispatchNo" in: "path" required: true schema: type: "string" maxLength: 128 get: operationId: "historyOwnedBusiness" summary: "原排车及附加真实流水聚合分页" description: "权限:platform:fleet:owned-business:list。仅可信平台主体;只读原排车事实,不改变其状态/版本,不发布费用。" x-permission-code: "platform:fleet:owned-business:list" responses: 200: description: "统一ApiResponse:成功code=200;业务错误保留A0400/A0403/A0404/A0409及诊断requestId/traceId。" content: "application/json": schema: type: "object" properties: code: type: "string" message: type: "string" data: allOf: - "$ref": "#/components/schemas/HistoryPage" nullable: true parameters: - name: "page" in: "query" required: false schema: type: "integer" minimum: 1 default: 1 - name: "size" in: "query" required: false schema: type: "integer" minimum: 1 maximum: 200 default: 20 "/api/platform/v1/last-leg/fleet/owned-business/{dispatchNo}/operations": parameters: - name: "dispatchNo" in: "path" required: true schema: type: "string" maxLength: 128 put: operationId: "saveOwnedBusinessOperations" summary: "按附加版本登记、更正或清空运营信息" description: "权限:platform:fleet:owned-business:edit。仅可信平台主体;只读原排车事实,不改变其状态/版本,不发布费用。" x-permission-code: "platform:fleet:owned-business:edit" responses: 200: description: "统一ApiResponse:成功code=200;业务错误保留A0400/A0403/A0404/A0409及诊断requestId/traceId。" content: "application/json": schema: type: "object" properties: code: type: "string" message: type: "string" data: allOf: - "$ref": "#/components/schemas/Detail" nullable: true requestBody: required: true content: "application/json": schema: "$ref": "#/components/schemas/SaveOperations" "/api/platform/v1/last-leg/fleet/owned-business/{dispatchNo}/photos/{slot}/uploads": parameters: - name: "dispatchNo" in: "path" required: true schema: type: "string" maxLength: 128 - name: "slot" in: "path" required: true schema: "$ref": "#/components/schemas/PhotoSlot" post: operationId: "uploadOwnedBusinessPhoto" summary: "逐框准备照片,尚未保存绑定" description: "权限:platform:fleet:owned-business:upload。仅可信平台主体;只读原排车事实,不改变其状态/版本,不发布费用。" x-permission-code: "platform:fleet:owned-business:upload" responses: 200: description: "统一ApiResponse:成功code=200;业务错误保留A0400/A0403/A0404/A0409及诊断requestId/traceId。" content: "application/json": schema: type: "object" properties: code: type: "string" message: type: "string" data: allOf: - "$ref": "#/components/schemas/Photo" nullable: true requestBody: required: true content: "multipart/form-data": schema: type: "object" required: - "file" - "idempotencyKey" properties: idempotencyKey: type: "string" minLength: 8 maxLength: 128 description: "原上传请求键,以multipart表单字段提交,绑定使用独立请求键。" file: type: "string" format: "binary" description: "真实JPG/PNG,非空,最大10MiB;与独立绑定命令使用不同请求键。" "/api/platform/v1/last-leg/fleet/owned-business/{dispatchNo}/photos/{slot}": parameters: - name: "dispatchNo" in: "path" required: true schema: type: "string" maxLength: 128 - name: "slot" in: "path" required: true schema: "$ref": "#/components/schemas/PhotoSlot" put: operationId: "bindOwnedBusinessPhoto" summary: "保存原上传fileId;失败保留原键恢复,不重新上传" description: "权限:platform:fleet:owned-business:upload。仅可信平台主体;只读原排车事实,不改变其状态/版本,不发布费用。" x-permission-code: "platform:fleet:owned-business:upload" responses: 200: description: "统一ApiResponse:成功code=200;业务错误保留A0400/A0403/A0404/A0409及诊断requestId/traceId。" content: "application/json": schema: type: "object" properties: code: type: "string" message: type: "string" data: allOf: - "$ref": "#/components/schemas/Detail" nullable: true requestBody: required: true content: "application/json": schema: "$ref": "#/components/schemas/BindPhoto" "/api/platform/v1/last-leg/fleet/owned-business/{dispatchNo}/photos/{slot}/files/{fileId}/content": parameters: - name: "dispatchNo" in: "path" required: true schema: type: "string" maxLength: 128 - name: "slot" in: "path" required: true schema: "$ref": "#/components/schemas/PhotoSlot" - name: "fileId" in: "path" required: true schema: type: "string" pattern: "^[1-9][0-9]*$" get: operationId: "readOwnedBusinessPhoto" summary: "授权读取当前或原历史绑定图片" description: "权限:platform:fleet:owned-business:list。仅可信平台主体;只读原排车事实,不改变其状态/版本,不发布费用。" x-permission-code: "platform:fleet:owned-business:list" responses: 200: description: "仅当前或指定历史引用的图片字节,Cache-Control:no-store,X-Content-Type-Options:nosniff" content: "image/jpeg": schema: type: "string" format: "binary" "image/png": schema: type: "string" format: "binary" parameters: - name: "revisionVersion" in: "query" required: false schema: type: "integer" format: "int64" minimum: 1 "/api/platform/v1/last-leg/fleet/owned-business/{dispatchNo}/commands/{idempotencyKey}": parameters: - name: "dispatchNo" in: "path" required: true schema: type: "string" maxLength: 128 - name: "idempotencyKey" in: "path" required: true schema: type: "string" minLength: 8 maxLength: 128 get: operationId: "recoverOwnedBusinessCommand" summary: "恢复本操作者原命令,未知结果不得换键重发" description: "权限:platform:fleet:owned-business:list。仅可信平台主体;只读原排车事实,不改变其状态/版本,不发布费用。" x-permission-code: "platform:fleet:owned-business:list" responses: 200: description: "统一ApiResponse:成功code=200;业务错误保留A0400/A0403/A0404/A0409及诊断requestId/traceId。" content: "application/json": schema: type: "object" properties: code: type: "string" message: type: "string" data: allOf: - "$ref": "#/components/schemas/Command" nullable: true components: securitySchemes: bearerAuth: type: "http" scheme: "bearer" bearerFormat: "JWT" schemas: Stage: type: "string" enum: - "AFTER_LOADING" - "DELIVERING" - "DELIVERED" PhotoSlot: type: "string" enum: - "LOADING_SCENE" - "LOADING_LIST" - "PRE_DEPARTURE_CHECK" - "DRIVER_LICENSE" - "RECEIPT" - "FUEL_START" - "FUEL_END" Money: type: "object" x-java-record: "OwnedBusinessModels.Money" required: - "currency" - "amount" properties: currency: type: "string" enum: - "CNY" - "USD" amount: type: "string" pattern: "^(0|[1-9][0-9]{0,15})(\\.[0-9]{1,2})?$" Arrival: type: "object" x-java-record: "OwnedBusinessModels.Arrival" required: - "destinationKey" properties: destinationKey: type: "string" minLength: 1 maxLength: 256 actualArrivedAt: type: "string" nullable: true format: "date-time" Operations: type: "object" x-java-record: "OwnedBusinessModels.Operations" required: - "arrivals" properties: money: allOf: - "$ref": "#/components/schemas/Money" nullable: true actualDistanceMiles: type: "string" nullable: true pattern: "^(0|[1-9][0-9]{0,8})(\\.[0-9]{1,3})?$" fuelConsumptionLitresPer100Km: type: "string" nullable: true pattern: "^(0|[1-9][0-9]{0,8})(\\.[0-9]{1,3})?$" arrivals: type: "array" items: "$ref": "#/components/schemas/Arrival" SaveOperations: type: "object" x-java-record: "OwnedBusinessModels.SaveOperations" required: - "recordVersion" - "idempotencyKey" - "operations" properties: recordVersion: type: "string" pattern: "^(0|[1-9][0-9]*)$" idempotencyKey: type: "string" minLength: 8 maxLength: 128 operations: "$ref": "#/components/schemas/Operations" reason: type: "string" nullable: true maxLength: 1000 BindPhoto: type: "object" x-java-record: "OwnedBusinessModels.BindPhoto" required: - "recordVersion" - "idempotencyKey" - "fileId" properties: recordVersion: type: "string" pattern: "^(0|[1-9][0-9]*)$" idempotencyKey: type: "string" minLength: 8 maxLength: 128 fileId: type: "string" pattern: "^[1-9][0-9]*$" Gate: type: "object" x-java-record: "OwnedBusinessModels.Gate" required: - "allowed" properties: allowed: type: "boolean" blockReason: type: "string" nullable: true Actions: type: "object" x-java-record: "OwnedBusinessModels.Actions" required: - "edit" - "upload" properties: edit: "$ref": "#/components/schemas/Gate" upload: "$ref": "#/components/schemas/Gate" Origin: type: "object" x-java-record: "OwnedBusinessModels.Origin" required: - "warehouseId" - "warehouseCode" - "warehouseName" properties: warehouseId: type: "string" warehouseCode: type: "string" warehouseName: type: "string" Vehicle: type: "object" x-java-record: "OwnedBusinessModels.Vehicle" required: - "ownership" properties: vehicleId: type: "string" nullable: true plate: type: "string" nullable: true ownership: type: "string" enum: - "OWNED" - "DISPATCHED" Driver: type: "object" x-java-record: "OwnedBusinessModels.Driver" properties: name: type: "string" nullable: true phone: type: "string" nullable: true Appointment: type: "object" x-java-record: "OwnedBusinessModels.Appointment" required: - "appointmentNo" - "allocatedPackages" properties: appointmentNo: type: "string" confirmationNo: type: "string" nullable: true scheduledAt: type: "string" nullable: true format: "date-time" allocatedPackages: type: "string" pattern: "^[1-9][0-9]*$" Destination: type: "object" x-java-record: "OwnedBusinessModels.Destination" required: - "destinationKey" - "appointments" properties: destinationKey: type: "string" warehouseCode: type: "string" nullable: true warehouseName: type: "string" nullable: true address: type: "string" nullable: true appointments: type: "array" items: "$ref": "#/components/schemas/Appointment" actualArrivedAt: type: "string" nullable: true format: "date-time" Photo: type: "object" x-java-record: "OwnedBusinessModels.Photo" required: - "slot" - "category" - "fileId" - "fileName" - "contentType" - "sizeBytes" - "uploadedAt" properties: slot: "$ref": "#/components/schemas/PhotoSlot" category: type: "string" enum: - "LOADING" - "FUEL" fileId: type: "string" fileName: type: "string" contentType: type: "string" enum: - "image/jpeg" - "image/png" sizeBytes: type: "string" pattern: "^[1-9][0-9]*$" uploadedAt: type: "string" savedAt: type: "string" nullable: true format: "date-time" description: "上传回执savedAt为空;绑定成功才填写savedAt。File类型分别为OVERSEAS_DISPATCH_LOADING_PHOTO和OVERSEAS_DISPATCH_FUEL_PHOTO,平台0、原dispatch内部ID,最多10MiB。" PhotoSummary: type: "object" x-java-record: "OwnedBusinessModels.PhotoSummary" required: - "loadingCount" - "fuelCount" properties: loadingCount: type: "integer" minimum: 0 fuelCount: type: "integer" minimum: 0 Row: type: "object" x-java-record: "OwnedBusinessModels.Row" required: - "dispatchNo" - "stage" - "plannedDepartureAt" - "loadingCompletedAt" - "origin" - "vehicle" - "driver" - "destinations" - "operations" - "recordVersion" - "dispatchRecordVersion" - "photoSummary" - "actions" - "sourceIssues" properties: dispatchNo: type: "string" stage: "$ref": "#/components/schemas/Stage" plannedDepartureAt: type: "string" format: "date-time" loadingCompletedAt: type: "string" format: "date-time" departedAt: type: "string" nullable: true format: "date-time" deliveryCompletedAt: type: "string" nullable: true format: "date-time" origin: "$ref": "#/components/schemas/Origin" vehicle: "$ref": "#/components/schemas/Vehicle" driver: "$ref": "#/components/schemas/Driver" destinations: type: "array" items: "$ref": "#/components/schemas/Destination" actualPalletCount: type: "integer" minimum: 0 nullable: true operations: "$ref": "#/components/schemas/Operations" unitPrice: type: "string" nullable: true pattern: "^(0|[1-9][0-9]{0,15})(\\.[0-9]{1,2})?$" recordVersion: type: "string" pattern: "^(0|[1-9][0-9]*)$" dispatchRecordVersion: type: "string" pattern: "^(0|[1-9][0-9]*)$" photoSummary: "$ref": "#/components/schemas/PhotoSummary" actions: "$ref": "#/components/schemas/Actions" sourceIssues: type: "array" items: type: "string" Summary: type: "object" x-java-record: "OwnedBusinessModels.Summary" required: - "dispatchCount" - "afterLoadingCount" - "deliveringCount" - "deliveredCount" properties: dispatchCount: type: "integer" minimum: 0 afterLoadingCount: type: "integer" minimum: 0 deliveringCount: type: "integer" minimum: 0 deliveredCount: type: "integer" minimum: 0 ListResult: type: "object" x-java-record: "OwnedBusinessModels.ListResult" required: - "records" - "page" - "size" - "total" - "summary" properties: records: type: "array" items: "$ref": "#/components/schemas/Row" page: type: "integer" minimum: 1 size: type: "integer" minimum: 1 maximum: 200 total: type: "integer" minimum: 0 summary: "$ref": "#/components/schemas/Summary" Cargo: type: "object" x-java-record: "OwnedBusinessModels.Cargo" required: - "sourceKey" - "customerId" - "palletNo" - "destinationKey" - "packages" properties: sourceKey: type: "string" customerId: type: "string" customerName: type: "string" nullable: true orderNo: type: "string" nullable: true inboundCode: type: "string" nullable: true palletNo: type: "string" destinationKey: type: "string" packages: type: "string" Detail: type: "object" x-java-record: "OwnedBusinessModels.Detail" required: - "row" - "dispatch" - "cargo" - "photos" properties: row: "$ref": "#/components/schemas/Row" dispatch: "$ref": "./overseas-business-v1.yaml#/components/schemas/DispatchDetail" cargo: type: "array" items: "$ref": "#/components/schemas/Cargo" photos: type: "array" items: "$ref": "#/components/schemas/Photo" History: type: "object" x-java-record: "OwnedBusinessModels.History" required: - "eventSource" - "action" - "occurredAt" - "photos" properties: eventSource: type: "string" enum: - "DISPATCH" - "OPERATIONS" recordVersion: type: "string" pattern: "^(0|[1-9][0-9]*)$" nullable: true dispatchRecordVersion: type: "string" pattern: "^(0|[1-9][0-9]*)$" nullable: true action: type: "string" operatorName: type: "string" nullable: true occurredAt: type: "string" format: "date-time" reason: type: "string" nullable: true operations: allOf: - "$ref": "#/components/schemas/Operations" nullable: true photos: type: "array" items: "$ref": "#/components/schemas/Photo" description: "UNION ALL读取原排车真实流水与附加流水,一次排序分页;DISPATCH事件recordVersion=null、operations=null、photos=[];OPERATIONS事件dispatchRecordVersion=null。" HistoryPage: type: "object" x-java-record: "OwnedBusinessModels.HistoryPage" required: - "records" - "page" - "size" - "total" properties: records: type: "array" items: "$ref": "#/components/schemas/History" page: type: "integer" minimum: 1 size: type: "integer" minimum: 1 maximum: 200 total: type: "integer" minimum: 0 Command: type: "object" x-java-record: "OwnedBusinessModels.Command" description: "SAVE_OPERATIONS/BIND_PHOTO成功时recordVersion和result必须有值;UPLOAD_PHOTO成功时result必须含fileId,recordVersion可空。仅可空的未确定或拒绝结果字段允许省略,不放宽成功回执的关联要求。" required: - "dispatchNo" - "action" - "idempotencyKey" - "state" - "replayed" - "retryAllowed" properties: dispatchNo: type: "string" action: type: "string" enum: - "SAVE_OPERATIONS" - "UPLOAD_PHOTO" - "BIND_PHOTO" idempotencyKey: type: "string" state: type: "string" enum: - "SUCCEEDED" - "PENDING" - "UNKNOWN_RESULT" - "REJECTED" recordVersion: type: "string" pattern: "^(0|[1-9][0-9]*)$" nullable: true replayed: type: "boolean" result: nullable: true oneOf: - "$ref": "#/components/schemas/Detail" - "$ref": "#/components/schemas/Photo" errorCode: type: "string" nullable: true retryAllowed: type: "boolean" enum: - false