feat: 报销审批流重构与管家计划全链路贯通

- 重构报销状态注册表、审批流路由与平台风险标记
- 完善管家意图规划器与模型计划构建器全链路
- 新增 OCR Worker 脚本、数据库会话管理与通知状态
- 优化文档中心、日志视图、预算中心与员工管理交互
- 增强工作台摘要、图标资源与全局主题样式
- 补充审批路由、状态注册、OCR 服务与管家规划器测试覆盖
This commit is contained in:
caoxiaozhu
2026-06-06 17:19:07 +08:00
parent f60cebadb8
commit e124e4bbcb
162 changed files with 9161 additions and 1941 deletions

View File

@@ -1,17 +1,17 @@
{
"schema_version": "2.0",
"rule_code": "risk.application.large_expense_without_preapproval",
"name": "大额费用未事前申请",
"description": "达到财务制度中大额标准的费用,未找到有效事前申请即进入报销。",
"name": "?????????",
"description": "???????? 2000 ?????????????",
"enabled": true,
"requires_attachment": false,
"risk_dimension": "expense_control_demo",
"risk_category": "申请前置",
"risk_category": "????",
"ontology_signal": "application_required",
"evaluator": "template_rule",
"template_key": "keyword_match_v1",
"finance_rule_code": "finance.preapproval.policy",
"finance_rule_sheet": "费用申请前置规则",
"template_key": "composite_rule_v1",
"finance_rule_code": "expense.preapproval.policy",
"finance_rule_sheet": "????????",
"business_stage": [
"reimbursement"
],
@@ -34,68 +34,75 @@
"fields": [
{
"key": "claim.amount",
"label": "报销金额",
"label": "????",
"type": "number",
"source": "claim"
},
{
"key": "claim.expense_type",
"label": "费用类型",
"label": "????",
"type": "enum",
"source": "claim"
},
{
"key": "claim.department_name",
"label": "部门",
"label": "??",
"type": "text",
"source": "claim"
},
{
"key": "claim.reason",
"label": "事由",
"label": "??",
"type": "text",
"source": "claim"
},
{
"key": "item.item_reason",
"label": "明细说明",
"label": "????",
"type": "text",
"source": "item"
},
{
"key": "application.id",
"label": "申请单",
"label": "???ID",
"type": "text",
"source": "application"
},
{
"key": "application.claim_no",
"label": "????",
"type": "text",
"source": "application"
},
{
"key": "application.status",
"label": "申请状态",
"label": "????",
"type": "enum",
"source": "application"
},
{
"key": "application.approved_amount",
"label": "申请审批金额",
"label": "??????",
"type": "number",
"source": "application"
},
{
"key": "application.expense_type",
"label": "申请费用类型",
"label": "??????",
"type": "enum",
"source": "application"
},
{
"key": "application.department_name",
"label": "申请部门",
"label": "????",
"type": "text",
"source": "application"
}
]
},
"params": {
"template_key": "keyword_match_v1",
"template_key": "composite_rule_v1",
"semantic_type": "preapproval_required_amount_threshold",
"field_keys": [
"claim.amount",
"claim.expense_type",
@@ -103,31 +110,89 @@
"claim.reason",
"item.item_reason",
"application.id",
"application.claim_no",
"application.status",
"application.approved_amount",
"application.expense_type",
"application.department_name"
],
"search_fields": [
"claim.reason",
"item.item_reason",
"claim.expense_type"
"conditions": [
{
"id": "amount_exceeds_preapproval_threshold",
"operator": "numeric_compare",
"left_fields": [
"claim.amount"
],
"threshold": 2000,
"compare": "gt"
},
{
"id": "application_present",
"operator": "exists_any",
"fields": [
"application.id",
"application.claim_no"
]
},
{
"id": "not_specific_preapproval_type",
"operator": "not_contains_any",
"fields": [
"claim.expense_type"
],
"keywords": [
"meal",
"entertainment",
"office",
"????",
"??",
"????",
"??"
]
}
],
"keywords": [
"大额费用",
"未申请",
"先申请后报销"
],
"condition_summary": "金额达到大额阈值且缺少已通过申请单时触发。",
"finance_rule_code": "finance.preapproval.policy",
"finance_rule_sheet": "费用申请前置规则",
"hit_logic": {
"all": [
"amount_exceeds_preapproval_threshold",
{
"not": "application_present"
},
"not_specific_preapproval_type"
]
},
"formula": "amount > threshold AND NOT hasApplication",
"condition_summary": "?????????????????? 2000 ????????????????",
"message_template": "?????? 2000 ?????????????????????????",
"finance_rule_code": "expense.preapproval.policy",
"finance_rule_sheet": "????????",
"business_stage": [
"reimbursement"
],
"expense_types": [
"all"
],
"budget_required": true
"budget_required": true,
"threshold_amount": 2000,
"rule_ir": {
"facts": [
{
"id": "A",
"label": "????",
"fields": [
"claim.amount"
]
},
{
"id": "B",
"label": "???",
"fields": [
"application.id",
"application.claim_no"
]
}
],
"hit_logic": "A > threshold AND NOT EXISTS(B)"
}
},
"outcomes": {
"pass": {
@@ -141,16 +206,16 @@
}
},
"metadata": {
"owner": "风控与审计部",
"owner": "??????",
"stability": "platform",
"source_ref": "费用管控 Demo 风险规则库",
"created_at": "2026-05-31T00:10:41.805274+00:00",
"source_ref": "??????????",
"created_at": "2026-06-05T00:00:00+08:00",
"created_by": "system",
"risk_score": 86,
"risk_level": "high",
"rule_title": "大额费用未事前申请",
"finance_rule_code": "finance.preapproval.policy",
"finance_rule_sheet": "费用申请前置规则",
"rule_title": "?????????",
"finance_rule_code": "expense.preapproval.policy",
"finance_rule_sheet": "????????",
"business_stage": [
"reimbursement"
],