List<EntDbFltConnectSummary> fltConnectSummaryList = dlFltConxSummaryBean.findExistingForAllFlights(bagSummary.getIdFlight(), bagSummary.getIdConxFlight());
//Find FLT_CONNECT_SUMMARY with conxflights and record doesn't exist / evaluate Bag connection status
if(fltConnectSummaryList.isEmpty()) {
EntDbAfttab entAft = dlAfttabBean.find(bagSummary.getIdFlight());
List<FltConnectionDTO> list = new ArrayList<>();
FltConnectionDTO dto = new FltConnectionDTO();
dto.setIdFlight(bagSummary.getIdFlight());
dto.setIdConxFlight(bagSummary.getIdConxFlight());
dto.setBagPcs(bagSummary.getBagPcs().intValue());
list.add(dto);
fltConxProcessBean.process(HpUfisAppConstants.CON_LOAD_BAG_SUMMARY, entAft, list);
return;
}
//Find FLT_CONNECT_SUMMARY with conxflights and record exists.
//If ‘Bag connection status’ is blank or ‘no connection’, do processing. Otherwise skip
//Result is at most 2 - idFlight/arr and idConxFlight/dep OR idConxFlight/arr and idFlight/dep
for (EntDbFltConnectSummary entDbFltConnectSummary : fltConnectSummaryList) {
if(HpUfisUtils.isNullOrEmptyStr(entDbFltConnectSummary.getConxStatBag().trim()) || entDbFltConnectSummary.getConxStatBag().trim().equalsIgnoreCase("X")) {
EntDbAfttab entAft = dlAfttabBean.find(entDbFltConnectSummary.getIdArrFlight());
List<FltConnectionDTO> list = new ArrayList<>();
FltConnectionDTO dto = new FltConnectionDTO();
dto.setIdFlight(entDbFltConnectSummary.getIdArrFlight());
dto.setIdConxFlight(entDbFltConnectSummary.getIdDepFlight());