Package com.ufis_as.ufisapp.server.oldflightdata.entities

Examples of com.ufis_as.ufisapp.server.oldflightdata.entities.EntDbFevtab


    //@PersistenceContext(unitName = HpUfisAppConstants.DEFAULT_PU_CEDA)
    @PersistenceContext(unitName = HpEKConstants.DEFAULT_PU_EK)
    private EntityManager _em;

    public EntDbFevtab getFevtab(BigDecimal uaft, String stco) {
        EntDbFevtab result = null;
        Query query = _em.createNamedQuery("EntDbFevtab.findByFlid");
        query.setParameter("uaft", uaft);
        //query.setParameter("stnm", stnm);
        query.setParameter("stco", stco);
View Full Code Here


        }
        return result;
    }
   
    public EntDbFevtab getMacsFlightEvent(String ifid, String stco) {
      EntDbFevtab result = null;
        Query query = _em.createNamedQuery("EntDbFevtab.findByIfid");
        query.setParameter("intFlid", ifid);
        //query.setParameter("stnm", stnm);
        query.setParameter("stco", stco);
View Full Code Here

        }
        return result;
    }
   
    public EntDbFevtab getFevtab(String intSystem, String intFlid) {
        EntDbFevtab result = null;
        Query query = _em.createNamedQuery("EntDbFevtab.findByIntFlid");
        query.setParameter("intSystem", intSystem);
        query.setParameter("intFlid", intFlid);

        List<EntDbFevtab> list = query.getResultList();
View Full Code Here

        }
        return result;
    }
   
    public EntDbFevtab findByFltDailyId(String idfd) {
      EntDbFevtab entity = null;
      try {
        Query query = _em.createNamedQuery("EntDbFevtab.findByIdfd");
        query.setParameter("idfd", idfd);
        List<EntDbFevtab> list = query.getResultList();
        if (list != null && list.size() > 0) {
View Full Code Here

              HpUfisCalendar nowUtc = new HpUfisCalendar(new Date());
              nowUtc.DateAdd(HpUfisAppConstants.OFFSET_LOCAL_UTC, EnumTimeInterval.Hours);
             
              // TODO update event ???
              //EntDbFevtab fevRecord = _fevBean.getFevtab(aftFlight.getUrno(), flightData.getFlightStatus());
              EntDbFevtab fevRecord = _fevBean.getMacsFlightEvent(flightData.getMflId(), flightData.getFlightStatus());
              if (fevRecord == null) {
                fevRecord = new EntDbFevtab();
                // 2013-12-30 updated by JGO - Change urno to uuid
                // get id from jnotab
                //fevRecord.setURNO(new BigDecimal(HpUfisUtils.formatJavaFevUrno(_jnoBean.getNextValueByKey("FEV-URNO", 1))));
                // cdat
                  fevRecord.setCDAT(nowUtc.getCedaString());
                  // usec
                  fevRecord.setUSEC(MSGIF);
                  // intSystem and intFlid
                  fevRecord.setINAM(MSGIF);
                  fevRecord.setIFID(flightData.getMflId());
                 
                  // ------------------------------------------------------
                  fevRecord.setUAFT(aftFlight.getUrno());
                  fevRecord.setSTNM("FLIGHT_STATUS");
                  fevRecord.setSTCO(flightData.getFlightStatus());
                  fevRecord.setSTTM(nowUtc.getCedaString());
                  fevRecord.setSTFL("");
                  //fevRecord.setSTRM("FLIGHT_STATUS");
                  //fevRecord.setUSEU(INTSYSTEM_MACS_FLT);
                 
                  // 2013-12-26 updated by JGO - Changed tag
                  if (HpUfisUtils.isNotEmptyStr(flightData.getChanged())) {
                    HpUfisCalendar cal = new HpUfisCalendar(flightData.getChanged(),
                          HpEKConstants.MACS_TIME_FORMAT);
                    fevRecord.setLSTU(cal.getCedaString());
                  }
                  _fevBean.persist(fevRecord);
              } else {
                fevRecord.setUSEU(MSGIF);
                fevRecord.setSTTM(nowUtc.getCedaString());
                // 2013-12-26 updated by JGO - Changed tag
                  if (HpUfisUtils.isNotEmptyStr(flightData.getChanged())) {
                    HpUfisCalendar cal = new HpUfisCalendar(flightData.getChanged(),
                          HpEKConstants.MACS_TIME_FORMAT);
                    fevRecord.setLSTU(cal.getCedaString());
                  }
                //fevRecord.setLSTU(nowUtc.getCedaString());
                _fevBean.update(fevRecord);
              }
            } else {
              // when afttab record is not found, use intsystem and intflid to insert event
              HpUfisCalendar nowUtc = new HpUfisCalendar(new Date());
              nowUtc.DateAdd(HpUfisAppConstants.OFFSET_LOCAL_UTC, EnumTimeInterval.Hours);
              // TODO need to know whether same flight different event got different mflid
              EntDbFevtab fevRecord = _fevBean.getFevtab(MSGIF, flightData.getMflId());
              if (fevRecord == null) {
                fevRecord = new EntDbFevtab();
                // get id from jnotab
                //fevRecord.setURNO(new BigDecimal(HpUfisUtils.formatJavaFevUrno(_jnoBean.getNextValueByKey("FEV-URNO", 1))));
                // cdat
                  fevRecord.setCDAT(nowUtc.getCedaString());
                  // usec
                  fevRecord.setUSEC(MSGIF);
                  // intSystem and intFlid
                  fevRecord.setINAM(MSGIF);
                  fevRecord.setIFID(flightData.getMflId());
                 
                  // ------------------------------------------------------
                  //fevRecord.setUAFT(result_entDbAfttab.getUrno());
                 
                  fevRecord.setSTNM("FLIGHT_STATUS");
                fevRecord.setSTCO(flightData.getFlightStatus());
                fevRecord.setSTTM(nowUtc.getCedaString());
                  fevRecord.setSTFL("");
                  //fevRecord.setSTRM("FLIGHT_STATUS");
                  //fevRecord.setUSEU(INTSYSTEM_MACS_FLT);
                  //fevRecord.setLSTU(nowUtc.getCedaString());
                  _fevBean.persist(fevRecord);
              }
View Full Code Here

              }
             
              // FEVTAB related info
              // RTG
              if (event.getRtg() != null) {
                EntDbFevtab fevtab = fevtabBean.findByFltDailyId(fltDaily.getId());
                if (fevtab == null) {
                  fevtab = new EntDbFevtab();
                  fevtab.setUSEC(dtfl);
                  fevtabBean.persist(fevtab);
                }
                if (event.getRtg().getLastDoorCl() != null) {
                  ufisCalendar.setTime(event.getRtg().getLastDoorCl());
                  fevtab.setSTTM(df.format(ufisCalendar.getTime()));
                }
                fevtab.setSTNM("Ready to Go");
                fevtab.setSTFL(event.getRtg().getValue());
                fevtab.setSTRM("");
                fevtab.setUSEU(dtfl);
                fevtabBean.update(fevtab);
              }
          }
        }
       
View Full Code Here

TOP

Related Classes of com.ufis_as.ufisapp.server.oldflightdata.entities.EntDbFevtab

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.