Package com.ufis_as.exco

Examples of com.ufis_as.exco.INFOJFEVTAB


          }
         
          // Cargo Door closed and Cabin Door closed
          if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getCARD())) {
            ufisCalendar.setTime(flightEvent.getEGDSBODY().getCARD(), ufisCalendar.getCustomFormat());
            INFOJFEVTAB cargoDoor = new INFOJFEVTAB();
            cargoDoor.setSTNM("CARGO DOOR CLOSED");
            cargoDoor.setSTTM(ufisCalendar.getCedaString());
            infojfevtablist.getINFOJFEVTAB().add(cargoDoor);
            fevFound = true;
          }
          if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getCABD())) {
            ufisCalendar.setTime(flightEvent.getEGDSBODY().getCABD(), ufisCalendar.getCustomFormat());
            INFOJFEVTAB cabinDoor = new INFOJFEVTAB();
            cabinDoor.setSTNM("CABIN DOOR CLOSED");
            cabinDoor.setSTTM(ufisCalendar.getCedaString());
            infojfevtablist.getINFOJFEVTAB().add(cabinDoor);
            fevFound = true;
          }
          break;
         
        case PROGRESSREPORT:
//          if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getETA())) {
//            infobjFlight.setELDN(flightEvent.getEGDSBODY().getETA());
//          }
          infobjFlight.setEIBN(flightEvent.getEGDSBODY().getETA());
          break;
         
        case LOADACC:
          infojxaftab.setLSHT(flightEvent.getEGDSBODY().getLOADSHEET());
//          if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getZFW())) {
//            infojxaftab.setZFWT(flightEvent.getEGDSBODY().getZFW());
//            xafFound = true;
//          }
//          if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getTOW())) {
//            infojxaftab.setTOWT(flightEvent.getEGDSBODY().getTOW());
//            xafFound = true;
//          }
          break;
         
        case ROUTE:
          // confirm message from pilot that crew is on board
          // due to if NON-EK need to ignore whole message
          infobjgeneric.setALC2("EK");
          if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSHEADER().getTIMESTAMP())) {
            ufisCalendar.setTime(flightEvent.getEGDSHEADER().getTIMESTAMP(), ufisCalendar.getCustomFormat());
            INFOJFEVTAB route = new INFOJFEVTAB();
            route.setSTNM("Route Request");
            route.setSTRM("<ACR>");
            route.setSTTM(ufisCalendar.getCedaString());
            infojfevtablist.getINFOJFEVTAB().add(route);
            fevFound = true;
          }
          break;
         
View Full Code Here


        }
       
        // Cargo Door closed and Cabin Door closed
        if (HpUfisUtils.isNotEmptyStr(message.getEGDSBODY().getCARD())) {
          ufisCalendar.setTime(message.getEGDSBODY().getCARD(), ufisCalendar.getCustomFormat());
          INFOJFEVTAB cargoDoor = new INFOJFEVTAB();
          cargoDoor.setSTNM("CARGO DOOR CLOSED");
          cargoDoor.setSTTM(ufisCalendar.getCedaString());
          infojfevtablist.getINFOJFEVTAB().add(cargoDoor);
          fevFound = true;
        }
        if (HpUfisUtils.isNotEmptyStr(message.getEGDSBODY().getCABD())) {
          ufisCalendar.setTime(message.getEGDSBODY().getCABD(), ufisCalendar.getCustomFormat());
          INFOJFEVTAB cabinDoor = new INFOJFEVTAB();
          cabinDoor.setSTNM("CABIN DOOR CLOSED");
          cabinDoor.setSTTM(ufisCalendar.getCedaString());
          infojfevtablist.getINFOJFEVTAB().add(cabinDoor);
          fevFound = true;
        }
       
        // if contains FOB
        if (xafFound) {
          try {
            oldData = fltFuelStatusBean.findByIdFlight(uaft);
            if (oldData == null) {
              // Prepare notification data (dat)
              data = new EntDbFlightFuelStatus();
              // id flight
              data.setIdFlight(uaft);
              // flight number
              data.setFlightNumber(fltn);
              // flight date
              //fuelStatus.setFltDate(aftFlight.getFlda());
              // regn
              data.setFltRegn(regn);
              // alc2
              data.setAirlineCode2(HpEKConstants.EK_ALC2);
              // org3
              data.setFltOrigin3(org3);
              // dep3
              data.setFltDest3(des3);
              data.setCreatedUser(MSGIF);
              data.setDataSource(MSGIF);
              // msg send date
              if (HpUfisUtils.isNotEmptyStr(message.getEGDSHEADER().getTIMESTAMP())) {
                ufisCalendar.setTime(message.getEGDSHEADER().getTIMESTAMP(), ufisCalendar.getCustomFormat());
                data.setMsgSendDate(ufisCalendar.getTime());
              }
              fltFuelStatusBean.persist(data);
              LOG.info("EGDS MVT: created flight fuel record={} for flight={}", data.getId(), uaft);
              cmd = UfisASCommands.IRT;
            }

           
            if (UfisASCommands.URT == cmd) {
              data = EntDbFlightFuelStatus.valueOf(oldData);
              String fob = message.getEGDSBODY().getFOB().isEmpty() ?
                  "0" : message.getEGDSBODY().getFOB();
              float onBoardFuel = Float.parseFloat(fob);
              // new value
              data.setOnboardFuel(onBoardFuel);

              // msg send date
              if (HpUfisUtils.isNotEmptyStr(message.getEGDSHEADER().getTIMESTAMP())) {
                ufisCalendar.setTime(message.getEGDSHEADER().getTIMESTAMP(),
                    ufisCalendar.getCustomFormat());
                data.setMsgSendDate(ufisCalendar.getTime());
              }
              data.setRecStatus(' ');
              data.setUpdatedUser(MSGIF);
              fltFuelStatusBean.update(data);
              LOG.info("EGDS MVT: updated flight fuel record={} for flight={}", data.getId(), uaft);
            }
           
            if (HpUfisUtils.isNotEmptyStr(HpCommonConfig.notifyTopic)) {
              // send notification message to topic
              ufisTopicProducer.sendNotification(true, cmd, String.valueOf(uaft), oldData, data);
            } else {
              // if topic not defined, send notification to queue
              ufisQueueProducer.sendNotification(true, cmd, String.valueOf(uaft), oldData, data);
            }
           
            // onboard fuel
            /*Float oldOnBoardFuel = 0f;
            if (message.getEGDSBODY().getFOB() != null) {
              String fob = message.getEGDSBODY().getFOB().isEmpty() ?
                  "0" : message.getEGDSBODY().getFOB();
              float onBoardFuel = Float.parseFloat(fob);
              // if fuel changed, update and notify
              if (onBoardFuel != fuelStatus.getOnboardFuel()) {
                // old value
                oldOnBoardFuel = fuelStatus.getOnboardFuel();
                // new value
                fuelStatus.setOnboardFuel(onBoardFuel);

                // msg send date
                if (HpUfisUtils.isNotEmptyStr(message.getEGDSHEADER().getTIMESTAMP())) {
                  ufisCalendar.setTime(message.getEGDSHEADER().getTIMESTAMP(),
                      ufisCalendar.getCustomFormat());
                  fuelStatus.setMsgSendDate(ufisCalendar.getTime());
                }
                fuelStatus.setRecStatus(' ');
                fuelStatus.setUpdatedUser(MSGIF);
                fltFuelStatusBean.update(fuelStatus);

                // notify flag
                isNofified = true;
              }
            }*/
           
            // notify change or not
            /*if (isNofified) {
              EntUfisMsgDTO msgObj = new EntUfisMsgDTO();
              // Header: id flight
              notifyHeader.getIdFlight().clear();
              notifyHeader.getIdFlight().add(String.valueOf(uaft));
              notifyHeader.setReqt(HpUfisCalendar.getCurrentUTCTimeString());
              msgObj.setHead(notifyHeader);
             
              // Body
              EntUfisMsgBody notifyBody = new EntUfisMsgBody();
              EntUfisMsgACT act = new EntUfisMsgACT();
              if (isInsert) {
                act.setCmd(HpUfisAppConstants.UfisASCommands.IRT.toString());
              } else {
                act.setCmd(HpUfisAppConstants.UfisASCommands.URT.toString());
              }
              act.setTab(TAB);
              act.getFld().add(NOTIFY_FOB);
              act.getData().add(message.getEGDSBODY().getFOB());
              act.getOdat().add(oldOnBoardFuel.toString());
              act.getId().add(fuelStatus.getId());
              act.setSel("WHERE id = " + "\"" + fuelStatus.getId() + "\"");
              notifyBody.getActs().add(act);
              msgObj.setBody(notifyBody);
             
              // json message
              String jsonNotifyMsg = mapper.writeValueAsString(msgObj);
              //bcMessaging.sendBroadcastMessage(jsonNotifyMsg);
              ufisTopicProducer.sendMessage(jsonNotifyMsg);
              LOG.debug("EGDS notification for changes: \n{}", jsonNotifyMsg);
            }*/
          } catch (Exception e) {
            LOG.error("Cannot transform egds message: {}", e.getMessage());
            //LOG.error("Message Dropped: \n{}", _flightXml);
          }
        }
        break;
       
      case PROGRESSREPORT:
        String eta = message.getEGDSBODY().getETA();
        if (HpUfisUtils.isNullOrEmptyStr(eta)) {
          // 2013-12-02 updated by JGO - ETA is optional in latest ICD
          // drop message
          /*LOG.debug("EGDS message dropped due to eta is null or empty");
            //LOG.error("Message Dropped: \n{}", _flightXml);
            addExptInfo(EnumExceptionCodes.EMAND.name(), EnumExceptionCodes.EMAND.toString());*/
            isContinue = false;
        }

        if (eta.matches(TIME_PATTERN)) {
          eta = String.format(TIME_FORMATTER, Integer.parseInt(eta.replaceAll(SYMB_COLON, "")));
          eta = HpUfisUtils.guessTheDate(tifa, eta);
          infobjFlight.setEIBN(eta);
        } else {
          LOG.debug("EGDS: ETA<{}> format is not match with HH:MM or HHMM", eta);
          addExptInfo(EnumExceptionCodes.EWVAL.name(), "ETA format not match with HH:MM or HHMM");
          isContinue = false;
        }
        break;
       
      case LOADACC:
        // aft
        //infobjFlight.setELDN(message.getEGDSBODY().getLOADSHEET());
        // xaf
        infojxaftab.setLSHT(message.getEGDSBODY().getLOADSHEET());
        infojxaftab.setZFWT(message.getEGDSBODY().getZFW());
        infojxaftab.setTOWT(message.getEGDSBODY().getTOW());
        // 2013-11-22 updated by JGO - Save LADT
        if (HpUfisUtils.isNotEmptyStr(message.getEGDSHEADER().getTIMESTAMP())) {
          ufisCalendar.setTime(message.getEGDSHEADER().getTIMESTAMP(), ufisCalendar.getCustomFormat());
          infojxaftab.setLADT(ufisCalendar.getCedaString());
        }
        xafFound = true;
        break;
       
      case ROUTE:
        // confirm message from pilot that crew is on board
        //infobjgeneric.setALC2("EK");
        if (HpUfisUtils.isNotEmptyStr(message.getEGDSHEADER().getTIMESTAMP())) {
          ufisCalendar.setTime(message.getEGDSHEADER().getTIMESTAMP(), ufisCalendar.getCustomFormat());
          INFOJFEVTAB route = new INFOJFEVTAB();
          route.setSTNM("Route Request");
          route.setSTRM(regn);
          route.setSTTM(ufisCalendar.getCedaString());
          infojfevtablist.getINFOJFEVTAB().add(route);
          fevFound = true;
        }
        break;
       
View Full Code Here

                }
               
                // RTG
                FlightEvent.Events.Rtg rtg = event.getRtg();
                if (rtg != null) {
                  INFOJFEVTAB fev = new INFOJFEVTAB();
                  if (rtg.getLastDoorCl() != null) {
                    ufisCalendar.setTime(rtg.getLastDoorCl());
                    //fev.setSTTM(ufisCalendar.getCedaString());
                    fev.setSTTM(df.format(ufisCalendar.getTime()));
                  }
                    fev.setSTNM("Ready to Go");
                    fev.setSTFL(rtg.getValue());
                    fev.setSTRM("");
                    // flight daily id
                    fev.setIDFD(fltDaily.getId());
                    infojfevtablist.getINFOJFEVTAB().add(fev);
                }
               
                // Get Delays
                if (flightEvent.getDelays() != null) {
View Full Code Here

TOP

Related Classes of com.ufis_as.exco.INFOJFEVTAB

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.