#988: EmployeeSalaryImportService.kt

projectforge-business/src/main/kotlin/org/projectforge/business/fibu/datev/EmployeeSalaryImportService.kt Type: Spring Service (import orchestration)
Package: org.projectforge.business.fibu.datev
Actual Path: projectforge-business/src/main/kotlin/org/projectforge/business/fibu/datev/EmployeeSalaryImportService.kt
Note: The file does not exist at the requested path (.../excelimport/...). It resides in the datev sub-package. The documentation below reflects the actual source. 139 lines · 101 code · 25 comments · 13 blank

Orchestration service for the employee salary import pipeline. Follows the same three-phase import lifecycle (import → reconcile → commit) established by DatevImportService. Coordinates between the EmployeeSalaryExcelImporter (parsing), EmployeeSalaryDao (persistence), and EmployeeSalaryService (lookup).

Architecture

Dependencies

DependencyRole
EmployeeSalaryExcelImporterParses the Excel workbook into ImportStorage<EmployeeSalaryDO>
EmployeeSalaryServiceLookup existing salaries by month for reconciliation
EmployeeSalaryDaoBulk commit and access control

Import Lifecycle

Phase 1: Import

importData(inputStream, filename, year, month) — opens an ExcelWorkbook, creates an ImportStorage, delegates to EmployeeSalaryExcelImporter.doImport(). Returns the populated storage.

Phase 2: Reconcile

reconcile(storage, sheetName, year, month) — looks up existing salaries for the given year/month via employeeSalaryService.selectByMonth(), then matches each imported element to an existing DB record by employee id. Sets oldValue, id, and created timestamp on the element for the commit phase. Sets status to RECONCILED.

Phase 3: Commit

commit(storage, sheetName) — requires RECONCILED status. Collects selected elements, copies the existing id from oldValue for updates, and bulk-commits via employeeSalaryDao.insertOrUpdate() in blocks of 50. Sets status to IMPORTED.

Access Control

checkLoggedinUserRight() delegates to employeeSalaryDao.checkLoggedInUserInsertAccess(), which verifies the user has the insert right for employee salaries.

Insert Block Size

SALARY_INSERT_BLOCK_SIZE = 50 — controls batch size for persistence operations.

Git History

868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
1012e347a Migration stuff in progress... (all tests of all packages: OK).