if(!cmd.equalsIgnoreCase(IRT.name()) && !cmd.equalsIgnoreCase(DRT.name()) && !cmd.equalsIgnoreCase(URT.name())) {
LOG.warn("LoadBagSummary record command is {} but not IRT/DRT/URT. The process won't be continued.", cmd);
return;
}
EntDbLoadBagSummary updatedBagSummary = formNewLoadBagSummary(ufisMsgDTO);
if(updatedBagSummary == null) {
LOG.error("BagSummary cannot be created with provided data. The process will not be performed.");
return;
}
LOG.info("ID_FLIGHT : {}, ID_CONX_FLIGHT : {}", updatedBagSummary.getIdFlight(), updatedBagSummary.getIdConxFlight());
//To process only when both id_flight and id_conx_flight have value.
if(updatedBagSummary.getIdFlight() == null || updatedBagSummary.getIdConxFlight() == null ||
updatedBagSummary.getIdFlight().equals(BigDecimal.ZERO) || updatedBagSummary.getIdConxFlight().equals(BigDecimal.ZERO) ||
updatedBagSummary.getIdFlight().equals(updatedBagSummary.getIdConxFlight())) {
LOG.error("ID_FLIGHT[{}] and ID_CONX_FLIGHT[{}] must be provided and not be the same. Otherwise the process will not be performed.", updatedBagSummary.getIdFlight(), updatedBagSummary.getIdConxFlight());
return;
}
switch(cmd) {
case "IRT": processConxStatForLoadBagSummaryIRT(updatedBagSummary);
break;
case "DRT": processConxStatForLoadBagSummaryDRT(updatedBagSummary);
break;
case "URT": EntDbLoadBagSummary oldΒagSummary = formOldLoadBagSummary(ufisMsgDTO);
if(oldΒagSummary == null) {
LOG.error("BagSummary cannot be created with provided data. The process will not be performed.");
return;
}
processConxStatForLoadBagSummaryURT(oldΒagSummary, updatedBagSummary);