Skip to content

Commit

Permalink
Merge branch 'develop' into saas
Browse files Browse the repository at this point in the history
  • Loading branch information
khergalant committed Nov 13, 2024
2 parents d5133cd + 0590761 commit 100a39a
Show file tree
Hide file tree
Showing 25 changed files with 326 additions and 148 deletions.
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<cglib.version>3.2.5</cglib.version>

<!-- Vaadin -->
<vaadin.version>7.7.43</vaadin.version>
<vaadin.version>7.7.44</vaadin.version>
<vaadin.spring.version>1.0.2</vaadin.spring.version>

<!-- Spring -->
Expand All @@ -67,14 +67,14 @@
<xdocreport.version>2.0.1</xdocreport.version>
<jett.version>0.10.0</jett.version>
<pdfbox.version>2.0.25</pdfbox.version>
<bouncycastle.version>1.77</bouncycastle.version>
<bouncycastle.version>1.78.1</bouncycastle.version>
<opencmis.version>1.1.0</opencmis.version>
<tika.version>2.9.1</tika.version>
<opencsv.version>5.3</opencsv.version>
<clamav-client.version>1.0.1</clamav-client.version>

<!-- Base de données et utilitaires -->
<mysql.connector.version>8.0.32</mysql.connector.version>
<mysql.connector.version>8.4.0</mysql.connector.version>
<ojdbc8.version>19.3.0.0</ojdbc8.version>
<eclipselink.version>2.7.3</eclipselink.version>
<javax.persistence-api.version>2.2</javax.persistence-api.version>
Expand All @@ -85,13 +85,13 @@
<flywaydb.version>4.2.0</flywaydb.version>

<!-- WS Apogee -->
<apo.ws.version>6.50.01</apo.ws.version>
<apo.ws.prod.version>6.50.01</apo.ws.prod.version>
<apo.ws-utils.version>1.0.3</apo.ws-utils.version>
<apo.ws.prod.version>6.50.30</apo.ws.prod.version>
<apo.ws.version>6.50.30</apo.ws.version>

<!-- Outils -->
<commons.beanutils.version>1.9.4</commons.beanutils.version>
<commons-io.version>2.8.0</commons-io.version>
<commons-io.version>2.17.0</commons-io.version>
<tools.univlorraine.version>1.5.11</tools.univlorraine.version>
<lombok.version>1.18.6</lombok.version>
<jackson.version>2.15.4</jackson.version>
Expand Down
45 changes: 35 additions & 10 deletions src/main/java/fr/univlorraine/ecandidat/config/LaunchAppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
import fr.univlorraine.ecandidat.controllers.LockCandidatController;
import fr.univlorraine.ecandidat.controllers.NomenclatureController;
import fr.univlorraine.ecandidat.entities.ecandidat.Adresse;
import fr.univlorraine.ecandidat.entities.ecandidat.Adresse_;
import fr.univlorraine.ecandidat.entities.ecandidat.Candidat;
import fr.univlorraine.ecandidat.entities.ecandidat.Candidat_;
import fr.univlorraine.ecandidat.entities.ecandidat.CompteMinima;
import fr.univlorraine.ecandidat.entities.ecandidat.CompteMinima_;
import fr.univlorraine.ecandidat.services.siscol.SiScolGenericService;
import fr.univlorraine.ecandidat.utils.ConstanteUtils;
import fr.univlorraine.ecandidat.utils.MethodUtils;
Expand Down Expand Up @@ -186,27 +191,47 @@ public void preprocessTemplate() {
/** Modifie la valeur de certaines annotations */
public void preprocessAnnotations() {
try {
final int size = siScolService.getSizeFieldAdresse();
if (size != ConstanteUtils.SIZE_FIELD_ADRESSE_DEFAULT) {
logger.info("Modification des annotations adresse, size = " + size);
changeAnnotationAdresse(Adresse.FIELD_ADR1, size);
changeAnnotationAdresse(Adresse.FIELD_ADR2, size);
changeAnnotationAdresse(Adresse.FIELD_ADR3, size);
changeAnnotationAdresse(Adresse.FIELD_LIB_COM_ETR, size);
/* Adresse */
final int sizeChampsAdr = siScolService.getSizeFieldAdresse();
if (sizeChampsAdr != ConstanteUtils.SIZE_FIELD_ADRESSE_DEFAULT) {
logger.info("Modification des annotations adresse, size = " + sizeChampsAdr);
changeAnnotation(Adresse.class, Adresse_.ADR1_ADR, sizeChampsAdr);
changeAnnotation(Adresse.class, Adresse_.ADR2_ADR, sizeChampsAdr);
changeAnnotation(Adresse.class, Adresse_.ADR3_ADR, sizeChampsAdr);
changeAnnotation(Adresse.class, Adresse_.LIB_COM_ETR_ADR, sizeChampsAdr);
}

/* Noms */
final int sizeChampsNom = siScolService.getSizeFieldNom();
if (sizeChampsNom != ConstanteUtils.SIZE_FIELD_NOM_DEFAULT) {
logger.info("Modification des annotations noms, size = " + sizeChampsNom);
changeAnnotation(CompteMinima.class, CompteMinima_.NOM_CPT_MIN, sizeChampsNom);
changeAnnotation(Candidat.class, Candidat_.NOM_PAT_CANDIDAT, sizeChampsNom);
changeAnnotation(Candidat.class, Candidat_.NOM_USU_CANDIDAT, sizeChampsNom);
}

/* Prenoms */
final int sizeChampsPrenom = siScolService.getSizeFieldPrenom();
if (sizeChampsPrenom != ConstanteUtils.SIZE_FIELD_PRENOM_DEFAULT) {
logger.info("Modification des annotations prenom, size = " + sizeChampsPrenom);
changeAnnotation(CompteMinima.class, CompteMinima_.PRENOM_CPT_MIN, sizeChampsPrenom);
changeAnnotation(Candidat.class, Candidat_.PRENOM_CANDIDAT, sizeChampsPrenom);
changeAnnotation(Candidat.class, Candidat_.AUTRE_PREN_CANDIDAT, sizeChampsPrenom);
}

} catch (final Exception e) {
logger.warn("Erreur a la modification des annotations", e);
}
}

/**
* Modifie la taille des champs d'adresse
* Modifie la taille des champs
* @param fieldName
* @throws Exception
*/
private void changeAnnotationAdresse(final String fieldName, final int size) throws Exception {
private void changeAnnotation(final Class<?> clazz, final String fieldName, final int size) throws Exception {
try {
final Field field = Adresse.class.getDeclaredField(fieldName);
final Field field = clazz.getDeclaredField(fieldName);

final Column fieldAnnotationColumn = field.getAnnotation(Column.class);
MethodUtils.changeAnnotationValue(fieldAnnotationColumn, "length", size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,12 @@ public List<SimpleTablePresentation> getInformationsCandidature(final Candidatur
applicationContext.getMessage("candidature." + ConstanteUtils.CANDIDATURE_OPI, null, UI.getCurrent().getLocale()),
opi));
}

/* Regime */
if (candidature.getSiScolRegime() != null) {
liste.add(new SimpleTablePresentation("candidature." + ConstanteUtils.CANDIDATURE_REGIME,
applicationContext.getMessage("candidature." + ConstanteUtils.CANDIDATURE_REGIME, null, UI.getCurrent().getLocale()),
candidature.getSiScolRegime().getLibRgi()));
}
/* Exoneration */
if (candidature.getSiScolCatExoExt() != null) {
liste.add(new SimpleTablePresentation("candidature." + ConstanteUtils.CANDIDATURE_EXO,
Expand Down Expand Up @@ -1349,6 +1354,7 @@ private ByteArrayInputStream generateDossier(final Candidature candidature,
adresseController.getLibelleAdresse(commission.getAdresse(), "\n"),
commission.getMailComm(),
commission.getTelComm(),
commission.getUrlComm(),
formation,
MethodUtils.formatToExportHtml(i18nController.getI18nTraduction(commission.getI18nCommentRetourComm())));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,32 @@ public boolean editDatRetour(final List<Candidature> listeCandidature, final Can
return true;
}

/**
* @param listeCandidature
* @param bean
* @return modifie les infos de montant des droits
*/
public boolean editRegime(final List<Candidature> listeCandidature, final Candidature bean) {
if (checkLockListCandidature(listeCandidature)) {
return false;
}
final String user = userController.getCurrentUserLogin();

for (Candidature candidature : listeCandidature) {
Assert.notNull(candidature, applicationContext.getMessage("assert.notNull", null, UI.getCurrent().getLocale()));
/* Verrou */
if (!lockCandidatController.getLockOrNotifyCandidature(candidature)) {
continue;
}
candidature.setSiScolRegime(bean.getSiScolRegime());
candidature.setUserModCand(user);
candidature = candidatureRepository.save(candidature);
}
Notification.show(applicationContext.getMessage("candidature.action.siScolRegime.notif", null, UI.getCurrent().getLocale()),
Type.TRAY_NOTIFICATION);
return true;
}

/**
* @param listeCandidature
* @param bean
Expand Down Expand Up @@ -1177,6 +1203,9 @@ private OnDemandFile generateExport(final String code,
case "dtNaissHide":
listValeur.add(MethodUtils.formatDate(candidature.getCandidat().getDatNaissCandidat(), formatterDate));
break;
case "villeNaissHide":
listValeur.add(candidature.getCandidat().getLibVilleNaissCandidat());
break;
case "nationaliteHide":
listValeur.add(MethodUtils.formatToExport(candidat.getSiScolPaysNat().getLicPay()));
break;
Expand Down Expand Up @@ -1338,6 +1367,9 @@ private OnDemandFile generateExport(final String code,
case "datNewRetourHide":
listValeur.add(MethodUtils.formatToExport(MethodUtils.formatDate(candidature.getDatNewRetourCand(), formatterDate)));
break;
case "regimeHide":
listValeur.add(MethodUtils.formatToExport(candidature.getSiScolRegime() != null ? candidature.getSiScolRegime().getDisplayLibelle() : null));
break;
case "catExoHide":
listValeur.add(MethodUtils.formatToExport(candidature.getSiScolCatExoExt() != null ? candidature.getSiScolCatExoExt().getDisplayLibelle() : null));
break;
Expand All @@ -1359,6 +1391,9 @@ private OnDemandFile generateExport(final String code,
case "userAnnulHide":
listValeur.add(MethodUtils.formatToExport(candidature.getUserAnnulCand()));
break;
case "questionReponseHide":
listValeur.add(formatLongCellSize(candidature.getQuestionCands().stream().map(e -> e.getQuestion().getLibQuestion() + " : " + e.getReponseQuestionCand()).collect(Collectors.joining(" / "))));
break;
case "postItHide":
listValeur.add(formatLongCellSize(getPostIt(candidature).stream().map(e -> e.getMessagePostIt()).collect(Collectors.joining(" / "))));
break;
Expand Down
Loading

0 comments on commit 100a39a

Please sign in to comment.