rajah 10 месяцев назад
Родитель
Сommit
a6a5eb3855

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

@@ -36,7 +36,8 @@ public interface ProductionRepository extends JpaRepository<Production, Integer>
               + "p.vignette, "
               + "p.numero_version,"
               + "0 AS numero_categorie, "
-              + "0 AS ordre_presentation "
+              + "0 AS ordre_presentation, "
+              + "0 AS etat_media "
               + "FROM vote.productions AS p "
               + "INNER JOIN vote.participants AS g ON p.numero_participant = g.numero_participant "
               + "WHERE p.flag_actif IS TRUE "
@@ -64,7 +65,8 @@ public interface ProductionRepository extends JpaRepository<Production, Integer>
               + "p.vignette, "
               + "p.numero_version,"
               + "0 AS numero_categorie, "
-              + "0 AS ordre_presentation "
+              + "0 AS ordre_presentation, "
+              + "0 AS etat_media "
               + "FROM vote.productions AS p "
               + "INNER JOIN vote.participants AS g ON p.numero_participant = g.numero_participant "
               + "WHERE p.numero_production = :numeroProduction "
@@ -89,14 +91,15 @@ public interface ProductionRepository extends JpaRepository<Production, Integer>
               + "p.vignette, "
               + "p.numero_version,"
               + "s.numero_categorie, "
-              + "((c.numero_ordre * 10000) + s.numero_ordre) AS ordre_presentation "
+              + "((c.numero_ordre * 10000) + s.numero_ordre) AS ordre_presentation, "
+              + "s.flag_media AS etat_media "
               + "FROM vote.productions AS p "
               + "INNER JOIN vote.participants AS g ON p.numero_participant = g.numero_participant "
               + "INNER JOIN vote.presentations AS s ON p.numero_production = s.numero_production "
               + "INNER JOIN vote.categories AS c ON s.numero_categorie = c.numero_categorie "
               + "WHERE p.flag_actif IS TRUE "
               + "ORDER BY ordre_presentation ASC, p.titre ASC ")
-  List<ProductionShort> findLinkedWithoutArchive(); // TODO ordonner par ordre de présentation
+  List<ProductionShort> findLinkedWithoutArchive();
 
   @NativeQuery("SELECT DISTINCT " 
       + "p.numero_production, "

+ 3 - 1
src/main/java/fr/triplea/demovote/dto/ProductionShort.java

@@ -22,7 +22,8 @@ public record ProductionShort
   byte[] vignette,
   Integer numeroVersion,
   Integer numeroCategorie,
-  Integer ordrePresentation
+  Integer ordrePresentation,
+  Integer etatMedia
 ) 
 { 
   public Production toProduction() 
@@ -53,6 +54,7 @@ public record ProductionShort
     p.setVignette(vignette);
     p.setNumeroVersion(numeroVersion);
     p.setNumeroCategorie(numeroCategorie);
+    p.setEtatMedia(etatMedia);
     
     return p;
   }  

+ 7 - 1
src/main/java/fr/triplea/demovote/model/Presentation.java

@@ -37,7 +37,10 @@ public class Presentation
   private Production production;
   
   private Integer numeroOrdre;
-  
+ 
+  @Column(name = "flag_media")
+  private Integer etatMedia = 0; // 0 = non traité, 1 = média en place pour présentation, 2 = média externe (trop gros ou exécutable à lancer sur machine spécifique)
+
   @Column(name="media_mime", length = 128)
   private String mediaMime = "application/octet-stream";
 
@@ -65,6 +68,9 @@ public class Presentation
   public void setNumeroOrdre(int n) { this.numeroOrdre = Integer.valueOf(n); }
   public Integer getNumeroOrdre() { return this.numeroOrdre; }
   
+  public void setEtatMedia(int n) { this.etatMedia = Integer.valueOf(n); }
+  public Integer getEtatMedia() { return this.etatMedia; }
+  
   public void setMediaMime(String str) { if (str != null) { this.mediaMime = StringUtils.truncate(str, 128); } }
   public String getMediaMime() { return this.mediaMime; }
 

+ 8 - 1
src/main/java/fr/triplea/demovote/model/Production.java

@@ -213,7 +213,7 @@ public class Production
 
   public void setVignette(String v) 
   { 
-    // TODO : vignette par défaut, selon le type
+    // TODO vignette par défaut, selon le type
     
     String[] s;
     
@@ -254,6 +254,13 @@ public class Production
   public void setNumeroCategorie(int n) { this.numeroCategorie = Integer.valueOf(n); }
   @Transient
   public Integer getNumeroCategorie() { return this.numeroCategorie; }
+  
+  @Transient
+  private Integer etatMedia = 0;
+  @Transient
+  public void setEtatMedia(int n) { this.etatMedia = Integer.valueOf(n); }
+  @Transient
+  public Integer getEtatMedia() { return this.etatMedia; }
 
 
   @Override

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

@@ -51,7 +51,7 @@ public class PresentationController
 
   // TODO préparer média à partir de l'archive uploadée, pour les présentation + flag "préparé" sur chaque production présentée
   // TODO version diaporama pour affichage sur écran de régie
-  // TODO raccourci 'ouvrir / fermer / calculer' les votes
+  // TODO raccourci ouvrir/fermer/calculer les votes
   
   @Autowired
   private PresentationRepository presentationRepository;

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

@@ -88,7 +88,7 @@ public class ProductionController
   @ResponseBody
   public ResponseEntity<Resource> getFile(@PathVariable int id, final Authentication authentication) 
   {
-    // TODO : après résultats affichés, download autorisé pour tous
+    // TODO après résultats affichés, download autorisé pour tous
     
     Production p = productionRepository.findById(id);