Merge branch 'dev' into hugo-shipping-notice

This commit is contained in:
hugo committed 2026-08-11 14:33:56 +08:00
commit 472b530be3
397 files changed
+46450 -34171

No files matched your search

@@ -0,0 +1,518 @@
{
"openapi": "3.0.3",
"info": {
"title": "HXOPS Accounting Voucher Check Tool API",
"description": "立账凭证检核查询 Tool API:缺资料清单、批次明细、单票最新状态。启动检核请复用 File Check 的 run_file_check(可传 run_options)。鉴权:Authorization Bearer 或 X-Integration-Key(与 FILE_CHECK_TOOL_API_KEY / INTEGRATION_API_KEY 相同)。",
"version": "1.0.0"
},
"servers": [
{
"url": "http://127.0.0.1:5052",
"description": "HXOPS_TOOLS_API_BASE"
}
],
"security": [
{
"BearerAuth": []
},
{
"IntegrationKey": []
}
],
"paths": {
"/api/accounting-voucher-check/tools/tasks/{task_id}/missing": {
"get": {
"operationId": "list_voucher_missing",
"summary": "查询缺资料发票(最新状态)",
"description": "按账套与月份查询 status=missing 的发票;默认当前自然月。",
"tags": [
"Accounting Voucher Check"
],
"parameters": [
{
"name": "task_id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"example": 12
},
"description": "排程任务 ID(Agent 绑定的 schedule_task_id,用于回显)"
},
{
"name": "period",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "2026-08"
},
"description": "检核月份 YYYY-MM;缺省为当前自然月"
},
{
"name": "scope_code",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": "HXJM",
"example": "HXJM"
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 200,
"minimum": 1,
"maximum": 1000
}
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MissingListResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"503": {
"$ref": "#/components/responses/MissingAuth"
}
}
}
},
"/api/accounting-voucher-check/tools/runs/{run_id}/items": {
"get": {
"operationId": "list_voucher_run_items",
"summary": "查询批次发票明细",
"description": "分页返回某 ScheduleRun 的单票结论;可按 result 过滤。",
"tags": [
"Accounting Voucher Check"
],
"parameters": [
{
"name": "run_id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"example": 1001
}
},
{
"name": "result",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"complete",
"missing",
"skipped",
"technical_error"
],
"example": "missing"
}
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 1,
"minimum": 1
}
},
{
"name": "page_size",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 50,
"minimum": 1,
"maximum": 200
}
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RunItemsResponse"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"503": {
"$ref": "#/components/responses/MissingAuth"
}
}
}
},
"/api/accounting-voucher-check/tools/invoices/{invoice_no}/latest": {
"get": {
"operationId": "get_voucher_invoice_latest",
"summary": "查询指定发票最新检核状态",
"description": "返回单票最新状态及近期批次快照;invoice_no 保持业务原值(仅 trim)。",
"tags": [
"Accounting Voucher Check"
],
"parameters": [
{
"name": "invoice_no",
"in": "path",
"required": true,
"schema": {
"type": "string",
"example": "INV-20260803001"
},
"description": "发票号(apa08 原值)"
},
{
"name": "period",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "2026-08"
}
},
{
"name": "scope_code",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": "HXJM"
}
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvoiceLatestResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"503": {
"$ref": "#/components/responses/MissingAuth"
}
}
}
}
},
"components": {
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"description": "Authorization: Bearer <FILE_CHECK_TOOL_API_KEY 或 INTEGRATION_API_KEY>"
},
"IntegrationKey": {
"type": "apiKey",
"in": "header",
"name": "X-Integration-Key",
"description": "与 Bearer 二选一"
}
},
"schemas": {
"MissingMaterial": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "price_check_sheet"
},
"name": {
"type": "string",
"example": "核价单"
}
}
},
"InvoiceState": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"scope_code": {
"type": "string"
},
"period_month": {
"type": "string",
"nullable": true
},
"invoice_no": {
"type": "string"
},
"invoice_date": {
"type": "string",
"nullable": true
},
"status": {
"type": "string",
"enum": [
"complete",
"missing"
]
},
"folder_path": {
"type": "string",
"nullable": true
},
"folder_exists": {
"type": "boolean"
},
"matched_files": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"missing_materials": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MissingMaterial"
}
},
"last_checked_at": {
"type": "string",
"nullable": true
}
}
},
"MissingListResponse": {
"type": "object",
"required": [
"ok",
"items",
"count"
],
"properties": {
"ok": {
"type": "boolean",
"example": true
},
"task_id": {
"type": "integer",
"nullable": true
},
"scope_code": {
"type": "string"
},
"period": {
"type": "string",
"example": "2026-08"
},
"count": {
"type": "integer"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/InvoiceState"
}
}
}
},
"RunItem": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"schedule_run_id": {
"type": "integer"
},
"invoice_no": {
"type": "string"
},
"result": {
"type": "string",
"enum": [
"complete",
"missing",
"skipped",
"technical_error"
]
},
"folder_path": {
"type": "string",
"nullable": true
},
"matched_files": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"missing_materials": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MissingMaterial"
}
},
"error_code": {
"type": "string",
"nullable": true
},
"error_message": {
"type": "string",
"nullable": true
}
}
},
"RunItemsResponse": {
"type": "object",
"required": [
"ok",
"items",
"total"
],
"properties": {
"ok": {
"type": "boolean"
},
"run_id": {
"type": "integer"
},
"run_no": {
"type": "string"
},
"page": {
"type": "integer"
},
"page_size": {
"type": "integer"
},
"total": {
"type": "integer"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RunItem"
}
}
}
},
"InvoiceLatestResponse": {
"type": "object",
"required": [
"ok",
"state"
],
"properties": {
"ok": {
"type": "boolean"
},
"state": {
"$ref": "#/components/schemas/InvoiceState"
},
"recent_run_items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RunItem"
}
}
}
},
"ToolError": {
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"example": false
},
"error_code": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "object"
}
}
}
},
"responses": {
"BadRequest": {
"description": "参数错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ToolError"
}
}
}
},
"Unauthorized": {
"description": "鉴权失败",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ToolError"
}
}
}
},
"NotFound": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ToolError"
}
}
}
},
"MissingAuth": {
"description": "服务端未配置 Tool API Key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ToolError"
}
}
}
}
}
}
}
+53 -2
View File
@@ -7,7 +7,7 @@
},
"servers": [
{
"url": "http://192.168.100.192:8890",
"url": "http://127.0.0.1:5052",
"description": "HXOPS_TOOLS_API_BASE"
}
],
@@ -560,12 +560,48 @@
"type": "string",
"nullable": true,
"description": "HXOPS 会话 ID;可与 sys.conversation_id 二选一,优先显式传入"
},
"mode": {
"type": "string",
"nullable": true,
"enum": [
"incremental",
"force_all",
"single"
],
"description": "【Dify 推荐】运行模式(立账凭证检核读取;文件检核忽略)。incremental=增量 / force_all=全量 / single=单发票;单发票时须同时填 invoice_no"
},
"invoice_no": {
"type": "string",
"nullable": true,
"description": "【Dify 推荐】mode=single 时必填的发票号;来自意图识别.invoice_no"
},
"run_options": {
"type": "object",
"nullable": true,
"description": "可选嵌套写法(部分 Dify 版本不展示对象字段;优先用顶层 mode/invoice_no)。mode=incremental|force_all|single;single 时须带 invoice_no",
"properties": {
"mode": {
"type": "string",
"enum": [
"incremental",
"force_all",
"single"
],
"default": "incremental"
},
"invoice_no": {
"type": "string",
"nullable": true,
"description": "mode=single 时必填的发票号"
}
}
}
},
"required": [
"task_id"
],
"description": "Chatflow Tool 节点绑定 task_id(Integer,来源 解析运行态上下文.task_id_int)、hxops_turn_id(经 agent_runtime_context 解析后传入);user_message 用于展示与兼容兜底"
"description": "Chatflow Tool 节点绑定 task_id(Integer,来源 解析运行态上下文.task_id_int)、hxops_turn_id(经 agent_runtime_context 解析后传入);立账凭证检核用顶层 mode/invoice_no(Dify 友好)或嵌套 run_options"
},
"RunCheckSuccessResponse": {
"type": "object",
@@ -891,6 +927,21 @@
}
}
}
},
"DataSourceUnavailable": {
"description": "检核数据源不可用(ODBC/SQL Server 连接失败或 SRM 环境变量未配置)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"example": {
"ok": false,
"error_code": "data_source_unavailable",
"message": "检核数据源不可用,请检查排程 SQL 配置、SRM_SQLSERVER_* 环境变量及本机 ODBC 驱动"
}
}
}
}
}
}