{ "openapi": "3.0.3", "info": { "title": "车辆采购与外接销售报价库", "version": "1.0.0", "description": "采购价关联公共TRUCKING+OVERSEAS有效供应商,销售价关联有效且具备下单资格的客户。报价仅为价格库,不写入成本/应收/应付,不自动覆盖车次成交快照。整车自提与整车派送按单,散板派送按托。日期为路线业务日(含失效当天),未自动匹配成交;同维度同有效期禁止重复,重叠有效期须由运营明确选择具体报价版本。CSV导入界面解析后提交结构化行,整批原子写入;不支持部分成功。查询/导出最多5000条,导入最多200行。历史接口仅返回最新200版。" }, "security": [ { "bearerAuth": [] } ], "paths": { "/api/platform/v1/last-leg/fleet/quotes": { "get": { "description": "platform:fleet:quote:list;包含详情只读", "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": "kind", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "PURCHASE", "SALE" ] } }, { "name": "keyword", "in": "query", "required": false, "schema": { "type": "string", "maxLength": 128 } }, { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "ACTIVE", "INACTIVE" ] } }, { "name": "effectiveOn", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } } ], "responses": { "200": { "description": "业务响应;成功code为200,业务失败不代表写入成功", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "data": { "type": "object", "properties": { "records": { "type": "array", "items": { "$ref": "#/components/schemas/Quote" } }, "page": { "type": "integer", "minimum": 0 }, "size": { "type": "integer", "minimum": 0 }, "total": { "type": "integer", "minimum": 0 }, "pages": { "type": "integer", "minimum": 0 } }, "required": [ "records", "page", "size", "total", "pages" ] } }, "required": [ "code", "message", "data" ] } } } } } }, "post": { "description": "platform:fleet:quote:create;原操作人+幂等键唯一,异内容拒绝。目录校验失败不写入。", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "idempotencyKey": { "type": "string", "minLength": 8, "maxLength": 128 }, "details": { "$ref": "#/components/schemas/Draft" } }, "required": [ "idempotencyKey", "details" ] } } } }, "responses": { "200": { "description": "业务响应;成功code为200,业务失败不代表写入成功", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "data": { "$ref": "#/components/schemas/Quote" } }, "required": [ "code", "message", "data" ] } } } } } } }, "/api/platform/v1/last-leg/fleet/quotes/{quoteNo}": { "parameters": [ { "name": "quoteNo", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "description": "platform:fleet:quote:list", "responses": { "200": { "description": "业务响应;成功code为200,业务失败不代表写入成功", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "data": { "$ref": "#/components/schemas/Quote" } }, "required": [ "code", "message", "data" ] } } } } } }, "put": { "description": "platform:fleet:quote:edit;行锁+版本,更正保留旧版,用途不可变", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "recordVersion": { "type": "integer", "minimum": 0 }, "details": { "$ref": "#/components/schemas/Draft" } }, "required": [ "recordVersion", "details" ] } } } }, "responses": { "200": { "description": "业务响应;成功code为200,业务失败不代表写入成功", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "data": { "$ref": "#/components/schemas/Quote" } }, "required": [ "code", "message", "data" ] } } } } } }, "delete": { "description": "platform:fleet:quote:delete;保存DELETED历史,退出报价库;不删除已成交业务快照", "parameters": [ { "name": "recordVersion", "in": "query", "required": true, "schema": { "type": "integer", "minimum": 0 } } ], "responses": { "200": { "description": "业务响应;成功code为200,业务失败不代表写入成功", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "data": { "$ref": "#/components/schemas/Quote" } }, "required": [ "code", "message", "data" ] } } } } } } }, "/api/platform/v1/last-leg/fleet/quotes/{quoteNo}/status": { "parameters": [ { "name": "quoteNo", "in": "path", "required": true, "schema": { "type": "string" } } ], "patch": { "description": "platform:fleet:quote:status;启用时重新校验目录", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "recordVersion": { "type": "integer", "minimum": 0 }, "status": { "type": "string", "enum": [ "ACTIVE", "INACTIVE" ] } }, "required": [ "recordVersion", "status" ] } } } }, "responses": { "200": { "description": "业务响应;成功code为200,业务失败不代表写入成功", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "data": { "$ref": "#/components/schemas/Quote" } }, "required": [ "code", "message", "data" ] } } } } } } }, "/api/platform/v1/last-leg/fleet/quotes/{quoteNo}/history": { "parameters": [ { "name": "quoteNo", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "description": "platform:fleet:quote:list;最新200个不可变版本", "responses": { "200": { "description": "业务响应;成功code为200,业务失败不代表写入成功", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/History" } } }, "required": [ "code", "message", "data" ] } } } } } } }, "/api/platform/v1/last-leg/fleet/quotes/customer-options": { "get": { "description": "platform:fleet:quote:list;复用IAM有效客户目录。供应商候选由Admin调用现有/platform/v1/suppliers,须platform:supplier:list,非此接口扩权。", "parameters": [ { "name": "keyword", "in": "query", "required": false, "schema": { "type": "string", "maxLength": 128 } } ], "responses": { "200": { "description": "业务响应;成功code为200,业务失败不代表写入成功", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "code": { "type": "string" }, "name": { "type": "string" }, "contactName": { "type": "string", "nullable": true }, "contactPhone": { "type": "string", "nullable": true } }, "required": [ "id", "code", "name", "contactName", "contactPhone" ] } } }, "required": [ "code", "message", "data" ] } } } } } } }, "/api/platform/v1/last-leg/fleet/quotes/import": { "post": { "description": "platform:fleet:quote:import;最多200行,所有行与审计同事务提交;原批次键的行数或内容变化拒绝", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "idempotencyKey": { "type": "string", "minLength": 8, "maxLength": 100 }, "rows": { "type": "array", "minItems": 1, "maxItems": 200, "items": { "$ref": "#/components/schemas/Draft" } } }, "required": [ "idempotencyKey", "rows" ] } } } }, "responses": { "200": { "description": "业务响应;成功code为200,业务失败不代表写入成功", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "data": { "type": "object", "properties": { "importedRows": { "type": "integer", "minimum": 0 }, "records": { "type": "array", "items": { "$ref": "#/components/schemas/Quote" } } }, "required": [ "importedRows", "records" ] } }, "required": [ "code", "message", "data" ] } } } } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "schemas": { "Draft": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "PURCHASE", "SALE" ] }, "partyId": { "type": "integer", "format": "int64", "minimum": 1 }, "originCity": { "type": "string", "maxLength": 128 }, "destinationCode": { "type": "string", "maxLength": 64 }, "distanceMiles": { "type": "number", "minimum": 0, "multipleOf": 0.1 }, "currency": { "type": "string", "enum": [ "USD", "CNY" ] }, "selfPickupPrice": { "type": "number", "minimum": 0, "nullable": true }, "fullDeliveryPrice": { "type": "number", "minimum": 0, "nullable": true }, "looseDeliveryPrice": { "type": "number", "minimum": 0, "nullable": true }, "validFrom": { "type": "string", "format": "date" }, "validTo": { "type": "string", "format": "date" }, "remark": { "type": "string", "nullable": true, "maxLength": 1000 } }, "required": [ "kind", "partyId", "originCity", "destinationCode", "distanceMiles", "currency", "validFrom", "validTo" ] }, "Quote": { "type": "object", "properties": { "quoteNo": { "type": "string" }, "details": { "$ref": "#/components/schemas/Draft" }, "partyName": { "type": "string" }, "status": { "type": "string", "enum": [ "ACTIVE", "INACTIVE", "DELETED" ] }, "recordVersion": { "type": "integer", "format": "int64", "minimum": 0 }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "quoteNo", "details", "partyName", "status", "recordVersion", "updatedAt" ] }, "History": { "type": "object", "properties": { "recordVersion": { "type": "integer", "minimum": 0 }, "action": { "type": "string" }, "occurredAt": { "type": "string", "format": "date-time" }, "snapshot": { "$ref": "#/components/schemas/Quote" } }, "required": [ "recordVersion", "action", "occurredAt", "snapshot" ] } } }, "x-integration-database": { "owner": "总控集成:lastleg.sql及海外统一初始化SQL;本文件仅为字段与索引清单,不执行SQL", "tables": { "ll_fleet_quote": { "comment": "车辆采购与外接销售报价", "columns": { "id": "BIGINT PRIMARY KEY COMMENT '报价记录主键'", "quote_no": "VARCHAR(64) NOT NULL COMMENT '报价业务编号'", "kind": "VARCHAR(16) NOT NULL COMMENT '报价用途采购或销售'", "party_id": "BIGINT NOT NULL COMMENT '供应商或客户主档标识'", "party_name": "VARCHAR(160) NOT NULL COMMENT '往来单位名称快照'", "origin_city": "VARCHAR(128) NOT NULL COMMENT '发货城市'", "destination_code": "VARCHAR(64) NOT NULL COMMENT '目的仓业务编码'", "valid_from": "DATE NOT NULL COMMENT '报价生效日期'", "valid_to": "DATE NOT NULL COMMENT '报价失效日期含当天'", "status": "VARCHAR(16) NOT NULL COMMENT '报价启停或删除状态'", "natural_key": "CHAR(64) NOT NULL COMMENT '报价组合去重摘要'", "details_json": "JSON NOT NULL COMMENT '完整报价明细快照'", "record_version": "BIGINT NOT NULL COMMENT '报价记录版本'", "create_key": "VARCHAR(128) NOT NULL COMMENT '创建幂等键'", "create_hash": "CHAR(64) NOT NULL COMMENT '创建请求含导入批次内容摘要'", "created_by": "VARCHAR(64) NOT NULL COMMENT '创建操作人标识'", "created_at": "DATETIME(3) NOT NULL COMMENT '创建时间UTC'", "updated_at": "DATETIME(3) NOT NULL COMMENT '更新时间UTC'" }, "indexes": [ "UNIQUE KEY uk_fleet_quote_no (quote_no)", "UNIQUE KEY uk_fleet_quote_natural (natural_key)", "UNIQUE KEY uk_fleet_quote_create (created_by,create_key)", "KEY idx_fleet_quote_search (kind,status,valid_from,valid_to)" ] }, "ll_fleet_quote_history": { "comment": "车辆报价不可变版本历史", "columns": { "id": "BIGINT PRIMARY KEY COMMENT '报价历史主键'", "quote_id": "BIGINT NOT NULL COMMENT '报价记录标识'", "record_version": "BIGINT NOT NULL COMMENT '报价记录版本'", "action": "VARCHAR(24) NOT NULL COMMENT '报价操作类型'", "operator_id": "VARCHAR(64) NOT NULL COMMENT '操作人标识'", "occurred_at": "DATETIME(3) NOT NULL COMMENT '操作时间UTC'", "snapshot_json": "JSON NOT NULL COMMENT '报价完整版本快照'" }, "indexes": [ "UNIQUE KEY uk_fleet_quote_history_version (quote_id,record_version)" ] } } } }