Skip to content

Commit

Permalink
Saisie du régime dans la candidature
Browse files Browse the repository at this point in the history
  • Loading branch information
khergalant committed Sep 23, 2024
1 parent 4e17d11 commit 518ff03
Show file tree
Hide file tree
Showing 16 changed files with 207 additions and 87 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<groupId>fr.univlorraine</groupId>
<artifactId>ecandidat</artifactId>
<packaging>war</packaging>
<version>2.4.6-SNAPSHOT</version>
<version>2.4.7-SNAPSHOT</version>
<name>ecandidat</name>

<properties>
Expand All @@ -42,7 +42,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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,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
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 @@ -1338,6 +1364,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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,17 @@ private void nomenclatureDroits(final Locale locale) {
applicationContext.getMessage("nomenclature.fonctionnalite.editDatRetour.lic", null, locale),
true, 21, true));

majDroitProfilFonc(profilCtrCand, null,
new DroitFonctionnalite(NomenclatureUtils.FONCTIONNALITE_GEST_REGIME,
applicationContext.getMessage("nomenclature.fonctionnalite.editRegime.lib", null, locale),
applicationContext.getMessage("nomenclature.fonctionnalite.editRegime.lic", null, locale),
true, 22, true));

majDroitProfilFonc(profilCtrCand, null,
new DroitFonctionnalite(NomenclatureUtils.FONCTIONNALITE_GEST_MONTANT,
applicationContext.getMessage("nomenclature.fonctionnalite.editMontant.lib", null, locale),
applicationContext.getMessage("nomenclature.fonctionnalite.editMontant.lic", null, locale),
true, 22, true));
true, 23, true));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ public class Candidature implements Serializable {
@NotNull
private TypeStatut typeStatut;

// bi-directional many-to-one association to TypeTraitement
@ManyToOne
@JoinColumn(name = "cod_typ_trait", nullable = false)
@NotNull
private TypeTraitement typeTraitement;

// bi-directional many-to-one association to SiScolPays
@ManyToOne
@JoinColumns({ @JoinColumn(name = "cod_cat_exo_ext", referencedColumnName = "cod_cat_exo_ext"),
Expand All @@ -195,11 +201,11 @@ public class Candidature implements Serializable {
@Digits(integer = 10, fraction = 2)
private BigDecimal mntChargeCand;

// bi-directional many-to-one association to TypeTraitement
// bi-directional many-to-one association to SiScolPays
@ManyToOne
@JoinColumn(name = "cod_typ_trait", nullable = false)
@NotNull
private TypeTraitement typeTraitement;
@JoinColumns({ @JoinColumn(name = "cod_rgi", referencedColumnName = "cod_rgi"),
@JoinColumn(name = "typ_siscol", referencedColumnName = "typ_siscol", insertable = false, updatable = false) })
private SiScolRegime siScolRegime;

/* Date de la formation lors de l'archivage */
@Convert(converter = LocalDatePersistenceConverter.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
@SuppressWarnings("serial")
public class SiScolRegime implements Serializable {

public static String DISPLAY_LIB_FIELD = "displayLibelle";

@EmbeddedId
private SiScolRegimePK id;

Expand All @@ -65,7 +67,14 @@ public class SiScolRegime implements Serializable {
* @return le libellé à afficher dans la listBox
*/
public String getGenericLibelle() {
return this.libRgi;
return this.id.getCodRgi() + "/" + this.libRgi;
}

/**
* @return le libellé à afficher dans la grid
*/
public String getDisplayLibelle() {
return "[" + this.id.getCodRgi() + "] " + this.libRgi;
}

public SiScolRegime() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,7 @@ public void creerOpiViaWS(final Candidat candidat, final Boolean isBatch) {
// donnees personnelles
donneesPersonnelles.setAdrMailOpi(candidat.getCompteMinima().getMailPersoCptMin());
donneesPersonnelles.setNumTelPorOpi(candidat.getTelPortCandidat());

/* Vérification si le régime statut est activé */
if (hasRegStu()) {
if (candidat.getSiScolRegime() != null) {
Expand Down Expand Up @@ -1571,6 +1572,10 @@ private MAJOpiVoeuDTO3 getVoeuByCandidature(final Candidature candidature) {
voeu.setComExoExt(String.valueOf(candidature.getMntChargeCand()));
}
}
/* Regime */
if (candidature.getSiScolRegime() != null) {
voeu.setCodRge(candidature.getSiScolRegime().getId().getCodRgi());
}

return voeu;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ public class ConstanteUtils {
public static final String CANDIDATURE_EXO = "exo";
public static final String CANDIDATURE_COMP_EXO = "compExo";
public static final String CANDIDATURE_MNT = "mntCharge";
public static final String CANDIDATURE_REGIME = "regime";
public static final String CANDIDATURE_ID_INS = "idIns";

/* Cursus externe */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class NomenclatureUtils {

/* Version */
public static final String VERSION_NOMENCLATURE_COD = "VERSION_NOMENCLATURE";
public static final String VERSION_NOMENCLATURE_VAL = "2.4.5.2";
public static final String VERSION_NOMENCLATURE_VAL = "2.4.7.0";
public static final String VERSION_NO_VERSION_VAL = "-";
public static final String VERSION_APPLICATION_COD = "VERSION_APPLICATION";
public static final String VERSION_DB = "VERSION_DB";
Expand Down Expand Up @@ -132,6 +132,7 @@ public class NomenclatureUtils {
public static final String FONCTIONNALITE_GEST_TAG = "GEST_TAG";
public static final String FONCTIONNALITE_GEST_DAT_CONFIRM = "GEST_DAT_CONFIRM";
public static final String FONCTIONNALITE_GEST_DAT_RETOUR = "GEST_DAT_RETOUR";
public static final String FONCTIONNALITE_GEST_REGIME = "GEST_REGIME";
public static final String FONCTIONNALITE_GEST_MONTANT = "GEST_MONTANT";

/* Fonctionnalité étendue scol centrale */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
import fr.univlorraine.ecandidat.entities.ecandidat.MotivationAvis_;
import fr.univlorraine.ecandidat.entities.ecandidat.Opi_;
import fr.univlorraine.ecandidat.entities.ecandidat.SiScolCatExoExt;
import fr.univlorraine.ecandidat.entities.ecandidat.SiScolRegime;
import fr.univlorraine.ecandidat.entities.ecandidat.Tag;
import fr.univlorraine.ecandidat.entities.ecandidat.Tag_;
import fr.univlorraine.ecandidat.entities.ecandidat.TypeDecisionCandidature;
Expand Down Expand Up @@ -147,6 +148,7 @@ public class CandidatureViewTemplate extends VerticalLayout implements Candidatu
Candidature_.datIncompletDossierCand.getName(),
Candidature_.datNewConfirmCand.getName(),
Candidature_.datNewRetourCand.getName(),
Candidature_.siScolRegime.getName() + "." + SiScolRegime.DISPLAY_LIB_FIELD,
Candidature_.siScolCatExoExt.getName() + "." + SiScolCatExoExt.DISPLAY_LIB_FIELD,
Candidature_.compExoExtCand.getName(),
Candidature_.mntChargeCand.getName(),
Expand Down Expand Up @@ -459,6 +461,10 @@ public void init(final Boolean modeModification, final String typGestionCandidat
getComboBoxCatExoExt(libFilterNull),
libFilterNull,
TypeFilter.EQUALS));
listeCbFilter.add(new ComboBoxFilterPresentation(Candidature_.siScolRegime.getName() + "." + SiScolRegime.DISPLAY_LIB_FIELD,
getComboRegime(libFilterNull),
libFilterNull,
TypeFilter.EQUALS));

/* La colonne de tag n'est plus automatiquement visibles si aucun tags en service */
final String[] fieldsOrderVisibletoUse = (listeTags.size() != 0) ? FIELDS_ORDER_VISIBLE : (String[]) ArrayUtils.removeElement(FIELDS_ORDER_VISIBLE, Candidature_.tags.getName());
Expand Down Expand Up @@ -733,8 +739,7 @@ private Candidature getCandidatureSelected() {
/** Met à jour le nombre de candidatures */
private void majNbCandidatures() {
nbCandidatureLabel
.setValue(applicationContext.getMessage("candidature.table.nombre", new Object[]
{ candidatureGrid.getContainerDataSource().getItemIds().size() }, UI.getCurrent().getLocale()));
.setValue(applicationContext.getMessage("candidature.table.nombre", new Object[] { candidatureGrid.getContainerDataSource().getItemIds().size() }, UI.getCurrent().getLocale()));
nbCandidatureLabelSelected.setValue(applicationContext.getMessage("candidature.table.nombre.select", new Object[] { getListeCandidatureSelected().size() }, UI.getCurrent().getLocale()));
}

Expand Down Expand Up @@ -871,16 +876,14 @@ private void addLegend() {
/* Ajout de la légende d'alertes SVA */
if (listeAlertesSva.size() != 0 && alertSvaDat != null && !alertSvaDat.equals(NomenclatureUtils.CAND_DAT_NO_DAT)) {
final Label labelTitleSva = new Label(
applicationContext.getMessage("alertSva.popup.title", new Object[]
{ alertSvaController.getLibelleDateSVA(parametreController.getAlertSvaDat()) }, UI.getCurrent().getLocale()));
applicationContext.getMessage("alertSva.popup.title", new Object[] { alertSvaController.getLibelleDateSVA(parametreController.getAlertSvaDat()) }, UI.getCurrent().getLocale()));
labelTitleSva.addStyleName(ValoTheme.LABEL_LARGE);
labelTitleSva.addStyleName(ValoTheme.LABEL_BOLD);
vlAlert.addComponent(labelTitleSva);

listeAlertesSva.forEach(alert -> {
vlAlert.addComponent(new Label(
getHtmlLegend(alert.getColorSva(), applicationContext.getMessage("alertSva.popup.alert", new Object[]
{ alert.getNbJourSva() }, UI.getCurrent().getLocale())),
getHtmlLegend(alert.getColorSva(), applicationContext.getMessage("alertSva.popup.alert", new Object[] { alert.getNbJourSva() }, UI.getCurrent().getLocale())),
ContentMode.HTML));
});
}
Expand Down Expand Up @@ -1029,7 +1032,17 @@ private ComboBox getComboBoxTypDec(final String libNull) {
*/
private ComboBox getComboBoxCatExoExt(final String libNull) {
final List<String> list = new ArrayList<>();
cacheController.getListeCatExoExt().stream().sorted((f1, f2) -> f2.getId().getCodCatExoExt().compareTo(f1.getId().getCodCatExoExt())).forEach(e -> list.add(e.getLibCatExoExt()));
cacheController.getListeCatExoExt().stream().sorted((f1, f2) -> f2.getId().getCodCatExoExt().compareTo(f1.getId().getCodCatExoExt())).forEach(e -> list.add(e.getGenericLibelle()));
return generateComboBox(list, libNull, null);
}

/**
* @param libNull
* @return la combo des régimes
*/
private ComboBox getComboRegime(final String libNull) {
final List<String> list = new ArrayList<>();
cacheController.getListeRegime().stream().sorted((f1, f2) -> f2.getId().getCodRgi().compareTo(f1.getId().getCodRgi())).forEach(e -> list.add(e.getLibRgi()));
return generateComboBox(list, libNull, null);
}

Expand Down
Loading

0 comments on commit 518ff03

Please sign in to comment.