query_bill_to_file
Query Kingdee K3Cloud bills and stream to file for large exports; returns path, row count, and byte size without loading all data into memory.
Instructions
自动翻页并流式写入本地文件,适合大数据量导出(万行以上)。
不在内存中累积数据,写入完成后返回文件路径和统计信息。 文件可用 Read 工具抽检,或交由 pandas/polars 处理。
返回格式: {"path": "...", "row_count": N, "bytes": M, "format": "ndjson"} 若中途出错:{"error": "...", "path": "...", "row_count": <已写入>, "bytes": M}
Args: form_id: 表单ID。如 SAL_SaleOrder、PUR_PurchaseOrder、BD_MATERIAL 等 field_keys: 查询字段,逗号分隔。如 "FBillNo,FDate,FAmount" filter_string: 过滤条件。如 "FDate >= '2025-01-01'" output_path: 输出文件绝对路径。如 "/tmp/orders.ndjson" format: 输出格式,ndjson(每行一个 JSON 对象)或 csv,默认 ndjson page_size: 每页行数,默认 2000 max_rows: 最大写入行数,默认 500000;超过则截断并正常返回
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | ndjson | |
| form_id | Yes | ||
| max_rows | No | ||
| page_size | No | ||
| field_keys | Yes | ||
| output_path | No | ||
| filter_string | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |