This commit is contained in:
2026-08-11 18:06:30 +08:00
parent 863f9ca395
commit 767ffe8544
16 changed files with 1765 additions and 184 deletions
+73 -39
View File
@@ -4,8 +4,9 @@ info:
version: 1.2.0
description: >-
F1 人工账单、收款和成本目标契约。仅 CNY;平台财务可写;客户只读且仅可见
ISSUED、PARTIALLY_PAID、PAID 账单。固定 DTO、完整追踪字段、真实体积快照和
File fail-closed 校验属于放行目标;当前实现差异见契约门禁文档。
ISSUED、PARTIALLY_PAID、PAID 账单。整柜成本由 Finance 根据 containerId 调用
Firstleg 真实快照,浏览器不提交订单体积。固定 DTO、完整追踪字段和 File fail-closed
校验仍属于放行目标;当前实现差异见契约门禁文档。
servers:
- url: /api
paths:
@@ -120,6 +121,21 @@ paths:
$ref: '#/components/responses/BillDetailResponse'
'409':
$ref: '#/components/responses/IdempotencyConflict'
/platform/finance/v1/bills/{billId}/revisions:
get:
summary: 查询账单修订历史
description: 只返回指定客户所属账单的调整前快照,跨客户或不存在账单统一拒绝。
x-permission: platform:finance:bill:view
security:
- platformFinance: []
parameters:
- $ref: '#/components/parameters/BillId'
- $ref: '#/components/parameters/RequiredCustomerId'
responses:
'200':
$ref: '#/components/responses/BillRevisionListResponse'
'404':
$ref: '#/components/responses/BusinessError'
/platform/finance/v1/bills/{billId}/adjust:
post:
summary: 调整已出账账单并保留修订历史
@@ -204,9 +220,9 @@ paths:
post:
summary: 人工登记单票或整柜成本
description: >-
SINGLE_ORDER 直接归属经服务端验证的同客户订单;CONTAINER_SHARED 当前请求包含
containerOrders 过渡字段,但放行前必须改由服务端从 Firstleg 取得不可篡改体积快照。
总体积为零时拒绝,首期不支持人工分摊。
SINGLE_ORDER 直接归属经服务端验证的同客户订单;CONTAINER_SHARED 只提交 containerId,
Finance 从 Firstleg 取得属于该客户的柜内有效订单体积快照。快照为空或总体积无效时拒绝,
首期不支持浏览器提交体积或人工分摊。
x-permission: platform:finance:cost:create
security:
- platformFinance: []
@@ -228,8 +244,8 @@ paths:
summary: 上传财务凭证图片
description: >-
当前 Finance Controller 的真实入口,query 参数为 customerId,multipart 字段为 file。
当前 File 仅校验图片 MIME,尚无用途区分和关联状态;收款/成本落库前的 fail-closed
校验仍是门禁阻断。
收款与成本创建均按客户、FINANCE_VOUCHER 业务类型和图片 MIME 校验元数据;
File 客户端缺失时仍须改为 fail-closed,详见门禁文档。
x-permission-any-of:
- platform:finance:receipt:create
- platform:finance:cost:create
@@ -337,10 +353,6 @@ components:
type: string
pattern: '^(0|[1-9][0-9]*)(\.[0-9]{1,6})?$'
example: '300.000000'
SignedMoney:
type: string
pattern: '^-?(0|[1-9][0-9]*)(\.[0-9]{1,6})?$'
example: '-0.000001'
ResponseMeta:
type: object
required:
@@ -592,7 +604,6 @@ components:
required:
- costType
- containerId
- containerOrders
properties:
costType:
type: string
@@ -600,30 +611,6 @@ components:
- CONTAINER_SHARED
containerId:
$ref: '#/components/schemas/Id'
containerOrders:
type: array
minItems: 1
items:
$ref: '#/components/schemas/ContainerOrderVolumeInput'
description: >-
当前 Java 过渡请求字段。调用方不得把人工填写体积视为可信快照;放行前应由
Finance 根据 containerId 从 Firstleg 获取并校验,届时公开请求应移除此字段。
ContainerOrderVolumeInput:
type: object
required:
- orderId
- inboundId
- containerId
- volumeCbm
properties:
orderId:
$ref: '#/components/schemas/Id'
inboundId:
$ref: '#/components/schemas/Id'
containerId:
$ref: '#/components/schemas/Id'
volumeCbm:
$ref: '#/components/schemas/Money'
FinanceVoucherUploadRequest:
type: object
required:
@@ -733,6 +720,40 @@ components:
type: array
items:
$ref: '#/components/schemas/BillLine'
BillRevision:
type: object
required:
- revisionId
- billId
- version
- reason
- billSnapshot
- lineSnapshot
- createdBy
- createdAt
properties:
revisionId:
$ref: '#/components/schemas/Id'
billId:
$ref: '#/components/schemas/Id'
version:
type: integer
minimum: 0
reason:
type: string
billSnapshot:
type: object
additionalProperties: true
lineSnapshot:
type: array
items:
type: object
additionalProperties: true
createdBy:
$ref: '#/components/schemas/Id'
createdAt:
type: string
format: date-time
ClientBillDetail:
allOf:
- $ref: '#/components/schemas/ClientBill'
@@ -841,7 +862,6 @@ components:
- ratio
- allocatedAmount
- roundingAdjustment
- roundingDelta
properties:
orderId:
$ref: '#/components/schemas/Id'
@@ -857,8 +877,6 @@ components:
roundingAdjustment:
type: boolean
description: 仅实际尾差非零时为 true。
roundingDelta:
$ref: '#/components/schemas/SignedMoney'
Cost:
type: object
required:
@@ -1033,6 +1051,17 @@ components:
code: {type: string, example: '200'}
message: {type: string}
data: {$ref: '#/components/schemas/BillDetail'}
BillRevisionListEnvelope:
allOf:
- $ref: '#/components/schemas/ResponseMeta'
- type: object
required: [code, message, data]
properties:
code: {type: string, example: '200'}
message: {type: string}
data:
type: array
items: {$ref: '#/components/schemas/BillRevision'}
ClientBillDetailEnvelope:
allOf:
- $ref: '#/components/schemas/ResponseMeta'
@@ -1127,6 +1156,11 @@ components:
content:
application/json:
schema: {$ref: '#/components/schemas/BillDetailEnvelope'}
BillRevisionListResponse:
description: 账单修订历史列表。
content:
application/json:
schema: {$ref: '#/components/schemas/BillRevisionListEnvelope'}
ClientBillDetailResponse:
description: 客户可见账单详情。
content: