feat: 增强差旅报销审核流程与票据智能推理

优化本体解析和编排器的差旅场景处理能力,完善报销单草稿
保存和费用明细同步逻辑,前端报销创建页面增加行程推理和
票据审核交互,新增助手会话快照工具函数,补充单元测试。
This commit is contained in:
caoxiaozhu
2026-05-21 16:09:47 +08:00
parent f28d7e6d16
commit e701fa01da
33 changed files with 3033 additions and 337 deletions

View File

@@ -51,6 +51,18 @@ def test_document_intelligence_extracts_larger_decimal_amount_from_multiple_cand
assert any(field.label == "金额" and field.value == "13.4元" for field in insight.fields)
def test_document_intelligence_extracts_hotel_total_fee_instead_of_date_year() -> None:
insight = build_document_insight(
filename="hotel-invoice.png",
summary="酒店住宿票据",
text="北京中心酒店 金额 2026-02-20 入住 总费用是828元 离店日期 2026-02-21",
)
assert insight.document_type == "hotel_invoice"
assert any(field.label == "金额" and field.value == "828元" for field in insight.fields)
assert not any(field.label == "金额" and field.value == "2026元" for field in insight.fields)
def test_document_intelligence_prefers_train_ticket_for_railway_e_ticket_invoice_text() -> None:
insight = build_document_insight(
filename="铁路电子客票.pdf",