Ril. DBCFX_RU_374 - Modifica flussi Cubo Saldi Netti (Consumer e Business) gestione Codice_Sessione del.82

This commit is contained in:
manuelstefanile
2025-03-04 16:32:36 +01:00
parent 98cdcf8e5a
commit bb1d007ecb
4 changed files with 70 additions and 46 deletions

View File

@@ -0,0 +1,2 @@
TRUNCATE TABLE GNP_DWHE2E_SALDINETTI_IN;
ALTER TABLE GNP_DWHE2E_SALDINETTI_IN MODIFY ID_RICHIESTA varchar2(50);

View File

@@ -16,8 +16,8 @@
<property name="crm" type="string">
<column name="CRM" length="2" />
</property>
<property name="idRichiesta" type="java.lang.Long">
<column name="ID_RICHIESTA" precision="22" scale="0" not-null="true" />
<property name="idRichiesta" type="string">
<column name="ID_RICHIESTA" length="50" not-null="true" />
</property>
<property name="linea" type="string">
<column name="LINEA" length="15" />

View File

@@ -13,7 +13,7 @@ public class GnpDwhe2eSaldinettiIn implements java.io.Serializable {
private Long uniqueId;
private String nomeFile;
private String crm;
private Long idRichiesta;
private String idRichiesta;
private String linea;
private String cor;
private Date e2eDataCessazione;
@@ -31,11 +31,11 @@ public class GnpDwhe2eSaldinettiIn implements java.io.Serializable {
}
public GnpDwhe2eSaldinettiIn(Long idRichiesta) {
public GnpDwhe2eSaldinettiIn(String idRichiesta) {
this.idRichiesta = idRichiesta;
}
public GnpDwhe2eSaldinettiIn(String nomeFile, String crm, Long idRichiesta, String linea, String cor, Date e2eDataCessazione, String e2eServizioAccesso, String e2eDimensione1, String e2eDimensione2, String e2eDimensione3, String e2eDimensione4, String e2eDimensione5, String dbcfxDimCodiceOlo, String dbcfxDimTipoUscita, String dbcfxDimDelibera) {
public GnpDwhe2eSaldinettiIn(String nomeFile, String crm, String idRichiesta, String linea, String cor, Date e2eDataCessazione, String e2eServizioAccesso, String e2eDimensione1, String e2eDimensione2, String e2eDimensione3, String e2eDimensione4, String e2eDimensione5, String dbcfxDimCodiceOlo, String dbcfxDimTipoUscita, String dbcfxDimDelibera) {
this.nomeFile = nomeFile;
this.crm = crm;
this.idRichiesta = idRichiesta;
@@ -77,11 +77,11 @@ public class GnpDwhe2eSaldinettiIn implements java.io.Serializable {
this.crm = crm;
}
public Long getIdRichiesta() {
public String getIdRichiesta() {
return this.idRichiesta;
}
public void setIdRichiesta(Long idRichiesta) {
public void setIdRichiesta(String idRichiesta) {
this.idRichiesta = idRichiesta;
}

View File

@@ -42,7 +42,7 @@ public class Dwhe2eRepoSaldiNettiIn extends InternalSenderProcess implements Log
private static final String DEL_103_NATOLO_TIPOUSCITA = "Uscite 103 Donor Nativo OLO";
private static final String DEL_103_STD_VOIP_TIPOUSCITA = "Uscite 103 Standard o VOIP";
private static final String DATACESSAZIONE_FORMAT = new String("yyyy-MM-dd");
private static final String REGEXP_SALDINETTI_LINE = "^(\\d{1,22});([^;]{0,15});([^;]{0,50});((\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))|);([^;]{0,1000});([^;]{0,1000});([^;]{0,1000});([^;]{0,1000});([^;]{0,1000});([^;]{0,1000})$";
private static final String REGEXP_SALDINETTI_LINE = "^([^;]{1,50});([^;]{0,15});([^;]{0,50});((\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))|);([^;]{0,1000});([^;]{0,1000});([^;]{0,1000});([^;]{0,1000});([^;]{0,1000});([^;]{0,1000})$";
//variabible usata per associare ad ogni nome file il proprio numero di righe e di errori
private HashMap<String, InnerRowFile> associazioneFileReport;
@@ -330,7 +330,7 @@ public class Dwhe2eRepoSaldiNettiIn extends InternalSenderProcess implements Log
listForFile.add(gnpDwhe2eSaldinettiIn);
else {
irf.incrementRowError();
log.write("9999", "Errore record nel formato della linea " + (row +1));
log.write("9999", "Errore record nel formato della linea " + (row +1) + " : " +nextLine);
}
}catch (Exception e){
@@ -426,9 +426,20 @@ public class Dwhe2eRepoSaldiNettiIn extends InternalSenderProcess implements Log
gnpDwhe2eSaldinettiIn.setNomeFile(nomeFile);
gnpDwhe2eSaldinettiIn.setCrm(piattaforma);
//se manca l' ID_RICHIESTA, si romper il parse e non calcola il record
if (0<parts.length)
gnpDwhe2eSaldinettiIn.setIdRichiesta(Long.valueOf(parts[0]));
// deve esserci l'ID_RICHIESTA, altrimenti eccezione
if (0<parts.length){
try{
//sono sicuro che sia un ID di una del. <> 82
Long id = Long.parseLong(parts[0]);
gnpDwhe2eSaldinettiIn.setIdRichiesta(parts[0]);
}catch (Exception e){
// potrebbe essere popolato con un codice_sessione del.82
if(parts[0].startsWith("C")||parts[0].startsWith("B"))
gnpDwhe2eSaldinettiIn.setIdRichiesta(parts[0]);
else
throw e;
}
}
if (1<parts.length)
gnpDwhe2eSaldinettiIn.setLinea(parts[1]);
@@ -499,48 +510,54 @@ public class Dwhe2eRepoSaldiNettiIn extends InternalSenderProcess implements Log
//effettua la ricerca nelle tabelle sfruttando ID_RICHIESTA, aggiorna i campi dbcfx e SE trova allora salva
for(GnpDwhe2eSaldinettiIn dwhe2eItem : gnpDwhe2eSaldinettiIn ){
//per del.82 l'ID_RICHIESTA sarà popolato con il codice sessione alfanumerico che inizia con 'C' o 'B'
boolean isDel82 = dwhe2eItem.getIdRichiesta().startsWith("C")|| dwhe2eItem.getIdRichiesta().startsWith("B");
trovato = false;
// del. 82
GnpRichiesteDonor82 gnpRichiestaDonor82 = daoRichiesteD82.findById(dwhe2eItem.getIdRichiesta());
if(gnpRichiestaDonor82!=null){
dwhe2eItem.popolaAggiuntiviFX(gnpRichiestaDonor82.getCowRecipient(),this.DEL_82_TIPOUSCITA, this.DEL_82);
dwhe2eSaldinettiInDAO.save(dwhe2eItem);
counter++;
trovato = true;
}
if(isDel82){
// del. 274
if(!trovato){
GnpRichiesteDonor gnpRichiestaDonor274 = daoRichiesteDonor.findById(dwhe2eItem.getIdRichiesta());
if(gnpRichiestaDonor274!=null){
dwhe2eItem.popolaAggiuntiviFX(gnpRichiestaDonor274.getCowRecipient(),this.DEL_274_TIPOUSCITA, this.DEL_274);
// del. 82
GnpRichiesteDonor82 gnpRichiestaDonor82 = daoRichiesteD82.findByCodiceSessione(dwhe2eItem.getIdRichiesta());
if(gnpRichiestaDonor82!=null){
dwhe2eItem.popolaAggiuntiviFX(gnpRichiestaDonor82.getCowRecipient(),this.DEL_82_TIPOUSCITA, this.DEL_82);
dwhe2eSaldinettiInDAO.save(dwhe2eItem);
counter++;
trovato = true;
}
}
}else {
// del. 103 uscite Donor nativi olo
GnpRichiesteCsNpg103 gnpRichiesteCsNpg = null;
if(!trovato){
gnpRichiesteCsNpg = daoCsNpg103.findById(dwhe2eItem.getIdRichiesta());
if(gnpRichiesteCsNpg!=null && gnpRichiesteCsNpg.getProcesso().equalsIgnoreCase("DONOR_NAT_OLO")){
dwhe2eItem.popolaAggiuntiviFX(gnpRichiesteCsNpg.getCodOpRecipient(),this.DEL_103_NATOLO_TIPOUSCITA, this.DEL_103);
dwhe2eSaldinettiInDAO.save(dwhe2eItem);
counter++;
trovato = true;
// del. 274
if(!trovato){
GnpRichiesteDonor gnpRichiestaDonor274 = daoRichiesteDonor.findById(Long.parseLong(dwhe2eItem.getIdRichiesta()));
if(gnpRichiestaDonor274!=null){
dwhe2eItem.popolaAggiuntiviFX(gnpRichiestaDonor274.getCowRecipient(),this.DEL_274_TIPOUSCITA, this.DEL_274);
dwhe2eSaldinettiInDAO.save(dwhe2eItem);
counter++;
trovato = true;
}
}
}
// del. 103 uscite Donor nativi olo
if(!trovato){
if(gnpRichiesteCsNpg!=null && gnpRichiesteCsNpg.getProcesso().equalsIgnoreCase("CSNPg103")){
dwhe2eItem.popolaAggiuntiviFX(gnpRichiesteCsNpg.getCodOpRecipient(),this.DEL_103_STD_VOIP_TIPOUSCITA, this.DEL_103);
dwhe2eSaldinettiInDAO.save(dwhe2eItem);
counter++;
trovato = true;
// del. 103 uscite Donor nativi olo
GnpRichiesteCsNpg103 gnpRichiesteCsNpg = null;
if(!trovato){
gnpRichiesteCsNpg = daoCsNpg103.findById(Long.parseLong(dwhe2eItem.getIdRichiesta()));
if(gnpRichiesteCsNpg!=null && gnpRichiesteCsNpg.getProcesso().equalsIgnoreCase("DONOR_NAT_OLO")){
dwhe2eItem.popolaAggiuntiviFX(gnpRichiesteCsNpg.getCodOpRecipient(),this.DEL_103_NATOLO_TIPOUSCITA, this.DEL_103);
dwhe2eSaldinettiInDAO.save(dwhe2eItem);
counter++;
trovato = true;
}
}
// del. 103 uscite Donor nativi olo
if(!trovato){
if(gnpRichiesteCsNpg!=null && gnpRichiesteCsNpg.getProcesso().equalsIgnoreCase("CSNPg103")){
dwhe2eItem.popolaAggiuntiviFX(gnpRichiesteCsNpg.getCodOpRecipient(),this.DEL_103_STD_VOIP_TIPOUSCITA, this.DEL_103);
dwhe2eSaldinettiInDAO.save(dwhe2eItem);
counter++;
trovato = true;
}
}
}
@@ -552,8 +569,13 @@ public class Dwhe2eRepoSaldiNettiIn extends InternalSenderProcess implements Log
}
if(!trovato){
//se soon arrivato qui, allora non c'è corrispondenza nel DB dell'ID_RICHIESTA
log.write("9999", "ID_RICHIESTA non trovato a DB: " + dwhe2eItem.getIdRichiesta());
if (isDel82)
log.write("9999", "ID_RICHIESTA popolato con CODICE_SESSIONE non trovato a DB: " + dwhe2eItem.getIdRichiesta());
else
//se soon arrivato qui, allora non c'è corrispondenza nel DB dell'ID_RICHIESTA
log.write("9999", "ID_RICHIESTA non trovato a DB: " + dwhe2eItem.getIdRichiesta());
//aggiungo errori legati alla mancata presenza dell'ID_RICHIESTA tra le varie delibere
InnerRowFile ird = associazioneFileReport.get(dwhe2eItem.getNomeFile());
ird.incrementRowError();