Package com.ufis_as.ek_if.macs.entities

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


    if(!cmd.equalsIgnoreCase(IRT.name()) && !cmd.equalsIgnoreCase(DRT.name()) && !cmd.equalsIgnoreCase(URT.name())) {
      LOG.warn("LoadPaxConnect record command is {} but not IRT/DRT/URT. The process won't be continued.", cmd);
      return;
    }
   
    EntDbLoadPaxConn loadPaxConnect = formLoadPaxConnect(ufisMsgDTO);
    if(loadPaxConnect == null) {
      LOG.error("LoadPaxConnect cannot be created with provided data. The process will not be performed.");
      return;
    }
   
    LOG.info("ID_FLIGHT : {}, ID_CONX_FLIGHT : {}", loadPaxConnect.getIdFlight(), loadPaxConnect.getIdConxFlight());
   
    //To process only when both id_flight and id_conx_flight have value.
    if(loadPaxConnect.getIdFlight() == 0 || loadPaxConnect.getIdConxFlight() == 0 ||
        loadPaxConnect.getIdFlight() == loadPaxConnect.getIdConxFlight()) {
      LOG.error("ID_FLIGHT[{}] and ID_CONX_FLIGHT[{}] must be provided and not be the same. Otherwise the process will not be performed.", loadPaxConnect.getIdFlight(), loadPaxConnect.getIdConxFlight());
      return;
    }
   
    switch(cmd) {
      case "IRT": processConxStatForIRT(loadPaxConnect);
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;
    }
   
    EntDbLoadPaxConn loadPaxConnect = new EntDbLoadPaxConn();
   
    int i = 0;
    for (String fld : fldList) {
      switch(fld.toUpperCase()){
        case "ID_FLIGHT": loadPaxConnect.setIdFlight(Integer.parseInt(data.get(i).toString())); break;
        case "ID_CONX_FLIGHT" : loadPaxConnect.setIdConxFlight(Integer.parseInt(data.get(i).toString())); break;
      }
      i++;
    }
   
    return loadPaxConnect;
View Full Code Here

  }

  public EntDbLoadPaxConn readStorePax(InbDetails inbDetails, long irmtabRef) {
    // Store Pax Details for this MAXCS ID
    // find record with the maxcs id and
    EntDbLoadPaxConn result = null;
   
    if (inbDetails != null) {
     
      logLevel = entStartupInitSingleton.getIrmLogLev();
       
        msgLogged = Boolean.FALSE;
        if (irmtabRef > 0) {
          msgLogged = Boolean.TRUE;
        }
     
      HpUfisCalendar ufisCalendar = new HpUfisCalendar();
      ufisCalendar.setCustomFormat(HpEKConstants.MACS_TIME_FORMAT); // 2012-12-18
                                      // 00:00:00

      EntDbLoadPaxConn edpiod = new EntDbLoadPaxConn();
      LoadPaxConnPK paxConnPk = new LoadPaxConnPK();

      // To check and set the mandatory fields first
      // check as it's a mandatory field
      if (inbDetails.getInbId() != null
          && !inbDetails.getInbId().isEmpty()) {
        edpiod.setIntId(inbDetails.getInbId());
      } else {
        LOG.info("Mandatory field INB_ID is null or empty, Inbound Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // check as it's a mandatory field
      if (inbDetails.getMflId() != null
          && !inbDetails.getMflId().isEmpty()) {
        paxConnPk.setInterfaceFltid(inbDetails.getMflId());
//        edpiod.setInterfaceFltid(inbDetails.getMflId());
      } else {
        LOG.info("Mandatory field MFL_ID is null or empty, Inbound Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // check as it's a mandatory field
      if (inbDetails.getBoardPoint() != null
          && !inbDetails.getBoardPoint().isEmpty()) {
        edpiod.setBoardPoint(inbDetails.getBoardPoint());
      } else {
        LOG.info("Mandatory field BOARD_POINT is null or empty, Inbound Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // check as it's a mandatory field
      if (inbDetails.getOffPoint() != null
          && !inbDetails.getOffPoint().isEmpty()) {
        edpiod.setOffPoint(inbDetails.getOffPoint());
      } else {
        LOG.info("Mandatory field OFF_POINT is null or empty, Inbound Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // // check as it's a mandatory field
      // if (inbDetails.getAirlineDesignator() != null &&
      // !inbDetails.getAirlineDesignator().isEmpty()){
      // edpiod.setAirlineCode(inbDetails.getAirlineDesignator());
      // }else{
      // LOG.info("Mandatory field AIRLINE_DESIGNATOR is null or empty, Inbound Message is rejected");
      // // return null;
      // }

      // check as it's a mandatory field
      if (inbDetails.getAirlineDesignator() == null
          || inbDetails.getAirlineDesignator().isEmpty()) {
        LOG.info("Mandatory field AIRLINE_DESIGNATOR is null or empty, Inbound Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // // check as it's a mandatory field
      // if (inbDetails.getFlightNumber() != null &&
      // !inbDetails.getFlightNumber().isEmpty()){
      // String strFlightNumber = inbDetails.getFlightNumber();
      // strFlightNumber = HpUfisUtils.formatCedaFltn(strFlightNumber);
      // // if (strFlightNumber.length() != 3){
      // // strFlightNumber =
      // Integer.toString(Integer.parseInt(strFlightNumber));
      // // if (strFlightNumber.length() < 3){
      // // int numAdd = 3 - strFlightNumber.length();
      // // for (int i= 0; i < numAdd; i++ ){
      // // strFlightNumber = "0"+strFlightNumber;
      // // }
      // // }
      // // }
      // edpiod.setFlightNumber(strFlightNumber);
      // }else{
      // LOG.info("Mandatory field FLIGHT_NUMBER is null or empty, Inbound Message is rejected");
      // // return null;
      // }

      // check as it's a mandatory field
      if (inbDetails.getFlightNumber() == null
          || inbDetails.getFlightNumber().isEmpty()) {
        LOG.info("Mandatory field FLIGHT_NUMBER is null or empty, Inbound Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // if(inbDetails.getFlightNumberExp() != null){
      // edpiod.setFlightNumberSuffice(inbDetails.getFlightNumberExp());
      // }else{
      // edpiod.setFlightNumberSuffice(" "); // default value
      // }

      // check as it's a mandatory field
      if (inbDetails.getOperationDate() != null
          && !inbDetails.getOperationDate().isEmpty()) {
        ufisCalendar.setTime(inbDetails.getOperationDate(),
            ufisCalendar.getCustomFormat());
        if (inbDetails.getOperationTime().length() >= 4) {
          int hour = 0;
          int min = 0;
          try {
            hour = Integer.parseInt(inbDetails.getOperationTime()
                .substring(0, 2));
            min = Integer.parseInt(inbDetails.getOperationTime()
                .substring(2, 4));
          } catch (Exception e) {
            LOG.info("Inbound message OperationTime parse erro");
          }
          ufisCalendar.DateAdd(hour, EnumTimeInterval.Hours);
          ufisCalendar.DateAdd(min, EnumTimeInterval.Minutes);

        }
        edpiod.setConxFltDate(ufisCalendar.getTime());
      } else {
        LOG.info("Mandatory field OPERATION_DATE is null or empty, Inbound Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // check as it's a mandatory field
      if (inbDetails.getReferenceNumber() != null
          && !inbDetails.getReferenceNumber().isEmpty()) {
//        edpiod.setIntRefNumber(inbDetails.getReferenceNumber());
        paxConnPk.setIntRefNumber(inbDetails.getReferenceNumber());
      } else {
        LOG.info("Mandatory field REFERENCE_NUMBER is null or empty, Inbound Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }
     
      edpiod.setPaxConnPK(paxConnPk);

      edpiod.setIntSystem(HpEKConstants.MACS_PAX_DATA_SOURCE);
      edpiod.setConnType(EnumLoadPaxConnType.I.toString());
      edpiod.setBookedClass(inbDetails.getBookedClass());
      edpiod.setDownloadDate(inbDetails.getDownloadDate());
      edpiod.setConnStatus(inbDetails.getStatus());
      edpiod.setMsgTimeStamp(inbDetails.getTimeStamp());
      edpiod.setVariableData(inbDetails.getVariableData());
      // added by 2013.10.01 according to the new design document
      edpiod.setPaxConxFlno(HpUfisUtils.formatCedaFlno(inbDetails
          .getAirlineDesignator(), HpUfisUtils.formatCedaFltn(inbDetails.getFlightNumber()),
          inbDetails.getFlightNumberExp() == null ? "" : inbDetails
              .getFlightNumberExp().trim()));

//      result = (EntDbLoadPaxConn) SerializationUtils
View Full Code Here

  public EntDbLoadPaxConn readStorePax(OnwDetails ownDetails, long irmtabRef) {
    // Store Pax Details for this MAXCS ID
    // find record with the maxcs id and
   
    EntDbLoadPaxConn result = null;
   
    if (ownDetails != null) {
     
      logLevel = entStartupInitSingleton.getIrmLogLev();
       
        msgLogged = Boolean.FALSE;
        if (irmtabRef > 0) {
          msgLogged = Boolean.TRUE;
        }
     
      EntDbLoadPaxConn edpiod = new EntDbLoadPaxConn();
      LoadPaxConnPK paxConnPk = new LoadPaxConnPK();
     
      HpUfisCalendar ufisCalendar = new HpUfisCalendar();
      ufisCalendar.setCustomFormat(HpEKConstants.MACS_TIME_FORMAT); // 2012-12-18
                                      // 00:00:00

      // check as it's a mandatory field
      if (ownDetails.getOnwId() != null
          && !ownDetails.getOnwId().isEmpty()) {
        edpiod.setIntId(ownDetails.getOnwId());
      } else {
        LOG.info("Mandatory field ONW_ID is null or empty, Onward Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // check as it's a mandatory field
      if (ownDetails.getMflId() != null
          && !ownDetails.getMflId().isEmpty()) {
//        edpiod.setInterfaceFltid(ownDetails.getMflId());
        paxConnPk.setInterfaceFltid(ownDetails.getMflId());
      } else {
        LOG.info("Mandatory field MFL_ID is null or empty, Onward Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // check as it's a mandatory field
      if (ownDetails.getBoardPoint() != null
          && !ownDetails.getBoardPoint().isEmpty()) {
        edpiod.setBoardPoint(ownDetails.getBoardPoint());
      } else {
        LOG.info("Mandatory field BOARD_POINT is null or empty, Onward Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // check as it's a mandatory field
      if (ownDetails.getOffPoint() != null
          && !ownDetails.getOffPoint().isEmpty()) {
        edpiod.setOffPoint(ownDetails.getOffPoint());
      } else {
        LOG.info("Mandatory field OFF_POINT is null or empty, Onward Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // // check as it's a mandatory field
      // if (ownDetails.getAirlineDesignator() != null &&
      // !ownDetails.getAirlineDesignator().isEmpty()){
      // edpiod.setAirlineCode(ownDetails.getAirlineDesignator());
      // }else{
      // LOG.info("Mandatory field AIRLINE_DESIGNATOR is null or empty, Onward Message is rejected");
      // // return null;
      // }

      // check as it's a mandatory field
      if (ownDetails.getAirlineDesignator() == null
          || ownDetails.getAirlineDesignator().isEmpty()) {
        LOG.info("Mandatory field AIRLINE_DESIGNATOR is null or empty, Onward Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // // check as it's a mandatory field
      // if (ownDetails.getFlightNumber() != null &&
      // !ownDetails.getFlightNumber().isEmpty()){
      // String strFlightNumber = ownDetails.getFlightNumber();
      // strFlightNumber = HpUfisUtils.formatCedaFltn(strFlightNumber);
      // // if (strFlightNumber.length() != 3){
      // // strFlightNumber =
      // Integer.toString(Integer.parseInt(strFlightNumber));
      // // if (strFlightNumber.length() < 3){
      // // int numAdd = 3 - strFlightNumber.length();
      // // for (int i= 0; i < numAdd; i++ ){
      // // strFlightNumber = "0"+strFlightNumber;
      // // }
      // // }
      // // }
      //
      // edpiod.setFlightNumber(strFlightNumber);
      // }else{
      // LOG.info("Mandatory field FLIGHT_NUMBER is null or empty, Onward Message is rejected");
      // // return null;
      // }

      // check as it's a mandatory field
      if (ownDetails.getFlightNumber() == null
          || ownDetails.getFlightNumber().isEmpty()) {
        LOG.info("Mandatory field FLIGHT_NUMBER is null or empty, Onward Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

      // if(ownDetails.getFlightNumberExp() != null){
      // edpiod.setFlightNumberSuffice(ownDetails.getFlightNumberExp());
      // }else{
      // edpiod.setFlightNumberSuffice(" "); // default value
      // }

      // check as it's a mandatory field
      if (ownDetails.getOperationDate() != null
          && !ownDetails.getOperationDate().isEmpty()) {
        ufisCalendar.setTime(ownDetails.getOperationDate(),
            ufisCalendar.getCustomFormat());
        if (ownDetails.getOperationTime().length() >= 4) {
          int hour = 0;
          int min = 0;
          try {
            hour = Integer.parseInt(ownDetails.getOperationTime()
                .substring(0, 2));
            min = Integer.parseInt(ownDetails.getOperationTime()
                .substring(2, 4));
          } catch (Exception e) {
            LOG.info("Onward message OperationTime parse erro");
          }
          ufisCalendar.DateAdd(hour, EnumTimeInterval.Hours);
          ufisCalendar.DateAdd(min, EnumTimeInterval.Minutes);
        }
        edpiod.setConxFltDate(ufisCalendar.getTime());
      } else {
        LOG.info("Mandatory field OPERATION_DATE is null or empty, Onward Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }

//      // check as it's a mandatory field
//      if (ownDetails.getOperationDate() == null
//          || ownDetails.getOperationDate().isEmpty()) {
//        LOG.info("Mandatory field OPERATION_DATE is null or empty, Onward Message is rejected");
//        addExptInfo(EnumExceptionCodes.EMAND,irmtabRef.name(), "OPERATION_DATE");
//        // return null;
//      }

      // check as it's a mandatory field
      if (ownDetails.getReferenceNumber() != null
          && !ownDetails.getReferenceNumber().isEmpty()) {
//        edpiod.setIntRefNumber(ownDetails.getReferenceNumber());
        paxConnPk.setIntRefNumber(ownDetails.getReferenceNumber());
      } else {
        LOG.info("Mandatory field REFERENCE_NUMBER is null or empty, Onward Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND,irmtabRef);
         return null;
      }
     
      edpiod.setPaxConnPK(paxConnPk);

      edpiod.setIntSystem(HpEKConstants.MACS_PAX_DATA_SOURCE);
      edpiod.setConnType(EnumLoadPaxConnType.O.toString());
      edpiod.setBookedClass(ownDetails.getBookedClass());
      edpiod.setDownloadDate(ownDetails.getDownloadDate());
      edpiod.setConnStatus(ownDetails.getStatus());
      edpiod.setMsgTimeStamp(ownDetails.getTimeStamp());
      edpiod.setVariableData(ownDetails.getVariableData());
      // added by 2013.10.01 according to the new design document
      edpiod.setPaxConxFlno(HpUfisUtils.formatCedaFlno(ownDetails
          .getAirlineDesignator(),  HpUfisUtils.formatCedaFltn(ownDetails.getFlightNumber()),
          ownDetails.getFlightNumberExp() == null ? "" : ownDetails
              .getFlightNumberExp().trim()));

//      result = (EntDbLoadPaxConn) SerializationUtils
View Full Code Here

    protected EntityManager getEntityManager() {
        return _em;
    }

    public EntDbLoadPaxConn getPaxConn(String intId, EnumLoadPaxConnType connType) {
        EntDbLoadPaxConn result = null;
        Query query = getEntityManager().createNamedQuery("EntDbLoadPaxConn.findByIdAndType");
        query.setParameter("intId", intId);
        query.setParameter("connType", connType);
        List<EntDbLoadPaxConn> list = query.getResultList();
        if (list != null && list.size() > 0) {
View Full Code Here

        return result;
    }
   
    // testing use
    public EntDbLoadPaxConn getPaxConnByFliId(String FliId, String system) {
        EntDbLoadPaxConn result = null;
        Query query = getEntityManager().createNamedQuery("EntDbLoadPaxConn.findByFlid");
        query.setParameter("intFlId", FliId);
        query.setParameter("intSystem", system);
        List<EntDbLoadPaxConn> list = query.getResultList();
        if (list != null && list.size() > 0) {
View Full Code Here

      return result; 
    }
   
   
    public EntDbLoadPaxConn findByPkId(String intId, String system){
      EntDbLoadPaxConn entLoadPaxConn = null;
    try {
      Query query = getEntityManager().createNamedQuery("EntDbLoadPaxConn.findByPk");
      query.setParameter("intId", intId);
      query.setParameter("intSystem", system);
     
View Full Code Here

    return entLoadPaxConn;
     
    }
   
    public EntDbLoadPaxConn findByPkIdX(String intId){
    EntDbLoadPaxConn result = null;
     
    CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
     CriteriaQuery<EntDbLoadPaxConn> cq = cb.createQuery(EntDbLoadPaxConn.class);
    Root<EntDbLoadPaxConn> r = cq.from(EntDbLoadPaxConn.class);
    cq.select(r);
View Full Code Here

   
    return result;
    }
   
    public EntDbLoadPaxConn findByintFltRefX(String intFlId, String intRefNumber){
      EntDbLoadPaxConn result = null;


    CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
    CriteriaQuery cq = cb.createQuery();
    Root<EntDbLoadPaxConn> r = cq.from(EntDbLoadPaxConn.class);
View Full Code Here

    return result; 
    }
   
   
    public EntDbLoadPaxConn findByIdLoadPax(String idLoadPax){
      EntDbLoadPaxConn result = null;

    CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
    CriteriaQuery cq = cb.createQuery();
    Root<EntDbLoadPaxConn> r = cq.from(EntDbLoadPaxConn.class);
    cq.select(r);
View Full Code Here

TOP

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

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.