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

@@ -12,6 +12,8 @@ from app.models.employee import Employee
from app.models.employee_behavior_profile import EmployeeBehaviorProfileSnapshot
from app.models.financial_record import ExpenseClaim, ExpenseClaimItem
from app.models.organization import OrganizationUnit
from app.services.digital_employee_dashboard import DigitalEmployeeDashboardService
from app.services.employee_profile_scan_task import EmployeeProfileScanTaskService
from app.services.hermes_employee_profile_scanner import HermesEmployeeProfileScannerService
@@ -35,6 +37,24 @@ def test_hermes_employee_profile_scan_returns_profile_baseline_summary() -> None
)
def test_employee_profile_scan_task_records_digital_employee_run() -> None:
session_factory = _build_session_factory()
with session_factory() as db:
_seed_scan_data(db)
result = EmployeeProfileScanTaskService(db).refresh_profiles()
summary = result["summary"]
assert result["task_type"] == "employee_behavior_profile_scan"
assert summary["target_employee_count"] == 3
assert summary["snapshot_count"] >= 12
assert db.query(EmployeeBehaviorProfileSnapshot).count() >= 12
dashboard = DigitalEmployeeDashboardService(db).build_dashboard(days=7)
assert dashboard.totals["profileSnapshots"] >= 12
assert dashboard.task_distribution[0]["taskType"] == "employee_behavior_profile_scan"
def _build_session_factory() -> sessionmaker[Session]:
engine = create_engine(
"sqlite+pysqlite:///:memory:",