Browse Source

dev en cours

rajah 6 tháng trước cách đây
mục cha
commit
8898cf9d28

+ 1 - 5
src/main/java/fr/triplea/demovote/CreateDefaultValues.java

@@ -99,11 +99,7 @@ public class CreateDefaultValues implements ApplicationListener<ContextRefreshed
     
     addVariableIfMissing("Navigation", "LISTE_PARTICIPANTS_MAX", "300");
     addVariableIfMissing("Navigation", "LISTE_VARIABLES_MAX", "100");
-    
-    addVariableIfMissing("Catégories", "ETAPE1_DEADLINE_EFFECTUEE", "TRUE");
-    addVariableIfMissing("Catégories", "ETAPE2_SCRUTIN_CLOTURE", "TRUE");
-    addVariableIfMissing("Catégories", "ETAPE3_RESULTATS_DEMASQUES", "TRUE");
-    
+     
     addVariableIfMissing("Résultats", "NOMBRE_CHOIX", "3");
     addVariableIfMissing("Résultats", "POINTS_POSITION_01", "3");
     addVariableIfMissing("Résultats", "POINTS_POSITION_02", "2");

+ 3 - 0
src/main/java/fr/triplea/demovote/dao/BulletinRepository.java

@@ -50,6 +50,9 @@ public interface BulletinRepository extends JpaRepository<Bulletin, Integer>
       + "FROM vote.bulletins AS u "
       + "WHERE u.numero_categorie = :categorie AND u.flag_valide IS TRUE ")
   List<BulletinShort> findByCategorie(@Param("categorie") int cat_id);
+  
+  @NativeQuery("SELECT DISTINCT COUNT(u.*) AS nombre FROM vote.bulletins AS u WHERE u.numero_categorie = :categorie AND u.flag_valide IS TRUE ")
+  Integer countByCategorie(@Param("categorie") int cat_id);
 
   @NativeQuery("SELECT DISTINCT "
              + " u.* "

+ 4 - 2
src/main/java/fr/triplea/demovote/dao/ProductionRepository.java

@@ -190,13 +190,15 @@ public interface ProductionRepository extends JpaRepository<Production, Integer>
       + "p.auteurs, "
       + "p.groupes, "
       + "p.plateforme, "
+      + "p.informations_privees, "
+      + "CONCAT(g.pseudonyme, ' = ', g.nom, ' ', g.prenom) AS nom_gestionnaire, "
       + "0 AS nombre_points,"
       + "0 AS nombre_first "
       + "FROM vote.productions AS p "
       + "INNER JOIN vote.presentations AS s ON p.numero_production = s.numero_production "
+      + "INNER JOIN vote.participants AS g ON p.numero_participant = g.numero_participant "
       + "WHERE s.numero_categorie = :numero "
-      + "  AND p.flag_actif IS TRUE "
-      + "ORDER BY s.numero_ordre ASC, p.titre ASC ")
+      + "  AND p.flag_actif IS TRUE ")
   List<ProductionVote> findForCalculation(@Param("numero") int numeroCategorie);
  
   @Override

+ 19 - 7
src/main/java/fr/triplea/demovote/dto/ProductionVote.java

@@ -3,16 +3,18 @@ package fr.triplea.demovote.dto;
 public class ProductionVote 
 { 
   
-  Integer numeroProduction;
+  int numeroProduction;
   String type;
   String titre;
   String auteurs;
   String groupes;
   String plateforme;
-  Integer nombrePoints;
-  Integer nombreFirst;
+  String informationsPrivees;
+  String nomGestionnaire;
+  int nombrePoints;
+  int nombreFirst;
   
-  public ProductionVote(Integer numeroProduction, String type, String titre, String auteurs, String groupes, String plateforme, Integer nombrePoints, Integer nombreFirst) 
+  public ProductionVote(int numeroProduction, String type, String titre, String auteurs, String groupes, String plateforme, String informationsPrivees, String nomGestionnaire, int nombrePoints, int nombreFirst) 
   {
     this.numeroProduction = numeroProduction;
     this.type = type;
@@ -20,12 +22,14 @@ public class ProductionVote
     this.auteurs = auteurs;
     this.groupes = groupes;
     this.plateforme = plateforme;
+    this.informationsPrivees = informationsPrivees;
+    this.nomGestionnaire = nomGestionnaire;
     this.nombrePoints = nombrePoints;
     this.nombreFirst = nombreFirst;
   }
 
   public void setNumeroProduction(Integer numeroProduction) { this.numeroProduction = numeroProduction; }
-  public Integer getNumeroProduction() { return numeroProduction; }
+  public int getNumeroProduction() { return numeroProduction; }
   
   public void setType(String type) { this.type = type; }
   public String getType() { return type; }
@@ -41,13 +45,21 @@ public class ProductionVote
 
   public void setPlateforme(String plateforme) { this.plateforme = plateforme; }
   public String getPlateforme() { return plateforme; }
+  
+  public void setInformationsPrivees(String informationsPrivees) { this.informationsPrivees = informationsPrivees; }
+  public String getInformationsPrivees() { return informationsPrivees; }
+
+  public void setNomGestionnaire(String nomGestionnaire) { this.nomGestionnaire = nomGestionnaire; }
+  public String getNomGestionnaire() { return nomGestionnaire; }
 
   public void setNombrePoints(Integer nombrePoints) { this.nombrePoints = nombrePoints; }
-  public Integer getNombrePoints() { return nombrePoints; }
+  public int getNombrePoints() { return nombrePoints; }
   public void addPoints(Integer points) { this.nombrePoints += points; }
 
   public void setNombreFirst(Integer nombreFirst) { this.nombreFirst = nombreFirst; }
-  public Integer getNombreFirst() { return nombreFirst; }
+  public int getNombreFirst() { return nombreFirst; }
   public void setFirst() { this.nombreFirst++; }
   
+  public int getValue() { return ((this.nombrePoints * 10000) + this.nombreFirst); }
+  
 }

+ 67 - 118
src/main/java/fr/triplea/demovote/web/controller/BulletinController.java

@@ -2,6 +2,8 @@ package fr.triplea.demovote.web.controller;
 
 import java.awt.Color;
 import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
@@ -21,6 +23,7 @@ import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.core.Authentication;
+import org.springframework.util.StreamUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -41,7 +44,6 @@ import fr.triplea.demovote.dao.VariableRepository;
 import fr.triplea.demovote.dto.BulletinShort;
 import fr.triplea.demovote.dto.MessagesTransfer;
 import fr.triplea.demovote.dto.ProductionChoice;
-import fr.triplea.demovote.dto.ProductionShort;
 import fr.triplea.demovote.dto.ProductionVote;
 import fr.triplea.demovote.model.Bulletin;
 import fr.triplea.demovote.model.Categorie;
@@ -57,7 +59,7 @@ public class BulletinController
   //@SuppressWarnings("unused") 
   private static final Logger LOG = LoggerFactory.getLogger(BulletinController.class);
 
-  // TODO : page des résultats, résultats PDF pour toutes les catégories + HTML par catégorie
+  // TODO : page des résultats
 
   @Autowired
   private VariableRepository variableRepository;
@@ -489,10 +491,8 @@ public class BulletinController
     Locale locale = localeResolver.resolveLocale(request);
 
     List<Categorie> categories = categorieRepository.findAll(0, true);
-    
-    List<ProductionShort> productions = productionRepository.findLinkedWithoutArchive();
-   
-    if ((categories != null) && (productions != null)) 
+       
+    if ((categories != null)) 
     { 
       ByteArrayOutputStream baos = new ByteArrayOutputStream();
       
@@ -507,31 +507,36 @@ public class BulletinController
 
         PDRectangle A4_paysage = new PDRectangle(297 * POINTS_PER_MM, 210 * POINTS_PER_MM);
         
-        Table.TableBuilder tb = Table.builder().addColumnsOfWidth(20f, 100f, 100f, 100f, 105f, 190f, 190f).padding(4);
+        Table.TableBuilder tb = Table.builder().addColumnsOfWidth(40f, 100f, 50f, 50f, 100f, 100f, 100f, 105f, 160f).padding(4);
 
         for (Categorie categorie: categories)
         {
           if (categorie.isAvailable())
           {
-            tb.addRow(createTitleRow(categorie.getLibelle()));
+            int nombreVotants = bulletinRepository.countByCategorie(categorie.getNumeroCategorie());
+
+            tb.addRow(createTitleRow(categorie.getLibelle() + " : " + nombreVotants + " " + messageSource.getMessage("show.pdf.votes", null, locale)));
             tb.addRow(createHeaderRow(locale));
 
-            int nombre = 0;
-            
-            if ((productions.size() > 0)) 
-            { 
-              for (ProductionShort production: productions) 
+            List<ProductionVote> productions = bulletinService.decompterVotes(categorie.getNumeroCategorie());
+
+            if (productions != null)
+            {
+              if ((productions.size() > 0)) 
               { 
-                if (production.numeroCategorie() == categorie.getNumeroCategorie())
-                {
-                  nombre++;
-                  
-                  tb.addRow(createProductionRow(production, nombre));
-                }
+                int position = 1;
+                int place = 1;
+
+                for (int i = 0; i < productions.size(); i++) 
+                { 
+                  if (i > 0) { if (productions.get(i).getValue() != productions.get(i - 1).getValue()) { position = place; } } else { position = place; }
+                  tb.addRow(createProductionRow(productions.get(i), position));
+                  place++;
+                } 
               } 
-            } 
-            
-            tb.addRow(createTitleRow(categorie.getLibelle() + " : " + nombre + " " + messageSource.getMessage("show.pdf.productions", null, locale)));
+            }
+                        
+            tb.addRow(createTitleRow(categorie.getLibelle() + " : " + productions.size() + " " + messageSource.getMessage("show.pdf.productions", null, locale)));
             tb.addRow(createEmptyRow());
            }
         }
@@ -560,7 +565,7 @@ public class BulletinController
       
       return ResponseEntity
               .ok()
-              .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"presentations.pdf\"")
+              .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"resultats.pdf\"")
               .header(HttpHeaders.CONTENT_LENGTH, "" + binaire.length)
               .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_PDF.toString())
               .body(r); 
@@ -571,24 +576,26 @@ public class BulletinController
   private Row createTitleRow(String str) 
   {
     return Row.builder()
-              .add(TextCell.builder().text(str).colSpan(7).fontSize(10).backgroundColor(Color.WHITE).horizontalAlignment(HorizontalAlignment.LEFT).borderWidth(0.1f).build())
+              .add(TextCell.builder().text(str).colSpan(9).fontSize(10).backgroundColor(Color.WHITE).horizontalAlignment(HorizontalAlignment.LEFT).borderWidth(0.1f).build())
               .build();
   }
   private Row createEmptyRow() 
   {
     return Row.builder()
-              .add(TextCell.builder().text(" ").colSpan(7).fontSize(10).backgroundColor(Color.WHITE).horizontalAlignment(HorizontalAlignment.LEFT).borderWidth(0).build())
+              .add(TextCell.builder().text(" ").colSpan(9).fontSize(10).backgroundColor(Color.WHITE).horizontalAlignment(HorizontalAlignment.LEFT).borderWidth(0).build())
               .build();
   }
   private Row createHeaderRow(Locale locale) 
   {
     return Row.builder()
-              .add(createHeaderCell(""))
+              .add(createHeaderCell(messageSource.getMessage("show.pdf.position", null, locale)))
               .add(createHeaderCell(messageSource.getMessage("show.pdf.title", null, locale)))
+              .add(createHeaderCell(messageSource.getMessage("show.pdf.number.points", null, locale)))
+              .add(createHeaderCell(messageSource.getMessage("show.pdf.number.firsts", null, locale)))
               .add(createHeaderCell(messageSource.getMessage("show.pdf.authors", null, locale)))
               .add(createHeaderCell(messageSource.getMessage("show.pdf.groups", null, locale)))
+              .add(createHeaderCell(messageSource.getMessage("show.pdf.plateform", null, locale)))
               .add(createHeaderCell(messageSource.getMessage("show.pdf.manager", null, locale)))
-              .add(createHeaderCell(messageSource.getMessage("show.pdf.comments", null, locale)))
               .add(createHeaderCell(messageSource.getMessage("show.pdf.private", null, locale)))
               .build();
   }
@@ -603,19 +610,21 @@ public class BulletinController
                    .fontSize(8)
                    .build();
   }
-  private Row createProductionRow(ProductionShort production, int nombre) 
+  private Row createProductionRow(ProductionVote production, int nombre) 
   {
     return Row.builder()
-              .add(createCell("#" + nombre))
-              .add(createCell(production.titre()))
-              .add(createCell(production.auteurs()))
-              .add(createCell(production.groupes()))
-              .add(createCell(production.nomGestionnaire()))
-              .add(createCell(production.commentaire()))
-              .add(createCell(production.informationsPrivees()))
+              .add(createCell("#" + nombre, 10))
+              .add(createCell(production.getTitre(), 8))
+              .add(createCell("" + production.getNombrePoints(), 10))
+              .add(createCell("" + production.getNombreFirst(), 10))
+              .add(createCell(production.getAuteurs(), 8))
+              .add(createCell(production.getGroupes(), 8))
+              .add(createCell(production.getPlateforme(), 8))
+              .add(createCell(production.getNomGestionnaire(), 8))
+              .add(createCell(production.getInformationsPrivees(), 8))
               .build();
   }
-  private TextCell createCell(String str)
+  private TextCell createCell(String str, int s)
   {
     return TextCell.builder()
                    .text(str)
@@ -623,7 +632,7 @@ public class BulletinController
                    .textColor(Color.BLACK)
                    .horizontalAlignment(HorizontalAlignment.LEFT)
                    .borderWidth(0.1f)
-                   .fontSize(8)
+                   .fontSize(s)
                    .build();
   }
 
@@ -641,7 +650,7 @@ public class BulletinController
     
     List<ProductionVote> productions = bulletinService.decompterVotes(numeroCategorie);
     
-    /*if ((categorie != null) && (presentations != null))
+    if ((categorie != null) && (productions != null))
     {
       String libelleCategorie = categorie.getLibelle();
          
@@ -657,94 +666,34 @@ public class BulletinController
       sb.append("</head>\n\n");
       sb.append("<body>\n");
 
-      sb.append("<div class=\"diapo_start\" id=\"diapo_page_0\">\n");
+      // TODO : résultats HTML par catégorie
       
-      sb.append("\t").append("<div class=\"diapo_compo\">").append(libelleCategorie).append("</div>\n");
-      sb.append("\t").append("<div class=\"diapo_range\">").append(messageSource.getMessage("show.file.starting", null, locale)).append("</div>\n");
-
-      sb.append("\t").append("<div class=\"diapo_hub\">\n");
-      sb.append("\t").append("\t").append("<button class=\"diapo_bouton\" style=\"visibility:hidden;\">&#9665;</button>\n");
-      sb.append("\t").append("\t").append("<button class=\"diapo_bouton\" onClick=\"show_next(0);\" title=\"").append(messageSource.getMessage("show.file.next", null, locale)).append("\">&#9655;</button>\n");
-      sb.append("\t").append("</div>\n");
+      sb.append("<div class=\"ranking_page\" id=\"ranking_page\">\n");
       
-      sb.append("</div>\n");
-
-      int n = 1;
+      sb.append("\t").append("<div class=\"ranking_compo\">").append(libelleCategorie).append("</div>\n");
       
-      for (int i = 0; i < presentations.size(); i++)
-      {
-        Presentation d = presentations.get(i);
-        Production p = d.getProduction();
+      int position = 1;
+      int place = 1;
 
-        sb.append("<div class=\"diapo_page\" id=\"diapo_page_" + n + "\">\n");
+      for (int i = 0; i < productions.size(); i++)
+      {
+        if (i > 0) { if (productions.get(i).getValue() != productions.get(i - 1).getValue()) { position = place; } } else { position = place; }
 
-        sb.append("\t").append("<div class=\"diapo_compo\">").append(libelleCategorie).append("</div>\n");
-        sb.append("\t").append("<div class=\"diapo_order\">").append("#").append("" + (i + 1)).append("</div>\n");
-        sb.append("\t").append("<div class=\"diapo_title\">").append(p.getTitre()).append("</div>\n");
-        sb.append("\t").append("<div class=\"diapo_authors\">").append(messageSource.getMessage("show.file.by", null, locale)).append(" ").append(p.getAuteurs()).append(" / ").append(p.getGroupes()).append("</div>\n");
-        sb.append("\t").append("<div class=\"diapo_comments\">");
-        if (p.hasPlateforme()) { sb.append(messageSource.getMessage("show.file.on", null, locale)).append(" ").append(p.getPlateforme()).append("<br/>"); }
-        sb.append(p.getCommentaire()).append("</div>\n");
+        ProductionVote p = productions.get(i);
 
-        if (d.getEtatMedia() == 1)
-        {
-          if (d.getMimeMedia().startsWith("image/"))
-          {
-            sb.append("\t").append("<div id=\"diapo_pict_").append(n).append("\" class=\"diapo_image_container\">\n");
-            sb.append("\t").append("\t").append("<div class=\"diapo_image_content\" onClick=\"pict_hide(").append(n).append(");\"><img src=\"").append(d.getDataMediaAsString()).append("\" alt=\"\" class=\"diapo_image\" /></div>\n");
-            sb.append("\t").append("</div>\n");
-          }
-          else if (d.getMimeMedia().startsWith("audio/"))
-          {
-            sb.append("\t").append("<div id=\"diapo_file_").append(n).append("\" class=\"diapo_audio_container\">\n");
-            sb.append("\t").append("\t").append("<audio controls><source src=\"").append(d.getDataMediaAsString()).append("\" type=\"").append(d.getMimeMedia()).append("\" />").append("</audio>\n");
-            sb.append("\t").append("</div>\n");
-          }
-          else if (d.getMimeMedia().startsWith("video/"))
-          {
-            sb.append("\t").append("<div id=\"diapo_file_").append(n).append("\" class=\"diapo_video_container\">\n");
-            sb.append("\t").append("\t").append("<video controls width=\"480\" height=\"240\"><source src=\"").append(d.getDataMediaAsString()).append("\" type=\"").append(d.getMimeMedia()).append("\" />").append("</video>\n");
-            sb.append("\t").append("</div>\n");
-          }
-        }
+        sb.append("<div class=\"ranking_item\" id=\"diapo_item_" + i + "\">\n");
 
-        sb.append("\t").append("<div id=\"diapo_ctrl_").append(n).append("\" class=\"diapo_hub\">\n");
-        sb.append("\t").append("\t").append("<button class=\"diapo_bouton\" onClick=\"show_prev(").append(n).append(");\" title=\"").append(messageSource.getMessage("show.file.previous", null, locale)).append("\">&#9665;</button>\n");
-        sb.append("\t").append("\t").append("<button class=\"diapo_bouton\" onClick=\"show_next(").append(n).append(");\" title=\"").append(messageSource.getMessage("show.file.next", null, locale)).append("\">&#9655;</button>\n");
-        if ((d.getEtatMedia() == 1))
-        {
-          if (d.getMimeMedia().startsWith("image/"))
-          {
-            sb.append("\t").append("\t").append("<button class=\"diapo_bouton\" onClick=\"pict_open(").append(n).append(");\" title=\"").append(messageSource.getMessage("show.file.open", null, locale)).append("\">&#9713;</button>\n");
-          }
-          else
-          {
-            sb.append("\t").append("\t").append("<button class=\"diapo_bouton\" onClick=\"file_open(").append(n).append(");\" title=\"").append(messageSource.getMessage("show.file.open", null, locale)).append("\">&#9713;</button>\n");
-          }
-        }
-        else if ((d.getEtatMedia() == 2))
-        {
-          sb.append("\t").append("\t").append("<button class=\"diapo_warning\">").append(messageSource.getMessage("show.file.acknowlegded", null, locale)).append("</button>\n");
-        }
-        else
-        {
-          sb.append("\t").append("\t").append("<button class=\"diapo_alert\">").append(messageSource.getMessage("show.file.missing", null, locale)).append("</button>\n");
-        }
-        sb.append("\t").append("</div>\n");
+        sb.append("\t").append("<div class=\"ranking_order\">").append("#").append("" + position).append("</div>\n");
+        sb.append("\t").append("<div class=\"ranking_title\">").append(p.getTitre()).append("</div>\n");
+        sb.append("\t").append("<div class=\"ranking_points\">").append(p.getNombrePoints() + " / " + p.getNombreFirst()).append("</div>\n");
+        sb.append("\t").append("<div class=\"ranking_authors\">").append(messageSource.getMessage("show.file.by", null, locale)).append(" ").append(p.getAuteurs()).append(" / ").append(p.getGroupes()).append("</div>\n");
+        sb.append("\t").append("<div class=\"ranking_plateform\">").append(messageSource.getMessage("show.file.on", null, locale)).append(" ").append(p.getPlateforme()).append("</div>\n");
 
         sb.append("</div>\n");
-        n++;
+        
+        place++;
       }
-      
-      sb.append("<div class=\"diapo_page\" id=\"diapo_page_" + n + "\">\n");
-      
-      sb.append("\t").append("<div class=\"diapo_compo\">").append(libelleCategorie).append("</div>\n");
-      sb.append("\t").append("<div class=\"diapo_range\">").append(messageSource.getMessage("show.file.ending", null, locale)).append("</div>\n");
-
-      sb.append("\t").append("<div class=\"diapo_hub\">\n");
-      sb.append("\t").append("\t").append("<button class=\"diapo_bouton\" onClick=\"show_prev(").append(n).append(");\" title=\"").append(messageSource.getMessage("show.file.previous", null, locale)).append("\">&#9665;</button>\n");
-      sb.append("\t").append("</div>\n");
-      
+            
       sb.append("</div>\n");
 
       sb.append("<script type=\"text/javascript\">\n");
@@ -759,11 +708,11 @@ public class BulletinController
       
       return ResponseEntity
               .ok()
-              .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + libelleCategorie +".html\"")
+              .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"resultats." + libelleCategorie +".html\"")
               .header(HttpHeaders.CONTENT_LENGTH, "" + sb.length())
               .header(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_HTML.toString())
               .body(sb.toString());
-    }*/
+    }
     
     return ResponseEntity.notFound().build();
   }  

+ 1 - 1
src/main/java/fr/triplea/demovote/web/controller/PresentationController.java

@@ -364,7 +364,7 @@ public class PresentationController
       
       return ResponseEntity
               .ok()
-              .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + libelleCategorie +".html\"")
+              .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"presentation." + libelleCategorie +".html\"")
               .header(HttpHeaders.CONTENT_LENGTH, "" + sb.length())
               .header(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_HTML.toString())
               .body(sb.toString());

+ 7 - 19
src/main/java/fr/triplea/demovote/web/service/BulletinService.java

@@ -11,7 +11,6 @@ import fr.triplea.demovote.dao.ProductionRepository;
 import fr.triplea.demovote.dao.VariableRepository;
 import fr.triplea.demovote.dto.BulletinShort;
 import fr.triplea.demovote.dto.ProductionVote;
-import jakarta.annotation.PostConstruct;
 
 @Service
 public class BulletinService 
@@ -37,12 +36,13 @@ public class BulletinService
   int points_position_09 = 0;
   int points_position_10 = 0;
   
-  boolean init = false;
-  
-  @PostConstruct
-  public void init()
+  public List<ProductionVote> decompterVotes(int numeroCategorie)
   {
-    if (init == false)
+    List<BulletinShort> bulletins = bulletinRepository.findByCategorie(numeroCategorie);
+    
+    List<ProductionVote> productions = productionRepository.findForCalculation(numeroCategorie);
+    
+    if ((bulletins != null) && (productions != null))
     {
       points_position_01 = Integer.parseInt(variableRepository.findByTypeAndCode("Résultats", "POINTS_POSITION_01"));
       points_position_02 = Integer.parseInt(variableRepository.findByTypeAndCode("Résultats", "POINTS_POSITION_02"));
@@ -55,18 +55,6 @@ public class BulletinService
       points_position_09 = Integer.parseInt(variableRepository.findByTypeAndCode("Résultats", "POINTS_POSITION_09"));
       points_position_10 = Integer.parseInt(variableRepository.findByTypeAndCode("Résultats", "POINTS_POSITION_10"));
 
-      init = true;
-    }
-  }
-  
-  public List<ProductionVote> decompterVotes(int numeroCategorie)
-  {
-    List<BulletinShort> bulletins = bulletinRepository.findByCategorie(numeroCategorie);
-    
-    List<ProductionVote> productions = productionRepository.findForCalculation(numeroCategorie);
-    
-    if ((bulletins != null) && (productions != null))
-    {
       if ((bulletins.size() > 0) && (productions.size() > 0))
       {
         for (int b = 0; b < bulletins.size(); b++)
@@ -90,7 +78,7 @@ public class BulletinService
           }
         }
         
-        productions.sort(Comparator.comparing(ProductionVote::getNombrePoints).thenComparing(ProductionVote::getNombreFirst));
+        productions.sort(Comparator.comparing(ProductionVote::getValue).reversed());
       }
     }
     

+ 5 - 0
src/main/resources/langs/messages_en.properties

@@ -41,10 +41,15 @@ account.password.changed=The new password was correctly registered in the databa
 show.pdf.title=Title
 show.pdf.authors=Author(s)
 show.pdf.groups=Group(s)
+show.pdf.plateform=Plateform
 show.pdf.manager=Manager
 show.pdf.comments=Comments
 show.pdf.private=Private informations
 show.pdf.productions=prod(s)
+show.pdf.position=Position
+show.pdf.number.points=Points number
+show.pdf.number.firsts=Firsts positions count
+show.pdf.votes=vote(s)
 
 show.file.loaded=The displayable media for this production is uploaded.
 show.file.acknowlegded=The displayable media for this production is known and managed externaly.

+ 5 - 0
src/main/resources/langs/messages_fr.properties

@@ -41,10 +41,15 @@ account.password.changed=Le nouveau mot de passe est bien enregistr
 show.pdf.title=Titre
 show.pdf.authors=Auteur(s)
 show.pdf.groups=Groupe(s)
+show.pdf.plateform=Plateforme
 show.pdf.manager=Gestionnaire
 show.pdf.comments=Commentaires
 show.pdf.private=Informations privées
 show.pdf.productions=production(s)
+show.pdf.position=Place
+show.pdf.number.points=Nombre de points
+show.pdf.number.firsts=Nombre de premières places
+show.pdf.votes=vote(s)
 
 show.file.loaded=Le média présentable de cette production a été chargé.
 show.file.acknowlegded=Le média présentable de cette production est géré en externe.