Files
verify-invoice-default/scripts/db/rpa_invoice_schema.py
chenfuqiang c5103e2650
All checks were successful
技能自动化发布 / release (push) Successful in 9s
chore: auto release commit (2026-09-14 15:11:41)
2026-09-14 15:11:41 +08:00

103 lines
2.9 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""RPA发票数据表结构定义。"""
from __future__ import annotations
# RPA发票数据表DDL
RPA_INVOICES_DDL = """
CREATE TABLE IF NOT EXISTS rpa_invoices (
id INTEGER PRIMARY KEY AUTOINCREMENT,
batch_id TEXT NOT NULL,
source_url TEXT NOT NULL,
extraction_time INTEGER NOT NULL DEFAULT (unixepoch()),
username TEXT,
invoice_data_json TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'extracted',
error_message TEXT,
created_at INTEGER NOT NULL DEFAULT (unixepoch())
)
"""
RPA_INVOICES_INDEX = """
CREATE INDEX IF NOT EXISTS idx_rpa_invoices_batch
ON rpa_invoices(batch_id)
"""
# RPA发票数据表列定义
RPA_INVOICES_COLUMNS = (
{
"column_name": "id",
"display_name": "编号",
"description": "主键",
"visible": 1,
"searchable": 1,
"editable": 0,
},
{
"column_name": "batch_id",
"display_name": "批次ID",
"description": "RPA提取批次的唯一标识",
"visible": 1,
"searchable": 1,
"editable": 0,
},
{
"column_name": "source_url",
"display_name": "来源网址",
"description": "RPA操作的目标网站URL",
"visible": 1,
"searchable": 1,
"editable": 0,
},
{
"column_name": "extraction_time",
"display_name": "提取时间",
"description": "RPA提取完成的时间(Unix秒级时间戳)",
"visible": 1,
"searchable": 0,
"editable": 0,
"display_type": "datetime_unix_seconds",
},
{
"column_name": "username",
"display_name": "操作用户",
"description": "执行RPA操作的用户",
"visible": 1,
"searchable": 1,
"editable": 0,
},
{
"column_name": "invoice_data_json",
"display_name": "发票数据",
"description": "提取的发票数据JSON(完整数据)",
"visible": 0,
"searchable": 0,
"editable": 0,
"display_type": "textarea",
},
{
"column_name": "status",
"display_name": "状态",
"description": "提取状态:extracted/processed/error",
"visible": 1,
"searchable": 1,
"editable": 0,
"options_json": '[{"value":"extracted","label":"已提取"},{"value":"processed","label":"已处理"},{"value":"error","label":"错误"}]',
},
{
"column_name": "error_message",
"display_name": "错误信息",
"description": "RPA执行过程中的错误信息",
"visible": 1,
"searchable": 1,
"editable": 0,
},
{
"column_name": "created_at",
"display_name": "创建时间",
"description": "记录创建时间(Unix秒级时间戳)",
"visible": 1,
"searchable": 0,
"editable": 0,
"display_type": "datetime_unix_seconds",
},
)