Package com.ufis_as.ek_if.macs.entities

Examples of com.ufis_as.ek_if.macs.entities.EntDbLoadPaxSummary


    if(!cmd.equalsIgnoreCase(IRT.name()) && !cmd.equalsIgnoreCase(DRT.name()) && !cmd.equalsIgnoreCase(URT.name())) {
      LOG.warn("LoadPaxSummary record command is {} but not IRT/DRT/URT. The process won't be continued.", cmd);
      return;
    }
   
    EntDbLoadPaxSummary updatedPaxSummary = formNewLoadPaxSummary(ufisMsgDTO);
    if(updatedPaxSummary == null) {
      LOG.error("PaxSummary cannot be created with provided data. The process will not be performed.");
      return;
    }
   
    LOG.info("ID_FLIGHT : {}, ID_CONX_FLIGHT : {}", updatedPaxSummary.getIdFlight(), updatedPaxSummary.getIdConxFlight());
   
    //To process only when both id_flight and id_conx_flight have value.
    if(updatedPaxSummary.getIdFlight() == null || updatedPaxSummary.getIdConxFlight() == null ||
        updatedPaxSummary.getIdFlight().equals(BigDecimal.ZERO) || updatedPaxSummary.getIdConxFlight().equals(BigDecimal.ZERO) ||
        updatedPaxSummary.getIdFlight().equals(updatedPaxSummary.getIdConxFlight())) {
      LOG.error("ID_FLIGHT[{}] and ID_CONX_FLIGHT[{}] must be provided and not be the same. Otherwise the process will not be performed.", updatedPaxSummary.getIdFlight(), updatedPaxSummary.getIdConxFlight());
      return;
    }
   
    switch(cmd) {
      case "IRT": processConxStatForLoadPaxSummaryIRT(updatedPaxSummary);
            break;
      case "DRT": processConxStatForLoadPaxSummaryDRT(updatedPaxSummary);
            break;
      case "URT": EntDbLoadPaxSummary oldPaxSummary = formOldLoadPaxSummary(ufisMsgDTO);
            if(oldPaxSummary == null) {
              LOG.error("PaxSummary cannot be created with provided data. The process will not be performed.");
              return;
            }
            processConxStatForLoadPaxSummaryURT(oldPaxSummary, updatedPaxSummary);
View Full Code Here


    if(fldList.size() != data.size()) {
      LOG.error("Field list size and data list size are not equal. The process will not be performed.");
      return null;
    }
   
    EntDbLoadPaxSummary paxSummary = new EntDbLoadPaxSummary();
   
    int i = 0;
    for (String fld : fldList) {
      switch(fld.toUpperCase()){
        case "ID_FLIGHT": paxSummary.setIdFlight(BigDecimal.valueOf(Long.parseLong(data.get(i).toString()))); break;
        case "ID_CONX_FLIGHT" : paxSummary.setIdConxFlight(BigDecimal.valueOf(Long.parseLong(data.get(i).toString()))); break;
        case "INFO_TYPE" : paxSummary.setInfoType(data.get(i).toString()); break;
        case "TOTAL_PAX" : paxSummary.setTotalPax(BigDecimal.valueOf(Float.parseFloat(data.get(i).toString()))); break;
      }
      i++;
    }
   
    return paxSummary;
View Full Code Here

      // 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");
View Full Code Here

  protected EntityManager getEntityManager() {
    return _em;
  }

  public EntDbLoadPaxSummary findByPk(String id) {
    EntDbLoadPaxSummary entDbLoadPaxSummary = null;
    try {
      Query query = getEntityManager().createNamedQuery(
          "EntDbLoadPaxSummary.findByPk");
      query.setParameter("id", id);
View Full Code Here

    return entDbLoadPaxSummary;

  }
 
  public EntDbLoadPaxSummary findByintIdNtype(EntDbLoadPaxSummary loadPaxSum) {
    EntDbLoadPaxSummary entDbLoadPaxSummary = null;
    try {
      Query query = getEntityManager().createNamedQuery(
          "EntDbLoadPaxSummary.findByintIdNtype");
      query.setParameter("interfaceFltId", loadPaxSum.getInterfaceFltId());
      query.setParameter("infoType", loadPaxSum.getInfoType());
View Full Code Here

  }

  @Override
  public EntDbLoadPaxSummary getLoadPaxSummaryByMfid(BigDecimal mfid,
      String dataSource) {
    EntDbLoadPaxSummary entity = null;
    try {
      Query query = getEntityManager().createNamedQuery(
          "EntDbLoadPaxSummary.findByMfid");
      query.setParameter("mfid", mfid);
      query.setParameter("infoType", HpEKConstants.LOAD_TYPE_CONFIG);
View Full Code Here

        if (loadPaxSumList != null) {
          LOG.debug("{} records found in Load_Pax_Summary for idArrFlight={}",
              loadPaxSumList.size(),
              flight.getUrno());
          for (int i = 0; i < loadPaxSumList.size(); i++) {
            EntDbLoadPaxSummary loadPaxSummary = loadPaxSumList.get(i);
            if (loadPaxSummary.getIdDepFlight() != null) {
              // find the conx dept flight from AFTTAB
              EntDbAfttab dept = clsAfttabBeanLocal.findFlightForConx(
                      loadPaxSummary.getIdDepFlight());
              if (dept != null) {
                criticalNum += processFltConxSummary(flight, dept);
              } else {
                LOG.debug("No Connected flight(urno:{}) found in AFTTAB for flight(urno: {})",
                    loadPaxSummary.getIdDepFlight(),
                    flight.getUrno());
              }
            }
          }
        }
      } else if ('D' == flight.getAdid()) {

        // look for connected arr flight from load_pax_summary
        List<EntDbLoadPaxSummary> loadPaxSumList = clsDlLoadSummaryBean.findByDepFlId(flight.getUrno());
        if (loadPaxSumList != null) {
          LOG.debug("{} records found in Load_Pax_Summary for idDepFlight={}",
              loadPaxSumList.size(),
              flight.getUrno());
          for (int i = 0; i < loadPaxSumList.size(); i++) {
            EntDbLoadPaxSummary loadPaxSummary = loadPaxSumList.get(i);
            if (loadPaxSummary.getIdArrFlight() != null) {
              EntDbAfttab arr = clsAfttabBeanLocal.findFlightForConx(
                      loadPaxSummary.getIdArrFlight());
              if (arr != null) {
                // process only when the conx flight existed.
                criticalNum += processFltConxSummary(arr, flight);
              } else {
                LOG.debug("No Connected flight(urno:{}) found in AFTTAB for flight(urno: {})",
                    loadPaxSummary.getIdArrFlight(),
                    flight.getUrno());
              }
            }
          }
        }
View Full Code Here

  public void handleMACSPAX(List<EntDbLoadPaxSummary> entDbLoadPaxSummaryList) {

    Iterator<EntDbLoadPaxSummary> it = entDbLoadPaxSummaryList.iterator();
    while (it.hasNext()) {
      EntDbLoadPaxSummary entDbLoadPaxSummary = it.next();

      EntDbLoadPaxSummary EntDbLoadSummaryFind = _loadPaxSummaryBean
          .findByPk(entDbLoadPaxSummary.getId());

      if (EntDbLoadSummaryFind != null) {
        _loadPaxSummaryBean.update(entDbLoadPaxSummary);
      } else {
View Full Code Here

    long endTime = new Date().getTime();
    LOG.info("takes {} ms to get records from load_pax  table, idFlight: {}", (endTime - startTime), entDbFlightIdMapping.getIdFlight().intValue());

    if (rawPaxList != null){   
    // set basic
    EntDbLoadPaxSummary loa = getLoadSummaryBasic(entDbFlightIdMapping, rawPaxList);
   
    // set booking
    loaList.add(setLoadSummaryResult((EntDbLoadPaxSummary)SerializationUtils.clone(loa),"BOK",rawPaxList));
    // set check in
    loaList.add(setLoadSummaryResult((EntDbLoadPaxSummary)SerializationUtils.clone(loa),"CIN",rawPaxList));
View Full Code Here

      // Get raw passenger information from database
      List<EntDbLoadPaxConn> rawPaxConnList = dlPaxConBean.getPaxConnListByIntflidAndFlightnumberX(intIdFlight, airlineCode, flightNumber, flightNumberSuffice, scheduledFlightDatetime);
     
      if (rawPaxConnList != null){
        // set basic
        EntDbLoadPaxSummary loa = getLoadSummaryBasic(null, rawPaxConnList);
        // set transfer
        loaList.add(setLoadSummaryResult((EntDbLoadPaxSummary)SerializationUtils.clone(loa),"TXF",rawPaxConnList));
       
      }else{
        LOG.debug("Can not find paxConn by intIdFlight "+intIdFlight);
View Full Code Here

TOP

Related Classes of com.ufis_as.ek_if.macs.entities.EntDbLoadPaxSummary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.