统一财务费用来源入池链路

This commit is contained in:
2026-09-09 16:39:20 +08:00
parent 9fdb199972
commit 17b9f3eb73
35 changed files with 442 additions and 195 deletions
@@ -194,11 +194,12 @@ paths:
/api/platform/v1/last-leg/orders/{id}/fees:
post:
summary: 新增尾程订单费用
description: 权限 platform:overseas-warehouse:last-mile-order:edit;在订单客户范围内新增费用并记录操作人和处理结果。
description: 权限 platform:overseas-warehouse:last-mile-order:edit;在订单客户范围内创建统一费用来源并提交财务审核。
security: [{ bearerAuth: [] }]
parameters:
- { name: id, in: path, required: true, schema: { type: integer, format: int64 } }
- { name: customerId, in: query, required: false, schema: { type: string, pattern: '^[1-9][0-9]*$' } }
- { name: Idempotency-Key, in: header, required: true, schema: { type: string, minLength: 1, maxLength: 128 } }
requestBody:
required: true
content: { application/json: { schema: { $ref: '#/components/schemas/LastMileFeeCreate' } } }
@@ -1331,28 +1332,44 @@ components:
plannedArrivalAt: { type: string, format: date-time, nullable: true, description: ll_order.estimated_warehouse_at }
LastMileFeeCreate:
type: object
required: [feeItem, currency, amount, status]
required: [feeItemCode, feeItemName, direction, currency, amount, businessDate]
properties:
feeItem: { type: string, minLength: 1, maxLength: 128 }
currency: { type: string, pattern: '^[A-Z]{3}$', example: USD }
feeItemCode: { type: string, minLength: 1, maxLength: 64 }
feeItemName: { type: string, minLength: 1, maxLength: 128 }
direction: { type: string, enum: [RECEIVABLE, PAYABLE] }
currency: { type: string, enum: [CNY, USD] }
amount: { type: number, format: decimal, minimum: 0.01 }
status: { type: string, enum: [PENDING_REVIEW, APPROVED, REJECTED] }
supplierDescription: { type: string, maxLength: 500 }
businessDate: { type: string, format: date }
supplierId: { type: string, pattern: '^[1-9][0-9]*$' }
supplierName: { type: string, maxLength: 200 }
supplierCategory: { type: string, maxLength: 32 }
settlementMode: { type: string, enum: [ON_ACCOUNT, DIRECT_PAID] }
chargeableQuantity: { type: number, exclusiveMinimum: 0 }
quantityUnit: { type: string, maxLength: 32 }
unitPrice: { type: number, exclusiveMinimum: 0 }
periodStart: { type: string, format: date }
periodEnd: { type: string, format: date }
LastMileFee:
type: object
required: [id, customerId, orderId, feeItem, currency, amount, status, createdBy, createdAt, updatedAt]
required: [id, sourceFeeId, sourceVersion, customerId, feeItemCode, feeItemName, direction, currency, amount, originalCurrency, originalAmount, reviewStatus, publicationStatus, sourceStatus]
properties:
id: { type: integer, format: int64 }
id: { type: string, pattern: '^[1-9][0-9]*$' }
sourceFeeId: { type: string, pattern: '^[1-9][0-9]*$' }
sourceVersion: { type: integer, minimum: 1 }
customerId: { type: string }
orderId: { type: integer, format: int64 }
feeItem: { type: string }
currency: { type: string }
orderId: { type: string, pattern: '^[1-9][0-9]*$' }
feeItemCode: { type: string }
feeItemName: { type: string }
direction: { type: string, enum: [RECEIVABLE, PAYABLE] }
currency: { type: string, enum: [CNY] }
amount: { type: number, format: decimal }
status: { type: string }
supplierDescription: { type: string, nullable: true }
createdBy: { type: string }
createdAt: { type: string, format: date-time }
updatedAt: { type: string, format: date-time }
originalCurrency: { type: string, enum: [CNY, USD] }
originalAmount: { type: number, format: decimal }
exchangeRate: { type: number, format: decimal }
exchangeRateMonth: { type: string, pattern: '^\\d{4}-\\d{2}$' }
reviewStatus: { type: string, enum: [DRAFT, PENDING, APPROVED, REJECTED] }
publicationStatus: { type: string }
sourceStatus: { type: string }
LastMileFeeApiResponse:
type: object
required: [code, message, data]
@@ -1842,11 +1859,22 @@ components:
enum: [START_PROCESSING, COMPLETE_EXCEPTION, CANCEL_EXCEPTION]
DeliveryFeeInput:
type: object
required: [feeType, currency, amount]
required: [feeType, feeName, direction, currency, amount]
properties:
feeType: { type: string, maxLength: 64 }
currency: { type: string, maxLength: 8 }
amount: { type: number, minimum: 0 }
feeName: { type: string, maxLength: 128 }
direction: { type: string, enum: [RECEIVABLE, PAYABLE] }
currency: { type: string, enum: [CNY, USD] }
amount: { type: number, exclusiveMinimum: 0 }
supplierId: { type: string, pattern: '^[1-9][0-9]*$' }
supplierName: { type: string, maxLength: 200 }
supplierCategory: { type: string, maxLength: 32 }
settlementMode: { type: string, enum: [ON_ACCOUNT, DIRECT_PAID] }
chargeableQuantity: { type: number, exclusiveMinimum: 0 }
quantityUnit: { type: string, maxLength: 32 }
unitPrice: { type: number, exclusiveMinimum: 0 }
periodStart: { type: string, format: date }
periodEnd: { type: string, format: date }
remark: { type: string, nullable: true, maxLength: 500 }
OneClickOutboundCreate:
type: object
@@ -42,7 +42,7 @@ paths:
responses: { '200': { description: 当前费用来源版本 }, '409': { description: 状态、版本或幂等冲突 } }
components:
schemas:
BusinessType: { type: string, enum: [OVERSEAS_INBOUND, OVERSEAS_PROCUREMENT, US_TRUCK, LOCAL_LOOSEBOARD, WAREHOUSE_SERVICE, OVERSEAS_CONTAINER] }
BusinessType: { type: string, enum: [OVERSEAS_INBOUND, OVERSEAS_PROCUREMENT, PROCUREMENT_FEE, US_TRUCK, LOCAL_LOOSEBOARD, WAREHOUSE_SERVICE, OVERSEAS_CONTAINER, LASTLEG_ORDER, DELIVERY_ORDER, RELABEL_ORDER] }
OverseasContainerFeeItem:
type: string
description: 海外阶段柜级费用项目:港口费、堆存费、修箱费、吊机费、码头拖车费、其他。
@@ -70,7 +70,7 @@ components:
required: [customerId, sourceType, businessType, businessNo, feeItemCode, feeItemName, direction, businessDate, currency, amount]
properties:
customerId: { type: string }
sourceType: { type: string, enum: [OVERSEAS_INBOUND_FEE, OVERSEAS_PROCUREMENT_FEE, OVERSEAS_TRUCK_FEE, OVERSEAS_LOOSEBOARD_FEE, OVERSEAS_WAREHOUSE_FEE, OVERSEAS_CONTAINER_FEE] }
sourceType: { type: string, enum: [OVERSEAS_INBOUND_FEE, OVERSEAS_PROCUREMENT_FEE, OVERSEAS_TRUCK_FEE, OVERSEAS_LOOSEBOARD_FEE, OVERSEAS_WAREHOUSE_FEE, OVERSEAS_CONTAINER_FEE, OVERSEAS_ORDER_FEE, OVERSEAS_DELIVERY_FEE, OVERSEAS_RELABEL_FEE] }
businessType: { $ref: '#/components/schemas/BusinessType' }
businessId: { type: string, pattern: '^[1-9][0-9]*$', nullable: true }
businessNo: { type: string, maxLength: 128 }