-
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.
- Construction de l'étape 2 de lecture de la ligne du fichier
- Loading branch information
1 parent
5f3fcbd
commit 1841b55
Showing
6 changed files
with
119 additions
and
8 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
45 changes: 45 additions & 0 deletions
45
batch/src/main/java/fr/abes/item/batch/traitement/model/LigneFichierDtoSuppr.java
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,45 @@ | ||
package fr.abes.item.batch.traitement.model; | ||
|
||
import fr.abes.item.core.constant.TYPE_DEMANDE; | ||
import fr.abes.item.core.entities.item.Demande; | ||
import fr.abes.item.core.entities.item.LigneFichierSupp; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@NoArgsConstructor | ||
public class LigneFichierDtoSuppr extends LigneFichierDto implements ILigneFichierDtoService { | ||
@Getter @Setter | ||
private String requete; | ||
@Getter @Setter | ||
private String ppn; | ||
@Getter @Setter | ||
private String rcr; | ||
@Getter @Setter | ||
private String epn; | ||
|
||
public LigneFichierDtoSuppr(LigneFichierSupp ligneFichierSupp){ | ||
super(ligneFichierSupp.getNumLigneFichier(), ligneFichierSupp.getTraitee(), ligneFichierSupp.getPosition(), ligneFichierSupp.getId(), ligneFichierSupp.getRetourSudoc(), ligneFichierSupp.getValeurZone()); | ||
this.epn = ligneFichierSupp.getEpn(); | ||
this.ppn = ligneFichierSupp.getPpn(); | ||
this.rcr = ligneFichierSupp.getRcr(); | ||
} | ||
|
||
public LigneFichierDtoSuppr(Integer numLigneFichier, Integer traitee, Integer position, Integer refDemande, String retourSudoc, String valeurZone, String requete, String ppn, String rcr, String epn) { | ||
super(numLigneFichier, traitee, position, refDemande, retourSudoc, valeurZone); | ||
this.requete = requete; | ||
this.ppn = ppn; | ||
this.rcr = rcr; | ||
this.epn = epn; | ||
} | ||
|
||
@Override | ||
public String getValeurToWriteInFichierResultat(Demande demande, Integer nbPpnInFileResult) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public TYPE_DEMANDE getTypeDemande() { | ||
return null; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
batch/src/main/java/fr/abes/item/batch/traitement/model/LigneFichierDtoSupprMapper.java
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,24 @@ | ||
package fr.abes.item.batch.traitement.model; | ||
|
||
import fr.abes.item.core.configuration.factory.Strategy; | ||
import fr.abes.item.core.constant.TYPE_DEMANDE; | ||
import fr.abes.item.core.entities.item.DemandeSupp; | ||
import fr.abes.item.core.entities.item.LigneFichier; | ||
import fr.abes.item.core.entities.item.LigneFichierSupp; | ||
|
||
@Strategy(type = ILigneFichierDtoMapper.class, typeDemande = TYPE_DEMANDE.EXEMP) | ||
public class LigneFichierDtoSupprMapper implements ILigneFichierDtoMapper { | ||
@Override | ||
public LigneFichierSupp getLigneFichierEntity(LigneFichierDto lfd) | ||
//TODO ajuster le mapper en fonction de ce que renvoie le sudoc | ||
{ | ||
LigneFichierDtoSuppr lfdSuppr = (LigneFichierDtoSuppr) lfd; | ||
LigneFichierSupp lf = new LigneFichierSupp(); | ||
lf.setPpn(lfdSuppr.getPpn()); | ||
lf.setRcr(lfdSuppr.getRcr()); | ||
lf.setEpn(lfdSuppr.getEpn()); | ||
lf.setDemandeSupp(new DemandeSupp(lfdSuppr.getRefDemande())); | ||
lf.setTraitee(lfdSuppr.getTraitee()); | ||
return lf; | ||
} | ||
} |
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
41 changes: 41 additions & 0 deletions
41
core/src/main/java/fr/abes/item/core/entities/item/LigneFichierSupp.java
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,41 @@ | ||
package fr.abes.item.core.entities.item; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import java.io.Serializable; | ||
|
||
@Entity | ||
@Getter @Setter | ||
@NoArgsConstructor | ||
@Table(name="LIGNE_FICHIER_SUPP") | ||
public class LigneFichierSupp extends LigneFichier implements Serializable, ILigneFichier { | ||
@Column(name = "PPN") | ||
private String ppn; | ||
|
||
@Column(name = "RCR") | ||
private String rcr; | ||
|
||
@Column(name = "EPN") | ||
private String epn; | ||
|
||
@Column(name = "NB_REPONSE") | ||
private Integer nbReponse; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "REF_DEMANDE") @NotNull | ||
private DemandeSupp demandeSupp; | ||
|
||
|
||
@Override | ||
public void setEntityAfterBatch(LigneFichier ligneFichier) { | ||
//TODO revoir | ||
LigneFichierSupp ligneFichierSupp = (LigneFichierSupp)ligneFichier; | ||
this.setRetourSudoc(ligneFichierSupp.getRetourSudoc()); | ||
this.setNbReponse(ligneFichierSupp.getNbReponse()); | ||
this.setTraitee(1); | ||
} | ||
} |