#1107: TimesheetStats.kt

projectforge-business/src/main/kotlin/org/projectforge/business/timesheet/TimesheetStats.kt Service, projectforge-business/src/main/kotlin/org/projectforge/business/timesheet/TimesheetStats.kt 199 lines · 119 code · 65 comments · 15 blank
Accumulates and provides statistical data for timesheets, including total hours, planned vs. actual comparisons, and aggregate calculations.

Architecture

Aggregation Engine

Collects timesheet entries and computes aggregate statistics: total hours, planned personnel days vs. actual, cost summaries, and AI time savings. Uses Kotlin's collection operations for efficient data processing.

Data Flow

Receives a filtered list of TimesheetDO entities, groups them by relevant dimensions (user, task, project), computes per-group sums, and returns a structured TimesheetStats result object.

Design Rationale

Separated from the DAO and export logic to keep statistical computation independently testable and reusable across dashboards, reports, and Excel exports.

Architecture Analysis

Resides in projectforge-business, the core module containing domain logic, services, and persistence. Typically annotated with @Service or @Component, managed by the Spring IoC container with dependency injection.

Git History

CommitWhat changed
868d6abb752025 -> 2026
63081666f6Source file headers: 2024-> 2025.
b6092df092Copyright 2023 -> 2024
ab45d51fa4Copyright 2001-2022 -> 2001-2023.
5f7ef41b8cCopyright 2021 -> 2022
ceb63e8a1bSource code header: (C) 2001-2021.
0e8ed158b6TimesheetStats supports now rounding modes. Migrated to Kotlin.