DBCFX_RIL_1049 - Ril. DBCFX_RU_377 - 328134 CVM_KPI per analisi destinazione olo fisso - BU
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
##############
|
||||
#EDL
|
||||
##############
|
||||
# CONFIGURAZIONE PER PUT SU Enterpries_Data_Lake
|
||||
PUT.LOCAL.PATH.EDL=/gnpapp/batch/ftpout/edl_olo_dest
|
||||
PUT.LOCAL.BACKUP.PATH.EDL=/gnpapp/batch/backup_out/edl_olo_dest
|
||||
# Estensione files da inviare verso EDL (POSSONO ESSERE PIU' DI UNA DELIMITATE DA ";")
|
||||
PUT.EXTENSION.EDL=.csv
|
||||
PUT.IDENTITY.EDL=/bea/.ssh/id_rsa
|
||||
PUT.PASSPHRASE.EDL=bea
|
||||
PUT.USERNAME.EDL=bea
|
||||
PUT.HOST.EDL=10.192.65.18
|
||||
PUT.PORT.EDL=22
|
||||
PUT.KNOWN_HOSTS.EDL=/bea/.ssh/known_hosts
|
||||
PUT.REMOTE_PATH.EDL=/home/bea/temp/edl
|
||||
PUT.RENAMECTR.EDL=NO
|
||||
PUT.RENAMECTR.SUFFIX.EDL=
|
||||
PUT_SENDCTR.EDL=YES
|
||||
# TIMEOUT IN MILLISECONDI (10000 = 10sec, 1800000 = 30min)
|
||||
PUT.CONNECT.TIMEOUT.EDL=30000
|
||||
##############
|
||||
@@ -44,7 +44,8 @@ public class SFTPPutDaemon {
|
||||
&& !idSistemaRemoto.equalsIgnoreCase(ApplicationConstants.PDC) //ADD PDC RU_352
|
||||
&& !idSistemaRemoto.equalsIgnoreCase(ApplicationConstants.CRMB) //ADD CRMB RU_XXX
|
||||
&& !idSistemaRemoto.equalsIgnoreCase(ApplicationConstants.DWHE2E_REPOSALDINETTI_CO) //ADD DHWE2E_REPOSALDINETTI
|
||||
&& !idSistemaRemoto.equalsIgnoreCase(ApplicationConstants.DWHE2E_REPOSALDINETTI_BU)){
|
||||
&& !idSistemaRemoto.equalsIgnoreCase(ApplicationConstants.DWHE2E_REPOSALDINETTI_BU)
|
||||
&& !idSistemaRemoto.equalsIgnoreCase(ApplicationConstants.EDL)){ //ADD EDL RU_377
|
||||
log.fatal("Sistema remoto sconosciuto: "+idSistemaRemoto);
|
||||
}
|
||||
initConfig(idSistemaRemoto);
|
||||
|
||||
@@ -22,6 +22,7 @@ public class ApplicationConstants {
|
||||
public static final String NOW_NGA = "NOW_NGA"; // Utilizzato per la GET da NOW dei servizi NGA
|
||||
public static final String DWHE2E_REPOSALDINETTI_CO = "DWHE2E_REPOSALDINETTI_CO";
|
||||
public static final String DWHE2E_REPOSALDINETTI_BU = "DWHE2E_REPOSALDINETTI_BU";
|
||||
public static final String EDL="EDL";
|
||||
|
||||
public static final String EXTENSION_CTR = "ctr";
|
||||
public static final String EXTENSION_GZ = "gz";
|
||||
|
||||
@@ -371,5 +371,34 @@ public class GnpRichiesteCsNpg103DAO extends BaseHibernateDAO{
|
||||
}
|
||||
}
|
||||
|
||||
public List<GnpRichiesteCsNpg103> getEdlEspletamentoDel103(String tipoEstrazione, String param) {
|
||||
try {
|
||||
|
||||
|
||||
String sqlQuery = "SELECT " +
|
||||
"A.* "+
|
||||
"FROM GNP_RICHIESTE_CS_NPG103 A " +
|
||||
"WHERE A.STATO ='5' " +
|
||||
"AND PIATTAFORMA_COMPETENZA IN ('D','B') ";
|
||||
|
||||
if("FULL".equalsIgnoreCase(tipoEstrazione)) {
|
||||
sqlQuery = sqlQuery + "AND A.DAC >= TO_DATE(:param,'DD/MM/YYYY') ";
|
||||
} else {
|
||||
sqlQuery = sqlQuery + "AND A.DAC >= TRUNC(sysdate - :param) ";
|
||||
}
|
||||
|
||||
Query hqlQuery = getSession().createSQLQuery(sqlQuery).addEntity("A", GnpRichiesteCsNpg103.class);
|
||||
hqlQuery.setParameter("param", param);
|
||||
|
||||
return hqlQuery.list();
|
||||
|
||||
} catch (RuntimeException re) {
|
||||
log.error("get GNP_RICHIESTE_CS_NPG103 query failed", re);
|
||||
throw re;
|
||||
}finally {
|
||||
closeSession();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -272,5 +272,34 @@ public class GnpRichiesteDonNatOloDAO extends BaseHibernateDAO{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<GnpRichiesteDonNatOlo> getEdlEspletamentoDel103NatOlo(String tipoEstrazione, String param) {
|
||||
try {
|
||||
|
||||
|
||||
String sqlQuery = "SELECT " +
|
||||
"A.* "+
|
||||
"FROM GNP_RICHIESTE_DON_NAT_OLO A " +
|
||||
"WHERE A.STATO ='5' " +
|
||||
"AND PIATTAFORMA_COMPETENZA IN ('D','B') ";
|
||||
|
||||
if("FULL".equalsIgnoreCase(tipoEstrazione)) {
|
||||
sqlQuery = sqlQuery + "AND A.DAC >= TO_DATE(:param,'DD/MM/YYYY') ";
|
||||
} else {
|
||||
sqlQuery = sqlQuery + "AND A.DAC >= TRUNC(sysdate - :param) ";
|
||||
}
|
||||
|
||||
Query hqlQuery = getSession().createSQLQuery(sqlQuery).addEntity("A", GnpRichiesteDonNatOlo.class);
|
||||
hqlQuery.setParameter("param", param);
|
||||
|
||||
return hqlQuery.list();
|
||||
|
||||
} catch (RuntimeException re) {
|
||||
log.error("get GNP_RICHIESTE_DON_NAT_OLO query failed", re);
|
||||
throw re;
|
||||
}finally {
|
||||
closeSession();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -540,5 +540,38 @@ public class GnpRichiesteDonor82DAO extends BaseHibernateDAO{
|
||||
closeSession();
|
||||
}
|
||||
}
|
||||
|
||||
public List getEdlEspletamentoDel82(String tipoEstrazione, String param) {
|
||||
try {
|
||||
|
||||
|
||||
String sqlQuery = "SELECT " +
|
||||
"A.*, B.* "+
|
||||
"FROM GNP_RICHIESTE_D82 A, GNP_NOW_D82_RICHIESTE_IN B " +
|
||||
"WHERE A.ID_RICHIESTA = B.ID_RICHIESTA_D82 " +
|
||||
"AND B.DATA_ESPLETAMENTO IS NOT NULL " +
|
||||
"AND B.TIPO_NOTIFICA = 'N10' " +
|
||||
"AND B.TIPO_EVENTO = '0' " +
|
||||
"AND CRM_COMPETENZA IN ('D','B') ";
|
||||
|
||||
if("FULL".equalsIgnoreCase(tipoEstrazione)) {
|
||||
sqlQuery = sqlQuery + "AND B.DATA_ESPLETAMENTO >= TO_DATE(:param,'DD/MM/YYYY') ";
|
||||
} else {
|
||||
sqlQuery = sqlQuery + "AND B.DATA_ESPLETAMENTO >= TRUNC(sysdate - :param) ";
|
||||
}
|
||||
|
||||
Query hqlQuery = getSession().createSQLQuery(sqlQuery).addEntity("A", GnpRichiesteDonor82.class)
|
||||
.addEntity("B", GnpNowD82RichiesteIn.class);
|
||||
hqlQuery.setParameter("param", param);
|
||||
|
||||
return hqlQuery.list();
|
||||
|
||||
} catch (RuntimeException re) {
|
||||
log.error("get join GNP_RICHIESTE_D82 and GNP_NOW_D82_RICHIESTE_IN query failed", re);
|
||||
throw re;
|
||||
}finally {
|
||||
closeSession();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -510,5 +510,33 @@ public class GnpRichiesteDonorDAO extends BaseHibernateDAO{
|
||||
closeSession();
|
||||
}
|
||||
}
|
||||
|
||||
public List<GnpRichiesteDonor> getEdlEspletamentoDel274(String tipoEstrazione, String param) {
|
||||
try {
|
||||
|
||||
String sqlQuery = "SELECT " +
|
||||
"A.* "+
|
||||
"FROM GNP_RICHIESTE_DONOR A " +
|
||||
"WHERE A.STATO ='4' " +
|
||||
"AND CRM_COMPETENZA IN ('B','D') ";
|
||||
|
||||
if("FULL".equalsIgnoreCase(tipoEstrazione)) {
|
||||
sqlQuery = sqlQuery + "AND A.DAC >= TO_DATE(:param,'DD/MM/YYYY') ";
|
||||
} else {
|
||||
sqlQuery = sqlQuery + "AND A.DAC >= TRUNC(sysdate - :param) ";
|
||||
}
|
||||
|
||||
Query hqlQuery = getSession().createSQLQuery(sqlQuery).addEntity("A", GnpRichiesteDonor.class);
|
||||
hqlQuery.setParameter("param", param);
|
||||
|
||||
return hqlQuery.list();
|
||||
|
||||
} catch (RuntimeException re) {
|
||||
log.error("get join GNP_RICHIESTE query failed", re);
|
||||
throw re;
|
||||
}finally {
|
||||
closeSession();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,321 @@
|
||||
package it.valueteam.gnp.internalflow.out;
|
||||
|
||||
import it.valueteam.crontab.processexecutor.ProcessIF;
|
||||
import it.valueteam.gnp.dao.db.hb.*;
|
||||
import it.valueteam.gnp.log.Loggable;
|
||||
import it.valueteam.gnp.log.ProcessLogger;
|
||||
import it.valueteam.gnp.obj.LogInfo;
|
||||
import it.valueteam.gnp.obj.LogProcess;
|
||||
import it.valueteam.gnp.utility.DateUtils;
|
||||
import it.valueteam.gnp.utility.Resources;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class EdlEspletamentoOut extends InternalSenderProcess implements Loggable, ProcessIF {
|
||||
private ProcessLogger log;
|
||||
|
||||
//TODO EDL verificare il codice processo
|
||||
private static final String codiceProcesso = "IG";
|
||||
private static final String versione = "1.0.0";
|
||||
private static final char separator = ';';
|
||||
|
||||
// pattern della data per il nome del file csv da inviare
|
||||
private static final String DATE_PATTERN_FILE_NAME = "yyyyMMdd";
|
||||
private static final String DATE_PATTERN_DD_MM_YYYY = "dd-MM-yyyy";
|
||||
|
||||
//pattern date per campi file
|
||||
|
||||
private static final String ESTRAZIONE_FULL = "FULL";
|
||||
private static final String ESTRAZIONE_DELTA = "DELTA";
|
||||
|
||||
private static final String DELIBERA_82 = "Del. 82";
|
||||
private static final String DELIBERA_274 = "Del. 274";
|
||||
private static final String DELIBERA_103 = "Del. 103_NP";
|
||||
private static final String DELIBERA_103NATOLO = "Del. 103_NatOLO";
|
||||
private static final String BUSINESS = "BU";
|
||||
private static final String CONSUMER = "CO";
|
||||
|
||||
/**
|
||||
* EdlEspletmentoOut
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public EdlEspletamentoOut() throws Exception {
|
||||
super();
|
||||
try {
|
||||
LogProcess logProcess = new LogProcess();
|
||||
logProcess.setCodice(codiceProcesso);
|
||||
logProcess.setProcess(this);
|
||||
log = new ProcessLogger(logProcess);
|
||||
} catch (Exception ex) {
|
||||
System.out.println("Errore nella creazione del ProcessLogger");
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Interfaccia ProcessExecutor
|
||||
* Ritorniamo sempre false perche' gestiamo le TX internamente
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean requiredTX() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* getLogInfo
|
||||
*
|
||||
* @return LogInfo
|
||||
*/
|
||||
public LogInfo getLogInfo() {
|
||||
LogInfo logInfo = new LogInfo();
|
||||
logInfo.setProcess(getClass().getName());
|
||||
logInfo.setLogPath(Resources.getLogPath());
|
||||
logInfo.setTypeInfo(Resources.getTypeInfo());
|
||||
logInfo.setTypeDebug(Resources.getTypeDebug());
|
||||
logInfo.setTypeError(Resources.getTypeError());
|
||||
return logInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inizia il processo di creazione del file
|
||||
*
|
||||
* @param args String[]
|
||||
*/
|
||||
public void execute(String[] args) throws Exception {
|
||||
log.write("9999", " Enterprise_Lake (EDL) ");
|
||||
|
||||
try {
|
||||
if (args.length == 1 && (ESTRAZIONE_FULL.equalsIgnoreCase(args[0]) || ESTRAZIONE_DELTA.equalsIgnoreCase(args [0])))
|
||||
generaFile(args[0]);
|
||||
else {
|
||||
log.write("9999", "Creazione file non eseguita. Inserire parametro (FULL o DELTA)");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
//0003 C - PROCESSO TERMINATO CON ECCEZIONI
|
||||
log.write("0003", "" + ex.toString());
|
||||
ex.printStackTrace();
|
||||
//Termino l'esecuzione ritornando un errore a chi mi ha eseguito
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Genera il file per Enterprise_Lake
|
||||
* @param arg String
|
||||
*/
|
||||
private void generaFile(String arg) throws Exception {
|
||||
|
||||
log.write("0001", " versione " + versione);
|
||||
|
||||
GnpRichiesteDonor82DAO donor82DAO = new GnpRichiesteDonor82DAO();
|
||||
GnpRichiesteDonorDAO donorDAO = new GnpRichiesteDonorDAO();
|
||||
GnpRichiesteCsNpg103DAO donorNpg103DAO = new GnpRichiesteCsNpg103DAO();
|
||||
GnpRichiesteDonNatOloDAO donorNatOlo103DAO = new GnpRichiesteDonNatOloDAO();
|
||||
|
||||
String resourceParam = null;
|
||||
|
||||
List donorDelibera82 = null;
|
||||
List<GnpRichiesteDonor> donorDelibera274 = null;
|
||||
List<GnpRichiesteCsNpg103> donorDelibera103 = null;
|
||||
List<GnpRichiesteDonNatOlo> donorDelibera103NativiOlo = null;
|
||||
|
||||
if(ESTRAZIONE_FULL.equalsIgnoreCase(arg)) {
|
||||
resourceParam = Resources.getEDL_DONOR_START_FULL();
|
||||
} else {
|
||||
resourceParam = Resources.getEDL_DONOR_GIORNI_DELTA();
|
||||
}
|
||||
try {
|
||||
donorDelibera82 = donor82DAO.getEdlEspletamentoDel82(arg,resourceParam);
|
||||
donorDelibera274 = donorDAO.getEdlEspletamentoDel274(arg,resourceParam);
|
||||
donorDelibera103 = donorNpg103DAO.getEdlEspletamentoDel103(arg,resourceParam);
|
||||
donorDelibera103NativiOlo = donorNatOlo103DAO.getEdlEspletamentoDel103NatOlo(arg,resourceParam);
|
||||
|
||||
|
||||
//TODO log
|
||||
log.write("9999","------------ Start Liste size ------------");
|
||||
log.write("9999", " Lista Delibera 82 numerazioni espletatate size = " + donorDelibera82!=null?String.valueOf(donorDelibera82.size()):"0");
|
||||
log.write("9999", " Lista Delibera 274 numerazioni espletatate size = " + donorDelibera274!=null?String.valueOf(donorDelibera274.size()):"0");
|
||||
log.write("9999", " Lista Delibera 103 standard numerazioni espletatate size = " + donorDelibera103!=null?String.valueOf(donorDelibera103.size()):"0");
|
||||
log.write("9999", " Lista Delibera 103 NatOLO numerazioni espletatate size = " + donorDelibera103NativiOlo!=null?String.valueOf(donorDelibera103NativiOlo.size()):"0");
|
||||
log.write("9999","------------ End Liste size ------------");
|
||||
} catch (Exception ex) {
|
||||
log.write("0003", "ERRORE NEL RECUPERO DEI DATI PER EDL " + ex.toString());
|
||||
}
|
||||
|
||||
String fileName = getNomeFile();
|
||||
String filePath = Resources.getEDL_DONOR_OUT_PATH();
|
||||
log.write("9999", "INIZIO CREAZIONE FILE " + fileName);
|
||||
openFile(fileName, filePath);
|
||||
|
||||
//scrivo l'header
|
||||
String campiHead = Resources.getEDL_DONOR_HEADER();
|
||||
writeRecord(campiHead);
|
||||
scritturaDonorSuFile(donorDelibera82,donorDelibera274,donorDelibera103,donorDelibera103NativiOlo);
|
||||
|
||||
log.write("9999", "CREATO FILE " + filePath + fileName);
|
||||
|
||||
// Chiudi il file e crea il file di sincronizzazione
|
||||
closeFile(true);
|
||||
|
||||
}
|
||||
|
||||
private void scritturaDonorSuFile(List listaDonorDelibera82, List listaDonorDelibera274, List listaDonorDelibera103, List listaDonorDelibera103NativiOlo) throws Exception {
|
||||
Iterator it;
|
||||
String recordGenerato;
|
||||
|
||||
String crmCompetenza, dn, dataEspletamento, codiceOloRecipient;
|
||||
if(listaDonorDelibera82!=null && listaDonorDelibera82.size()>0) {
|
||||
log.write("9999","------------ Start Del. 82 ------------");
|
||||
for (Object o : listaDonorDelibera82) {
|
||||
Object[] ob = (Object[]) o;
|
||||
GnpRichiesteDonor82 gnpRichiesteDonor82 = (GnpRichiesteDonor82) ob[0];
|
||||
GnpNowD82RichiesteIn gnpNowD82RichiesteIn = (GnpNowD82RichiesteIn) ob[1];
|
||||
|
||||
crmCompetenza = mappincCrm(gnpRichiesteDonor82.getCrmCompetenza());
|
||||
dn = gnpRichiesteDonor82.getDn() != null ? gnpRichiesteDonor82.getDn().toString() : "";
|
||||
dataEspletamento = gnpNowD82RichiesteIn.getDataEspletamento() != null ? DateUtils.toString(gnpNowD82RichiesteIn.getDataEspletamento(), DATE_PATTERN_DD_MM_YYYY) : "";
|
||||
codiceOloRecipient = gnpNowD82RichiesteIn.getCodiceOperatoreRecipient() != null ? gnpNowD82RichiesteIn.getCodiceOperatoreRecipient().toString() : "";
|
||||
|
||||
List<String> valori = new ArrayList<String>();
|
||||
|
||||
valori.add(crmCompetenza);
|
||||
valori.add(dn);
|
||||
valori.add(dataEspletamento);
|
||||
valori.add(codiceOloRecipient);
|
||||
valori.add(DELIBERA_82);
|
||||
|
||||
recordGenerato = generaRecord(valori);
|
||||
writeRecord(recordGenerato);
|
||||
stampaRecord(crmCompetenza,dn,dataEspletamento,codiceOloRecipient,DELIBERA_82);
|
||||
|
||||
}
|
||||
log.write("9999","------------ End Del. 82 ------------");
|
||||
}
|
||||
|
||||
|
||||
if(listaDonorDelibera274!= null && listaDonorDelibera274.size()>0){
|
||||
log.write("9999","------------ Start Del. 274 ------------");
|
||||
it = listaDonorDelibera274.iterator();
|
||||
while (it.hasNext()) {
|
||||
GnpRichiesteDonor gnpRichiesteDonor274 = (GnpRichiesteDonor) it.next();
|
||||
|
||||
crmCompetenza = mappincCrm(gnpRichiesteDonor274.getCrmCompetenza());
|
||||
dn = gnpRichiesteDonor274.getDn() != null ? gnpRichiesteDonor274.getDn().toString() : "";
|
||||
dataEspletamento = gnpRichiesteDonor274.getDac() != null ? DateUtils.toString(gnpRichiesteDonor274.getDac(), DATE_PATTERN_DD_MM_YYYY) : "";
|
||||
codiceOloRecipient = gnpRichiesteDonor274.getCowRecipient() != null ? gnpRichiesteDonor274.getCowRecipient().toString() : "";
|
||||
|
||||
List<String> valori = new ArrayList<String>();
|
||||
|
||||
valori.add(crmCompetenza);
|
||||
valori.add(dn);
|
||||
valori.add(dataEspletamento);
|
||||
valori.add(codiceOloRecipient);
|
||||
valori.add(DELIBERA_274);
|
||||
|
||||
recordGenerato = generaRecord(valori);
|
||||
writeRecord(recordGenerato);
|
||||
stampaRecord(crmCompetenza,dn,dataEspletamento,codiceOloRecipient,DELIBERA_274);
|
||||
|
||||
}
|
||||
log.write("9999","------------ End Del. 274 ------------");
|
||||
}
|
||||
|
||||
if(listaDonorDelibera103!= null && listaDonorDelibera103.size()>0) {
|
||||
log.write("9999","------------ Start Del. 103 ------------");
|
||||
it = listaDonorDelibera103.iterator();
|
||||
while (it.hasNext()) {
|
||||
GnpRichiesteCsNpg103 gnpRichiesteCsNpg103 = (GnpRichiesteCsNpg103) it.next();
|
||||
|
||||
crmCompetenza = mappincCrm(gnpRichiesteCsNpg103.getPiattaformaCompetenza());
|
||||
dn = gnpRichiesteCsNpg103.getDn() != null ? gnpRichiesteCsNpg103.getDn().toString() : "";
|
||||
dataEspletamento = gnpRichiesteCsNpg103.getDac() != null ? DateUtils.toString(gnpRichiesteCsNpg103.getDac(), DATE_PATTERN_DD_MM_YYYY) : "";
|
||||
codiceOloRecipient = gnpRichiesteCsNpg103.getCodOpRecipient() != null ? gnpRichiesteCsNpg103.getCodOpRecipient().toString() : "";
|
||||
|
||||
List<String> valori = new ArrayList<String>();
|
||||
valori.add(crmCompetenza);
|
||||
valori.add(dn);
|
||||
valori.add(dataEspletamento);
|
||||
valori.add(codiceOloRecipient);
|
||||
valori.add(DELIBERA_103);
|
||||
|
||||
recordGenerato = generaRecord(valori);
|
||||
writeRecord(recordGenerato);
|
||||
stampaRecord(crmCompetenza,dn,dataEspletamento,codiceOloRecipient,DELIBERA_103);
|
||||
|
||||
}
|
||||
log.write("9999","------------ End Del. 103 ------------");
|
||||
}
|
||||
|
||||
if(listaDonorDelibera103NativiOlo!= null && listaDonorDelibera103NativiOlo.size()>0) {
|
||||
log.write("9999","------------ Start Del. 103 NatOlo ------------");
|
||||
it = listaDonorDelibera103NativiOlo.iterator();
|
||||
while (it.hasNext()) {
|
||||
GnpRichiesteDonNatOlo gnpRichiesteDonNatOlo = (GnpRichiesteDonNatOlo) it.next();
|
||||
|
||||
crmCompetenza = mappincCrm(gnpRichiesteDonNatOlo.getPiattaformaCompetenza());
|
||||
dn = gnpRichiesteDonNatOlo.getDn() != null ? gnpRichiesteDonNatOlo.getDn().toString() : "";
|
||||
dataEspletamento = gnpRichiesteDonNatOlo.getDac() != null ? DateUtils.toString(gnpRichiesteDonNatOlo.getDac(), DATE_PATTERN_DD_MM_YYYY) : "";
|
||||
codiceOloRecipient = gnpRichiesteDonNatOlo.getCodOpRecipient() != null ? gnpRichiesteDonNatOlo.getCodOpRecipient().toString() : "";
|
||||
|
||||
List<String> valori = new ArrayList<String>();
|
||||
valori.add(crmCompetenza);
|
||||
valori.add(dn);
|
||||
valori.add(dataEspletamento);
|
||||
valori.add(codiceOloRecipient);
|
||||
valori.add(DELIBERA_103NATOLO);
|
||||
|
||||
recordGenerato = generaRecord(valori);
|
||||
writeRecord(recordGenerato);
|
||||
stampaRecord(crmCompetenza,dn,dataEspletamento,codiceOloRecipient,DELIBERA_103NATOLO);
|
||||
}
|
||||
log.write("9999","------------ End Del. 103 NatOlo ------------");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce il nome del file da generare
|
||||
*
|
||||
* @return il nome esteso del file
|
||||
*/
|
||||
protected String getNomeFile() {
|
||||
Date dataAttuale = new Date();
|
||||
String prefisso = Resources.getEDL_DONOR_FILENAME_PREFIX();
|
||||
String ext = Resources.getEDL_DONOR_FILENAME_EXT();
|
||||
String formatDate = DateUtils.toString(dataAttuale, DATE_PATTERN_FILE_NAME);
|
||||
return prefisso + formatDate + ext;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce un record a partire dalla lista di campi
|
||||
*
|
||||
* @param campi di campi
|
||||
* @return il record
|
||||
*/
|
||||
private String generaRecord(List<String> campi) {
|
||||
StringBuilder line = new StringBuilder();
|
||||
Iterator<String> it = campi.iterator();
|
||||
while (it.hasNext()) {
|
||||
line.append(it.next());
|
||||
if (it.hasNext()) line.append(separator);
|
||||
}
|
||||
return line.toString();
|
||||
}
|
||||
|
||||
private String mappincCrm(String crm){
|
||||
if(crm.equalsIgnoreCase("D"))
|
||||
return CONSUMER;
|
||||
else return BUSINESS;
|
||||
}
|
||||
private void stampaRecord(String crmCompetenza, String dn, String dataEspletamento, String codiceOlo, String delibera){
|
||||
log.write("9999","CrmCompetenza = " + crmCompetenza +
|
||||
" dn = " + dn + " dataEspletamento = " + dataEspletamento +
|
||||
" codiceOloRecipient = " + codiceOlo + " delibera = " + delibera );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3353,4 +3353,41 @@ public class Resources {
|
||||
return Trim(props.getProperty("DWHE2E_REPOSALDINETTI_BUFFER_COMMIT"));
|
||||
}
|
||||
|
||||
//EDL file per OLO destinazione
|
||||
public static String getEDL_DONOR_HEADER() {
|
||||
if (props == null)
|
||||
init();
|
||||
return Trim(props.getProperty("EDL_DONOR_HEADER"));
|
||||
}
|
||||
|
||||
public static String getEDL_DONOR_OUT_PATH() {
|
||||
if (props == null)
|
||||
init();
|
||||
return Trim(props.getProperty("EDL_DONOR_OUT_PATH"));
|
||||
}
|
||||
|
||||
public static String getEDL_DONOR_FILENAME_EXT() {
|
||||
if (props == null)
|
||||
init();
|
||||
return Trim(props.getProperty("EDL_DONOR_FILENAME_EXT"));
|
||||
}
|
||||
|
||||
public static String getEDL_DONOR_FILENAME_PREFIX() {
|
||||
if (props == null)
|
||||
init();
|
||||
return Trim(props.getProperty("EDL_DONOR_FILENAME_PREFIX"));
|
||||
}
|
||||
|
||||
public static String getEDL_DONOR_GIORNI_DELTA() {
|
||||
if (props == null)
|
||||
init();
|
||||
return Trim(props.getProperty("EDL_DONOR_GIORNI_DELTA"));
|
||||
}
|
||||
|
||||
public static String getEDL_DONOR_START_FULL() {
|
||||
if (props == null)
|
||||
init();
|
||||
return Trim(props.getProperty("EDL_DONOR_START_FULL"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user