feat: 数字员工财务报告体系与定时提醒及看板快照调度

- 新增数字员工财务报告生成、邮件投递与渲染调度器
- 引入员工画像扫描调度与定时提醒任务
- 完善财务看板快照、排行口径与部门人员占比计算
- 优化数字员工工作看板仪表盘与技能目录
- 增强前端总览页图表、工作台摘要与顶部导航栏交互
- 新增差旅申请规划推动提醒与报销创建会话状态管理
- 补充财务报告、看板调度、数字员工工作记录测试覆盖
This commit is contained in:
caoxiaozhu
2026-06-03 09:25:23 +08:00
parent 0c74b4ab4a
commit 15006a05a7
114 changed files with 7356 additions and 650 deletions

View File

@@ -16,11 +16,14 @@ from app.services.agent_foundation_constants import (
DIGITAL_EMPLOYEE_DEPARTMENT_BASELINE_TASK_CODE,
DIGITAL_EMPLOYEE_FALSE_POSITIVE_SAMPLE_TASK_CODE,
DIGITAL_EMPLOYEE_FEEDBACK_SAMPLE_TASK_CODE,
DIGITAL_EMPLOYEE_FINANCE_DASHBOARD_SNAPSHOT_TASK_CODE,
DIGITAL_EMPLOYEE_FINANCE_REPORT_TASK_CODE,
DIGITAL_EMPLOYEE_MULTI_EVIDENCE_TASK_CODE,
DIGITAL_EMPLOYEE_POLICY_ALIGNMENT_TASK_CODE,
DIGITAL_EMPLOYEE_POLICY_CLAUSE_EXTRACT_TASK_CODE,
DIGITAL_EMPLOYEE_POLICY_GAP_TASK_CODE,
DIGITAL_EMPLOYEE_PROFILE_SCAN_TASK_CODE,
DIGITAL_EMPLOYEE_REMINDER_SCAN_TASK_CODE,
DIGITAL_EMPLOYEE_RISK_GRAPH_SCAN_TASK_CODE,
DIGITAL_EMPLOYEE_RULE_DISCOVERY_TASK_CODE,
DIGITAL_EMPLOYEE_RULE_TEMPLATE_ORGANIZE_TASK_CODE,
@@ -30,7 +33,6 @@ from app.services.agent_foundation_constants import (
DIGITAL_EMPLOYEE_SUPPLIER_RELATION_TASK_CODE,
)
DIGITAL_EMPLOYEE_ANALYSIS_ROLE_BOUNDARY = (
"规则由人定义,风险由人确认,主流程由外层智能体执行,"
"数字员工只读取事实、规则命中和反馈结果,生成后台分析、报告和待复核材料。"
@@ -40,6 +42,65 @@ DIGITAL_EMPLOYEE_ANALYSIS_ROLE_BOUNDARY = (
class AgentFoundationDigitalEmployeeTaskMixin:
def _runtime_digital_employee_task_specs(self) -> tuple[dict[str, object], ...]:
return (
self._digital_employee_task_spec(
code=DIGITAL_EMPLOYEE_FINANCE_DASHBOARD_SNAPSHOT_TASK_CODE,
name="财务经营快照沉淀",
description="按固定周期统计报销金额、费用结构、预算占用、高额单据和个人费用排行,刷新财务看板缓存。",
scenario_json=["schedule", "finance_dashboard", "expense", "budget"],
owner="财务运营组",
cron="0 2 * * *",
skill_category="整理",
skill_name="finance-dashboard-snapshot-analyst",
output_format="finance_dashboard_snapshot",
input_sources=[
"expense_claims",
"expense_items",
"budget_snapshots",
"employee_profiles",
],
execution_strategy="scheduled_dashboard_cache",
),
self._digital_employee_task_spec(
code=DIGITAL_EMPLOYEE_REMINDER_SCAN_TASK_CODE,
name="定时提醒与待办扫描",
description="按计划扫描待审批单据、预算编制周期、差旅申请到期和逾期报销,生成可触达的提醒事项。",
scenario_json=["schedule", "reminder", "approval", "budget", "travel"],
owner="财务运营组",
cron="0 2 * * *",
skill_category="升级",
skill_name="digital-employee-reminder-scanner",
output_format="digital_employee_reminder_report",
input_sources=[
"expense_claims",
"approval_tasks",
"budgets",
"travel_applications",
],
execution_strategy="scheduled_reminder_scan",
),
self._digital_employee_task_spec(
code=DIGITAL_EMPLOYEE_FINANCE_REPORT_TASK_CODE,
name="财务报告编排与邮件投递",
description=(
"按周、季、年整合费用、预算、风险、画像和提醒结果,"
"生成图文 PDF 报告并按邮箱设置投递给财务管理人员。"
),
scenario_json=["schedule", "finance_report", "pdf", "email", "management"],
owner="财务运营组",
cron="30 8 * * 1",
skill_category="整理",
skill_name="finance-report-orchestrator",
output_format="finance_report_pdf_delivery",
input_sources=[
"finance_dashboard_snapshots",
"budget_snapshots",
"risk_observations",
"employee_profiles",
"digital_employee_reminders",
"system_mail_settings",
],
execution_strategy="scheduled_pdf_email_report",
),
self._digital_employee_task_spec(
code=DIGITAL_EMPLOYEE_POLICY_CLAUSE_EXTRACT_TASK_CODE,
name="制度条款结构化抽取",
@@ -134,7 +195,10 @@ class AgentFoundationDigitalEmployeeTaskMixin:
{
"code": DIGITAL_EMPLOYEE_RISK_GRAPH_SCAN_TASK_CODE,
"name": "财务风险图谱巡检",
"description": "按计划扫描报销单、票据、审批链、员工画像和规则命中结果,生成风险观察与可复核证据链。",
"description": (
"按计划扫描报销单、票据、审批链、员工画像和规则命中结果,"
"生成风险观察与可复核证据链。"
),
"scenario_json": ["schedule", "expense", "risk_graph", "risk_observation"],
"owner": "风控与审计部",
"reviewer": "顾承宇",
@@ -167,7 +231,10 @@ class AgentFoundationDigitalEmployeeTaskMixin:
{
"code": DIGITAL_EMPLOYEE_PROFILE_SCAN_TASK_CODE,
"name": "员工行为画像巡检",
"description": "按计划更新员工费用行为、材料完整性、审批效率和智能协作画像,为风险图谱提供画像基线。",
"description": (
"按计划更新员工费用行为、材料完整性、审批效率和智能协作画像,"
"为风险图谱提供画像基线。"
),
"scenario_json": ["schedule", "employee_profile", "baseline", "risk_graph"],
"owner": "风控与审计部",
"reviewer": "顾承宇",
@@ -219,7 +286,12 @@ class AgentFoundationDigitalEmployeeTaskMixin:
skill_category="评估",
skill_name="travel-spatiotemporal-consistency-evaluator",
output_format="spatiotemporal_consistency_report",
input_sources=["expense_claims", "expense_items", "invoice_locations", "travel_routes"],
input_sources=[
"expense_claims",
"expense_items",
"invoice_locations",
"travel_routes",
],
execution_strategy="reuse_financial_risk_graph_scan",
),
self._digital_employee_task_spec(
@@ -232,7 +304,12 @@ class AgentFoundationDigitalEmployeeTaskMixin:
skill_category="评估",
skill_name="budget-overrun-precontrol-evaluator",
output_format="budget_precontrol_warning_report",
input_sources=["expense_claims", "budget_snapshots", "policy_refs", "profile_baselines"],
input_sources=[
"expense_claims",
"budget_snapshots",
"policy_refs",
"profile_baselines",
],
execution_strategy="definition_ready",
),
self._digital_employee_task_spec(
@@ -245,13 +322,21 @@ class AgentFoundationDigitalEmployeeTaskMixin:
skill_category="评估",
skill_name="supplier-abnormal-relation-evaluator",
output_format="supplier_abnormal_relation_report",
input_sources=["risk_graph", "expense_claims", "invoice_entities", "entity_registry"],
input_sources=[
"risk_graph",
"expense_claims",
"invoice_entities",
"entity_registry",
],
execution_strategy="reuse_financial_risk_graph_scan",
),
{
"code": DIGITAL_EMPLOYEE_RULE_DISCOVERY_TASK_CODE,
"name": "风险线索归集",
"description": "按计划复盘申请、报销、规则命中和人工反馈,归集带事实依据的潜在线索,提交人工复核,不生成规则。",
"description": (
"按计划复盘申请、报销、规则命中和人工反馈,"
"归集带事实依据的潜在线索,提交人工复核,不生成规则。"
),
"scenario_json": ["schedule", "application", "reimbursement", "risk_clue"],
"owner": "风控与审计部",
"reviewer": "顾承宇",
@@ -291,7 +376,11 @@ class AgentFoundationDigitalEmployeeTaskMixin:
skill_category="升级",
skill_name="risk-algorithm-replay-evaluator",
output_format="algorithm_replay_evaluation_report",
input_sources=["algorithm_replay_sets", "risk_observations", "risk_observation_feedback"],
input_sources=[
"algorithm_replay_sets",
"risk_observations",
"risk_observation_feedback",
],
execution_strategy="definition_ready",
),
self._digital_employee_task_spec(
@@ -304,7 +393,12 @@ class AgentFoundationDigitalEmployeeTaskMixin:
skill_category="升级",
skill_name="policy-reference-gap-hinter",
output_format="policy_reference_gap_hint_report",
input_sources=["policy_refs", "rule_hits", "expense_claims", "risk_feedback_samples"],
input_sources=[
"policy_refs",
"rule_hits",
"expense_claims",
"risk_feedback_samples",
],
execution_strategy="definition_ready",
),
)