Examples of EntDbCrewImmigration


Examples of com.ufis_as.ek_if.iams.entities.EntDbCrewImmigration

        return;
      }
      if (staffType.equalsIgnoreCase("C")
          || staffType.equalsIgnoreCase("F")) {
        BigDecimal flightId=new BigDecimal(idFlight);
        EntDbCrewImmigration entity = null, oldEnt = null, newEnt = null;
        entity = null;//clsDlCrewImmigration.getCrewByFltIdStaffNum(flightId, staffNumber);
        if (entity == null) {
          LOG.info("No record found in CREW_IMMIGRATION with idFlight: "
              + idFlight + "  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.IAMS_SOURCE);
            newEnt = clsDlCrewImmigration.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.iams.entities.EntDbCrewImmigration

    public DlCrewImmigrationBean() {
      super(EntDbCrewImmigration.class);
    }
   
    public EntDbCrewImmigration merge(EntDbCrewImmigration entity){
      EntDbCrewImmigration 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.iams.entities.EntDbCrewImmigration

    }
   
    public EntDbCrewImmigration getExistingCrewImmigration(String flNum, Date flightDate, String depNum,
        String legNum, String staffNum, String gateType){
      List<EntDbCrewImmigration> resultList = null;
      EntDbCrewImmigration result = null;
      Query query = getEntityManager().createNamedQuery("EntDbCrewImmigration.findByPk");
      try{
        query.setParameter("flNum", flNum);
        query.setParameter("flightDate", flightDate);
        query.setParameter("depNum", depNum);
        query.setParameter("legNum", legNum);
        query.setParameter("staffNum", staffNum);
        query.setParameter("gateType", gateType);
        query.setParameter("recStatus", "X");
       
        resultList = query.getResultList();
        if(resultList.size()>0){
          result = resultList.get(0);
          LOG.debug("Input data will be updated to existing Crew immigration record's ID : {}.", result.getId());
        }
        else
          LOG.debug("Crew immigration 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.iams.entities.EntDbCrewImmigration

    }
   
    public EntDbCrewImmigration getExistingByIdFlight(BigDecimal idFlight, String staffNumber,
        String staffCode, String idFltJobAssign){
      List<EntDbCrewImmigration> resultList = null;
      EntDbCrewImmigration result = null;
      Query query = getEntityManager().createNamedQuery("EntDbCrewImmigration.findByIdFlightAndStaffNum");
      try{
        query.setParameter("idFlight", idFlight);
        query.setParameter("crewTypeCode", 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 immigration record's ID : {}.", result.getId());
        }
        else
          LOG.debug("Crew immigration record is not existing.");
      }
      catch(Exception ex){
View Full Code Here

Examples of com.ufis_as.ek_if.iams.entities.EntDbCrewImmigration

      return result;
    }
   
    public EntDbCrewImmigration getExistingByIdJobAssign(BigDecimal idFlight, String idFltJobAssign){
      List<EntDbCrewImmigration> resultList = null;
      EntDbCrewImmigration result = null;
      Query query = getEntityManager().createNamedQuery("EntDbCrewImmigration.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 immigration record's ID : {}.", result.getId());
        }
        else
          LOG.debug("Crew immigration record is not existing to delete.");
      }
      catch(Exception ex){
View Full Code Here

Examples of com.ufis_as.ek_if.iams.entities.EntDbCrewImmigration

        LOG.warn("Input Gate type is not in MD_GATE_TYPE table.");
        addExptInfo(EnumExceptionCodes.WNOMD.name(), _input.getCrewStatusInfo().getGateDetails().getGateType());
      }*/
      statusChangeDtm = df.parse(convertFlDateToUTC(_input.getCrewStatusInfo().getStatusChageDTM()));
     
      EntDbCrewImmigration entCrew = null, oldEntCrew = new EntDbCrewImmigration();
      //find out existing crew immigration record
      entCrew = clsDlCrewImmigration.getExistingCrewImmigration(flNum, flDate, String.valueOf(_input.getFlightID().getDepNum()),
          String.valueOf(_input.getFlightID().getLegNum()), _input.getCrewDetails().getStaffNo(), _input.getCrewStatusInfo().getGateDetails().getGateType());
     
      if(entCrew == null){
        entCrew = new EntDbCrewImmigration();
        entCrew.setCreatedUser(HpEKConstants.IAMS_SOURCE);
        entCrew.setCreatedDate(HpUfisCalendar.getCurrentUTCTime());
        //entCrew.setCreatedDate(statusChangeDtm);
        entCrew.setDepNum(String.valueOf(_input.getFlightID().getDepNum()));
        entCrew.setLegNum(String.valueOf(_input.getFlightID().getLegNum()));
        entCrew.setStaffNumber(_input.getCrewDetails().getStaffNo());
        entCrew.setGateType(_input.getCrewStatusInfo().getGateDetails().getGateType());
        entCrew.setIdMdGateType(idGateType);
        entCrew.setFlightNumber(flNum);
      }
      else{
        oldEntCrew = new EntDbCrewImmigration(entCrew); //deep copy
        cmd = UfisASCommands.URT.name();
        entCrew.setUpdatedUser(HpEKConstants.IAMS_SOURCE);
        entCrew.setUpdatedDate(HpUfisCalendar.getCurrentUTCTime());
      }
     
      entCrew.setIdFltJobAssign(idFltJobAssign);
      if(_input.getTmStmp() != null
        entCrew.setMsgSendDate(df.parse(convertFlDateToUTC(_input.getTmStmp())));
      entCrew.setStatusChangeDate(statusChangeDtm);
      entCrew.setCrewTypeCode(_input.getCrewDetails().getCrewType());
      entCrew.setCrewActivityStat(_input.getCrewStatusInfo().getStatus());
      entCrew.setCrewActivityFlag(crewActivityFlag);
      entCrew.setStatusRemarks(_input.getCrewStatusInfo().getReason());
      entCrew.setGateNumber(_input.getCrewStatusInfo().getGateDetails().getGateNo());
      entCrew.setGateLocation(_input.getCrewStatusInfo().getGateDetails().getWing());
     
      entCrew.setIdFlight(urno);
      entCrew.setFltDate(flDate);
      entCrew.setFltOrigin3(_input.getFlightID().getDepStn());
      entCrew.setFltDest3(_input.getFlightID().getArrStn());
      entCrew.setDataSource(HpEKConstants.IAMS_SOURCE);
      entCrew.setRecStatus(" ");
     
      EntDbCrewImmigration resultEntCrew = clsDlCrewImmigration.merge(entCrew);
      if(resultEntCrew != null){
        sendNotifyUldInfoToInJson(resultEntCrew, oldEntCrew, cmd);
      }
    } catch (JAXBException e) {
      LOG.error("JAXBContext when unmarshalling... {}", e.getMessage());
View Full Code Here

Examples of com.ufis_as.ek_if.iams.entities.EntDbCrewImmigration

    String cmd = ufisMsgDTO.getBody().getActs().get(0).getCmd();
    switch(cmd){
    case "IRT" :
    case "URT" :
      //find the existing from crew immigration table
      EntDbCrewImmigration entCrew = clsDlCrewImmigration.getExistingByIdFlight(idFlt, staffNumber, staffCode, idFltJobAssign);
      if(entCrew == null) //do nothing
        return;
      EntDbCrewImmigration oldEntCrew = new EntDbCrewImmigration(entCrew); //deep copy
      entCrew.setIdFltJobAssign(idFltJobAssign);
     
      cmd = UfisASCommands.URT.name();
      entCrew.setUpdatedUser(HpEKConstants.IAMS_SOURCE);
      entCrew.setUpdatedDate(HpUfisCalendar.getCurrentUTCTime());
      entCrew.setRecStatus(" ");
     
      EntDbCrewImmigration resultEntCrew = clsDlCrewImmigration.merge(entCrew);
      if(resultEntCrew != null){ //send broadcast message.
        sendNotifyUldInfoToInJson(resultEntCrew, oldEntCrew, cmd);
      }
      break;
    case "DRT" :
      //delete the record for  id_flt_job_assign
    /*  clsDlCrewImmigration.updateIdFltJobAssignDeleted(idFltJobAssign);
      LOG.debug("Updated the deleted id_flt_job_assign successfully.");*/
     
      //find the existing from crew immigration table
      EntDbCrewImmigration entDeletedCrew = clsDlCrewImmigration.getExistingByIdJobAssign(idFlt, idFltJobAssign);
      if(entDeletedCrew == null) //do nothing
        return;
      EntDbCrewImmigration oldEntDeletedCrew = new EntDbCrewImmigration(entDeletedCrew); //deep copy
      entDeletedCrew.setIdFltJobAssign(idFltJobAssign);
     
      cmd = UfisASCommands.DRT.name();
      entDeletedCrew.setUpdatedUser(HpEKConstants.IAMS_SOURCE);
      entDeletedCrew.setUpdatedDate(HpUfisCalendar.getCurrentUTCTime());
      entDeletedCrew.setRecStatus("X");
     
      EntDbCrewImmigration resultEntDeletedCrew = clsDlCrewImmigration.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.