-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from abes-esr/develop
develop to main
- Loading branch information
Showing
19 changed files
with
377 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package fr.abes.item.core.dto; | ||
|
||
import fr.abes.item.core.entities.baseXml.LibProfile; | ||
import fr.abes.item.core.entities.item.Demande; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
@Getter | ||
@Setter | ||
public class DemandeDto { | ||
private Demande demande; | ||
|
||
private Integer nbLignes; | ||
|
||
public DemandeDto(Demande demande, Integer nbLignes) { | ||
this.demande = demande; | ||
this.nbLignes = nbLignes; | ||
} | ||
|
||
public DemandeDto(Demande demande, Long nbLignes) { | ||
this.demande = demande; | ||
this.nbLignes = Math.toIntExact(nbLignes); | ||
} | ||
|
||
public DemandeDto(Demande demande) { | ||
this.demande = demande; | ||
} | ||
|
||
public String getRcr() { | ||
return this.demande.getRcr(); | ||
} | ||
|
||
public void feedIlnAndShortname(List<LibProfile> libProfileList){ | ||
//Si l'iln de la demande est nul, on l'alimente avec la liste d'entités Libprofile récupérée précédemment | ||
if(this.demande.getIln() == null) { | ||
for (LibProfile libProfile : libProfileList) { | ||
if (Objects.equals(libProfile.getRcr(), this.demande.getRcr())) { | ||
this.demande.setIln(libProfile.getIln()); | ||
} | ||
} | ||
} | ||
//Si le shortname de la demande est nul, on l'alimente avec la liste d'entités Libprofile récupérée précédemment | ||
if (this.demande.getShortname() == null) { | ||
for (LibProfile libProfile : libProfileList) { | ||
if (libProfile.getRcr().equals(this.demande.getRcr())) { | ||
this.demande.setShortname(libProfile.getShortName()); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.