Skip to content

Commit

Permalink
feat: fileIdCard
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolife999 committed Oct 8, 2023
1 parent 3dd37f8 commit 0cf606a
Show file tree
Hide file tree
Showing 24 changed files with 449 additions and 348 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public enum ColumnEnum {
, CONDITION("condition", TypeEnum.TEXT, "") // ihm_controle_regle
, DATE_INACTIF("date_inactif", TypeEnum.DATE, "") // ihm_jeuderegle
, DATE_PRODUCTION("date_production", TypeEnum.DATE, "") // ihm_jeuderegle
, DATE_INTEGRATION("date_integration", TypeEnum.TEXT, "")
, DEF_NORME("def_norme", TypeEnum.TEXT, "") // ihm_norme
, DEF_VALIDITE("def_validite", TypeEnum.TEXT, "") // ihm_norme
, DELIMITER("delimiter", TypeEnum.TEXT, "") // ihm_chargement_regle
Expand All @@ -38,6 +39,7 @@ public enum ColumnEnum {
, FORMAT("format", TypeEnum.TEXT, "") // ihm_chargement_regle
, HOST_ALLOWED("host_allowed", TypeEnum.TEXT, "") // ihm_webservice_whitelist,ihm_webservice_log
, ID("id", TypeEnum.TEXT, "") // ext_webservice_type,ext_mod_periodicite,ext_webservice_queryview,ext_export_format,ext_etat,ext_type_normage,ext_type_fichier_chargement,ext_type_controle,ext_etat_jeuderegle
, ID_SAX("id", TypeEnum.INTEGER, "") // used by sax xml loaders
, IDEP("idep", TypeEnum.TEXT, "") // ihm_user
, ID_APPLICATION("id_application", TypeEnum.TEXT, "") // ihm_webservice_whitelist,ihm_webservice_log,ihm_client
, ID_CLASSE("id_classe", TypeEnum.TEXT, "") // ihm_normage_regle,ihm_controle_regle
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import fr.insee.arc.core.dataobjects.ArcPreparedStatementBuilder;
import fr.insee.arc.core.dataobjects.ColumnEnum;
import fr.insee.arc.core.service.global.bo.ArcDateFormat;
import fr.insee.arc.core.service.global.bo.NormeFichier;
import fr.insee.arc.core.service.p2chargement.bo.FileIdCard;
import fr.insee.arc.utils.dao.UtilitaireDao;
import fr.insee.arc.utils.exception.ArcException;
import fr.insee.arc.utils.structure.GenericBean;
Expand All @@ -34,10 +34,10 @@ public static String getRegles(String tableRegle, String tablePilotage) {
return requete.toString();
}

public static String getRegles(String tableRegle, NormeFichier normeFichier) {
public static String getRegles(String tableRegle, FileIdCard fileIdCard) {
StringBuilder requete = new StringBuilder();
requete.append("\n SELECT * FROM " + tableRegle + " a WHERE ");
requete.append(conditionRegle(normeFichier));
requete.append(conditionRegle(fileIdCard));
return requete.toString();
}

Expand Down Expand Up @@ -109,13 +109,13 @@ private static String conditionRegle(String tablePilotage) {
return requete.toString();
}

private static String conditionRegle(NormeFichier normeFichier) {
private static String conditionRegle(FileIdCard fileIdCard) {
StringBuilder requete = new StringBuilder();
requete.append("\n ");
requete.append("a.id_norme='" + normeFichier.getIdNorme() + "' ");
requete.append("AND a.periodicite='" + normeFichier.getPeriodicite() + "' ");
requete.append("AND a.validite_inf<=to_date('" + normeFichier.getValidite() + "','"+ArcDateFormat.DATE_FORMAT_CONVERSION.getDatastoreFormat()+"') ");
requete.append("AND a.validite_sup>=to_date('" + normeFichier.getValidite() + "','"+ArcDateFormat.DATE_FORMAT_CONVERSION.getDatastoreFormat()+"') ");
requete.append("a.id_norme='" + fileIdCard.getIdNorme() + "' ");
requete.append("AND a.periodicite='" + fileIdCard.getPeriodicite() + "' ");
requete.append("AND a.validite_inf<=to_date('" + fileIdCard.getValidite() + "','"+ArcDateFormat.DATE_FORMAT_CONVERSION.getDatastoreFormat()+"') ");
requete.append("AND a.validite_sup>=to_date('" + fileIdCard.getValidite() + "','"+ArcDateFormat.DATE_FORMAT_CONVERSION.getDatastoreFormat()+"') ");
requete.append(";");
return requete.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import fr.insee.arc.core.service.global.ApiService;
import fr.insee.arc.core.service.global.thread.MultiThreading;
import fr.insee.arc.core.service.p1reception.provider.DirectoriesReception;
import fr.insee.arc.core.service.p2chargement.bo.Norme;
import fr.insee.arc.core.service.p2chargement.bo.NormeRules;
import fr.insee.arc.core.service.p2chargement.thread.ThreadChargementService;
import fr.insee.arc.core.util.BDParameters;
import fr.insee.arc.core.util.StaticLoggerDispatcher;
Expand Down Expand Up @@ -50,7 +50,7 @@ public ApiChargementService(String aCurrentPhase, String aEnvExecution, String a
super(aCurrentPhase, aEnvExecution, aDirectoryRoot, aNbEnr, paramBatch);
}

protected List<Norme> listeNorme;
protected List<NormeRules> listeNorme;
protected String directoryIn;

@Override
Expand All @@ -65,7 +65,7 @@ public void executer() throws ArcException {
this.directoryIn = new DirectoriesReception(this.coordinatorSandbox).getDirectoryReceptionOK() + File.separator;

// récupération des différentes normes dans la base
this.listeNorme = Norme.getNormesBase(this.connexion.getCoordinatorConnection(), this.envExecution);
this.listeNorme = NormeRules.getNormesBase(this.connexion.getCoordinatorConnection(), this.envExecution);

this.maxParallelWorkers = bdParameters.getInt(this.connexion.getCoordinatorConnection(),
"ApiChargementService.MAX_PARALLEL_WORKERS", 4);
Expand All @@ -82,7 +82,7 @@ public void executer() throws ArcException {

}

public List<Norme> getListeNorme() {
public List<NormeRules> getListeNorme() {
return listeNorme;
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package fr.insee.arc.core.service.p2chargement.bo;

public class FileAttributesCSV {


private String[] headersV;
private String[] headersI;


public String[] getHeadersV() {
return headersV;
}


public void setHeadersV(String[] headersV) {
this.headersV = headersV;
}


public String[] getHeadersI() {
return headersI;
}


public void setHeadersI(String[] headersI) {
this.headersI = headersI;
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package fr.insee.arc.core.service.p2chargement.bo;

import java.util.Date;

import fr.insee.arc.core.service.global.dao.DateConversion;

public class FileIdCard {


private String fileName;
private String idNorme;
private String validite;
private String periodicite;
private final String integrationDate = DateConversion.queryDateConversion(new Date());

private FileIdCardChargement regleChargement;
public FileIdCardChargement getRegleChargement() {
return regleChargement;
}
public void setRegleChargement(FileIdCardChargement regleChargement) {
this.regleChargement = regleChargement;
}


public FileIdCard(String idSource) {
this.fileName = idSource;
}

public void setFileAttributes(String idNorme, String validite, String periodicite) {
this.idNorme = idNorme;
this.validite = validite;
this.periodicite = periodicite;
}


public String getFileName() {
return fileName;
}


public void setFileName(String fileName) {
this.fileName = fileName;
}


public String getValidite() {
return validite;
}


public void setValidite(String validite) {
this.validite = validite;
}


public String getIntegrationDate() {
return integrationDate;
}


public String getIdNorme() {
return idNorme;
}


public void setIdNorme(String idNorme) {
this.idNorme = idNorme;
}


public String getPeriodicite() {
return periodicite;
}


public void setPeriodicite(String periodicite) {
this.periodicite = periodicite;
}




}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
* @author S4LWO8
*
*/
public class RegleChargement {
public class FileIdCardChargement {

private TypeChargement typeChargement;
private String format;
private String delimiter;


public RegleChargement(TypeChargement typeChargement, String delimiter, String format) {
public FileIdCardChargement(TypeChargement typeChargement, String delimiter, String format) {
super();
this.typeChargement = typeChargement;
this.format = format;
Expand Down
Loading

0 comments on commit 0cf606a

Please sign in to comment.