feat: 扩展风险规则体系、审批动态路由与预算中心列表化改造
- 新增 25+ 条风险规则(预算/报销/申请/通用类),完善风险规则模拟与反馈发布机制 - 引入费用审批动态路由、平台风险分级、预审与风险阶段管理 - 预算中心列表化改造,优化票据夹仪表盘与数字员工工作看板 - 新增 Hermes 风险线索收集器、Agent 链路追踪中心 - 扩展数字员工能力库(18 个领域 Skill)与交通费用自动预估 - 完善报销申请快速预览、权限控制与前端测试覆盖
This commit is contained in:
@@ -5,6 +5,7 @@ from typing import Any
|
||||
from app.api.deps import CurrentUserContext
|
||||
from app.models.financial_record import ExpenseClaim
|
||||
from app.services.budget import BudgetService
|
||||
from app.services.expense_claim_risk_stage import enrich_risk_flag_semantics
|
||||
|
||||
|
||||
class ExpenseClaimBudgetFlowMixin:
|
||||
@@ -80,6 +81,8 @@ class ExpenseClaimBudgetFlowMixin:
|
||||
def _append_budget_flags(
|
||||
risk_flags: list[Any] | None,
|
||||
budget_flags: list[dict[str, Any]] | dict[str, Any] | None,
|
||||
*,
|
||||
business_stage: str | None = None,
|
||||
) -> list[Any]:
|
||||
if budget_flags is None:
|
||||
return list(risk_flags or [])
|
||||
@@ -89,7 +92,19 @@ class ExpenseClaimBudgetFlowMixin:
|
||||
next_flags = list(budget_flags or [])
|
||||
if not next_flags:
|
||||
return list(risk_flags or [])
|
||||
return [*list(risk_flags or []), *next_flags]
|
||||
enriched_flags = [
|
||||
enrich_risk_flag_semantics(
|
||||
flag,
|
||||
business_stage=business_stage,
|
||||
risk_domain="budget",
|
||||
visibility_scope="budget_manager",
|
||||
actionability="budget_governance",
|
||||
)
|
||||
if isinstance(flag, dict)
|
||||
else flag
|
||||
for flag in next_flags
|
||||
]
|
||||
return [*list(risk_flags or []), *enriched_flags]
|
||||
|
||||
@staticmethod
|
||||
def _resolve_budget_operator(current_user: CurrentUserContext) -> str:
|
||||
|
||||
Reference in New Issue
Block a user