Services:
- EvenementService: POST /inscriptions (sans membreId), DELETE /inscriptions, GET /recherche, GET /type/{type}
- MembreService: creer() accepte CreateMembreRequest au lieu de MembreResponse
- Nouveaux services: BackupService, EpargneService, FinanceApprovalService, LogsService, MessageService, OrganisationService, PaiementClientService
Beans:
- MembreInscriptionBean: construit CreateMembreRequest.builder() avec organisationId UUID
- EvenementsBean: inscrireParticipant(id) sans userId (backend infère depuis token)
- DashboardBean: checkAccessAndRedirect() SUPER_ADMIN en premier
Sécurité:
- AuthenticationFilter: gestion AJAX PrimeFaces (partial/ajax → XML partial-response redirect)
- PermissionChecker: vérification rôles côté bean
- k8s/: manifestes secrets SMTP et Wave (placeholders à remplir)
Pages XHTML: dashboards rôles, cotisations, membres, événements, organisations
1200 lines
37 KiB
Java
1200 lines
37 KiB
Java
package dev.lions.unionflow.client.view;
|
|
|
|
import dev.lions.unionflow.server.api.dto.organisation.response.OrganisationResponse;
|
|
import dev.lions.unionflow.server.api.dto.organisation.response.OrganisationSummaryResponse;
|
|
import dev.lions.unionflow.server.api.dto.common.PagedResponse;
|
|
import dev.lions.unionflow.server.api.dto.souscription.SouscriptionStatutResponse;
|
|
import dev.lions.unionflow.client.service.AdminUserService;
|
|
import dev.lions.unionflow.client.service.OrganisationService;
|
|
import dev.lions.unionflow.client.service.AuditService;
|
|
import dev.lions.unionflow.client.service.CotisationService;
|
|
import dev.lions.unionflow.client.service.MembreService;
|
|
import dev.lions.unionflow.client.service.MetricsService;
|
|
import dev.lions.unionflow.client.service.SouscriptionService;
|
|
import io.quarkus.security.identity.SecurityIdentity;
|
|
import jakarta.enterprise.context.SessionScoped;
|
|
import jakarta.inject.Inject;
|
|
import jakarta.inject.Named;
|
|
import jakarta.annotation.PostConstruct;
|
|
import org.eclipse.microprofile.rest.client.inject.RestClient;
|
|
import java.io.Serializable;
|
|
import java.math.BigDecimal;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDateTime;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Locale;
|
|
import java.util.Map;
|
|
import java.util.UUID;
|
|
import org.jboss.logging.Logger;
|
|
|
|
@Named("superAdminBean")
|
|
@SessionScoped
|
|
public class SuperAdminBean implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
private static final Logger LOG = Logger.getLogger(SuperAdminBean.class);
|
|
|
|
// Constantes de navigation outcomes (WOU/DRY - réutilisables)
|
|
private static final String OUTCOME_ENTITE_NOUVELLE = "entiteNouvellePage";
|
|
private static final String OUTCOME_ENTITE_GESTION = "entiteGestionPage";
|
|
private static final String OUTCOME_SUPER_ADMIN_RAPPORTS = "superAdminRapportsPage";
|
|
private static final String OUTCOME_SUPER_ADMIN_CONFIGURATION = "superAdminConfigurationPage";
|
|
private static final String OUTCOME_SUPER_ADMIN_ALERTES = "superAdminAlertesPage";
|
|
private static final String OUTCOME_SUPER_ADMIN_ACTIVITE = "superAdminActivitePage";
|
|
private static final String OUTCOME_SUPER_ADMIN_AUDIT = "/pages/admin/audit/journal";
|
|
private static final String OUTCOME_SUPER_ADMIN_BACKUP = "/pages/secure/admin/sauvegarde";
|
|
|
|
@Inject
|
|
@RestClient
|
|
private OrganisationService organisationService;
|
|
|
|
@Inject
|
|
@RestClient
|
|
private AdminUserService adminUserService;
|
|
|
|
@Inject
|
|
@RestClient
|
|
private CotisationService cotisationService;
|
|
|
|
@Inject
|
|
@RestClient
|
|
private AuditService auditService;
|
|
|
|
@Inject
|
|
@RestClient
|
|
private SouscriptionService souscriptionService;
|
|
|
|
@Inject
|
|
@RestClient
|
|
private MembreService membreService;
|
|
|
|
@Inject
|
|
private MetricsService metricsService;
|
|
|
|
@Inject
|
|
private SecurityIdentity securityIdentity;
|
|
|
|
private String nomComplet;
|
|
private String derniereConnexion;
|
|
private int totalEntites;
|
|
private int totalAdministrateurs;
|
|
private int totalMembres;
|
|
private String revenusGlobaux;
|
|
private int alertesCount;
|
|
private String croissanceEntites;
|
|
private int activiteJournaliere;
|
|
|
|
// Pourcentages de croissance calculés
|
|
private String croissanceMembres = "0";
|
|
private String croissanceRevenus = "0";
|
|
private int nouvellesEntites = 0;
|
|
private int utilisateursActifs = 0;
|
|
|
|
// Pourcentages pour les progress bars (jauges)
|
|
private int pourcentageMembres = 0;
|
|
private int pourcentageOrganisations = 0;
|
|
private int pourcentageRevenus = 0;
|
|
private int pourcentageActivite = 0;
|
|
|
|
// Métriques de souscription
|
|
private int totalSouscriptions;
|
|
private int souscriptionsActives;
|
|
private int souscriptionsExpirantSous30Jours;
|
|
private float tauxConversion;
|
|
|
|
// Revenus par forfait
|
|
private BigDecimal revenusStarter = BigDecimal.ZERO;
|
|
private BigDecimal revenusStandard = BigDecimal.ZERO;
|
|
private BigDecimal revenusPremmium = BigDecimal.ZERO;
|
|
private BigDecimal revenusCristal = BigDecimal.ZERO;
|
|
|
|
// Métriques système
|
|
private float disponibiliteSysteme;
|
|
private int tempsReponsMoyen;
|
|
private int ticketsSupportOuverts;
|
|
private float satisfactionClient;
|
|
|
|
private List<Alerte> alertesRecentes;
|
|
private List<Entite> topEntites;
|
|
private List<TypeEntite> repartitionTypes;
|
|
private List<Activite> activitesRecentes;
|
|
private List<EvolutionMois> evolutionEntites;
|
|
private RevenusData revenus;
|
|
private String periodeEvolution = "12M";
|
|
|
|
// Caches transients des stats (non sérialisés — rechargés à chaque nouvelle session)
|
|
private transient OrganisationService.StatistiquesOrganisationDTO orgStats;
|
|
private transient MembreService.StatistiquesMembreDTO membreStats;
|
|
|
|
@PostConstruct
|
|
public void init() {
|
|
initializeUserInfo();
|
|
initializeKPIs();
|
|
initializeAlertes();
|
|
initializeEntites();
|
|
initializeRepartitionTypes();
|
|
initializeActivites();
|
|
initializeEvolution();
|
|
initializeRevenus();
|
|
}
|
|
|
|
private void initializeUserInfo() {
|
|
try {
|
|
nomComplet = securityIdentity.getPrincipal().getName();
|
|
if (nomComplet == null || nomComplet.isBlank()) {
|
|
nomComplet = "Administrateur Système";
|
|
}
|
|
} catch (Exception e) {
|
|
LOG.debugf("Impossible de récupérer l'identité: %s", e.getMessage());
|
|
nomComplet = "Administrateur Système";
|
|
}
|
|
derniereConnexion = LocalDateTime.now().format(DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
|
|
}
|
|
|
|
private void initializeKPIs() {
|
|
loadStatsOrganisations();
|
|
loadStatsMembres();
|
|
initializeAssociationKPIs();
|
|
initializeAdminCount();
|
|
initializeCotisationKPIs();
|
|
initializeAuditKPIs();
|
|
initializeSouscriptionKPIs();
|
|
initializeSystemMetrics();
|
|
calculerPourcentagesJauges();
|
|
}
|
|
|
|
private void loadStatsOrganisations() {
|
|
try {
|
|
orgStats = organisationService.obtenirStatistiques();
|
|
} catch (Exception e) {
|
|
LOG.debugf("Impossible de charger les stats organisations: %s", e.getMessage());
|
|
orgStats = null;
|
|
}
|
|
}
|
|
|
|
private void loadStatsMembres() {
|
|
try {
|
|
membreStats = membreService.obtenirStatistiques();
|
|
} catch (Exception e) {
|
|
LOG.debugf("Impossible de charger les stats membres: %s", e.getMessage());
|
|
membreStats = null;
|
|
}
|
|
}
|
|
|
|
private void initializeAssociationKPIs() {
|
|
if (orgStats != null) {
|
|
totalEntites = orgStats.totalAssociations != null ? orgStats.totalAssociations.intValue() : 0;
|
|
nouvellesEntites = orgStats.nouvellesAssociations30Jours != null
|
|
? orgStats.nouvellesAssociations30Jours.intValue() : 0;
|
|
} else {
|
|
totalEntites = 0;
|
|
nouvellesEntites = 0;
|
|
}
|
|
croissanceEntites = nouvellesEntites > 0 ? "+" + nouvellesEntites : "0";
|
|
if (membreStats != null) {
|
|
totalMembres = membreStats.membresActifs != null ? membreStats.membresActifs.intValue() : 0;
|
|
croissanceMembres = membreStats.nouveauxMembres30Jours != null
|
|
? membreStats.nouveauxMembres30Jours.toString() : "0";
|
|
} else {
|
|
totalMembres = 0;
|
|
croissanceMembres = "0";
|
|
}
|
|
}
|
|
|
|
private void initializeAdminCount() {
|
|
try {
|
|
var result = adminUserService.lister(0, 1, null);
|
|
// Corrigé: getTotalElements() au lieu de getTotalCount()
|
|
if (result != null && result.getTotalElements() > 0) {
|
|
totalAdministrateurs = (int) result.getTotalElements();
|
|
} else {
|
|
totalAdministrateurs = 0;
|
|
}
|
|
} catch (Exception e) {
|
|
LOG.debugf("Impossible de charger le nombre d'administrateurs: %s", e.getMessage());
|
|
totalAdministrateurs = 0;
|
|
}
|
|
}
|
|
|
|
private void initializeCotisationKPIs() {
|
|
try {
|
|
Map<String, Object> stats = cotisationService.obtenirStatistiques();
|
|
if (stats != null) {
|
|
Object montantTotal = stats.get("montantTotalPaye");
|
|
if (montantTotal instanceof Number) {
|
|
revenusGlobaux = String.format("%,.0f FCFA", ((Number) montantTotal).doubleValue());
|
|
} else {
|
|
revenusGlobaux = "0 FCFA";
|
|
}
|
|
// tauxPaiement = % de cotisations payées (proxy de la santé financière)
|
|
Object croissance = stats.get("tauxPaiement");
|
|
if (croissance instanceof Number) {
|
|
double val = ((Number) croissance).doubleValue();
|
|
croissanceRevenus = val == 0.0 ? "0" : String.format(Locale.US, "%.1f", val);
|
|
} else {
|
|
croissanceRevenus = "0";
|
|
}
|
|
} else {
|
|
revenusGlobaux = "0 FCFA";
|
|
croissanceRevenus = "0";
|
|
}
|
|
} catch (Exception e) {
|
|
LOG.debugf("Impossible de charger les stats cotisations: %s", e.getMessage());
|
|
revenusGlobaux = "0 FCFA";
|
|
croissanceRevenus = "0";
|
|
}
|
|
}
|
|
|
|
private void initializeAuditKPIs() {
|
|
try {
|
|
Map<String, Object> stats = auditService.getStatistiques();
|
|
if (stats != null) {
|
|
// "total" = nombre total d'actions enregistrées (proxy activité)
|
|
Object total = stats.get("total");
|
|
activiteJournaliere = total instanceof Number ? ((Number) total).intValue() : 0;
|
|
// "errors" = erreurs critiques enregistrées (proxy alertes système)
|
|
Object errors = stats.get("errors");
|
|
alertesCount = errors instanceof Number ? ((Number) errors).intValue() : 0;
|
|
} else {
|
|
activiteJournaliere = 0;
|
|
alertesCount = 0;
|
|
}
|
|
} catch (Exception e) {
|
|
LOG.debugf("Impossible de charger les stats audit: %s", e.getMessage());
|
|
activiteJournaliere = 0;
|
|
alertesCount = 0;
|
|
}
|
|
utilisateursActifs = 0;
|
|
}
|
|
|
|
private void initializeSouscriptionKPIs() {
|
|
try {
|
|
List<SouscriptionStatutResponse> souscriptions = souscriptionService.listerToutes(null, 0, 1000);
|
|
if (souscriptions != null) {
|
|
totalSouscriptions = souscriptions.size();
|
|
souscriptionsActives = (int) souscriptions.stream()
|
|
.filter(s -> "ACTIVE".equals(s.getStatut()))
|
|
.count();
|
|
LocalDate dans30Jours = LocalDate.now().plusDays(30);
|
|
souscriptionsExpirantSous30Jours = (int) souscriptions.stream()
|
|
.filter(s -> s.getDateFin() != null && s.getDateFin().isBefore(dans30Jours)
|
|
&& s.getDateFin().isAfter(LocalDate.now()))
|
|
.count();
|
|
tauxConversion = totalSouscriptions > 0
|
|
? (float) souscriptionsActives / totalSouscriptions * 100
|
|
: 0.0f;
|
|
} else {
|
|
totalSouscriptions = 0;
|
|
souscriptionsActives = 0;
|
|
souscriptionsExpirantSous30Jours = 0;
|
|
tauxConversion = 0.0f;
|
|
}
|
|
} catch (Exception e) {
|
|
LOG.debugf("Impossible de charger les souscriptions: %s", e.getMessage());
|
|
totalSouscriptions = 0;
|
|
souscriptionsActives = 0;
|
|
souscriptionsExpirantSous30Jours = 0;
|
|
tauxConversion = 0.0f;
|
|
}
|
|
revenusStarter = BigDecimal.ZERO;
|
|
revenusStandard = BigDecimal.ZERO;
|
|
revenusPremmium = BigDecimal.ZERO;
|
|
revenusCristal = BigDecimal.ZERO;
|
|
}
|
|
|
|
private void initializeSystemMetrics() {
|
|
try {
|
|
Map<String, Object> metrics = metricsService.getGlobalMetrics();
|
|
if (metrics != null) {
|
|
Object successRate = metrics.get("backend_success_rate");
|
|
disponibiliteSysteme = successRate instanceof Number ? ((Number) successRate).floatValue() : 0.0f;
|
|
Object avgTime = metrics.get("response_time_avg_ms");
|
|
tempsReponsMoyen = avgTime instanceof Number ? ((Number) avgTime).intValue() : 0;
|
|
} else {
|
|
disponibiliteSysteme = 0.0f;
|
|
tempsReponsMoyen = 0;
|
|
}
|
|
} catch (Exception e) {
|
|
LOG.debugf("Impossible de charger les métriques système: %s", e.getMessage());
|
|
disponibiliteSysteme = 0.0f;
|
|
tempsReponsMoyen = 0;
|
|
}
|
|
ticketsSupportOuverts = 0;
|
|
satisfactionClient = 0.0f;
|
|
}
|
|
|
|
private void initializeAlertes() {
|
|
// Initialiser avec une liste vide - les alertes seront chargées depuis le
|
|
// backend quand le service sera disponible
|
|
alertesRecentes = new ArrayList<>();
|
|
}
|
|
|
|
private void initializeEntites() {
|
|
topEntites = new ArrayList<>();
|
|
try {
|
|
PagedResponse<OrganisationSummaryResponse> response = organisationService.listerToutes(0, 50);
|
|
List<OrganisationSummaryResponse> associations = (response != null && response.getData() != null) ? response.getData()
|
|
: new ArrayList<>();
|
|
topEntites = associations.stream()
|
|
.sorted((a1, a2) -> {
|
|
int m1 = a1.nombreMembres() != null ? a1.nombreMembres() : 0;
|
|
int m2 = a2.nombreMembres() != null ? a2.nombreMembres() : 0;
|
|
return Integer.compare(m2, m1);
|
|
})
|
|
.limit(5)
|
|
.map(a -> {
|
|
Entite entite = new Entite();
|
|
entite.setId(a.id());
|
|
entite.setNom(a.nom());
|
|
entite.setTypeEntite(a.typeOrganisation());
|
|
entite.setNombreMembres(a.nombreMembres() != null ? a.nombreMembres() : 0);
|
|
return entite;
|
|
})
|
|
.collect(java.util.stream.Collectors.toList());
|
|
} catch (Exception e) {
|
|
LOG.errorf(e, "Erreur lors du chargement des top entités");
|
|
}
|
|
}
|
|
|
|
private void initializeRepartitionTypes() {
|
|
repartitionTypes = new ArrayList<>();
|
|
if (orgStats == null || orgStats.repartitionParType == null || orgStats.repartitionParType.isEmpty()) {
|
|
return;
|
|
}
|
|
int total = orgStats.totalAssociations != null ? orgStats.totalAssociations.intValue() : 0;
|
|
String[] couleurs = { "blue", "green", "orange", "purple", "teal" };
|
|
int idx = 0;
|
|
for (java.util.Map.Entry<String, Long> entry : orgStats.repartitionParType.entrySet()) {
|
|
TypeEntite typeEntite = new TypeEntite();
|
|
typeEntite.setNom(entry.getKey());
|
|
typeEntite.setDescription(entry.getKey());
|
|
typeEntite.setNombre(entry.getValue().intValue());
|
|
typeEntite.setPourcentage(total > 0 ? (entry.getValue().intValue() * 100) / total : 0);
|
|
typeEntite.setIcone("pi-building");
|
|
typeEntite.setCouleurBg(idx < couleurs.length ? couleurs[idx] : "secondary");
|
|
typeEntite.setCouleurTexte("white");
|
|
repartitionTypes.add(typeEntite);
|
|
idx++;
|
|
}
|
|
}
|
|
|
|
private void initializeActivites() {
|
|
activitesRecentes = new ArrayList<>();
|
|
try {
|
|
// sortBy=dateHeure (nom réel du champ), sortOrder=desc
|
|
Map<String, Object> auditResult = auditService.listerTous(0, 10, "dateHeure", "desc");
|
|
if (auditResult != null && auditResult.containsKey("data")) {
|
|
@SuppressWarnings("unchecked")
|
|
List<Map<String, Object>> entries = (List<Map<String, Object>>) auditResult.get("data");
|
|
if (entries != null) {
|
|
for (Map<String, Object> entry : entries) {
|
|
Activite activite = new Activite();
|
|
activite.setId(UUID.randomUUID());
|
|
// typeAction = action métier, description = détail lisible
|
|
Object desc = entry.get("description");
|
|
Object typeAction = entry.get("typeAction");
|
|
activite.setDescription(desc != null ? desc.toString()
|
|
: (typeAction != null ? typeAction.toString() : ""));
|
|
activite.setEntite(entry.getOrDefault("module", "").toString());
|
|
activite.setUtilisateur(entry.getOrDefault("utilisateur", "").toString());
|
|
activite.setDetails(entry.getOrDefault("details", "").toString());
|
|
Object dateObj = entry.get("dateHeure");
|
|
activite.setDate(dateObj != null ? dateObj.toString() : "");
|
|
activite.setIcone("pi-history");
|
|
activitesRecentes.add(activite);
|
|
}
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
LOG.debugf("Impossible de charger les activités récentes: %s", e.getMessage());
|
|
}
|
|
}
|
|
|
|
private void initializeEvolution() {
|
|
// L'évolution mensuelle nécessite un endpoint d'historique des organisations
|
|
// (pas encore disponible)
|
|
evolutionEntites = new ArrayList<>();
|
|
}
|
|
|
|
private void initializeRevenus() {
|
|
revenus = new RevenusData();
|
|
revenus.setMensuel(revenusGlobaux != null ? revenusGlobaux : "0 FCFA");
|
|
revenus.setAnnuel(revenusGlobaux != null ? revenusGlobaux : "0 FCFA");
|
|
revenus.setCroissance(croissanceRevenus != null ? croissanceRevenus : "0");
|
|
revenus.setMoyenne("0 FCFA");
|
|
revenus.setCroissanceMensuelle("0");
|
|
revenus.setObjectifAnnuel("0 FCFA");
|
|
revenus.setDerniereMAJ(LocalDate.now().format(DateTimeFormatter.ofPattern("dd/MM/yyyy")));
|
|
revenus.setEvolution(new ArrayList<>());
|
|
}
|
|
|
|
// Actions (WOU/DRY - utilisation de navigation outcomes)
|
|
public String creerEntite() {
|
|
return OUTCOME_ENTITE_NOUVELLE + "?faces-redirect=true";
|
|
}
|
|
|
|
public String gererEntites() {
|
|
return OUTCOME_ENTITE_GESTION + "?faces-redirect=true";
|
|
}
|
|
|
|
public String genererRapport() {
|
|
return OUTCOME_SUPER_ADMIN_RAPPORTS + "?faces-redirect=true";
|
|
}
|
|
|
|
public String configurer() {
|
|
return OUTCOME_SUPER_ADMIN_CONFIGURATION + "?faces-redirect=true";
|
|
}
|
|
|
|
public void voirAlerte(Alerte alerte) {
|
|
LOG.infof("Voir alerte: %s", alerte.getTitre());
|
|
}
|
|
|
|
public String voirToutesAlertes() {
|
|
return OUTCOME_SUPER_ADMIN_ALERTES + "?faces-redirect=true";
|
|
}
|
|
|
|
public String voirTouteActivite() {
|
|
return OUTCOME_SUPER_ADMIN_ACTIVITE + "?faces-redirect=true";
|
|
}
|
|
|
|
public String auditSysteme() {
|
|
return OUTCOME_SUPER_ADMIN_AUDIT + "?faces-redirect=true";
|
|
}
|
|
|
|
public String backup() {
|
|
return OUTCOME_SUPER_ADMIN_BACKUP + "?faces-redirect=true";
|
|
}
|
|
|
|
public void exporterRapportFinancier() {
|
|
LOG.info("Export du rapport financier généré");
|
|
}
|
|
|
|
// Getters et Setters
|
|
public String getNomComplet() {
|
|
return nomComplet;
|
|
}
|
|
|
|
public void setNomComplet(String nomComplet) {
|
|
this.nomComplet = nomComplet;
|
|
}
|
|
|
|
public String getDerniereConnexion() {
|
|
return derniereConnexion;
|
|
}
|
|
|
|
public void setDerniereConnexion(String derniereConnexion) {
|
|
this.derniereConnexion = derniereConnexion;
|
|
}
|
|
|
|
public int getTotalEntites() {
|
|
return totalEntites;
|
|
}
|
|
|
|
public void setTotalEntites(int totalEntites) {
|
|
this.totalEntites = totalEntites;
|
|
}
|
|
|
|
public int getTotalAdministrateurs() {
|
|
return totalAdministrateurs;
|
|
}
|
|
|
|
public void setTotalAdministrateurs(int totalAdministrateurs) {
|
|
this.totalAdministrateurs = totalAdministrateurs;
|
|
}
|
|
|
|
public int getTotalMembres() {
|
|
return totalMembres;
|
|
}
|
|
|
|
public void setTotalMembres(int totalMembres) {
|
|
this.totalMembres = totalMembres;
|
|
}
|
|
|
|
public String getRevenusGlobaux() {
|
|
return revenusGlobaux;
|
|
}
|
|
|
|
public void setRevenusGlobaux(String revenusGlobaux) {
|
|
this.revenusGlobaux = revenusGlobaux;
|
|
}
|
|
|
|
public int getAlertesCount() {
|
|
return alertesCount;
|
|
}
|
|
|
|
public void setAlertesCount(int alertesCount) {
|
|
this.alertesCount = alertesCount;
|
|
}
|
|
|
|
public String getCroissanceEntites() {
|
|
return croissanceEntites;
|
|
}
|
|
|
|
public void setCroissanceEntites(String croissanceEntites) {
|
|
this.croissanceEntites = croissanceEntites;
|
|
}
|
|
|
|
public int getActiviteJournaliere() {
|
|
return activiteJournaliere;
|
|
}
|
|
|
|
public void setActiviteJournaliere(int activiteJournaliere) {
|
|
this.activiteJournaliere = activiteJournaliere;
|
|
}
|
|
|
|
// Getters pour les nouvelles métriques
|
|
public int getTotalSouscriptions() {
|
|
return totalSouscriptions;
|
|
}
|
|
|
|
public void setTotalSouscriptions(int totalSouscriptions) {
|
|
this.totalSouscriptions = totalSouscriptions;
|
|
}
|
|
|
|
public int getSouscriptionsActives() {
|
|
return souscriptionsActives;
|
|
}
|
|
|
|
public void setSouscriptionsActives(int souscriptionsActives) {
|
|
this.souscriptionsActives = souscriptionsActives;
|
|
}
|
|
|
|
public int getSouscriptionsExpirantSous30Jours() {
|
|
return souscriptionsExpirantSous30Jours;
|
|
}
|
|
|
|
public void setSouscriptionsExpirantSous30Jours(int souscriptionsExpirantSous30Jours) {
|
|
this.souscriptionsExpirantSous30Jours = souscriptionsExpirantSous30Jours;
|
|
}
|
|
|
|
public float getTauxConversion() {
|
|
return tauxConversion;
|
|
}
|
|
|
|
public void setTauxConversion(float tauxConversion) {
|
|
this.tauxConversion = tauxConversion;
|
|
}
|
|
|
|
public BigDecimal getRevenusStarter() {
|
|
return revenusStarter;
|
|
}
|
|
|
|
public void setRevenusStarter(BigDecimal revenusStarter) {
|
|
this.revenusStarter = revenusStarter;
|
|
}
|
|
|
|
public BigDecimal getRevenusStandard() {
|
|
return revenusStandard;
|
|
}
|
|
|
|
public void setRevenusStandard(BigDecimal revenusStandard) {
|
|
this.revenusStandard = revenusStandard;
|
|
}
|
|
|
|
public BigDecimal getRevenusPremmium() {
|
|
return revenusPremmium;
|
|
}
|
|
|
|
public void setRevenusPremmium(BigDecimal revenusPremmium) {
|
|
this.revenusPremmium = revenusPremmium;
|
|
}
|
|
|
|
public BigDecimal getRevenusCristal() {
|
|
return revenusCristal;
|
|
}
|
|
|
|
public void setRevenusCristal(BigDecimal revenusCristal) {
|
|
this.revenusCristal = revenusCristal;
|
|
}
|
|
|
|
public float getDisponibiliteSysteme() {
|
|
return disponibiliteSysteme;
|
|
}
|
|
|
|
public void setDisponibiliteSysteme(float disponibiliteSysteme) {
|
|
this.disponibiliteSysteme = disponibiliteSysteme;
|
|
}
|
|
|
|
public int getTempsReponsMoyen() {
|
|
return tempsReponsMoyen;
|
|
}
|
|
|
|
public void setTempsReponsMoyen(int tempsReponsMoyen) {
|
|
this.tempsReponsMoyen = tempsReponsMoyen;
|
|
}
|
|
|
|
public int getTicketsSupportOuverts() {
|
|
return ticketsSupportOuverts;
|
|
}
|
|
|
|
public void setTicketsSupportOuverts(int ticketsSupportOuverts) {
|
|
this.ticketsSupportOuverts = ticketsSupportOuverts;
|
|
}
|
|
|
|
public float getSatisfactionClient() {
|
|
return satisfactionClient;
|
|
}
|
|
|
|
public void setSatisfactionClient(float satisfactionClient) {
|
|
this.satisfactionClient = satisfactionClient;
|
|
}
|
|
|
|
// Méthodes utilitaires
|
|
public String getRevenusStarterFormat() {
|
|
return String.format("%,.0f FCFA", revenusStarter);
|
|
}
|
|
|
|
public String getRevenusStandardFormat() {
|
|
return String.format("%,.0f FCFA", revenusStandard);
|
|
}
|
|
|
|
public String getRevenusPremmiumFormat() {
|
|
return String.format("%,.0f FCFA", revenusPremmium);
|
|
}
|
|
|
|
public String getRevenusCristalFormat() {
|
|
return String.format("%,.0f FCFA", revenusCristal);
|
|
}
|
|
|
|
public String getTauxConversionFormat() {
|
|
return String.format(Locale.US, "%.1f%%", tauxConversion);
|
|
}
|
|
|
|
public String getDisponibiliteSystemeFormat() {
|
|
return String.format(Locale.US, "%.1f%%", disponibiliteSysteme);
|
|
}
|
|
|
|
public String getSatisfactionClientFormat() {
|
|
return String.format(Locale.US, "%.1f/5", satisfactionClient);
|
|
}
|
|
|
|
public List<Alerte> getAlertesRecentes() {
|
|
return alertesRecentes;
|
|
}
|
|
|
|
public void setAlertesRecentes(List<Alerte> alertesRecentes) {
|
|
this.alertesRecentes = alertesRecentes;
|
|
}
|
|
|
|
public List<Entite> getTopEntites() {
|
|
return topEntites;
|
|
}
|
|
|
|
public void setTopEntites(List<Entite> topEntites) {
|
|
this.topEntites = topEntites;
|
|
}
|
|
|
|
public List<TypeEntite> getRepartitionTypes() {
|
|
return repartitionTypes;
|
|
}
|
|
|
|
public void setRepartitionTypes(List<TypeEntite> repartitionTypes) {
|
|
this.repartitionTypes = repartitionTypes;
|
|
}
|
|
|
|
public List<Activite> getActivitesRecentes() {
|
|
return activitesRecentes;
|
|
}
|
|
|
|
public void setActivitesRecentes(List<Activite> activitesRecentes) {
|
|
this.activitesRecentes = activitesRecentes;
|
|
}
|
|
|
|
public List<EvolutionMois> getEvolutionEntites() {
|
|
return evolutionEntites;
|
|
}
|
|
|
|
public void setEvolutionEntites(List<EvolutionMois> evolutionEntites) {
|
|
this.evolutionEntites = evolutionEntites;
|
|
}
|
|
|
|
public RevenusData getRevenus() {
|
|
return revenus;
|
|
}
|
|
|
|
public void setRevenus(RevenusData revenus) {
|
|
this.revenus = revenus;
|
|
}
|
|
|
|
public String getPeriodeEvolution() {
|
|
return periodeEvolution;
|
|
}
|
|
|
|
public void setPeriodeEvolution(String periodeEvolution) {
|
|
this.periodeEvolution = periodeEvolution;
|
|
}
|
|
|
|
// Getters pour les nouvelles propriétés
|
|
public String getCroissanceMembres() {
|
|
return croissanceMembres;
|
|
}
|
|
|
|
public void setCroissanceMembres(String croissanceMembres) {
|
|
this.croissanceMembres = croissanceMembres;
|
|
}
|
|
|
|
public String getCroissanceRevenus() {
|
|
return croissanceRevenus;
|
|
}
|
|
|
|
public void setCroissanceRevenus(String croissanceRevenus) {
|
|
this.croissanceRevenus = croissanceRevenus;
|
|
}
|
|
|
|
public int getNouvellesEntites() {
|
|
return nouvellesEntites;
|
|
}
|
|
|
|
public void setNouvellesEntites(int nouvellesEntites) {
|
|
this.nouvellesEntites = nouvellesEntites;
|
|
}
|
|
|
|
public int getUtilisateursActifs() {
|
|
return utilisateursActifs;
|
|
}
|
|
|
|
public void setUtilisateursActifs(int utilisateursActifs) {
|
|
this.utilisateursActifs = utilisateursActifs;
|
|
}
|
|
|
|
/**
|
|
* Calcule les pourcentages pour les progress bars (jauges) basés sur des
|
|
* objectifs réalistes
|
|
*/
|
|
private void calculerPourcentagesJauges() {
|
|
// Objectif : 1000 membres (100%)
|
|
int objectifMembres = 1000;
|
|
pourcentageMembres = totalMembres > 0 ? Math.min(100, (totalMembres * 100) / objectifMembres) : 0;
|
|
|
|
// Objectif : 50 organisations (100%)
|
|
int objectifOrganisations = 50;
|
|
pourcentageOrganisations = totalEntites > 0 ? Math.min(100, (totalEntites * 100) / objectifOrganisations) : 0;
|
|
|
|
// Objectif : 10 000 000 FCFA de revenus (100%)
|
|
// Pour l'instant, si revenus = 0, on met 0%
|
|
try {
|
|
String revenusStr = revenusGlobaux.replaceAll("[^0-9]", "");
|
|
if (!revenusStr.isEmpty()) {
|
|
long revenusLong = Long.parseLong(revenusStr);
|
|
long objectifRevenus = 10_000_000L; // 10 millions FCFA
|
|
pourcentageRevenus = revenusLong > 0 ? Math.min(100, (int) ((revenusLong * 100) / objectifRevenus)) : 0;
|
|
} else {
|
|
pourcentageRevenus = 0;
|
|
}
|
|
} catch (Exception e) {
|
|
pourcentageRevenus = 0;
|
|
}
|
|
|
|
// Objectif : 100 activités journalières (100%)
|
|
int objectifActivite = 100;
|
|
pourcentageActivite = activiteJournaliere > 0 ? Math.min(100, (activiteJournaliere * 100) / objectifActivite)
|
|
: 0;
|
|
}
|
|
|
|
// Getters pour les pourcentages des jauges
|
|
public int getPourcentageMembres() {
|
|
return pourcentageMembres;
|
|
}
|
|
|
|
public void setPourcentageMembres(int pourcentageMembres) {
|
|
this.pourcentageMembres = pourcentageMembres;
|
|
}
|
|
|
|
public int getPourcentageOrganisations() {
|
|
return pourcentageOrganisations;
|
|
}
|
|
|
|
public void setPourcentageOrganisations(int pourcentageOrganisations) {
|
|
this.pourcentageOrganisations = pourcentageOrganisations;
|
|
}
|
|
|
|
public int getPourcentageRevenus() {
|
|
return pourcentageRevenus;
|
|
}
|
|
|
|
public void setPourcentageRevenus(int pourcentageRevenus) {
|
|
this.pourcentageRevenus = pourcentageRevenus;
|
|
}
|
|
|
|
public int getPourcentageActivite() {
|
|
return pourcentageActivite;
|
|
}
|
|
|
|
public void setPourcentageActivite(int pourcentageActivite) {
|
|
this.pourcentageActivite = pourcentageActivite;
|
|
}
|
|
|
|
// Classes internes
|
|
public static class Alerte {
|
|
private UUID id;
|
|
private String titre;
|
|
private String entite;
|
|
private String date;
|
|
private String icone;
|
|
private String couleur;
|
|
|
|
// Getters et setters
|
|
public UUID getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getTitre() {
|
|
return titre;
|
|
}
|
|
|
|
public void setTitre(String titre) {
|
|
this.titre = titre;
|
|
}
|
|
|
|
public String getEntite() {
|
|
return entite;
|
|
}
|
|
|
|
public void setEntite(String entite) {
|
|
this.entite = entite;
|
|
}
|
|
|
|
public String getDate() {
|
|
return date;
|
|
}
|
|
|
|
public void setDate(String date) {
|
|
this.date = date;
|
|
}
|
|
|
|
public String getIcone() {
|
|
return icone;
|
|
}
|
|
|
|
public void setIcone(String icone) {
|
|
this.icone = icone;
|
|
}
|
|
|
|
public String getCouleur() {
|
|
return couleur;
|
|
}
|
|
|
|
public void setCouleur(String couleur) {
|
|
this.couleur = couleur;
|
|
}
|
|
}
|
|
|
|
public static class Entite {
|
|
private UUID id;
|
|
private String nom;
|
|
private String typeEntite;
|
|
private int nombreMembres;
|
|
|
|
// Getters et setters
|
|
public UUID getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getNom() {
|
|
return nom;
|
|
}
|
|
|
|
public void setNom(String nom) {
|
|
this.nom = nom;
|
|
}
|
|
|
|
public String getTypeEntite() {
|
|
return typeEntite;
|
|
}
|
|
|
|
public void setTypeEntite(String typeEntite) {
|
|
this.typeEntite = typeEntite;
|
|
}
|
|
|
|
public int getNombreMembres() {
|
|
return nombreMembres;
|
|
}
|
|
|
|
public void setNombreMembres(int nombreMembres) {
|
|
this.nombreMembres = nombreMembres;
|
|
}
|
|
}
|
|
|
|
public static class TypeEntite {
|
|
private String nom;
|
|
private String description;
|
|
private int nombre;
|
|
private int pourcentage;
|
|
private String icone;
|
|
private String couleurBg;
|
|
private String couleurTexte;
|
|
|
|
// Getters et setters
|
|
public String getNom() {
|
|
return nom;
|
|
}
|
|
|
|
public void setNom(String nom) {
|
|
this.nom = nom;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public int getNombre() {
|
|
return nombre;
|
|
}
|
|
|
|
public void setNombre(int nombre) {
|
|
this.nombre = nombre;
|
|
}
|
|
|
|
public int getPourcentage() {
|
|
return pourcentage;
|
|
}
|
|
|
|
public void setPourcentage(int pourcentage) {
|
|
this.pourcentage = pourcentage;
|
|
}
|
|
|
|
public String getIcone() {
|
|
return icone;
|
|
}
|
|
|
|
public void setIcone(String icone) {
|
|
this.icone = icone;
|
|
}
|
|
|
|
public String getCouleurBg() {
|
|
return couleurBg;
|
|
}
|
|
|
|
public void setCouleurBg(String couleurBg) {
|
|
this.couleurBg = couleurBg;
|
|
}
|
|
|
|
public String getCouleurTexte() {
|
|
return couleurTexte;
|
|
}
|
|
|
|
public void setCouleurTexte(String couleurTexte) {
|
|
this.couleurTexte = couleurTexte;
|
|
}
|
|
}
|
|
|
|
public static class Activite {
|
|
private UUID id;
|
|
private String description;
|
|
private String entite;
|
|
private String date;
|
|
private String icone;
|
|
private String utilisateur;
|
|
private String details;
|
|
|
|
// Getters et setters
|
|
public UUID getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public String getEntite() {
|
|
return entite;
|
|
}
|
|
|
|
public void setEntite(String entite) {
|
|
this.entite = entite;
|
|
}
|
|
|
|
public String getDate() {
|
|
return date;
|
|
}
|
|
|
|
public void setDate(String date) {
|
|
this.date = date;
|
|
}
|
|
|
|
public String getIcone() {
|
|
return icone;
|
|
}
|
|
|
|
public void setIcone(String icone) {
|
|
this.icone = icone;
|
|
}
|
|
|
|
public String getUtilisateur() {
|
|
return utilisateur;
|
|
}
|
|
|
|
public void setUtilisateur(String utilisateur) {
|
|
this.utilisateur = utilisateur;
|
|
}
|
|
|
|
public String getDetails() {
|
|
return details;
|
|
}
|
|
|
|
public void setDetails(String details) {
|
|
this.details = details;
|
|
}
|
|
}
|
|
|
|
public static class EvolutionMois {
|
|
private String periode;
|
|
private int valeur;
|
|
private int hauteur;
|
|
|
|
// Getters et setters
|
|
public String getPeriode() {
|
|
return periode;
|
|
}
|
|
|
|
public void setPeriode(String periode) {
|
|
this.periode = periode;
|
|
}
|
|
|
|
public int getValeur() {
|
|
return valeur;
|
|
}
|
|
|
|
public void setValeur(int valeur) {
|
|
this.valeur = valeur;
|
|
}
|
|
|
|
public int getHauteur() {
|
|
return hauteur;
|
|
}
|
|
|
|
public void setHauteur(int hauteur) {
|
|
this.hauteur = hauteur;
|
|
}
|
|
}
|
|
|
|
public static class RevenusData {
|
|
private String mensuel;
|
|
private String annuel;
|
|
private String croissance;
|
|
private String moyenne;
|
|
private String croissanceMensuelle;
|
|
private String objectifAnnuel;
|
|
private String derniereMAJ;
|
|
private List<MoisRevenu> evolution = new ArrayList<>();
|
|
|
|
// Getters et setters
|
|
public String getMensuel() {
|
|
return mensuel;
|
|
}
|
|
|
|
public void setMensuel(String mensuel) {
|
|
this.mensuel = mensuel;
|
|
}
|
|
|
|
public String getAnnuel() {
|
|
return annuel;
|
|
}
|
|
|
|
public void setAnnuel(String annuel) {
|
|
this.annuel = annuel;
|
|
}
|
|
|
|
public String getCroissance() {
|
|
return croissance;
|
|
}
|
|
|
|
public void setCroissance(String croissance) {
|
|
this.croissance = croissance;
|
|
}
|
|
|
|
public String getMoyenne() {
|
|
return moyenne;
|
|
}
|
|
|
|
public void setMoyenne(String moyenne) {
|
|
this.moyenne = moyenne;
|
|
}
|
|
|
|
public String getCroissanceMensuelle() {
|
|
return croissanceMensuelle;
|
|
}
|
|
|
|
public void setCroissanceMensuelle(String croissanceMensuelle) {
|
|
this.croissanceMensuelle = croissanceMensuelle;
|
|
}
|
|
|
|
public String getObjectifAnnuel() {
|
|
return objectifAnnuel;
|
|
}
|
|
|
|
public void setObjectifAnnuel(String objectifAnnuel) {
|
|
this.objectifAnnuel = objectifAnnuel;
|
|
}
|
|
|
|
public String getDerniereMAJ() {
|
|
return derniereMAJ;
|
|
}
|
|
|
|
public void setDerniereMAJ(String derniereMAJ) {
|
|
this.derniereMAJ = derniereMAJ;
|
|
}
|
|
|
|
public List<MoisRevenu> getEvolution() {
|
|
return evolution;
|
|
}
|
|
|
|
public void setEvolution(List<MoisRevenu> evolution) {
|
|
this.evolution = evolution;
|
|
}
|
|
}
|
|
|
|
public static class MoisRevenu {
|
|
private String nom;
|
|
private int hauteur;
|
|
private String valeur;
|
|
|
|
// Getters et setters
|
|
public String getNom() {
|
|
return nom;
|
|
}
|
|
|
|
public void setNom(String nom) {
|
|
this.nom = nom;
|
|
}
|
|
|
|
public int getHauteur() {
|
|
return hauteur;
|
|
}
|
|
|
|
public void setHauteur(int hauteur) {
|
|
this.hauteur = hauteur;
|
|
}
|
|
|
|
public String getValeur() {
|
|
return valeur;
|
|
}
|
|
|
|
public void setValeur(String valeur) {
|
|
this.valeur = valeur;
|
|
}
|
|
}
|
|
}
|