feat: 增强风险规则生成引擎与预算中心页面
后端拆分风险规则生成为解释器、语义分析、本体对齐等子模块, 优化模板执行和流程图生成,完善员工种子数据和导入逻辑,增强 报销单权限策略和草稿持久化,前端新增预算中心视图和趋势图 组件,重构审计页面和风险规则测试对话框交互,完善文档中心 和报销创建页面细节,补充单元测试覆盖。
This commit is contained in:
@@ -244,10 +244,10 @@ def test_semantic_ontology_service_matches_day3_evaluation_set(
|
||||
assert result.run_id.startswith("run_")
|
||||
|
||||
|
||||
def test_semantic_ontology_service_extracts_entities_time_and_constraints() -> None:
|
||||
session_factory = build_session_factory()
|
||||
with session_factory() as db:
|
||||
result = SemanticOntologyService(db).parse(
|
||||
def test_semantic_ontology_service_extracts_entities_time_and_constraints() -> None:
|
||||
session_factory = build_session_factory()
|
||||
with session_factory() as db:
|
||||
result = SemanticOntologyService(db).parse(
|
||||
OntologyParseRequest(
|
||||
query="张三 2026年4月差旅报销金额超过5000元的明细",
|
||||
user_id="pytest",
|
||||
@@ -255,9 +255,30 @@ def test_semantic_ontology_service_extracts_entities_time_and_constraints() -> N
|
||||
)
|
||||
|
||||
assert result.scenario == "expense"
|
||||
assert result.intent == "query"
|
||||
assert result.time_range.start_date == "2026-04-01"
|
||||
assert result.time_range.end_date == "2026-04-30"
|
||||
assert result.intent == "query"
|
||||
assert result.time_range.start_date == "2026-04-01"
|
||||
assert result.time_range.end_date == "2026-04-30"
|
||||
|
||||
|
||||
def test_semantic_ontology_service_extracts_new_document_numbers() -> None:
|
||||
session_factory = build_session_factory()
|
||||
with session_factory() as db:
|
||||
result = SemanticOntologyService(db).parse(
|
||||
OntologyParseRequest(
|
||||
query="查询 RE-20260525103045-ABCDEFGH 和 AP-20260525113045-HGFEDCBA 的状态",
|
||||
user_id="pytest",
|
||||
)
|
||||
)
|
||||
|
||||
claim_codes = {
|
||||
item.normalized_value
|
||||
for item in result.entities
|
||||
if item.type == "expense_claim"
|
||||
}
|
||||
assert claim_codes == {
|
||||
"RE-20260525103045-ABCDEFGH",
|
||||
"AP-20260525113045-HGFEDCBA",
|
||||
}
|
||||
|
||||
|
||||
def test_semantic_ontology_service_treats_travel_amount_question_as_knowledge_query() -> None:
|
||||
|
||||
Reference in New Issue
Block a user