Package com.ufis_as.ek_if.aacs.uld.entities

Examples of com.ufis_as.ek_if.aacs.uld.entities.EntDbLoadUldMove


        EntDbLoadUld entUld = _dlLoadUldBean.getUldNum(urno, uldNumber);
        idUld = (entUld == null) ? "0" : entUld.getId();
       
        boolean flag = false;
        String cmdForBroadcasting =  null;
        EntDbLoadUldMove loadUldMove = null;
        EntDbLoadUldMove oldLoadUldMove = null;
       
        if("UNDO".equals(_inputUldScanInfo.getRECORDTYPE())){
          loadUldMove = _dlLoadUldMoveBean.getUldMoveByIdFlightUldNum(urno, uldNumber);
          flag = true;
        }
        if(loadUldMove == null){//null? create a new record
          if(flag){
            LOG.error(" ULD record does not exist to UNDO.  Message dropped.");
            addExptInfo(EnumExceptionCodes.ENOUD.name(), uldNumber);
            return false;
          }
          loadUldMove = new EntDbLoadUldMove();
          oldLoadUldMove = loadUldMove;
          loadUldMove.setFltDate(new HpUfisCalendar(flDate).getTime());
          loadUldMove.setUldFltno(flno);
          loadUldMove.setUldNumber(_inputUldScanInfo.getULDNUMBER());
          loadUldMove.setCreatedUser(_inputUldScanInfo.getSCANBY());
          loadUldMove.setCreatedDate(HpUfisCalendar.getCurrentUTCTime());
          cmdForBroadcasting = HpUfisAppConstants.UfisASCommands.IRT.toString();
        }
        else{
          oldLoadUldMove = new EntDbLoadUldMove(loadUldMove);
          loadUldMove.setUpdatedUser(_inputUldScanInfo.getSCANBY());
          loadUldMove.setUpdatedDate(HpUfisCalendar.getCurrentUTCTime());
          cmdForBroadcasting = HpUfisAppConstants.UfisASCommands.URT.toString();
        }
        loadUldMove.setIdFlight(urno);
        loadUldMove.setIdLoadUlds(idUld);
        List<EntDbMdUldLoc> uldLocList = _BasicDataSingleton.getUldLocList();
        List<EntDbMdUldScanAct> uldScanActList = _BasicDataSingleton.getUldScanActList();
       
        boolean isFound = false;
        for(int i = 0; i < uldLocList.size(); i++){
          if(uldLocList.get(i).getUldPlaceLoc().trim().equals(_inputUldScanInfo.getSCANLOCATIONCODE().trim())){
            loadUldMove.setIdScanMdUldLoc(uldLocList.get(i).getId());
            isFound = true;
          }
          //if(!HpUfisUtils.isNullOrEmptyStr(_inputUldScanInfo.getSCANDISLOCCODE())){ // only when the value is exist, check against the md value
            if(uldLocList.get(i).getUldPlaceLoc().trim().equals(_inputUldScanInfo.getSCANDISLOCCODE().trim())){
              loadUldMove.setIdDispMdUldLoc(uldLocList.get(i).getId());
              isFound = true;
            }
          //}
        }
        if (!isFound) {
          addExptInfo(EnumExceptionCodes.WNOMD.name(), String.format("SCAN_LOCATION_CODE/SCAN_DIS_LOC_CODE => %s/%s", _inputUldScanInfo.getSCANLOCATIONCODE().trim(),_inputUldScanInfo.getSCANDISLOCCODE().trim()));
          LOG.warn("Master Data scanLoc/scanDisLoc code is not match in MdUldLoc.");
        }
       
        isFound = false;
        for(int i = 0; i < uldScanActList.size(); i++){
          if(uldScanActList.get(i).getUldScanAction().trim().equals(_inputUldScanInfo.getSCANACTION().trim())){
            loadUldMove.setIdMdUldScanAct(uldScanActList.get(i).getId());
            isFound = true;
            break;
          }
        }
        if (!isFound) {
          addExptInfo(EnumExceptionCodes.WNOMD.name(), String.format("SCAN_ACTION => %s", _inputUldScanInfo.getSCANACTION().trim()));
          LOG.warn("Master Data uldScanAction is not match in MdUldScanAct.");
        }
       
        String status = " ";
        if("UNDO".equals(_inputUldScanInfo.getRECORDTYPE())){
          status = "X";
          cmdForBroadcasting = HpUfisAppConstants.UfisASCommands.DRT.toString();
        }
        loadUldMove.setRecFlag(status);
        loadUldMove.setArrDepFlag(_inputUldScanInfo.getFLIGHTAD());
        loadUldMove.setScanAction(_inputUldScanInfo.getSCANACTION());
        loadUldMove.setScanLocCode(_inputUldScanInfo.getSCANLOCATIONCODE());
        loadUldMove.setScanLocDesc(_inputUldScanInfo.getSCANLOCATIONDESC());
        if(!HpUfisUtils.isNullOrEmptyStr(_inputUldScanInfo.getSCANDATETIME()))
            loadUldMove.setScanDate(new HpUfisCalendar(convertFlDateToUTC(_inputUldScanInfo.getSCANDATETIME())).getTime());
        loadUldMove.setScanUser(_inputUldScanInfo.getSCANBY());
        loadUldMove.setDataSource(HpEKConstants.ULD_SOURCE);
        loadUldMove.setDispLocCode(_inputUldScanInfo.getSCANDISLOCCODE());
        loadUldMove.setDispLocDesc(_inputUldScanInfo.getSCANDISLOCDESC());
       
        if(!HpUfisUtils.isNullOrEmptyStr(_inputUldScanInfo.getRECORDSENDDATE()))
          loadUldMove.setUldSentDate(new HpUfisCalendar(convertFlDateToUTC(_inputUldScanInfo.getRECORDSENDDATE())).getTime());
        EntDbLoadUldMove uldMove = _dlLoadUldMoveBean.merge(loadUldMove);
        if(uldMove != null){
          sendNotifyUldMoveInJson(uldMove, oldLoadUldMove, cmdForBroadcasting);
        }
      }
      else {
View Full Code Here


    public void persist(EntDbLoadUldMove entity){
      em.persist(entity);  
    }
   
    public EntDbLoadUldMove merge(EntDbLoadUldMove entity){
      EntDbLoadUldMove loadUld = null;
      try{
        loadUld = em.merge(entity);
      }
      catch(Exception ex){
        LOG.error("ERROR to create new LOAD ULD !!! {}", ex.toString());
View Full Code Here

      }
      return loadUld;
    }
   
    public EntDbLoadUldMove getUldMoveByIdFlightUldNum(BigDecimal idFlight, String uldNumber){
      EntDbLoadUldMove result  = null;
      try{
        Query query = getEntityManager().createNamedQuery("EntDbLoadUldMove.findUldMoveByidFlightUldNum");
        query.setParameter("idFlight", idFlight);
        query.setParameter("uldNumber", uldNumber);
        query.setParameter("recStatus", "X");
       
        List<EntDbLoadUldMove> resultList = query.getResultList();
        if(resultList.size()>0){
          //get the uld latest movement
          result = resultList.get(0);
          LOG.info("Uld Move record found. ID : {}", result.getId());
        }
        else
          LOG.debug("ULD Move is not found");
    } catch (Exception nur) {
      LOG.error("ULD Move Record not found "+ nur.getMessage());
View Full Code Here

      return result;
    }
   
    public EntDbLoadUldMove getUldMoveByPk(Date flDate, String flno, String uldNo){
      //LOG.debug("==== Searching ULD Move ====");
      EntDbLoadUldMove result  = null;
      DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
      try{
        Query query = getEntityManager().createNamedQuery("EntDbLoadUldMove.findUldMoveByPk");
        query.setParameter("flightNumber", flno);
        query.setParameter("uldNumber", uldNo);
        query.setParameter("flightDate", formatter.format(flDate));
        query.setParameter("recStatus", "X");
        List<EntDbLoadUldMove> resultList = query.getResultList();
        if(resultList.size()>0){
          //get the uld latest movement
          result = resultList.get(0);
          LOG.info("Uld Move record found. ID : {}", result.getId());
        }
        else
          LOG.debug("ULD Move is not found");
    } catch (Exception nur) {
      LOG.error("ULD Move Record not found "+ nur.getMessage());
View Full Code Here

TOP

Related Classes of com.ufis_as.ek_if.aacs.uld.entities.EntDbLoadUldMove

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.