if(mainFlt.getUrno().equals(dto.getIdConxFlight())) {
LOG.error("ID_FLIGHT[{}] and ID_CONX_FLIGHT[{}] must not be the same. Otherwise the process will not be performed.", mainFlt.getUrno(), dto.getIdConxFlight());
return;
}
if (dto.getIdConxFlight().intValue() != 0) {
EntDbAfttab conxFlight = afttabBean.findFlightForConx(dto.getIdConxFlight());
if (conxFlight != null) {
// Main flight and conx flight must be either arrival or departure flight
if (ADID_ARRIVAL != mainFlt.getAdid() && ADID_DEPARTURE != mainFlt.getAdid()) {
LOG.warn("Main flight must be arrival or departure flight");
LOG.warn("ADID={} for main flight={}", mainFlt.getAdid(), mainFlt.getUrno());
continue;
}
if (ADID_ARRIVAL != conxFlight.getAdid() && ADID_DEPARTURE != conxFlight.getAdid()) {
LOG.warn("Conx flight must be arrival or departure flight");
LOG.warn("ADID={} for conx flight={}", conxFlight.getAdid(), conxFlight.getUrno());
continue;
}
// Calculate the time span between main and connect flight
BigDecimal idArrFlight = null;
BigDecimal idDepFlight = null;
HpUfisCalendar tifa = null;
HpUfisCalendar tifd = null;
char tga1 = ' ';
char tgd1 = ' ';
if (ADID_ARRIVAL == mainFlt.getAdid()) {
tifa = new HpUfisCalendar(mainFlt.getTifa());
tifd = new HpUfisCalendar(conxFlight.getTifd());
idArrFlight = mainFlt.getUrno();
idDepFlight = conxFlight.getUrno();
tga1 = mainFlt.getTga1();
tgd1 = conxFlight.getTgd1();
} else {
tifa = new HpUfisCalendar(conxFlight.getTifa());
tifd = new HpUfisCalendar(mainFlt.getTifd());
idArrFlight = conxFlight.getUrno();
idDepFlight = mainFlt.getUrno();
tga1 = conxFlight.getTgd1();
tgd1 = mainFlt.getTga1();
}
int timeDiff = (int) tifa.timeDiff(tifd, EnumTimeInterval.Minutes, false);
LOG.debug("Time Difference between main flight and conx flight: {} mins", timeDiff);