fix(finance): key container finance by booking

This commit is contained in:
2026-09-08 21:27:23 +08:00
parent 55c36cf290
commit 1cf6722d6e
13 changed files with 99 additions and 50 deletions
+1 -1
View File
@@ -229,7 +229,7 @@ CREATE TABLE IF NOT EXISTS fin_cost (
source_hash VARCHAR(71) NULL COMMENT '来源不可变快照SHA-256,兼容sha256前缀格式',
order_id BIGINT UNSIGNED NULL COMMENT '成本归属的头程订单ID,单票成本必填',
inbound_id BIGINT UNSIGNED NULL COMMENT '成本关联的入库单ID,可为空',
container_id BIGINT UNSIGNED NULL COMMENT 'Firstleg装柜计划ID,整柜公共成本必填',
container_id BIGINT UNSIGNED NULL COMMENT 'Firstleg真实货柜containerBookingId,整柜公共成本必填',
warehouse_id BIGINT UNSIGNED NULL COMMENT '业务直接已付成本关联仓库ID,可为空',
supplier_id BIGINT UNSIGNED NULL COMMENT 'Warehouse公共往来单位或供应商引用ID',
supplier_name_snapshot VARCHAR(200) NULL COMMENT '登记成本时供应商或成本对象名称快照',
@@ -10,7 +10,7 @@ paths:
get:
summary: 按客户和柜次查询已结算柜费及成本分摊
description: >-
customerId 与 containerId 必须在 Finance 的费用来源或成本快照中存在归属关系。
customerId 与 containerBookingId 必须在 Finance 的费用来源或成本快照中存在归属关系。
服务端固定执行三条集合 SQL,不按结算单或成本逐项查询;响应不包含整张结算单、
其他客户数据、付款凭证或内部备注。
x-permissions-all-of:
@@ -25,10 +25,10 @@ paths:
in: query
required: true
schema: {$ref: '#/components/schemas/Id'}
- name: containerId
- name: containerBookingId
in: query
required: true
description: Firstleg 装柜计划 ID。
description: Firstleg 真实货柜 containerBookingId,不是装柜计划 loadingPlanId。
schema: {$ref: '#/components/schemas/Id'}
responses:
'200':
@@ -63,10 +63,10 @@ components:
timestamp: {type: string, format: date-time}
ContainerSettlementDetails:
type: object
required: [customerId, containerId, settledSourceFeeIds, costs]
required: [customerId, containerBookingId, settledSourceFeeIds, costs]
properties:
customerId: {$ref: '#/components/schemas/Id'}
containerId: {$ref: '#/components/schemas/Id'}
containerBookingId: {$ref: '#/components/schemas/Id'}
settledSourceFeeIds:
type: array
uniqueItems: true
@@ -76,7 +76,7 @@ components:
items: {$ref: '#/components/schemas/ContainerCostDetail'}
ContainerCostDetail:
type: object
required: [costId, costNo, costType, costOrigin, containerId, feeItemName, amount, currency, status, allocations]
required: [costId, costNo, costType, costOrigin, containerBookingId, feeItemName, amount, currency, status, allocations]
properties:
costId: {$ref: '#/components/schemas/Id'}
costNo: {type: string}
@@ -84,7 +84,7 @@ components:
costOrigin: {type: string, enum: [MANUAL, FIRSTLEG_DIRECT_PAID, BUSINESS_DIRECT_PAID]}
sourceFeeId: {$ref: '#/components/schemas/Id'}
sourceFeeVersion: {type: integer, minimum: 1}
containerId: {$ref: '#/components/schemas/Id'}
containerBookingId: {$ref: '#/components/schemas/Id'}
supplierName: {type: string, nullable: true}
feeItemName: {type: string}
amount: {$ref: '#/components/schemas/Money'}