feat(file-check-tool): 实现对话触发检核无待检资料时展示100%完成进度卡

更新工具API的OpenAPI定义,新增NoDataResponse结构体;修改预检与响应逻辑,无待检资料时创建已完成的空批次并绑定当前对话;同步更新相关文档并补充测试用例验证流程正确性。
This commit is contained in:
hugo committed 2026-08-17 22:07:07 +08:00
1 parent 2878a6998e
commit e6a44df260
7 files changed
+177 -16

No files matched your search

+49 -1
View File
@@ -84,7 +84,7 @@
},
"responses": {
"200": {
"description": "启动成功;或已有 文件检核进行中,返回 ok=false/error_code=check_running",
"description": "启动成功;已有检核进行中或预检无资料时返回 ok=false。预检无资料仍返回已完成的 0 笔 run,供前端展示 100% 进度。",
"content": {
"application/json": {
"schema": {
@@ -94,6 +94,9 @@
},
{
"$ref": "#/components/schemas/CheckRunningResponse"
},
{
"$ref": "#/components/schemas/NoDataResponse"
}
]
}
@@ -641,6 +644,36 @@
}
}
},
"NoDataResponse": {
"type": "object",
"required": [
"ok",
"error_code",
"message",
"run",
"task"
],
"properties": {
"ok": {
"type": "boolean",
"example": false
},
"error_code": {
"type": "string",
"example": "no_data_to_check"
},
"message": {
"type": "string",
"example": "目前没有资料需要检核"
},
"run": {
"$ref": "#/components/schemas/RunDetail"
},
"task": {
"$ref": "#/components/schemas/TaskSummary"
}
}
},
"GetRunResponse": {
"type": "object",
"required": [
@@ -918,6 +951,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 驱动"
}
}
}
}
}
}