// load.set_createdDate(ufisCal.getTime());
// load.set_createdUser("MACS-FLT");
// _loadSummaryBean.persist(load);
// }
EntDbLoadPaxSummary load = _loadPaxSummaryBean
.getLoadPaxSummaryByMfid(new BigDecimal(flightData.getMflId()), DATA_SOURCE);
if (load == null) {
load = new EntDbLoadPaxSummary();
load.setInterfaceFltId(new BigDecimal(flightData.getMflId()));
load.setDataSource(DATA_SOURCE);
load.setCreatedUser(MSGIF);
load.setRecStatus(" ");
_loadPaxSummaryBean.create(load);
}
// config load
load.setInfoType(LOAD_INFOID);
// 2014-01-14 updated by JGO - change to id_flight and id_conx_flight
// update afttab flight urno to load summary table
/*if (aftFlight != null) {
if ('A' == aftFlight.getAdid()) {
//load.setArrFlId(String.valueOf(aftFlight.getUrno()));
load.setIdArrFlight(aftFlight.getUrno());
} else if ('D' == aftFlight.getAdid()) {
//load.setDepFlId(String.valueOf(aftFlight.getUrno()));
load.setIdDepFlight(aftFlight.getUrno());
}
}*/
load.setIdFlight(aftFlight.getUrno());
load.setIdConxFlight(BigDecimal.ZERO);
// update class configuration
String classConfig = flightData.getClassConfiguration();
if (HpUfisUtils.isNotEmptyStr(classConfig)) {
int indexF = classConfig.indexOf(CLASS_INDICATOR_FST);
int indexJ = classConfig.indexOf(CLASS_INDICATOR_BUS);
int indexY = classConfig.indexOf(CLASS_INDICATOR_ECO);
String figure = "";
// first
if (indexF != -1 && indexJ != -1 && (indexJ - indexF) > 0) {
figure = classConfig.substring(indexF + 1, indexJ);
//load.setFirstClass(Integer.parseInt(figure));
load.setFirstPax(new BigDecimal(figure));
}
// business
if (indexJ != -1 && indexY != -1 && (indexY - indexJ) > 0) {
figure = classConfig.substring(indexJ + 1, indexY);
//load.setBusinessClass(Integer.parseInt(figure));
load.setBusinessPax(new BigDecimal(figure));
}
// economy
if (indexY != -1) {
figure = classConfig.substring(indexY + 1);
//load.setEconomyClass(Integer.parseInt(figure));
load.setEconPax(new BigDecimal(figure));
// 2014-01-15 updated by JGO - save the value to all_econ_pax field as well
load.setAllEconPax(load.getEconPax());
}
// 2013-12-16 updated by JGO - Sum the total_pax for CFG
load.setTotalPax(load.getFirstPax().add(load.getBusinessPax()).add(load.getEconPax()));
}
load.setUpdatedDate(ufisCal.getTime());
//load.setDataSource(INTSYSTEM_MACS_FLT);
load.setDataSource(DATA_SOURCE);
load.setUpdatedUser(MSGIF);
load.setRecStatus(" ");
_loadPaxSummaryBean.edit(load);
LOG.debug("Class Configuration Info has been created/updated for MFL_ID: {}",
flightData.getMflId());
} catch (Exception e) {
LOG.error("Macs-Flt(load info): Cannot insert/update load summary class configuration");