Package com.ufis_as.ek_if.macs.entities

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


         odat.add(oloadPax.getBoardingHandlingAgent());
         odat.add(oloadPax.getIdConxFlight());    // ADDED BY 2013-12-23
       }
      
    }else if(data instanceof EntDbLoadPaxConnX){
      EntDbLoadPaxConnX loadPaxConn = (EntDbLoadPaxConnX) data;
//      fld.add(Integer.toString(loadPaxConn.getIdFlight()));
      tabName = "LOAD_PAX_CONNECT";
      selectStr = "WHERE ID = '"+loadPaxConn.getUuid()+"'";
      idFlightStr = Integer.toString(loadPaxConn.getIdFlight());
      ld.add(loadPaxConn.getUuid());
      // add fields
//       fld.add("ID");
       fld.add("INTERFACE_FLTID");
       fld.add("INTREFNUMBER");
       fld.add("ID_FLIGHT");
       fld.add("ID_LOAD_PAX");
       fld.add("BOARDPOINT");
       fld.add("BOOKEDCLASS");
       fld.add("CONNSTATUS");
       fld.add("CONNTYPE");
       fld.add("INTID");
       fld.add("INTERFACE_CONX_FLTID");
       fld.add("PAX_CONX_FLNO");
       fld.add("CONX_FLT_DATE");
       fld.add("ID_CONX_FLIGHT");
       fld.add("DATA_SOURCE");
       fld.add("OFFPOINT");
       // populate data
//       dat.add(loadPaxConn.getUuid());
       dat.add(loadPaxConn.getInterfaceFltid());
       dat.add(loadPaxConn.getIntRefNumber());
       dat.add(loadPaxConn.getIdFlight());
       dat.add(loadPaxConn.getIdLoadPax());
       dat.add(loadPaxConn.getBoardPoint());
       dat.add(loadPaxConn.getBookedClass());
       dat.add(loadPaxConn.getConnStatus());
       dat.add(loadPaxConn.getConnType());
       dat.add(loadPaxConn.getIntId());
       dat.add(loadPaxConn.getInterfaceConxFltid());
       dat.add(loadPaxConn.getPaxConxFlno());
       dat.add(loadPaxConn.getConxFltDate());
       dat.add(loadPaxConn.getIdConxFlight());
       dat.add(loadPaxConn.getIntSystem());
       dat.add(loadPaxConn.getOffPoint());
      
       if (oldData != null &&  oldData instanceof EntDbLoadPaxConnX){
         EntDbLoadPaxConnX oloadPaxConn = (EntDbLoadPaxConnX) oldData;
//         odat.add(oloadPaxConn.getUuid());
         odat.add(oloadPaxConn.getInterfaceFltid());
         odat.add(oloadPaxConn.getIntRefNumber());
         odat.add(oloadPaxConn.getIdFlight());
         odat.add(oloadPaxConn.getIdLoadPax());
         odat.add(oloadPaxConn.getBoardPoint());
         odat.add(oloadPaxConn.getBookedClass());
         odat.add(oloadPaxConn.getConnStatus());
         odat.add(oloadPaxConn.getConnType());
         odat.add(oloadPaxConn.getIntId());
         odat.add(oloadPaxConn.getInterfaceConxFltid());
         odat.add(oloadPaxConn.getPaxConxFlno());
         odat.add(oloadPaxConn.getConxFltDate());
         odat.add(oloadPaxConn.getIdConxFlight());
         odat.add(oloadPaxConn.getIntSystem());
         odat.add(oloadPaxConn.getOffPoint());
       }


    }else if (data instanceof EntDbServiceRequestX){
      EntDbServiceRequestX serviceRequest = (EntDbServiceRequestX) data;
View Full Code Here


    case "inb":
      try {
        if (msgString.contains("InbDetails")) {
          Object o = blHandleMacsPax.unMarshal(name, msgString, irmtabRef, message);
          EntDbLoadPaxConnX entDbLoadPaxConn =null;
          if (o != null ){
             entDbLoadPaxConn =  (EntDbLoadPaxConnX)o;
          }
               
          if (entDbLoadPaxConn != null){   
          _blHandleCedaMacsPax.handleMACSPAX(entDbLoadPaxConn,HpEKConstants.ARR_DEP_FALG_A, irmtabRef);
          }

//          LOG.info("1.2 handle InbDetails msg, takes {} ms",HpClock.GetDuration(true));
        } else {
          LOG.warn("msg from inb queue not contain 'InbDetails' , msg will not process");
        }
      } catch (Exception e) {
        LOG.error("inWard - Exception: {}", e);
      }
      break;
    case "onw":
      try {
        if (msgString.contains("OnwDetails")) {
          Object o = blHandleMacsPax.unMarshal(name, msgString, irmtabRef, message);
          EntDbLoadPaxConnX entDbLoadPaxConn =null;
          if (o != null ){
             entDbLoadPaxConn =  (EntDbLoadPaxConnX)o;
          }
         
          if (entDbLoadPaxConn != null){
View Full Code Here

         odat.add(oloadPax.getBoardingHandlingAgent());
         odat.add(oloadPax.getIdConxFlight());    // ADDED BY 2013-12-23
       }
      
    }else if(data instanceof EntDbLoadPaxConnX){
      EntDbLoadPaxConnX loadPaxConn = (EntDbLoadPaxConnX) data;
//      fld.add(Integer.toString(loadPaxConn.getIdFlight()));
      tabName = "LOAD_PAX_CONNECT";
      selectStr = "WHERE ID = '"+loadPaxConn.getUuid()+"'";
      idFlightStr = Integer.toString(loadPaxConn.getIdFlight());
      ld.add(loadPaxConn.getUuid());
      // add fields
//       fld.add("ID");
       fld.add("INTERFACE_FLTID");
       fld.add("INTREFNUMBER");
       fld.add("ID_FLIGHT");
       fld.add("ID_LOAD_PAX");
       fld.add("BOARDPOINT");
       fld.add("BOOKEDCLASS");
       fld.add("CONNSTATUS");
       fld.add("CONNTYPE");
       fld.add("INTID");
       fld.add("INTERFACE_CONX_FLTID");
       fld.add("PAX_CONX_FLNO");
       fld.add("CONX_FLT_DATE");
       fld.add("ID_CONX_FLIGHT");
       fld.add("DATA_SOURCE");
       fld.add("OFFPOINT");
       // populate data
//       dat.add(loadPaxConn.getUuid());
       dat.add(loadPaxConn.getInterfaceFltid());
       dat.add(loadPaxConn.getIntRefNumber());
       dat.add(loadPaxConn.getIdFlight());
       dat.add(loadPaxConn.getIdLoadPax());
       dat.add(loadPaxConn.getBoardPoint());
       dat.add(loadPaxConn.getBookedClass());
       dat.add(loadPaxConn.getConnStatus());
       dat.add(loadPaxConn.getConnType());
       dat.add(loadPaxConn.getIntId());
       dat.add(loadPaxConn.getInterfaceConxFltid());
       dat.add(loadPaxConn.getPaxConxFlno());
       dat.add(loadPaxConn.getConxFltDate());
       dat.add(loadPaxConn.getIdConxFlight());
       dat.add(loadPaxConn.getIntSystem());
       dat.add(loadPaxConn.getOffPoint());
      
       if (oldData != null &&  oldData instanceof EntDbLoadPaxConnX){
         EntDbLoadPaxConnX oloadPaxConn = (EntDbLoadPaxConnX) oldData;
//         odat.add(oloadPaxConn.getUuid());
         odat.add(oloadPaxConn.getInterfaceFltid());
         odat.add(oloadPaxConn.getIntRefNumber());
         odat.add(oloadPaxConn.getIdFlight());
         odat.add(oloadPaxConn.getIdLoadPax());
         odat.add(oloadPaxConn.getBoardPoint());
         odat.add(oloadPaxConn.getBookedClass());
         odat.add(oloadPaxConn.getConnStatus());
         odat.add(oloadPaxConn.getConnType());
         odat.add(oloadPaxConn.getIntId());
         odat.add(oloadPaxConn.getInterfaceConxFltid());
         odat.add(oloadPaxConn.getPaxConxFlno());
         odat.add(oloadPaxConn.getConxFltDate());
         odat.add(oloadPaxConn.getIdConxFlight());
         odat.add(oloadPaxConn.getIntSystem());
         odat.add(oloadPaxConn.getOffPoint());
       }


    }else if (data instanceof EntDbServiceRequestX){
      EntDbServiceRequestX serviceRequest = (EntDbServiceRequestX) data;
View Full Code Here

//    EntDbLoadPax entDbLoadPax = null;

    entDbLoadPaxConn.setIdConxFlight(idFlight);

    long startTime = System.currentTimeMillis();
    EntDbLoadPaxConnX entDbLoadPaxConnFind = _paxConBean.findByintFltRefX(
        entDbLoadPaxConn.getInterfaceFltid(),entDbLoadPaxConn.getIntRefNumber());
    LOG.info(
        "1.2.3 search records from paxConn table for paxConn Msg,  takes {} ms",
        (System.currentTimeMillis() - startTime));
   
    EntDbLoadPaxConnX oldEntDbLoadPaxConn = (EntDbLoadPaxConnX)SerializationUtils.clone(entDbLoadPaxConnFind);

    if (entDbLoadPaxConnFind != null) {

      startTime = System.currentTimeMillis();
     
View Full Code Here

            // send notification
            ufisTopicProducer.sendNotification(true, UfisASCommands.URT,
                String.valueOf(entDbLoadPax.getIdFlight()), oldEntDbLoadPax, entDbLoadPax);
           
            // update load_pax_connect
            EntDbLoadPaxConnX entDbLoadPaxConn = _paxConBean
                .findByIdLoadPax(entDbLoadPax.getUuid());
            if (entDbLoadPaxConn != null
                && idFlight != entDbLoadPaxConn.getIdFlight()) {
     
              EntDbLoadPaxConnX oldEntDbLoadPaxConn = (EntDbLoadPaxConnX)SerializationUtils.clone(entDbLoadPaxConn);

              entDbLoadPaxConn.setIdFlight(idFlight);
              entDbLoadPaxConn
                  .set_updateUser(HpEKConstants.MACS_PAX_DATA_SOURCE);
              entDbLoadPaxConn.set_updatedDate(HpUfisCalendar
                  .getCurrentUTCTime());
//              _paxConBean.Update(entDbLoadPaxConn);
             
              // send notification
              ufisTopicProducer.sendNotification(true, UfisASCommands.URT,
                  String.valueOf(entDbLoadPaxConn.getIdFlight()), oldEntDbLoadPaxConn, entDbLoadPaxConn);
            }

            // update load_bag
            List<EntDbLoadBag> loadBagList = dlLoadBagUpdateLocal
                .getBagMoveDetailsByIdLoadPax(entDbLoadPax
                    .getUuid());
            Iterator<EntDbLoadBag> loadBagListIt = loadBagList
                .iterator();
            while (loadBagListIt.hasNext()) {
              EntDbLoadBag entDbLoadBag = loadBagListIt.next();
              if (idFlight != entDbLoadBag.getIdFlight()) {

                EntDbLoadBag oldEntDbLoadBag = (EntDbLoadBag)SerializationUtils.clone(entDbLoadBag);

                entDbLoadBag.setIdFlight(idFlight);
                entDbLoadBag.setId_Flight(new BigDecimal(idFlight));
                entDbLoadBag
                    .setUpdatedUser(HpEKConstants.MACS_PAX_DATA_SOURCE);
                entDbLoadBag.setUpdatedDate(HpUfisCalendar
                    .getCurrentUTCTime());     
               
                // send notification
                ufisTopicProducer.sendNotification(true, UfisASCommands.URT,
                    String.valueOf(entDbLoadBag.getIdFlight()), oldEntDbLoadBag, entDbLoadBag);
              }

            }

            // update serviceReques
            List<EntDbServiceRequestX> serviceRequestList = _dlPaxServiceRequestBean
                .findByidLoadPax(entDbLoadPax.getUuid());
            Iterator<EntDbServiceRequestX> serviceRequestListIt = serviceRequestList
                .iterator();
            while (serviceRequestListIt.hasNext()) {
              EntDbServiceRequestX entDbServiceRequest = serviceRequestListIt
                  .next();
              if (entDbServiceRequest.getIdFlight() != idFlight) {

                EntDbServiceRequestX oldEntDbServiceRequest = (EntDbServiceRequestX)SerializationUtils.clone(entDbServiceRequest);

                entDbServiceRequest.setIdFlight(idFlight);
                entDbServiceRequest
                    .set_updateUser(HpEKConstants.MACS_PAX_DATA_SOURCE);
                entDbServiceRequest
                    .set_updatedDate(HpUfisCalendar
                        .getCurrentUTCTime());
               
                // send notification
                ufisTopicProducer.sendNotification(true, UfisASCommands.URT,
                    String.valueOf(entDbServiceRequest.getIdFlight()), oldEntDbServiceRequest, entDbServiceRequest);
              }
            }

          }

        }

        // update id_conx_flight for load_pax_conn table
        if (entDbFlightIdMapping.getFltNumber() != null
            && entDbFlightIdMapping.getFltDateLocal() != null) {
          List<EntDbLoadPaxConnX> entDbLoadPaxConnList = _paxConBean
              .findByFlnoFltDate(
                  entDbFlightIdMapping.getFltNumber(),
                  entDbFlightIdMapping.getFltDateLocal());
          Iterator<EntDbLoadPaxConnX> entDbLoadPaxConnListIt = entDbLoadPaxConnList
              .iterator();
          while (entDbLoadPaxConnListIt.hasNext()) {
            EntDbLoadPaxConnX entDbLoadPaxConn = entDbLoadPaxConnListIt
                .next();
            if (entDbFlightIdMapping.getIdFlight() != null
                && entDbLoadPaxConn.getIdConxFlight() != entDbFlightIdMapping
                    .getIdFlight().intValue()) {

              EntDbLoadPaxConnX oldEntDbLoadPaxConn = (EntDbLoadPaxConnX)SerializationUtils.clone(entDbLoadPaxConn);

              entDbLoadPaxConn
                  .setIdConxFlight(entDbFlightIdMapping
                      .getIdFlight().intValue());
              entDbLoadPaxConn
View Full Code Here

  }

  public EntDbLoadPaxConnX readStorePax(InbDetails inbDetails, long irmtabRef, Message message) {
    // Store Pax Details for this MAXCS ID
    // find record with the maxcs id and
    EntDbLoadPaxConnX 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

      EntDbLoadPaxConnX edpiod = new EntDbLoadPaxConnX();
//      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.name(),"Mandatory field INB_ID is null or empty, Inbound Message is rejected",irmtabRef, message);
         return null;
      }

      // check as it's a mandatory field
      if (inbDetails.getMflId() != null
          && !inbDetails.getMflId().isEmpty()) {
        edpiod.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.name(),"Mandatory field MFL_ID is null or empty, Inbound Message is rejected",irmtabRef, message);
         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.name(),"Mandatory field BOARD_POINT is null or empty, Inbound Message is rejected",irmtabRef, message);
         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.name(),"Mandatory field OFF_POINT is null or empty, Inbound Message is rejected",irmtabRef, message);
         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.name(),"Mandatory field AIRLINE_DESIGNATOR is null or empty, Inbound Message is rejected",irmtabRef, message);
         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.name(),"Mandatory field FLIGHT_NUMBER is null or empty, Inbound Message is rejected",irmtabRef, message);
         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.name(),"Mandatory field OPERATION_DATE is null or empty, Inbound Message is rejected",irmtabRef, message);
         return null;
      }

      // check as it's a mandatory field
      if (inbDetails.getReferenceNumber() != null
          && !inbDetails.getReferenceNumber().isEmpty()) {
//        edpiod.setIntRefNumber(inbDetails.getReferenceNumber());
        edpiod.setIntRefNumber(inbDetails.getReferenceNumber());
      } else {
        LOG.info("Mandatory field REFERENCE_NUMBER is null or empty, Inbound Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND.name(),"Mandatory field REFERENCE_NUMBER is null or empty, Inbound Message is rejected",irmtabRef, message);
         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()));
      edpiod.setAirlineCode(inbDetails.getAirlineDesignator()); // added by 2013-12-31

//      result = (EntDbLoadPaxConn) SerializationUtils
//          .clone(edpiod);
//      _edpiods.add(edpiod);
      result = edpiod;
View Full Code Here

  public EntDbLoadPaxConnX readStorePax(OnwDetails ownDetails, long irmtabRef, Message message) {
    // Store Pax Details for this MAXCS ID
    // find record with the maxcs id and
   
    EntDbLoadPaxConnX result = null;
   
    if (ownDetails != null) {
     
      logLevel = entStartupInitSingleton.getIrmLogLev();
       
        msgLogged = Boolean.FALSE;
        if (irmtabRef > 0) {
          msgLogged = Boolean.TRUE;
        }
     
      EntDbLoadPaxConnX edpiod = new EntDbLoadPaxConnX();
//      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.name(),"Mandatory field ONW_ID is null or empty, Onward Message is rejected",irmtabRef, message);
         return null;
      }

      // check as it's a mandatory field
      if (ownDetails.getMflId() != null
          && !ownDetails.getMflId().isEmpty()) {
//        edpiod.setInterfaceFltid(ownDetails.getMflId());
        edpiod.setInterfaceFltid(ownDetails.getMflId());
      } else {
        LOG.info("Mandatory field MFL_ID is null or empty, Onward Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND.name(),"Mandatory field MFL_ID is null or empty, Onward Message is rejected",irmtabRef, message);
         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.name(),"Mandatory field BOARD_POINT is null or empty, Onward Message is rejected",irmtabRef, message);
         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.name(),"Mandatory field OFF_POINT is null or empty, Onward Message is rejected",irmtabRef, message);
         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.name(),"Mandatory field AIRLINE_DESIGNATOR is null or empty, Onward Message is rejected",irmtabRef, message);
         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.name(),"Mandatory field FLIGHT_NUMBER is null or empty, Onward Message is rejected",irmtabRef, message);
         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.name(),"Mandatory field OPERATION_DATE is null or empty, Onward Message is rejected",irmtabRef, message);
         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.name(),irmtabRef.name(), "OPERATION_DATE");
//        // return null;
//      }

      // check as it's a mandatory field
      if (ownDetails.getReferenceNumber() != null
          && !ownDetails.getReferenceNumber().isEmpty()) {
//        edpiod.setIntRefNumber(ownDetails.getReferenceNumber());
        edpiod.setIntRefNumber(ownDetails.getReferenceNumber());
      } else {
        LOG.info("Mandatory field REFERENCE_NUMBER is null or empty, Onward Message is rejected");
        sendErroNotification(EnumExceptionCodes.EMAND.name(),"Mandatory field REFERENCE_NUMBER is null or empty, Onward Message is rejected",irmtabRef, message);
         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()));
      edpiod.setAirlineCode(ownDetails.getAirlineDesignator()); // added by 2013-12-31

//      result = (EntDbLoadPaxConn) SerializationUtils
//          .clone(edpiod);
      result = edpiod;
View Full Code Here

    protected EntityManager getEntityManager() {
        return _em;
    }
   
    public EntDbLoadPaxConnX findByintFltRefX(String intFlId, String intRefNumber){
      EntDbLoadPaxConnX result = null;


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

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

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

     

      idLoadPax = entDbLoadPaxFind.getUuid();
     
      startTime = System.currentTimeMillis();
      EntDbLoadPaxConnX connFindWithPax = _paxConBean.findByintFltRefX(entDbLoadPaxFind.getIntFlId(), entDbLoadPaxFind.getIntRefNumber());
      LOG.info("search paxConn record for Pax, takes {} ms",
          (System.currentTimeMillis() - startTime));

      if (connFindWithPax == null) {
        bagType = HpEKConstants.BAGTYPE_L;

        entDbLoadPaxFind.setIdLoadPaxConnect("0");
      } else {
        LOG.info("PaxConn found for Pax, intFlid {}, refNum {}",
            entDbLoadPaxFind.getIntFlId(),
            entDbLoadPaxFind.getIntRefNumber());
        bagType = HpEKConstants.BAGTYPE_T;
        connOrigin3 = connFindWithPax
            .getBoardPoint();
        connDest3 = connFindWithPax
            .getOffPoint();
        connFlightNumber = connFindWithPax
            .getPaxConxFlno();
        idConnFlight = connFindWithPax.getIdConxFlight();
        connFLightDate = HpEKConstants.MACS_PAX_DATE_FORMAT
            .format(connFindWithPax
                .getConxFltDate());
        entDbLoadPaxFind.setIdLoadPaxConnect(connFindWithPax.getUuid());
        entDbLoadPaxFind.setIdConxFlight(connFindWithPax.getIdConxFlight())// added by 2013-12-23
        connFindWithPax
            .setIdLoadPax(entDbLoadPaxFind.getUuid());
        connFindWithPax
            .setIdFlight(entDbLoadPaxFind.getIdFlight());
       
        ufisTopicProducer.sendNotification(true, UfisASCommands.URT,
            String.valueOf(entDbLoadPaxFind.getIdFlight()), oldEntDbLoadPax, entDbLoadPaxFind);

      }

    } else {
      startTime = System.currentTimeMillis();
      _paxbean.Persist(entDbLoadPax);
     
      idLoadPax = entDbLoadPax.getUuid(); // added by 2014/01/07 fix idLoadPax is null in load_bag

      LOG.info("1.2.5  insert paxDetails Msg to database, takes {} ms",
          (System.currentTimeMillis() - startTime));
     
      // send notification
      ufisTopicProducer.sendNotification(true, UfisASCommands.IRT,
          String.valueOf(entDbLoadPax.getIdFlight()), null, entDbLoadPax);

      startTime = System.currentTimeMillis();
      EntDbLoadPaxConnX paxConnForPax = _paxConBean.findByintFltRefX(
          entDbLoadPax.getIntFlId(), entDbLoadPax.getIntRefNumber());
      LOG.info("1.2.5+  search paxConn for Pax, takes {} ms",
          (System.currentTimeMillis() - startTime));

      if (paxConnForPax == null) {
//        entDbLoadPax.setIdLoadPaxConnect("0");
        bagType = HpEKConstants.BAGTYPE_L;
        // added by 2013-12-10
        if(isPaxCancelled){
          entDbLoadPax.set_recStatus("I");
        }
       
      } else {
       
        EntDbLoadPaxConnX  oldEntDbLoadPaxConn = (EntDbLoadPaxConnX)SerializationUtils.clone(paxConnForPax);
       
        bagType = HpEKConstants.BAGTYPE_T;
        connOrigin3 = paxConnForPax.getBoardPoint();
        connDest3 = paxConnForPax.getOffPoint();
        connFlightNumber = paxConnForPax.getPaxConxFlno();
View Full Code Here

TOP

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

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.