Fix DBCFX_SM_692 - Eliminato tag CharacteristicValue con nil="true" nella WirelineCeaseCheck82Request (CHECKFASE2/NOTIFICACONTROLLIFASE3) verso CCC, se CODFISCALEPARTITAIVA non è presente è popolato

This commit is contained in:
vincenzofariello
2024-10-08 16:35:00 +02:00
parent 64456e00c6
commit 0b9e63e74f
2 changed files with 20 additions and 41 deletions

View File

@@ -12,7 +12,6 @@ import it.valueteam.gnp.exception.xml.MalformedXmlException;
import it.valueteam.gnp.log.ProcessLogger;
import it.valueteam.gnp.manager.RequestManagerDonor82;
import it.valueteam.gnp.obj.*;
import it.valueteam.gnp.obj.jms.NotificationMessage;
import it.valueteam.gnp.systemcontroller.ControllerFactory;
import it.valueteam.gnp.systemcontroller.crm.SistemaCrmIF;
import it.valueteam.gnp.systemcontroller.formatcontroller.FormatController;
@@ -338,7 +337,7 @@ public abstract class AbstractCRMFormatController extends FormatController {
UserTransactionUtility.endUserTransaction(utx, true);
} catch (Exception ex) {
log.write("9999", "Errore in acquisizione esitoVerificaCS82: ] codice_sessione[" + body.getCODICE_SESSIONE() + "]" + " exception " + ex.getMessage());
response.setCOD_RISPOSTA("0");
response.setCOD_RISPOSTA("1");
response.setDESC_RISPOSTA(ex.getMessage());
ex.printStackTrace();
UserTransactionUtility.endUserTransaction(utx, false);

View File

@@ -1421,8 +1421,6 @@ public class DBSSFormatController extends FormatController {
Calendar calendar = Calendar.getInstance();
calendar.setTime(dbssDonorOut.getDataOrdine());
int charValueIndex = 0; //usato come indice per l'array CharacteristicValueType
GnpNowD82RichiesteOutDAO nowDonorOutDAO = new GnpNowD82RichiesteOutDAO();
GnpNowD82RichiesteOut nowDonorOut = null;
@@ -1433,61 +1431,42 @@ public class DBSSFormatController extends FormatController {
}
request.setInteractionDate(calendar);
CharacteristicValueType[] characteristics = new CharacteristicValueType[12];
// Check lunghezza array characteristics - begin
if (!Func.isNull(dbssDonorOut.getAggiuntivi())) {
characteristics = new CharacteristicValueType[13];
}
if (operation.equals(DBSSMap.EVENTO_ESITO_VERIFICA_COD_SESSIONE)) {
nowDonorOut = nowDonorOutDAO.findByIdRichiesta82(dbssDonorOut.getCodiceRichiesta());
if (!Func.isNull(dbssDonorOut.getAggiuntivi()) && (nowDonorOut != null && !Func.isNull(nowDonorOut.getMotivazione()))) {
characteristics = new CharacteristicValueType[15];
}
else {
if (!Func.isNull(dbssDonorOut.getAggiuntivi()) || (nowDonorOut != null && !Func.isNull(nowDonorOut.getMotivazione())))
characteristics = new CharacteristicValueType[14];
else
characteristics = new CharacteristicValueType[13];
}
}
ArrayList<CharacteristicValueType> characteristicsList = new ArrayList<CharacteristicValueType>();
CharacteristicValueType reqType = new CharacteristicValueType();
CharacteristicSpecificationType reqName = new CharacteristicSpecificationType();
reqName.setName("RequestType");
reqType.setCharacteristicSpecification(reqName);
reqType.setValue(dbssDonorOut.getAmbito());
characteristics[charValueIndex++] = reqType;
characteristicsList.add(reqType);
CharacteristicValueType reqId = new CharacteristicValueType();
CharacteristicSpecificationType reqIdName = new CharacteristicSpecificationType();
reqIdName.setName("RequestId");
reqId.setCharacteristicSpecification(reqIdName);
reqId.setValue(dbssDonorOut.getCodiceSessione());
characteristics[charValueIndex++] = reqId;
characteristicsList.add(reqId);
CharacteristicValueType externalId = new CharacteristicValueType();
CharacteristicSpecificationType externalIdName = new CharacteristicSpecificationType();
externalIdName.setName("ExternalID");
externalId.setCharacteristicSpecification(externalIdName);
externalId.setValue(dbssDonorOut.getCodiceOrdineOlo());
characteristics[charValueIndex++] = externalId;
characteristicsList.add(externalId);
CharacteristicValueType dnType = new CharacteristicValueType();
CharacteristicSpecificationType dnName = new CharacteristicSpecificationType();
dnName.setName("ServiceNumber");
dnType.setCharacteristicSpecification(dnName);
dnType.setValue(dbssDonorOut.getDirectoryNumber());
characteristics[charValueIndex++] = dnType;
characteristicsList.add(dnType);
CharacteristicValueType donorType = new CharacteristicValueType();
CharacteristicSpecificationType donorName = new CharacteristicSpecificationType();
donorName.setName("DonorCode");
donorType.setCharacteristicSpecification(donorName);
donorType.setValue(dbssDonorOut.getIdOperatoreDonor());
characteristics[charValueIndex++] = donorType;
characteristicsList.add(donorType);
if (!Func.isNull(dbssDonorOut.getAggiuntivi())) {
CharacteristicValueType additionalType = new CharacteristicValueType();
@@ -1495,7 +1474,7 @@ public class DBSSFormatController extends FormatController {
additionalName.setName("AdditionalServiceNumber");
additionalType.setCharacteristicSpecification(additionalName);
additionalType.setValue(dbssDonorOut.getAggiuntivi());
characteristics[charValueIndex++] = additionalType;
characteristicsList.add(additionalType);
}
CharacteristicValueType isnpType = new CharacteristicValueType();
@@ -1503,42 +1482,42 @@ public class DBSSFormatController extends FormatController {
isnpName.setName("isNP");
isnpType.setCharacteristicSpecification(isnpName);
isnpType.setValue(dbssDonorOut.getFlagNp());
characteristics[charValueIndex++] = isnpType;
characteristicsList.add(isnpType);
CharacteristicValueType oloCodeType = new CharacteristicValueType();
CharacteristicSpecificationType oloCodeName = new CharacteristicSpecificationType();
oloCodeName.setName("OLOCode");
oloCodeType.setCharacteristicSpecification(oloCodeName);
oloCodeType.setValue(dbssDonorOut.getIdOperatoreDonating());
characteristics[charValueIndex++] = oloCodeType;
characteristicsList.add(oloCodeType);
CharacteristicValueType cosCodeType = new CharacteristicValueType();
CharacteristicSpecificationType cosCodeName = new CharacteristicSpecificationType();
cosCodeName.setName("COSCode");
cosCodeType.setCharacteristicSpecification(cosCodeName);
cosCodeType.setValue(dbssDonorOut.getCodiceSegreto());
characteristics[charValueIndex++] = cosCodeType;
characteristicsList.add(cosCodeType);
CharacteristicValueType corCodeType = new CharacteristicValueType();
CharacteristicSpecificationType corCodeName = new CharacteristicSpecificationType();
corCodeName.setName("CORCode");
corCodeType.setCharacteristicSpecification(corCodeName);
corCodeType.setValue(dbssDonorOut.getCor());
characteristics[charValueIndex++] = corCodeType;
characteristicsList.add(corCodeType);
CharacteristicValueType oloRecType = new CharacteristicValueType();
CharacteristicSpecificationType oloRecName = new CharacteristicSpecificationType();
oloRecName.setName("RepientOLOCode");
oloRecType.setCharacteristicSpecification(oloRecName);
oloRecType.setValue(dbssDonorOut.getCodiceOloRecipient());
characteristics[charValueIndex++] = oloRecType;
characteristicsList.add(oloRecType);
CharacteristicValueType cowCodeType = new CharacteristicValueType();
CharacteristicSpecificationType cowCodeName = new CharacteristicSpecificationType();
cowCodeName.setName("COWCode");
cowCodeType.setCharacteristicSpecification(cowCodeName);
cowCodeType.setValue(dbssDonorOut.getCow());
characteristics[charValueIndex++] = cowCodeType;
characteristicsList.add(cowCodeType);
if (!Func.isNull(dbssDonorOut.getCodFiscalePartitaIva())) {
@@ -1548,7 +1527,7 @@ public class DBSSFormatController extends FormatController {
codiceFiscaleName.setName("FiscalCode");
codiceFiscaleType.setCharacteristicSpecification(codiceFiscaleName);
codiceFiscaleType.setValue(dbssDonorOut.getCodFiscalePartitaIva());
characteristics[charValueIndex++] = codiceFiscaleType;
characteristicsList.add(codiceFiscaleType);
}
else{
CharacteristicValueType partitaIvaType = new CharacteristicValueType();
@@ -1556,19 +1535,20 @@ public class DBSSFormatController extends FormatController {
partitaIvaName.setName("VATCode");
partitaIvaType.setCharacteristicSpecification(partitaIvaName);
partitaIvaType.setValue(dbssDonorOut.getCodFiscalePartitaIva());
characteristics[charValueIndex++] = partitaIvaType;
characteristicsList.add(partitaIvaType);
}
}
if (operation.equals(DBSSMap.EVENTO_ESITO_VERIFICA_COD_SESSIONE)) {
nowDonorOut = nowDonorOutDAO.findByIdRichiesta82(dbssDonorOut.getCodiceRichiesta());
if (nowDonorOut != null) {
CharacteristicValueType phase3Result = new CharacteristicValueType();
CharacteristicSpecificationType phase3ResultName = new CharacteristicSpecificationType();
phase3ResultName.setName("Phase3Result");
phase3Result.setCharacteristicSpecification(phase3ResultName);
phase3Result.setValue(nowDonorOut.getEsito());
characteristics[charValueIndex++] = phase3Result;
characteristicsList.add(phase3Result);
if (!Func.isNull(nowDonorOut.getMotivazione())){
CharacteristicValueType phase3ResultD = new CharacteristicValueType();
@@ -1576,12 +1556,12 @@ public class DBSSFormatController extends FormatController {
phase3ResultDName.setName("Phase3ResultDescription");
phase3ResultD.setCharacteristicSpecification(phase3ResultDName);
phase3ResultD.setValue(nowDonorOut.getMotivazione());
characteristics[charValueIndex++] = phase3ResultD;
characteristicsList.add(phase3ResultD);
}
}
}
request.setCharacteristicValue(characteristics);
request.setCharacteristicValue(characteristicsList.toArray(new CharacteristicValueType[0]));
return request;
}