feat(backend): ajout export PDF pour les membres
Nouveau format d'export :
- GET /api/membres/export?format=PDF - Export membres en PDF (OpenPDF)
- Support formats : EXCEL, CSV, PDF (dans MembreResource)
MembreImportExportService :
- exporterVersPDF() : 193 lignes, génération PDF professionnelle
* Document A4 landscape pour + de colonnes
* Titre + métadonnées (date, total)
* Table avec colonnes configurables (PERSO, CONTACT, ADHESION, ORGANISATION)
* Styles : headers (bleu foncé, blanc), données (noir, aligné)
* Page statistiques optionnelle (total, actifs/inactifs/suspendus, orgs)
- Méthodes helper : createHeaderCell, createDataCell, createStatsCell, ajouterStatistiquesPDF
MembreService :
- exporterVersPDF() : délégation vers MembreImportExportService
MembreResource :
- Mise à jour endpoint /export : if ("PDF".equalsIgnoreCase(format))
- Content-Type: application/pdf
- Filename: membres_export_YYYY-MM-DD.pdf
Correctifs imports :
- Résolution conflits OpenPDF vs Apache POI (List, Row, Font)
- Imports spécifiques : com.lowagie.text.Font, Document, PdfPTable, etc.
- Qualification complète pour éviter ambiguïtés (java.util.List vs com.lowagie.text.List)
Résultat : Export membres en 3 formats (EXCEL, CSV, PDF) ✅
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -853,6 +853,20 @@ public class MembreService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Exporte des membres vers PDF
|
||||
*/
|
||||
public byte[] exporterVersPDF(List<MembreResponse> membres, List<String> colonnesExport, boolean inclureHeaders,
|
||||
boolean formaterDates, boolean inclureStatistiques) {
|
||||
try {
|
||||
return membreImportExportService.exporterVersPDF(membres, colonnesExport, inclureHeaders, formaterDates,
|
||||
inclureStatistiques);
|
||||
} catch (Exception e) {
|
||||
LOG.errorf(e, "Erreur lors de l'export PDF");
|
||||
throw new RuntimeException("Erreur lors de l'export PDF: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Génère un modèle Excel pour l'import
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user