Fix DBCFX_SM_673 - completata
This commit is contained in:
@@ -119,11 +119,11 @@ public class RequestManagerDonor82 {
|
||||
richiesteDonor.setDfw(DateUtils.aggiungi24OreLavorative(oloRichiesteDonorIn.getDataRicezione()));
|
||||
//Calcolata con DataRicezione + 17 giorni lavorativi
|
||||
richiesteDonor.setDataScadenza(DateUtils.aggiungiGiorniLavorativiTodateImpostaOra
|
||||
(oloRichiesteDonorIn.getDataRicezione(),
|
||||
ApplicationCostants.GIORNI_CALCOLO_DATA_SCADENZA,
|
||||
ApplicationCostants.ORA_CALCOLO_DATA_SCADENZA,
|
||||
ApplicationCostants.MINUTI_CALCOLO_DATA_SCADENZA,
|
||||
ApplicationCostants.SECONDI_CALCOLO_DATA_SCADENZA)
|
||||
(oloRichiesteDonorIn.getDataRicezione(),
|
||||
ApplicationCostants.GIORNI_CALCOLO_DATA_SCADENZA,
|
||||
ApplicationCostants.ORA_CALCOLO_DATA_SCADENZA,
|
||||
ApplicationCostants.MINUTI_CALCOLO_DATA_SCADENZA,
|
||||
ApplicationCostants.SECONDI_CALCOLO_DATA_SCADENZA)
|
||||
);
|
||||
richiesteDonor.setCor(oloRichiesteDonorIn.getCor());
|
||||
richiesteDonor.setCos(oloRichiesteDonorIn.getCos());
|
||||
@@ -154,7 +154,7 @@ public class RequestManagerDonor82 {
|
||||
int statoDa = richiesta.getStato().intValue();
|
||||
int check = StateManagerDonor.checkTransition(richiesta.getIdRichiesta(), StatoRichiestaDon.ACCETTATA);
|
||||
if (check != StateManagerDonor.TRANSIZIONE_NON_POSSIBILE) {
|
||||
// CALCOLA DATA SCADENZA ALLA MEZZANOTTE DEL 16� GIORNO
|
||||
// CALCOLA DATA SCADENZA ALLA MEZZANOTTE DEL 16-esimo GIORNO
|
||||
log.write("9999", "avanzaStatoInAccettata richiestaD82:" + richiesta.getIdRichiesta());
|
||||
Date dataScadenza = DateUtils.aggiungiGiorniLavorativiTodateImpostaOra(new Date(), 16, 0, 0, 0);
|
||||
richiesta.setStato((long) StatoRichiestaDon.ACCETTATA);
|
||||
@@ -263,7 +263,7 @@ public class RequestManagerDonor82 {
|
||||
|
||||
// DETERMINO LA PIATTAFORMA CRM DI COMPETENZA
|
||||
/* C06 RE: GATEWAY DBCFX :Studio per il tracciamento di eventi non correttamente gestiti dal sistema
|
||||
* cambio implementazione del recupero della piattaforma di competenza, non si basa più sull'anagrafica (anagCowTelecom)
|
||||
* cambio implementazione del recupero della piattaforma di competenza, non si basa piu' sull'anagrafica (anagCowTelecom)
|
||||
* ma tramite il localizzatore. Per maggiori dettagli vedi mail
|
||||
*/
|
||||
if (!callCheckRetailPlatform(richiesta, log)) {
|
||||
@@ -306,7 +306,7 @@ public class RequestManagerDonor82 {
|
||||
boolean ret = true;
|
||||
|
||||
List<GnpRichiesteDonor82> richiesteDN = dao.getAltreRichiesteStessoCowDN(richiesta.getDn(), richiesta.getCowDonating());
|
||||
GnpRichiesteCsNpg103 richiesteCsNpg103s = npg103DAO.findByDn(richiesta.getDn()); //check su 103 è fattibile? TODO query
|
||||
GnpRichiesteCsNpg103 richiesteCsNpg103s = npg103DAO.findByDn(richiesta.getDn()); //check su 103 e' fattibile? TODO query
|
||||
List<GnpRichiesteDonor> richieste274 = dao.getAltreRichiesteStessoCowDN(richiesta.getDn(), richiesta.getCowDonating());
|
||||
Boolean daRifiutare = false;
|
||||
|
||||
@@ -325,7 +325,7 @@ public class RequestManagerDonor82 {
|
||||
if (richiesteCsNpg103s != null && (richiesteCsNpg103s.getStato() == 1 ||
|
||||
richiesteCsNpg103s.getStato() == 2 ||
|
||||
(richiesteCsNpg103s.getStato() == 3 && richiesteCsNpg103s.getProcesso().equalsIgnoreCase(ProcessMapper.proc_CS_NPg103))
|
||||
)) {
|
||||
)) {
|
||||
avanzaStatoInRifiutata(richiesta, "Altro ordine in corso per tale utenza", ApplicationCostants.PROCESSO_DONOR.OLO_OUT.CAUSALE_RIFIUTO_GESTIONALE, false, log);
|
||||
return true;
|
||||
}
|
||||
@@ -349,12 +349,12 @@ public class RequestManagerDonor82 {
|
||||
richiesta.setStato((long) StatoRichiestaDon.PRESA_IN_CARICO);
|
||||
|
||||
richiesta.setDataPresaincarico(new Date());
|
||||
|
||||
|
||||
log.write("9999", "PRESA IN CARICO del DN :"+richiesta.getDn()+" IdRichiesta: "+richiesta.getIdRichiesta()+richiesta.getDataPresaincarico());
|
||||
|
||||
|
||||
Boolean verificaWhiteList = new WhiteListManager().verificaCsWhiteListDonorDel274(richiesta.getDn(), richiesta.getCowDonating());
|
||||
if (verificaWhiteList != null && verificaWhiteList) {
|
||||
log.write("9999", "Risultato Verifica in WhiteList [TRUE]. Passaggio in ACCETTATA DN: "+richiesta.getDn());
|
||||
log.write("9999", "Risultato Verifica in WhiteList [TRUE]. Passaggio in ACCETTATA DN: "+richiesta.getDn());
|
||||
avanzaStatoInAccettata(richiesta, log);
|
||||
}
|
||||
else if (verificaWhiteList != null && !verificaWhiteList) {
|
||||
@@ -369,18 +369,18 @@ public class RequestManagerDonor82 {
|
||||
} else {
|
||||
|
||||
String crmCompetenza = richiesta.getCrmCompetenza();
|
||||
|
||||
|
||||
boolean utenzaDbss = false;
|
||||
|
||||
|
||||
// X06 2016 - Integrazione con DBSS (nuovo sistema Retail)
|
||||
if (Resources.getDBSS_DONOR_ACTIVE()) {
|
||||
if(isUtenzaDBSS(crmCompetenza)){
|
||||
log.write("9999", "isUtenzaDBSS: "+crmCompetenza+" DN:"+richiesta.getDn()+" Id-Richiesta: "+richiesta.getIdRichiesta());
|
||||
callVerificaFase2DBSS(log,richiesta,dbssDonorOutRecDAO);
|
||||
utenzaDbss=true;
|
||||
log.write("9999", "isUtenzaDBSS: "+crmCompetenza+" DN:"+richiesta.getDn()+" Id-Richiesta: "+richiesta.getIdRichiesta());
|
||||
callVerificaFase2DBSS(log,richiesta,dbssDonorOutRecDAO);
|
||||
utenzaDbss=true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UtilityDao utilityDao = new UtilityDao();
|
||||
|
||||
//PP X5.2010 - aggiunto controllo se multilinea
|
||||
@@ -420,106 +420,106 @@ public class RequestManagerDonor82 {
|
||||
throw new StateTransitionNotPossibleException("StateTransitionNotPossibleException");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected static boolean callCheckRetailPlatform(GnpRichiesteDonor82 richiestaDonor,ProcessLogger log) throws Exception {
|
||||
log.write("9999", " START callCheckRetailPlatform : " +richiestaDonor.getIdRichiesta() + "DN: "+ richiestaDonor.getDn());
|
||||
String methSig = "[RequestManagerDonor82].[callCheckRetailPlatform] ";
|
||||
boolean res=false;
|
||||
log.write("9999", " START callCheckRetailPlatform : " +richiestaDonor.getIdRichiesta() + "DN: "+ richiestaDonor.getDn());
|
||||
String methSig = "[RequestManagerDonor82].[callCheckRetailPlatform] ";
|
||||
boolean res=false;
|
||||
|
||||
CheckRetailPlatformRequest body = new CheckRetailPlatformRequest();
|
||||
body.setDN(richiestaDonor.getDn());
|
||||
CheckRetailPlatformRequest body = new CheckRetailPlatformRequest();
|
||||
body.setDN(richiestaDonor.getDn());
|
||||
|
||||
RetrieveByLineNumberResponseMessage resp = checkDN(body,log);
|
||||
RetrieveByLineNumberResponseMessage resp = checkDN(body,log);
|
||||
|
||||
res=gestisciResponseCheckRetail(methSig,resp,log,richiestaDonor);
|
||||
res=gestisciResponseCheckRetail(methSig,resp,log,richiestaDonor);
|
||||
|
||||
|
||||
log.write("9999", " END callCheckRetailPlatform : " +richiestaDonor.getIdRichiesta() + "DN: "+ richiestaDonor.getDn()+ "con esito: "+res);
|
||||
log.write("9999", " END callCheckRetailPlatform : " +richiestaDonor.getIdRichiesta() + "DN: "+ richiestaDonor.getDn()+ "con esito: "+res);
|
||||
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
private static boolean gestisciResponseCheckRetail(String methSig,RetrieveByLineNumberResponseMessage resp,ProcessLogger log,GnpRichiesteDonor82 richiestaDon) throws Exception {
|
||||
//return code puo' essere a una cifra o due (es. 01 o 1)
|
||||
int retCode = new Integer(resp.getProcessData().getReturnCode());
|
||||
log.write("9999", " return code ricevuto da ws: " + retCode);
|
||||
|
||||
boolean foundByWs = false;
|
||||
String crmComp = "";
|
||||
//return code puo' essere a una cifra o due (es. 01 o 1)
|
||||
int retCode = new Integer(resp.getProcessData().getReturnCode());
|
||||
log.write("9999", " return code ricevuto da ws: " + retCode);
|
||||
|
||||
switch (retCode) {
|
||||
//0
|
||||
case (RET_CODE_OK_FROM_WS):
|
||||
//itera sui (tre) parameter, se ne trova uno con valore == 'Y' ne restituisce il name, altrimentii restituisce codice di errore
|
||||
Parameter[] params = resp.getProcessData().getParameters().getParameter();
|
||||
for (Parameter p : params) {
|
||||
if (!("Y").equalsIgnoreCase(p.getValue())) {
|
||||
continue; //se diverso da Y passa al successivo
|
||||
}
|
||||
|
||||
log.write("9999", methSig + " - trovato el. con val. = Y e name " + p.getName());
|
||||
|
||||
if (SystemControllerIF.SystemProvider_CRMB_DESC.equals(p.getName())) {
|
||||
crmComp = "B";
|
||||
foundByWs = true;
|
||||
} else if (SystemControllerIF.SystemProvider_CRMR_DESC.equals(p.getName())) {
|
||||
// DISMISSIONE CRMR: nel caso la richiesta risulti proveniente da CRMR viene settato a D invece di R
|
||||
crmComp = "D";
|
||||
foundByWs = true;
|
||||
} else if (SystemControllerIF.SystemProvider_DBSS_DESC.equals(p.getName())) {
|
||||
crmComp = "D";
|
||||
foundByWs = true;
|
||||
} else {
|
||||
log.write("9999", methSig + " valore non previsto");
|
||||
log.write("0002", methSig + " ws response return code: " + retCode);
|
||||
log.write("9999", methSig +" non avanza stato in rifiutato : " + retCode);
|
||||
log.write("9999", methSig +" PER RICHIESTA DI INGLISA VIENE SETTATO IL CRM DI COMPETENZA A B");
|
||||
|
||||
//MODIFICA INGLISA NEL CASO IN CUI NON TROVO IL CRM CONTATTO B
|
||||
//RequestManagerDonor.avanzaStatoInRifiutata(richiestaDon, "COW COR Errato", ApplicationCostants.PROCESSO_DONOR.OLO_OUT.COD_MOTIVO_COW_COR_ERRATO,true, log);
|
||||
|
||||
crmComp = "B";
|
||||
foundByWs = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case (RET_CODE_UTENZA_NON_PRESENTE_FROM_WS):
|
||||
log.write("9999", methSig + " ws response return code [" + retCode + "] corrispondente a LINEA NON PRESENTE SU WS"+
|
||||
"ANCHE SE DBSS RESTITUISCE UTENZA NON PRESENTE,PER RICHIESTA DI INGLISA VIENE SETTATO IL CRM DI COMPETENZA A B");
|
||||
|
||||
crmComp = "B";
|
||||
foundByWs = true;
|
||||
|
||||
//RequestManagerDonor.avanzaStatoInRifiutata(richiestaDon, "COW COR Errato", ApplicationCostants.PROCESSO_DONOR.OLO_OUT.COD_MOTIVO_COW_COR_ERRATO,true, log);
|
||||
|
||||
break;
|
||||
case (RET_CODE_SERV_CRMB_NON_DISPONIBILE):
|
||||
case (RET_CODE_SERV_CRMR_NON_DISPONIBILE):
|
||||
case (RET_CODE_ERRORE_GENERICO_WS):
|
||||
log.write("0002", methSig + " ws response return code: " + retCode+ "corrispondente a un errore interno di CCC scrivo solo nella SCARTI CS");
|
||||
buildScartiVerificaCs(richiestaDon,ANOMALIA_ERRORE_CODICE_SERVIZIO_CCC,ANOMALIA_ERRORE_CODICE_SERVIZIO_CCC_DESCRIZIONE+retCode,log);
|
||||
break;
|
||||
default:
|
||||
log.write("9999", methSig + " ws response return code [" + retCode + "] non previsto da interfaccia");
|
||||
log.write("0002", methSig + " ws response return code: " + retCode+ "corrispondente a un errore interno di CCC");
|
||||
buildScartiVerificaCs(richiestaDon,ANOMALIA_ERRORE_CODICE_SERVIZIO_NON_PREVISTO_CCC,ANOMALIA_ERRORE_CODICE_SERVIZIO_NON_PREVISTO_CCC_DESCRIZIONE+retCode,log);
|
||||
}
|
||||
boolean foundByWs = false;
|
||||
String crmComp = "";
|
||||
|
||||
if (foundByWs) {
|
||||
log.write("9999", methSig + " crm recuperato da DBSS e settato nella richiesta : " + crmComp);
|
||||
richiestaDon.setCrmCompetenza(crmComp);
|
||||
}
|
||||
switch (retCode) {
|
||||
//0
|
||||
case (RET_CODE_OK_FROM_WS):
|
||||
//itera sui (tre) parameter, se ne trova uno con valore == 'Y' ne restituisce il name, altrimentii restituisce codice di errore
|
||||
Parameter[] params = resp.getProcessData().getParameters().getParameter();
|
||||
for (Parameter p : params) {
|
||||
if (!("Y").equalsIgnoreCase(p.getValue())) {
|
||||
continue; //se diverso da Y passa al successivo
|
||||
}
|
||||
|
||||
return foundByWs;
|
||||
log.write("9999", methSig + " - trovato el. con val. = Y e name " + p.getName());
|
||||
|
||||
if (SystemControllerIF.SystemProvider_CRMB_DESC.equals(p.getName())) {
|
||||
crmComp = "B";
|
||||
foundByWs = true;
|
||||
} else if (SystemControllerIF.SystemProvider_CRMR_DESC.equals(p.getName())) {
|
||||
// DISMISSIONE CRMR: nel caso la richiesta risulti proveniente da CRMR viene settato a D invece di R
|
||||
crmComp = "D";
|
||||
foundByWs = true;
|
||||
} else if (SystemControllerIF.SystemProvider_DBSS_DESC.equals(p.getName())) {
|
||||
crmComp = "D";
|
||||
foundByWs = true;
|
||||
} else {
|
||||
log.write("9999", methSig + " valore non previsto");
|
||||
log.write("0002", methSig + " ws response return code: " + retCode);
|
||||
log.write("9999", methSig +" non avanza stato in rifiutato : " + retCode);
|
||||
log.write("9999", methSig +" PER RICHIESTA DI INGLISA VIENE SETTATO IL CRM DI COMPETENZA A B");
|
||||
|
||||
//MODIFICA INGLISA NEL CASO IN CUI NON TROVO IL CRM CONTATTO B
|
||||
//RequestManagerDonor.avanzaStatoInRifiutata(richiestaDon, "COW COR Errato", ApplicationCostants.PROCESSO_DONOR.OLO_OUT.COD_MOTIVO_COW_COR_ERRATO,true, log);
|
||||
|
||||
crmComp = "B";
|
||||
foundByWs = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case (RET_CODE_UTENZA_NON_PRESENTE_FROM_WS):
|
||||
log.write("9999", methSig + " ws response return code [" + retCode + "] corrispondente a LINEA NON PRESENTE SU WS"+
|
||||
"ANCHE SE DBSS RESTITUISCE UTENZA NON PRESENTE,PER RICHIESTA DI INGLISA VIENE SETTATO IL CRM DI COMPETENZA A B");
|
||||
|
||||
crmComp = "B";
|
||||
foundByWs = true;
|
||||
|
||||
//RequestManagerDonor.avanzaStatoInRifiutata(richiestaDon, "COW COR Errato", ApplicationCostants.PROCESSO_DONOR.OLO_OUT.COD_MOTIVO_COW_COR_ERRATO,true, log);
|
||||
|
||||
break;
|
||||
case (RET_CODE_SERV_CRMB_NON_DISPONIBILE):
|
||||
case (RET_CODE_SERV_CRMR_NON_DISPONIBILE):
|
||||
case (RET_CODE_ERRORE_GENERICO_WS):
|
||||
log.write("0002", methSig + " ws response return code: " + retCode+ "corrispondente a un errore interno di CCC scrivo solo nella SCARTI CS");
|
||||
buildScartiVerificaCs(richiestaDon,ANOMALIA_ERRORE_CODICE_SERVIZIO_CCC,ANOMALIA_ERRORE_CODICE_SERVIZIO_CCC_DESCRIZIONE+retCode,log);
|
||||
break;
|
||||
default:
|
||||
log.write("9999", methSig + " ws response return code [" + retCode + "] non previsto da interfaccia");
|
||||
log.write("0002", methSig + " ws response return code: " + retCode+ "corrispondente a un errore interno di CCC");
|
||||
buildScartiVerificaCs(richiestaDon,ANOMALIA_ERRORE_CODICE_SERVIZIO_NON_PREVISTO_CCC,ANOMALIA_ERRORE_CODICE_SERVIZIO_NON_PREVISTO_CCC_DESCRIZIONE+retCode,log);
|
||||
}
|
||||
|
||||
if (foundByWs) {
|
||||
log.write("9999", methSig + " crm recuperato da DBSS e settato nella richiesta : " + crmComp);
|
||||
richiestaDon.setCrmCompetenza(crmComp);
|
||||
}
|
||||
|
||||
return foundByWs;
|
||||
}
|
||||
|
||||
|
||||
private static void buildScartiVerificaCs(GnpRichiesteDonor82 richiestaDon,String tipoAnomalia,String descrizioneAnomalia,ProcessLogger log) {
|
||||
log.write("9999","START buildScartiVerificaCs DN: " + richiestaDon.getDn()+"Idrichiesta: "+richiestaDon.getIdRichiesta());
|
||||
|
||||
GnpScartiVerificaCsDAO scartiVerificaCsDao=new GnpScartiVerificaCsDAO();
|
||||
log.write("9999","START buildScartiVerificaCs DN: " + richiestaDon.getDn()+"Idrichiesta: "+richiestaDon.getIdRichiesta());
|
||||
|
||||
GnpScartiVerificaCsDAO scartiVerificaCsDao=new GnpScartiVerificaCsDAO();
|
||||
GnpScartiVerificaCs scartiVerificaCs=new GnpScartiVerificaCs();
|
||||
|
||||
|
||||
scartiVerificaCs.setIdRichiesta(richiestaDon.getIdRichiesta());
|
||||
scartiVerificaCs.setDn(richiestaDon.getDn());
|
||||
scartiVerificaCs.setTipoAnomalia(tipoAnomalia);
|
||||
@@ -527,18 +527,18 @@ public class RequestManagerDonor82 {
|
||||
scartiVerificaCs.setCodiceSegreto(richiestaDon.getCowDonating());
|
||||
scartiVerificaCs.setDataInserimento(new Date());
|
||||
|
||||
|
||||
|
||||
scartiVerificaCsDao.merge(scartiVerificaCs);
|
||||
|
||||
|
||||
log.write("9999","END buildScartiVerificaCs DN: " + richiestaDon.getDn()+"Idrichiesta: "+richiestaDon.getIdRichiesta());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @version 4.1 20180417 migliorati i log
|
||||
*/
|
||||
public static RetrieveByLineNumberResponseMessage checkDN(CheckRetailPlatformRequest body,ProcessLogger log) throws Exception {
|
||||
String requestDn = body.getDN();
|
||||
String requestDn = body.getDN();
|
||||
log.write("9999", "NowController RetrieveByLineNumberResponseMessage - Ricevuta richiesta DN ["+requestDn+"]");
|
||||
CustomerLocationQueryClient client = new CustomerLocationQueryClient();
|
||||
RetrieveByLineNumberRequestMessage requestMessage = new RetrieveByLineNumberRequestMessage();
|
||||
@@ -576,16 +576,16 @@ public class RequestManagerDonor82 {
|
||||
String descr = retrieveByLineNumberResponseMessage != null && retrieveByLineNumberResponseMessage.getProcessData() != null ?
|
||||
retrieveByLineNumberResponseMessage.getProcessData().getReturnDescription() : null;
|
||||
log.write("9999", "NowController RetrieveByLineNumberResponseMessage Ottenuta risposta DN ["+requestDn+"] descrizione ["+descr+"]");
|
||||
|
||||
|
||||
return retrieveByLineNumberResponseMessage;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Passaggio di stato in PRESAINCARICO.
|
||||
* <p/>
|
||||
* Ritorna false se il COW Donating non � mappato su uno di quelli Telecom
|
||||
* Ritorna false se il COW Donating non e' mappato su uno di quelli Telecom
|
||||
*
|
||||
* @param richiesta
|
||||
* @param log
|
||||
@@ -593,154 +593,126 @@ public class RequestManagerDonor82 {
|
||||
* @throws Exception
|
||||
*/
|
||||
public static boolean avanzaStatoInPresaInCaricoTool(GnpRichiesteDonor82 richiesta,String piattaformaCompetenza, ProcessLogger log)
|
||||
throws Exception {
|
||||
GnpRichiesteDonor82DAO dao = new GnpRichiesteDonor82DAO();
|
||||
GnpCrmNotifyDonorOutDAO dbssDonorOutRecDAO = new GnpCrmNotifyDonorOutDAO();
|
||||
boolean ret = true;
|
||||
//richiesta.setStato(new Long(StatoRichiestaDon.ACQUISITA));
|
||||
//int check = StateManagerDonor.checkTransition(richiesta.getIdRichiesta(), StatoRichiestaDon.PRESA_IN_CARICO);
|
||||
|
||||
int check=1;
|
||||
|
||||
if (check != StateManagerDonor.TRANSIZIONE_NON_POSSIBILE) {
|
||||
int statoDa = richiesta.getStato().intValue();
|
||||
richiesta.setStato((long) StatoRichiestaDon.PRESA_IN_CARICO);
|
||||
|
||||
/*
|
||||
*
|
||||
* Penso che la presa in carico sia più corretta considerare la prima data e non questa
|
||||
* quindi non sovrascrivere la precedente
|
||||
*/
|
||||
//richiesta.setDataPresaincarico(new java.util.Date());
|
||||
throws Exception {
|
||||
GnpRichiesteDonor82DAO dao = new GnpRichiesteDonor82DAO();
|
||||
GnpCrmNotifyDonorOutDAO dbssDonorOutRecDAO = new GnpCrmNotifyDonorOutDAO();
|
||||
boolean ret = true;
|
||||
//richiesta.setStato(new Long(StatoRichiestaDon.ACQUISITA));
|
||||
//int check = StateManagerDonor.checkTransition(richiesta.getIdRichiesta(), StatoRichiestaDon.PRESA_IN_CARICO);
|
||||
|
||||
log.write("9999", "Verifica cs whitelist null");
|
||||
// Ricerco nell'anagrafica il cow Donating ricevuto
|
||||
int check=1;
|
||||
|
||||
if (check != StateManagerDonor.TRANSIZIONE_NON_POSSIBILE) {
|
||||
int statoDa = richiesta.getStato().intValue();
|
||||
richiesta.setStato((long) StatoRichiestaDon.PRESA_IN_CARICO);
|
||||
|
||||
/*
|
||||
*
|
||||
* Penso che la presa in carico sia piu' corretta considerare la prima data e non questa
|
||||
* quindi non sovrascrivere la precedente
|
||||
*/
|
||||
//richiesta.setDataPresaincarico(new java.util.Date());
|
||||
|
||||
log.write("9999", "Verifica cs whitelist null");
|
||||
// Ricerco nell'anagrafica il cow Donating ricevuto
|
||||
GnpAnagCowLineaTelecom anagCowLineaTelecom=null;
|
||||
GnpAnagCowLineaTelecomDAO cowLineaDao;
|
||||
GnpAnagCowTelecomDAO anagCowDAO = new GnpAnagCowTelecomDAO();
|
||||
GnpAnagCowTelecom anagCowTelecom = anagCowDAO.findById(richiesta.getCowDonating());
|
||||
|
||||
//C09 2019 WA RICHIESTO ESCLUSIVAMENTE PER LA VERIFICA CS
|
||||
GnpAnagCowTelecomDAO anagCowDAO = new GnpAnagCowTelecomDAO();
|
||||
GnpAnagCowTelecom anagCowTelecom = anagCowDAO.findById(richiesta.getCowDonating());
|
||||
|
||||
//C09 2019 WA RICHIESTO ESCLUSIVAMENTE PER LA VERIFICA CS
|
||||
if(Resources.getFLAG_CHECK_ANAG_COW_LINEA()) {
|
||||
log.write("9999", "CONTROLLO SU TABELLA GNP_ANAG_COW_LINEA_TELECOM(FLAG WA ABILITATO) : "+richiesta.getIdRichiesta()+" COW: "+richiesta.getCowDonating()+" DN:"+richiesta.getDn());
|
||||
log.write("9999", "CONTROLLO SU TABELLA GNP_ANAG_COW_LINEA_TELECOM(FLAG WA ABILITATO) : "+richiesta.getIdRichiesta()+" COW: "+richiesta.getCowDonating()+" DN:"+richiesta.getDn());
|
||||
cowLineaDao = new GnpAnagCowLineaTelecomDAO();
|
||||
anagCowLineaTelecom = cowLineaDao.findByDnAndCowOld(richiesta.getDn(),richiesta.getCowDonating());
|
||||
}
|
||||
|
||||
|
||||
//C09 2019 WA RICHIESTO ESCLUSIVAMENTE PER LA VERIFICA CS SE E' UGUALE A NULL IL PROCESSO RESTA INVARIATO
|
||||
if(anagCowLineaTelecom!=null) {
|
||||
log.write("9999", "TROVATA LINEA SU TABELLA GNP_ANAG_COW_LINEA_TELECOM(FLAG WA ABILITATO) : "+richiesta.getIdRichiesta()+" COW VECCHIO: "+richiesta.getCowDonating()+
|
||||
" COW NUOVO:"+anagCowLineaTelecom.getCowNew()+" DN:"+richiesta.getDn());
|
||||
anagCowTelecom=new GnpAnagCowTelecom();
|
||||
anagCowTelecom.setCow(anagCowLineaTelecom.getCowNew());
|
||||
richiesta.setCowDonating(anagCowLineaTelecom.getCowNew());
|
||||
log.write("9999", "TROVATA LINEA SU TABELLA GNP_ANAG_COW_LINEA_TELECOM(FLAG WA ABILITATO) : "+richiesta.getIdRichiesta()+" COW VECCHIO: "+richiesta.getCowDonating()+
|
||||
" COW NUOVO:"+anagCowLineaTelecom.getCowNew()+" DN:"+richiesta.getDn());
|
||||
anagCowTelecom=new GnpAnagCowTelecom();
|
||||
anagCowTelecom.setCow(anagCowLineaTelecom.getCowNew());
|
||||
richiesta.setCowDonating(anagCowLineaTelecom.getCowNew());
|
||||
// salvo la richiesta con stato acquisita
|
||||
dao.save(richiesta);
|
||||
dao.save(richiesta);
|
||||
}
|
||||
|
||||
// Se non trovo il cow nell'anagrafica:
|
||||
// 1)Aggiorno la tabella GNP_RICHIESTE_DONOR con cod_validazione = 1
|
||||
// 2)Inserisco un record nella tabella GNP_OLO_RICHIESTE_DONOR_OUT
|
||||
if (anagCowTelecom == null) {
|
||||
ret = false;
|
||||
} else {
|
||||
log.write("9999", "Piattaforma notificata da BO : "+piattaformaCompetenza+" DN:"+richiesta.getDn()+" Id-Richiesta: "+richiesta.getIdRichiesta());
|
||||
//Setto la piattaforma di competenza con quello del campo settato dal BO
|
||||
String crmCompetenza=piattaformaCompetenza;
|
||||
richiesta.setCrmCompetenza(crmCompetenza);
|
||||
|
||||
boolean utenzaDbss = false;
|
||||
|
||||
if(isUtenzaDBSS(piattaformaCompetenza)){
|
||||
log.write("9999", "isUtenzaDBSS: "+piattaformaCompetenza+" DN:"+richiesta.getDn()+" Id-Richiesta: "+richiesta.getIdRichiesta());
|
||||
if (Resources.getDBSS_DONOR_ACTIVE()) {
|
||||
callVerificaFase2DBSS(log,richiesta,dbssDonorOutRecDAO);
|
||||
utenzaDbss=true;
|
||||
}
|
||||
}
|
||||
// X06 2016 - Integrazione con DBSS (nuovo sistema Retail)
|
||||
|
||||
UtilityDao utilityDao = new UtilityDao();
|
||||
// Se non trovo il cow nell'anagrafica:
|
||||
// 1)Aggiorno la tabella GNP_RICHIESTE_DONOR con cod_validazione = 1
|
||||
// 2)Inserisco un record nella tabella GNP_OLO_RICHIESTE_DONOR_OUT
|
||||
if (anagCowTelecom == null) {
|
||||
ret = false;
|
||||
} else {
|
||||
log.write("9999", "Piattaforma notificata da BO : "+piattaformaCompetenza+" DN:"+richiesta.getDn()+" Id-Richiesta: "+richiesta.getIdRichiesta());
|
||||
//Setto la piattaforma di competenza con quello del campo settato dal BO
|
||||
String crmCompetenza=piattaformaCompetenza;
|
||||
richiesta.setCrmCompetenza(crmCompetenza);
|
||||
|
||||
//PP X5.2010 - aggiunto controllo se multilinea
|
||||
if (utilityDao.isDnMultilinea(richiesta.getDn()) && crmCompetenza.equalsIgnoreCase("B") && !utenzaDbss) {
|
||||
log.write("9999", "DN BUSINESS MULTILINEA: DBCFX SIMULA LA NOTIFICA OK DA CRM");
|
||||
boolean utenzaDbss = false;
|
||||
|
||||
//-- PASSAGGIO FORZATO IN PRESA IN CARICO -------------------
|
||||
dao.merge(richiesta);
|
||||
if(isUtenzaDBSS(piattaformaCompetenza)){
|
||||
log.write("9999", "isUtenzaDBSS: "+piattaformaCompetenza+" DN:"+richiesta.getDn()+" Id-Richiesta: "+richiesta.getIdRichiesta());
|
||||
if (Resources.getDBSS_DONOR_ACTIVE()) {
|
||||
callVerificaFase2DBSS(log,richiesta,dbssDonorOutRecDAO);
|
||||
utenzaDbss=true;
|
||||
}
|
||||
}
|
||||
// X06 2016 - Integrazione con DBSS (nuovo sistema Retail)
|
||||
|
||||
logStoricoPassaggioStato(richiesta.getIdRichiesta(), statoDa, StatoRichiestaDon.PRESA_IN_CARICO, log);
|
||||
//-----------------------------------------------------------
|
||||
UtilityDao utilityDao = new UtilityDao();
|
||||
|
||||
//PP X5.2010 - aggiunto controllo se multilinea
|
||||
if (utilityDao.isDnMultilinea(richiesta.getDn()) && crmCompetenza.equalsIgnoreCase("B") && !utenzaDbss) {
|
||||
log.write("9999", "DN BUSINESS MULTILINEA: DBCFX SIMULA LA NOTIFICA OK DA CRM");
|
||||
|
||||
//-- PASSAGGIO FORZATO IN PRESA IN CARICO -------------------
|
||||
dao.merge(richiesta);
|
||||
|
||||
logStoricoPassaggioStato(richiesta.getIdRichiesta(), statoDa, StatoRichiestaDon.PRESA_IN_CARICO, log);
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
||||
//-- PASSAGGIO FORZATO IN ATTESA VERIFICA -------------------
|
||||
RequestManagerDonor82.avanzaStatoInAttesaVerifica(richiesta.getCodiceSessione(), log);
|
||||
//-----------------------------------------------------------
|
||||
//-- PASSAGGIO FORZATO IN ATTESA VERIFICA -------------------
|
||||
RequestManagerDonor82.avanzaStatoInAttesaVerifica(richiesta.getCodiceSessione(), log);
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
||||
//-- PASSAGGIO FORZATO IN ACCETTATA -------------------------
|
||||
RequestManagerDonor82.avanzaStatoInAccettata(richiesta, log);
|
||||
//-----------------------------------------------------------
|
||||
} else if (!utenzaDbss) {
|
||||
log.write("9999", "DN NON MULTILINEA");
|
||||
//-- PASSAGGIO FORZATO IN ACCETTATA -------------------------
|
||||
RequestManagerDonor82.avanzaStatoInAccettata(richiesta, log);
|
||||
//-----------------------------------------------------------
|
||||
} else if (!utenzaDbss) {
|
||||
log.write("9999", "DN NON MULTILINEA");
|
||||
|
||||
//-- PASSAGGIO IN PRESA IN CARICO e INVIO NOTIFICA A CRM ---
|
||||
SistemaCrmIF crmController = ControllerFactory.getSistemaCRMDonor(crmCompetenza);
|
||||
crmController.notificaCRMDonor(richiesta.getIdRichiesta());
|
||||
//-- PASSAGGIO IN PRESA IN CARICO e INVIO NOTIFICA A CRM ---
|
||||
SistemaCrmIF crmController = ControllerFactory.getSistemaCRMDonor(crmCompetenza);
|
||||
crmController.notificaCRMDonor(richiesta.getIdRichiesta());
|
||||
|
||||
dao.merge(richiesta);
|
||||
dao.merge(richiesta);
|
||||
|
||||
logStoricoPassaggioStato(richiesta.getIdRichiesta(), statoDa, StatoRichiestaDon.PRESA_IN_CARICO, log);
|
||||
//-----------------------------------------------------------
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
} else
|
||||
throw new StateTransitionNotPossibleException("StateTransitionNotPossibleException");
|
||||
logStoricoPassaggioStato(richiesta.getIdRichiesta(), statoDa, StatoRichiestaDon.PRESA_IN_CARICO, log);
|
||||
//-----------------------------------------------------------
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
} else
|
||||
throw new StateTransitionNotPossibleException("StateTransitionNotPossibleException");
|
||||
}
|
||||
|
||||
private static void callVerificaFase2DBSS(ProcessLogger log, GnpRichiesteDonor82 richiesta, GnpCrmNotifyDonorOutDAO dbssDonorOutRecDAO) throws Exception {
|
||||
log.write("9999", "START Chiamata al WS WirelineLineCodeQuery DBSS DN:["+richiesta.getDn()+"]");
|
||||
// chiamata al WS WirelineLineCodeQuery
|
||||
DBSSController dbssController = DBSSController.getInstance();
|
||||
GnpCrmNotifyDonorOut dbssDonorOut = dbssController.creaRichiestaVerificaFase2(richiesta);
|
||||
WirelineCeaseCheck82ResponseType dbssResponse = dbssController.callNotificaDbssD82(dbssDonorOut);
|
||||
|
||||
String esito = null;
|
||||
if (dbssResponse != null) {
|
||||
esito = dbssResponse.getProcessData().getReturnDescription();
|
||||
dbssDonorOutRecDAO.save(dbssDonorOut);
|
||||
log.write("9999", "Esito sincrono chiamata: " + esito);
|
||||
}else {
|
||||
log.write("9999", "Risposta vuota non gestita: "+richiesta.getCrmCompetenza()+" DN:"+richiesta.getDn()+" Id-Richiesta: "+richiesta.getIdRichiesta());
|
||||
buildScartiVerificaCs(richiesta,VERIFICA_CS_DBSS_ESITO_NON_GESTITO,VERIFICA_CS_DBSS_ESITO_NON_GESTITO_DESCRIZIONE,log);
|
||||
}
|
||||
|
||||
log.write("9999", "END Chiamata al WS WirelineLineCodeQuery DBSS DN:["+richiesta.getDn()+"]");
|
||||
private static void callVerificaFase2DBSS(ProcessLogger log, GnpRichiesteDonor82 richiesta, GnpCrmNotifyDonorOutDAO dbssDonorOutRecDAO) throws Exception {
|
||||
DBSSController dbssController = DBSSController.getInstance();
|
||||
GnpCrmNotifyDonorOut dbssDonorOut = dbssController.creaRichiestaVerificaFase2(richiesta);
|
||||
dbssController.invioNotificaD82(dbssDonorOut);
|
||||
}
|
||||
|
||||
public static void callNotificaFase3DBSS(ProcessLogger log, GnpRichiesteDonor82 richiesta, GnpCrmNotifyDonorOutDAO dbssDonorOutRecDAO, GnpNowD82RichiesteOut nowDonorOut) throws Exception {
|
||||
log.write("9999", "START Chiamata al WS WirelineLineCodeQuery DBSS DN:["+richiesta.getDn()+"]");
|
||||
// chiamata al WS WirelineLineCodeQuery
|
||||
DBSSController dbssController = DBSSController.getInstance();
|
||||
GnpCrmNotifyDonorOut dbssDonorOut = dbssController.creaNotificaEsitoN9(richiesta, nowDonorOut);
|
||||
WirelineCeaseCheck82ResponseType dbssResponse = dbssController.callNotificaDbssD82(dbssDonorOut);
|
||||
|
||||
String esito = null;
|
||||
if (dbssResponse != null) {
|
||||
esito = dbssResponse.getProcessData().getReturnDescription();
|
||||
dbssDonorOutRecDAO.save(dbssDonorOut);
|
||||
log.write("9999", "Esito sincrono chiamata: " + esito);
|
||||
}else {
|
||||
log.write("9999", "Risposta vuota non gestita: "+richiesta.getCrmCompetenza()+" DN:"+richiesta.getDn()+" Id-Richiesta: "+richiesta.getIdRichiesta());
|
||||
//buildScartiVerificaCs(richiesta,VERIFICA_CS_DBSS_ESITO_NON_GESTITO,VERIFICA_CS_DBSS_ESITO_NON_GESTITO_DESCRIZIONE,log);
|
||||
}
|
||||
|
||||
log.write("9999", "END Chiamata al WS WirelineLineCodeQuery DBSS DN:["+richiesta.getDn()+"]");
|
||||
dbssController.invioNotificaD82(dbssDonorOut);
|
||||
}
|
||||
|
||||
|
||||
private static boolean isUtenzaDBSS(String piattaforma) {
|
||||
return "D".equalsIgnoreCase(piattaforma);
|
||||
return "D".equalsIgnoreCase(piattaforma);
|
||||
}
|
||||
|
||||
public static void avanzaStatoInPresaInCaricoKO(GnpRichiesteDonor82 richiesta, ProcessLogger log)
|
||||
@@ -797,4 +769,3 @@ public class RequestManagerDonor82 {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user