Examples of EntDbCrewCheckin


Examples of com.ufis_as.ek_if.bms.entities.EntDbCrewCheckin

    public DlCrewCheckInBean() {
      super(EntDbCrewCheckin.class);
    }
   
    public EntDbCrewCheckin merge(EntDbCrewCheckin entity){
      EntDbCrewCheckin crewImmigration = null;
      try{
        crewImmigration = em.merge(entity);
        //em.flush();
      } catch (OptimisticLockException Oexc) {
        LOG.error("OptimisticLockException Entity:{} , Error:{}", entity, Oexc);
View Full Code Here

Examples of com.ufis_as.ek_if.bms.entities.EntDbCrewCheckin

      return crewImmigration;
    }
   
    public EntDbCrewCheckin getExistingCrewCheckIn(String flNum, String legNum, String depNum,
        String staffNum, Date flightDate){
      EntDbCrewCheckin result = null;
      Query query = getEntityManager().createNamedQuery("EntDbCrewCheckin.findByKey");
      try{
        query.setParameter("flNum", flNum);
        query.setParameter("flightDate", flightDate);
        query.setParameter("depNum", depNum);
        query.setParameter("legNum", legNum);
        query.setParameter("staffNum", staffNum);
        List<EntDbCrewCheckin> resultList = query.getResultList();
        if(resultList.size()>0){
          result = resultList.get(0);
          LOG.debug("Input data will be updated to existing Crew CheckIn record's ID : {}.", result.getId());
        }
        else
          LOG.debug("Crew CheckIn record is not existing. Input data will be added as a new record.");
    }
    catch(Exception ex){
View Full Code Here

Examples of com.ufis_as.ek_if.bms.entities.EntDbCrewCheckin

    }
   
    public EntDbCrewCheckin getExistingByIdFlight(BigDecimal idFlight, String staffNumber,
        String staffCode, String idFltJobAssign){
      List<EntDbCrewCheckin> resultList = null;
      EntDbCrewCheckin result = null;
      Query query = getEntityManager().createNamedQuery("EntDbCrewCheckin.findByIdFlightAndStaffNum");
      try{
        query.setParameter("idFlight", idFlight);
        query.setParameter("staffType", staffCode);
        query.setParameter("staffNumber", staffNumber);
        query.setParameter("idFltJobAssign", idFltJobAssign);
        query.setParameter("recStatus", "X");
       
        resultList = query.getResultList();
        if(resultList.size()>0){
          result = resultList.get(0);
          LOG.debug("Data will be updated to existing Crew check in record's ID : {}.", result.getId());
        }
        else
          LOG.debug("Crew check in record is not existing.");
      }
      catch(Exception ex){
View Full Code Here

Examples of com.ufis_as.ek_if.bms.entities.EntDbCrewCheckin

      return result;
    }
   
    public EntDbCrewCheckin getExistingByIdJobAssign(BigDecimal idFlight, String idFltJobAssign){
      List<EntDbCrewCheckin> resultList = null;
      EntDbCrewCheckin result = null;
      Query query = getEntityManager().createNamedQuery("EntDbCrewCheckin.findByIdFlightAndIdFltJobAssign");
      try{
        query.setParameter("idFlight", idFlight);
        query.setParameter("idFltJobAssign", idFltJobAssign);
        query.setParameter("recStatus", "X");
       
        resultList = query.getResultList();
        if(resultList.size()>0){
          result = resultList.get(0);
          LOG.debug("Data will be updated to existing Crew checkin record's ID : {}.", result.getId());
        }
        else
          LOG.debug("Crew check in record is not existing to delete.");
      }
      catch(Exception ex){
View Full Code Here

Examples of com.ufis_as.ek_if.bms.entities.EntDbCrewCheckin

        return;
      }
      if (staffType.equalsIgnoreCase("C")
          || staffType.equalsIgnoreCase("F")) {
        BigDecimal flightId=new BigDecimal(idFlight);
        EntDbCrewCheckin entity = null, oldEnt = null, newEnt = null;
        entity = null;//clsDlCrewCheckInBean.getCrewCheckInByFltIdStaffNum(flightId, staffNumber);
        if (entity == null) {
          LOG.info("No record found in CREW_CHEKIN with idFlight: "
              + flightId + "  and Staff Number :" + staffNumber);
          // Need to insert or not????
        } else {
          if (!entity.getIdFltJobAssign().equalsIgnoreCase(
              id_Flt_job_assign)) {
            // UfisASCommands.URT
            oldEnt = entity;
            entity.setIdFltJobAssign(id_Flt_job_assign);
            entity.setUpdatedDate(HpUfisCalendar
                .getCurrentUTCTime());
            entity.setUpdatedUser(HpEKConstants.BMS_SOURCE);
            newEnt = clsDlCrewCheckInBean.merge(entity);
            if (HpUfisUtils
                .isNotEmptyStr(HpCommonConfig.notifyTopic)) {
              // send notification message to topic
              ufisTopicProducer.sendNotification(true,
View Full Code Here

Examples of com.ufis_as.ek_if.bms.entities.EntDbCrewCheckin

        idFltJobAssign = (entFltJobAssign == null)? "0" : entFltJobAssign.getId();
      }
      checkInDate = sf.parse(convertFlDateToUTC(_input.getCheckInInfo().getCheckInTime()));
      msgInTime = sf.parse(convertFlDateToUTC(_input.getMeta().getMessageTime()));
     
      EntDbCrewCheckin entity = null, oldEnt = null;
      entity = clsDlCrewCheckInBean.getExistingCrewCheckIn(flNum, legNum,
            depNum, _input.getCheckInInfo().getStaffno(), flDate);
      if(entity == null){
        entity = new EntDbCrewCheckin();
        entity.setFlightNumber(flNum);
        entity.setLegNum(legNum);
        entity.setDepNum(depNum);
        entity.setStaffNumber(_input.getCheckInInfo().getStaffno());
        entity.setFltDate(flDate);
       
        entity.setCreatedDate(HpUfisCalendar.getCurrentUTCTime());
        entity.setCreatedUser(HpEKConstants.BMS_SOURCE);
      }
      else{
        oldEnt = new EntDbCrewCheckin(entity);
        entity.setUpdatedDate(HpUfisCalendar.getCurrentUTCTime());
        entity.setUpdatedUser(HpEKConstants.BMS_SOURCE);
        cmd = UfisASCommands.URT.name();
      }
      entity.setIdFlight(urno);
      entity.setIdFltJobAssign(idFltJobAssign);
      entity.setMsgSendDate(msgInTime);
      entity.setFltOrigin3(_input.getFlightID().getDepStn());
      entity.setFltDest3(_input.getFlightID().getArrStn());
      entity.setStaffName(_input.getCheckInInfo().getStaffName());
      entity.setStaffOpGrade(_input.getCheckInInfo().getOperatingGrade());
      entity.setCheckinDate(checkInDate);
      entity.setStaffType(_input.getCheckInInfo().getCrewType());
      entity.setSelfCheckinFlag(_input.getCheckInInfo().getSelfCheckIn());
      entity.setRecStatus(" ");
      entity.setDataSource(HpEKConstants.BMS_SOURCE);
     
      EntDbCrewCheckin entCrewCheckIn = clsDlCrewCheckInBean.merge(entity);
      if(entCrewCheckIn != null){
        sendNotifyUldInfoToInJson(entCrewCheckIn, oldEnt, cmd);
      }
    }catch (JAXBException e) {
      LOG.error("JAXBContext when unmarshalling... {}", e.getMessage());
View Full Code Here

Examples of com.ufis_as.ek_if.bms.entities.EntDbCrewCheckin

    String cmd = ufisMsgDTO.getBody().getActs().get(0).getCmd();
    switch(cmd){
    case "IRT" :
    case "URT" :
      //find the existing from crew immigration table
      EntDbCrewCheckin entCrew = clsDlCrewCheckInBean.getExistingByIdFlight(idFlt, staffNumber, staffCode, idFltJobAssign);
      if(entCrew == null) //do nothing
        return;
      EntDbCrewCheckin oldEntCrew = new EntDbCrewCheckin(entCrew); //deep copy
      entCrew.setIdFltJobAssign(idFltJobAssign);
     
      cmd = UfisASCommands.URT.name();
      entCrew.setUpdatedUser(HpEKConstants.BMS_SOURCE);
      entCrew.setUpdatedDate(HpUfisCalendar.getCurrentUTCTime());
      entCrew.setRecStatus(" ");
     
      EntDbCrewCheckin resultEntCrew = clsDlCrewCheckInBean.merge(entCrew);
      if(resultEntCrew != null){ //send broadcast message.
        sendNotifyUldInfoToInJson(resultEntCrew, oldEntCrew, cmd);
      }
      break;
    case "DRT" :
     
      //find the existing from crew checkin table
      EntDbCrewCheckin entDeletedCrew = clsDlCrewCheckInBean.getExistingByIdJobAssign(idFlt, idFltJobAssign);
      if(entDeletedCrew == null) //do nothing
        return;
      EntDbCrewCheckin oldEntDeletedCrew = new EntDbCrewCheckin(entDeletedCrew); //deep copy
      entDeletedCrew.setIdFltJobAssign(idFltJobAssign);
     
      cmd = UfisASCommands.DRT.name();
      entDeletedCrew.setUpdatedUser(HpEKConstants.BMS_SOURCE);
      entDeletedCrew.setUpdatedDate(HpUfisCalendar.getCurrentUTCTime());
      entDeletedCrew.setRecStatus("X");
     
      EntDbCrewCheckin resultEntDeletedCrew = clsDlCrewCheckInBean.merge(entDeletedCrew);
      if(resultEntDeletedCrew != null){ //send broadcast message.
        sendNotifyUldInfoToInJson(resultEntDeletedCrew, oldEntDeletedCrew, cmd);
      }
      break;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.