- Apache POI 5.2.5 for Excel file processing
- OpenCSV 5.9 for CSV file processing
VoterImportResult.java- Tracks import results with success/failure countsVoterImportData.java- Represents individual voter data during import
BulkImportService.java- Handles Excel/CSV parsing, validation, and password generation- Auto-generates passwords as: firstName + "123"
- Encrypts passwords with BCrypt before saving
- GET
/admin/voters/import- Shows import page - POST
/admin/voters/import- Handles file upload and processing - GET
/admin/voters/download-template- Downloads Excel template
voter-import.html- New import page with drag-drop upload, template download, and results displayvoter-management.html- Added link to Bulk Import page
- Username: required, unique (checks database and within file)
- Full Name: required
- Email: optional, unique if provided
- Accepts Excel (.xlsx, .xls) and CSV files
- Standardized template with columns: Username, Full Name, Email
- Auto-generates default password (firstName + "123")
- Passwords encrypted with BCrypt
- Detailed feedback showing success/failure counts
- Failed records shown with error reasons
- Template download with example data
- Drag-and-drop file upload UI
- Start the application:
./mvnw spring-boot:run - Navigate to http://localhost:8080
- Login as admin
- Go to Voter Management page
- Click "Bulk Import Voters" button
- Download the template and prepare your voter data
- Upload the file and verify import results
- Successfully imported voters will have encrypted passwords in the format: john123 (for "John Doe")
- Failed records will be listed with specific error reasons
- Total processed, successful, and failed counts will be displayed