Package com.ufis_as.ek_if.macs.entities

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


    }
    return intFliId;
  }
 
  public EntDbFlightIdMapping getMappingByFlightIdX(BigDecimal idFlight){
    EntDbFlightIdMapping result = null;
   
    CriteriaBuilder cb = _em.getCriteriaBuilder();
     CriteriaQuery<EntDbFlightIdMapping> cq = cb.createQuery(EntDbFlightIdMapping.class);
    Root<EntDbFlightIdMapping> r = cq.from(EntDbFlightIdMapping.class);
    cq.select(r);
View Full Code Here


    String mainDest3 = "";
    String connDest3 = "";
    String mainFlightDate = "";
    String connFLightDate = "";

    EntDbFlightIdMapping entDbFlIdMapping = null;
    if ( entDbLoadPax.getIntFlId() != null) {
      long startTime = System.currentTimeMillis();
      entDbFlIdMapping = dlFlightMappingBean
          .getFlightIdMappingX(entDbLoadPax.getIntFlId()
              .toString().trim());
      LOG.info("1.2.1 search flight from flightIdMapping table for paxDetails Msg, takes {} ms ",
          (System.currentTimeMillis() - startTime));
    }

    if (entDbFlIdMapping != null) {
      idFlightStr = entDbFlIdMapping.getIdFlight();
      if (entDbFlIdMapping.getArrDepFlag() != null) {
        adid = entDbFlIdMapping.getArrDepFlag();
      }

      // added by 2013.10.22
      mainFlightNumber = entDbFlIdMapping.getFltNumber();
      mainFlightDate = HpEKConstants.MACS_PAX_DATE_FORMAT.format(entDbFlIdMapping.getFltDateLocal());
      mainOrigin3 = entDbLoadPax.getCheckInCity();
      mainDest3 = entDbLoadPax.getDestination();

    } else {
      LOG.debug(
View Full Code Here

    }
   
//    notifyEntUfisMsgDTOList = new ArrayList<>();
    // // set ID_FLIGHT
    BigDecimal idFlightStr = new BigDecimal(0);
    EntDbFlightIdMapping entDbFlIdMapping = null;
    BigDecimal nonEkFlightStr = null;
    EntDbFlightIdMapping idFlightMapping = null;
    if (entDbLoadPaxConn.getInterfaceFltid() != null) {
      if(entDbLoadPaxConn.getIdFlight() == 0){
      idFlightMapping = dlFlightMappingBean
          .getFlightIdMappingX(entDbLoadPaxConn.getInterfaceFltid().toString().trim());
      if(idFlightMapping != null)
        entDbLoadPaxConn.setIdFlight(idFlightMapping.getIdFlight().intValue());
      }
     
      long startTime = System.currentTimeMillis();
           
      if ("EK".equalsIgnoreCase(entDbLoadPaxConn.getAirlineCode())){   // EK flight
View Full Code Here

  public void handleFltIdMappingNotification(EntUfisMsgDTO ufisMsgDTO) {
    try {

      int idFlight = 0;
      String intFlId = null;
      EntDbFlightIdMapping entDbFlightIdMapping = null;
     
      try{

      if ("INTERFACE_FLTID".equalsIgnoreCase(ufisMsgDTO.getBody()
          .getActs().get(0).getFld().get(0))) {
        intFlId = (String) ufisMsgDTO.getBody().getActs().get(0)
            .getData().get(0);
      } else {
        LOG.warn("fltIdMapping msg from Macs-Flt, field name is not 'INTERFACE_FLTID'. Msg will not be processed");
      }
     
      }catch(Exception e){
        LOG.error("erro when handleFltIdMappingNotification, {}",e);
        return;
      }

      if (intFlId != null) {
        entDbFlightIdMapping = dlFlightMappingBean
            .getFlightIdMappingX(intFlId);
      } else {
        LOG.warn("fltIdMapping msg from Macs-Flt, intFlId is null. Msg will not be processed");
        return;
      }
      // List<String> idFlightList = ufisMsgDTO.getHead().getIdFlight();

      if (entDbFlightIdMapping != null
          && entDbFlightIdMapping.getIdFlight() != null) {
        idFlight = entDbFlightIdMapping.getIdFlight().intValue();
      } else {
        LOG.warn("fltIdMapping msg from Macs-Flt, entDbFlightIdMapping or entDbFlightIdMapping.getIdFlight() is null. Msg will not be processed");
        return;
      }

      // main handle logic
      if (idFlight != 0 && intFlId != null) {
        // update load_pax
        List<EntDbLoadPaxX> loadPaxList = _paxbean
            .findByIntFltId(intFlId);
        Iterator<EntDbLoadPaxX> loadPaxListIt = loadPaxList.iterator();
        while (loadPaxListIt.hasNext()) {
          EntDbLoadPaxX entDbLoadPax = loadPaxListIt.next();

          if (idFlight != entDbLoadPax.getIdFlight()) {

            EntDbLoadPaxX oldEntDbLoadPax = (EntDbLoadPaxX)SerializationUtils.clone(entDbLoadPax);

            entDbLoadPax.setIdFlight(idFlight);
            entDbLoadPax
                .set_updateUser(HpEKConstants.MACS_PAX_DATA_SOURCE);
            entDbLoadPax.set_updatedDate(HpUfisCalendar
                .getCurrentUTCTime());
//            _paxbean.Update(entDbLoadPax);
            // 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
                  .set_updateUser(HpEKConstants.MACS_PAX_DATA_SOURCE);
              entDbLoadPaxConn.set_updatedDate(HpUfisCalendar
                  .getCurrentUTCTime());
View Full Code Here

TOP

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

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.