Examples of EntDbLoadBagMove


Examples of com.ufis_as.ek_if.belt.entities.EntDbLoadBagMove

  public boolean tranformFlightCrews(Message message,
      BagDetailsType bagDetails, Long irmtabRef) {
    // String cmdForBroadcasting = null;
    msgLogged = Boolean.FALSE;
    dtflStr = HpCommonConfig.dtfl;
    EntDbLoadBagMove loadBagMoveStat = null;
    if (irmtabRef > 0) {
      msgLogged = Boolean.TRUE;
    }
    // EntDbLoadBagMove oldLoadBagMove = new EntDbLoadBagMove();
    try {
      EntDbLoadBagMove loadBagMove = new EntDbLoadBagMove();

      if (HpUfisUtils.isNullOrEmptyStr(bagDetails.getBagInfo()
          .getScanLocation())
          || (bagDetails.getBagInfo().getScanAction() == null)
          || HpUfisUtils.isNullOrEmptyStr(bagDetails.getBagInfo()
              .getChangeDate())
          || HpUfisUtils.isNullOrEmptyStr(bagDetails.getBagInfo()
              .getChangeTime())) {
        LOG.warn(
            "Dropped Message details( BagInfo Mandatory values(BagScanLoc,ScanAction,ChangeTime,ChangeDate) are not specified): "
                + "BagTag = {}, "
                + "Flight info = {}, "
                + " Flight Date = {}, ", new Object[] {
                bagDetails.getBagInfo().getBagTag(),
                bagDetails.getFlightInfo()
                    .getFullFlightNumber(),
                bagDetails.getFlightInfo().getFlightDate() });

        if (HpCommonConfig.irmtab
            .equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
                .name())) {
          if (!msgLogged) {
            irmtabRef = _irmfacade.storeRawMsg(message, dtflStr);
            msgLogged = Boolean.TRUE;
          }
        }
        if (irmtabRef > 0) {
          sendErrInfo(EnumExceptionCodes.EMAND,
              "BagInfo Mandatory values missing.Bag Tag:"
                  + bagDetails.getBagInfo().getBagTag()
                  + "  Flight Number:"
                  + bagDetails.getFlightInfo()
                      .getFullFlightNumber()
                  + "  Flight Date:"
                  + bagDetails.getFlightInfo()
                      .getFlightDate(), irmtabRef);
        }

        return false;
      }
      if (_startupInitSingleton.isMdBagTypeOn() && allBagTypes.isEmpty()) {
        allBagTypes = _startupInitSingleton.getMdBagTypeList();
        for (EntDbMdBagType bagTypeRec : allBagTypes) {
          if ((bagTypeRec.getRecStatus() != null)
              && !bagTypeRec.getRecStatus().equalsIgnoreCase("X")) {
            masterBagTypes.add(bagTypeRec.getBagTypeCode());
          }
        }
        LOG.debug("Total valid Master BagTypes records: {}",
            masterBagTypes.size());
      }
      if (_startupInitSingleton.isMdBagActionOn()
          && allBagActions.isEmpty()) {
        allBagActions = _startupInitSingleton.getMdBagActionList();
        for (EntDbMdBagAction bagActRec : allBagActions) {
          if ((bagActRec.getRecStatus() != null)
              && !bagActRec.getRecStatus().equalsIgnoreCase("X")) {
            masterBagAction.add(bagActRec.getBagActionCode());
          }
        }
        LOG.debug("Total valid Master BagAction records: {}",
            masterBagAction.size());
      }
      if (_startupInitSingleton.isMdBagHandleLocOn()
          && allBagHandleLocs.isEmpty()) {
        allBagHandleLocs = _startupInitSingleton
            .getMdBagHandleLocList();

        for (EntDbMdBagHandleLoc bagHandleRec : allBagHandleLocs) {
          if ((bagHandleRec.getRecStatus() != null)
              && !bagHandleRec.getRecStatus().equalsIgnoreCase(
                  "X")) {
            masterHandleLocs.add(bagHandleRec);
          }
        }
        LOG.debug("Total valid Master BagHandleLocs records: {}",
            masterHandleLocs.size());
        if (!masterHandleLocs.isEmpty()) {
          for (EntDbMdBagHandleLoc bagHandleLocs : masterHandleLocs) {
            if (!allHandleLocCodes.contains(bagHandleLocs
                .getLocCode())) {
              allHandleLocCodes.add(bagHandleLocs.getLocCode());
            }
            idHandleLocationMap.put(bagHandleLocs.getLocCode(),
                bagHandleLocs.getId());
            idHandleLocationNodeInfoMap.put(
                bagHandleLocs.getLocCode(),
                bagHandleLocs.getNodeInfo());
            locBIMLocCodeMap.put(bagHandleLocs.getLocCode(),
                bagHandleLocs.getBimLocCode());
            locDescMap.put(bagHandleLocs.getLocCode(),
                bagHandleLocs.getLocDesc());
          }
        }
      }
      if (_startupInitSingleton.isMdBagReconLocOn()
          && allBagReconLocs.isEmpty()) {
        allBagReconLocs = _startupInitSingleton.getMdBagReconLocList();
        for (EntDbMdBagReconLoc bagReconLocRec : allBagReconLocs) {
          if ((bagReconLocRec.getRecStatus() != null)
              && !bagReconLocRec.getRecStatus().equalsIgnoreCase(
                  "X")) {
            masterReconLocs.add(bagReconLocRec);
          }
        }
        LOG.debug("Total valid Master BagReconLocs records: {}",
            masterReconLocs.size());
        if (!masterReconLocs.isEmpty()) {
          for (EntDbMdBagReconLoc bagReconLocs : masterReconLocs) {
            if (!allReconLocCodes.contains(bagReconLocs
                .getLocCode())) {
              allReconLocCodes.add(bagReconLocs.getLocCode());
            }
            idReconLocationMap.put(bagReconLocs.getLocCode(),
                bagReconLocs.getId());
          }
        }
      }
      long startTime = new Date().getTime();

      if (_startupInitSingleton.isMdBagTypeOn()
          && (!masterBagTypes.isEmpty() && !(masterBagTypes
              .contains(bagDetails.getBagInfo().getBagType()
                  .value())))) {
        LOG.error(
            "Dropping the message .Specified BagType is not available in Master Data BagTypes for the Flight :"
                + "BagTag = {}, "
                + "flight Number = {}, "
                + "Flight Date= {}, ", new Object[] {
                bagDetails.getBagInfo().getBagTag(),
                bagDetails.getFlightInfo()
                    .getFullFlightNumber(),
                bagDetails.getFlightInfo().getFlightDate() });

        if (HpCommonConfig.irmtab
            .equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
                .name())) {
          if (!msgLogged) {
            irmtabRef = _irmfacade.storeRawMsg(message, dtflStr);
            msgLogged = Boolean.TRUE;
          }
        }
        if (irmtabRef > 0) {
          sendErrInfo(EnumExceptionCodes.ENOMD,
              "BagType not in MasterData.Bag Type: "
                  + bagDetails.getBagInfo().getBagType()
                      .value()
                  + "  Bag Tag:"
                  + bagDetails.getBagInfo().getBagTag()
                  + "  Flight Number:"
                  + bagDetails.getFlightInfo()
                      .getFullFlightNumber()
                  + "  Flight Date:"
                  + bagDetails.getFlightInfo()
                      .getFlightDate(), irmtabRef);

        }

        return false;

      }

      if (_startupInitSingleton.isMdBagActionOn()
          && (!masterBagAction.isEmpty()
              && bagDetails.getBagInfo().getScanAction() != null && !(masterBagAction
                .contains(bagDetails.getBagInfo()
                    .getScanAction().value())))) {
        LOG.error(
            "Dropping the message .The specified Scan Action value not available in Master Data Bag Scan Action for the Flight :"
                + "BagTag = {}, "
                + "flight Number = {}, "
                + "Flight Date= {}, ", new Object[] {
                bagDetails.getBagInfo().getBagTag(),
                bagDetails.getFlightInfo()
                    .getFullFlightNumber(),
                bagDetails.getFlightInfo().getFlightDate() });

        if (HpCommonConfig.irmtab
            .equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
                .name())) {
          if (!msgLogged) {
            irmtabRef = _irmfacade.storeRawMsg(message, dtflStr);
            msgLogged = Boolean.TRUE;
          }
        }
        if (irmtabRef > 0) {
          sendErrInfo(EnumExceptionCodes.ENOMD,
              "Scan Action not in Master data.Scan Action:"
                  + bagDetails.getBagInfo().getScanAction()
                  + "  Bag Tag:"
                  + bagDetails.getBagInfo().getBagTag()
                  + "  Flight Number:"
                  + bagDetails.getFlightInfo()
                      .getFullFlightNumber()
                  + "  Flight Date:"
                  + bagDetails.getFlightInfo()
                      .getFlightDate(), irmtabRef);

        }
        return false;

      }
      if (bagDetails.getFlightInfo() != null) {
        String urno = null;

        String flightNumber = bagDetails.getFlightInfo()
            .getCarrierCode() == null ? " "
            : bagDetails.getFlightInfo().getCarrierCode()
                .substring(0, 2)
                + " "
                + HpUfisUtils.formatCedaFltn(String
                    .valueOf(bagDetails.getFlightInfo()
                        .getFlightNumber()))
                + (bagDetails.getFlightInfo().getFlightSuffix() == null ? ""
                    : bagDetails.getFlightInfo()
                        .getFlightSuffix());
        String fltDate = chgStringToFltDate(bagDetails.getFlightInfo()
            .getFlightDate());
        LOG.debug("flightNumber: " + flightNumber + "   FlightDate:"
            + fltDate);
        long idFlight = 0;
        // if (HpBeltConfig.getGetLinkTables().equalsIgnoreCase(
        // HpEKBeltConfigConstants.CON_YES)) {
        // if (!HpBeltConfig.getAfttabIstaExlList().isEmpty()) {
        // startTime = new Date().getTime();
        // // urno = _afttabBean.getUrnoFoFlDtOrgExlIsta(flightNumber,
        // // bagDetails.getFlightInfo().getDepartureAirport(),
        // // bagDetails
        // // .getFlightInfo().getArrivalAirport(), fltDate,
        // // HpBeltConfig.getAfttabIstaExlList());
        // urno = _afttabBean.getUrnoFoFlDtAdidExlIsta(flightNumber,
        // bagDetails.getFlightInfo().getArrivalAirport(), fltDate,
        // HpBeltConfig.getAfttabIstaExlList());
        //
        // LOG.debug("Total Duration on searching flight from AFTTAB (in ms): {}",
        // new Date().getTime() - startTime);
        // } else {

        // Change
        EntDbAfttab criteriaParams = new EntDbAfttab();
        // startTime = new Date().getTime();
        criteriaParams.setFlno(flightNumber);
        criteriaParams.setFlda(fltDate);
        // criteriaParams.setAdid('D');
        if (HpUfisUtils.isNullOrEmptyStr(bagDetails.getFlightInfo()
            .getArrivalAirport())) {
          urno = _afttabBean.getUrnoByFldaFlnoAdid(criteriaParams,
              null, bagDetails.getFlightInfo()
                  .getDepartureAirport());
        } else {
          urno = _afttabBean.getUrnoByFldaFlnoAdid(criteriaParams,
              bagDetails.getFlightInfo().getArrivalAirport(),
              bagDetails.getFlightInfo().getDepartureAirport());
        }

        // startTime = new Date().getTime();
        // // urno = _afttabBean.getUrnoFoFlDtOrg(flightNumber,
        // // bagDetails.getFlightInfo().getDepartureAirport(),
        // // bagDetails.getFlightInfo()
        // // .getArrivalAirport(), fltDate);
        // urno = _afttabBean.getUrnoByFldtAdid(flightNumber,
        // bagDetails.getFlightInfo().getArrivalAirport(), fltDate);
        // LOG.debug("Total Duration on searching flight from AFTTAB (in ms): {}",
        // new Date().getTime() - startTime);
        // }

        if (urno == null || String.valueOf(urno) == null
            || urno.isEmpty()) {
          urno = new Long(0).toString();
          LOG.error(
              "No flight is available in AFTTAB with the Flight details:"
                  + "BagTag = {}, " + "flight Number = {}, "
                  + "Flight Date= {}, ", new Object[] {
                  bagDetails.getBagInfo().getBagTag(),
                  flightNumber, fltDate });

          if (HpCommonConfig.irmtab
              .equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
                  .name())) {
            if (!msgLogged) {
              irmtabRef = _irmfacade
                  .storeRawMsg(message, dtflStr);
              msgLogged = Boolean.TRUE;
            }
          }
          if (irmtabRef > 0) {
            sendErrInfo(EnumExceptionCodes.ENOFL,
                "Flight Not Found.Bag Tag:"
                    + bagDetails.getBagInfo().getBagTag()
                    + "  Flight Number:"
                    + bagDetails.getFlightInfo()
                        .getFullFlightNumber()
                    + "  Flight Date:"
                    + bagDetails.getFlightInfo()
                        .getFlightDate(), irmtabRef);
          }
        }
        idFlight = Long.parseLong(urno);
        // }
        // long idFlight = (urno != null && (String.valueOf(urno) !=
        // null) && (!urno
        // .isEmpty())) ? Long.parseLong(urno) : 0;

        String recStatus = " ";
        // if (idFlight != 0) {
        loadBagMove.setIdFlight(new BigDecimal(idFlight));
        // }
        loadBagMove.setFlightNumber(flightNumber);
        loadBagMove.setFltDate(fltDate);
        loadBagMove.setMsgSendDate(convertDateToUTC(bagDetails
            .getMeta().getMessageTime()));
        loadBagMove.setFltOrigin3(bagDetails.getFlightInfo()
            .getDepartureAirport());
        loadBagMove.setFltDest3(bagDetails.getFlightInfo()
            .getArrivalAirport());

        try {
          loadBagMove.setBagTag(bagDetails.getBagInfo().getBagTag());
          // if (HpBeltConfig.getGetLinkTables().equalsIgnoreCase(
          // HpEKBeltConfigConstants.CON_YES)) {
          startTime = new Date().getTime();
          // List<EntDbLoadBag> entLoadBag = _loadBagUpdate
          // .getBagMoveDetailsByBagTag(idFlight,
          // bagDetails.getBagInfo()
          // .getBagTag());
          if (idFlight != 0) {
            EntDbLoadBag entLoadBag = _loadBagUpdate
                .getValidBagMoveDetailsByBagTag(idFlight,
                    bagDetails.getBagInfo().getBagTag());
            LOG.info(
                "Total Duration on searching LOAD_BAG (idFlight{} and BagTag{}) (in ms): {}",
                idFlight, bagDetails.getBagInfo().getBagTag(),
                new Date().getTime() - startTime);
            if (entLoadBag != null) {
              loadBagMove.setIdLoadBag(entLoadBag.getId());
            }
          }/*
           * else { LOG.error(
           * "No record found in LOAD_BAG table for the Bag Move update details:"
           * + "BagTag = {}, " + "IdFlight = {} ", new Object[] {
           * bagDetails.getBagInfo().getBagTag(), idFlight });
           *
           * if (HpCommonConfig.irmtab .equalsIgnoreCase(
           * HpUfisAppConstants.IrmtabLogLev.LOG_ERR .name())) { if
           * (!msgLogged) { irmtabRef =
           * _irmfacade.storeRawMsg(message, dtflStr); msgLogged =
           * Boolean.TRUE; } } if (irmtabRef > 0) {
           * sendErrInfo(EnumExceptionCodes.ENOBG,
           * "Bag details not found.Bag Tag:" +
           * bagDetails.getBagInfo() .getBagTag() + "  Flight Number:"
           * + bagDetails.getFlightInfo() .getFullFlightNumber() +
           * "  Flight Date:" + bagDetails.getFlightInfo()
           * .getFlightDate(), irmtabRef);
           *
           * }
           *
           * return false; }
           */
          // }
        } catch (NumberFormatException nfe) {
          LOG.error("!!!! Error in Converting the BagTag from String to long");
        }

        if (HpUfisUtils.isNullOrEmptyStr(bagDetails.getBagInfo()
            .getContainerID())) {
          LOG.warn(
              "Container ID is null. Skip the search in LOAD_ULD table:"
                  + "BagTag = {}, " + "flight Number = {}, "
                  + "Flight Date= {}, ", new Object[] {
                  bagDetails.getBagInfo().getBagTag(),
                  flightNumber, fltDate });
        } else {
          EntDbLoadUld containerId = null;
          // if (HpBeltConfig.getGetLinkTables().equalsIgnoreCase(
          // HpEKBeltConfigConstants.CON_YES)) {
          startTime = new Date().getTime();
          if (idFlight != 0) {
            containerId = _loadUldBean.getUldNum(new BigDecimal(
                idFlight), bagDetails.getBagInfo()
                .getContainerID());
            LOG.debug(
                "Total Duration on searching ULD from LOAD_ULD (in ms): {}",
                new Date().getTime() - startTime);
            // !!!!!********** need to UNDO
            if (containerId == null) {
              LOG.warn("No ULD is found in LOAD_ULD "
                  + "idFlight:" + idFlight
                  + "   ContainerID:"
                  + bagDetails.getBagInfo().getContainerID()
                  + " for the Flight details:"
                  + "BagTag = {}, " + "flight Number = {}, "
                  + "Flight Date= {}, ", new Object[] {
                  bagDetails.getBagInfo().getBagTag(),
                  flightNumber, fltDate });
              // return false;

              if (HpCommonConfig.irmtab
                  .equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
                      .name())) {
                if (!msgLogged) {
                  irmtabRef = _irmfacade.storeRawMsg(message,
                      dtflStr);
                  msgLogged = Boolean.TRUE;
                }
              }
              if (irmtabRef > 0) {
                sendErrInfo(EnumExceptionCodes.WNOUD,
                    "Container ID not found. Container ID: "
                        + bagDetails.getBagInfo()
                            .getContainerID()
                        + "  Bag Tag:"
                        + bagDetails.getBagInfo()
                            .getBagTag()
                        + "  Flight Number:"
                        + bagDetails.getFlightInfo()
                            .getFullFlightNumber()
                        + "  Flight Date:"
                        + bagDetails.getFlightInfo()
                            .getFlightDate(),
                    irmtabRef);

              }

            }
            // }
            if (containerId != null) {
              loadBagMove.setIdLoadUld(containerId.getId());
            }
          }
        }
        loadBagMove.setBagType(bagDetails.getBagInfo().getBagType()
            .value());
        if (!HpUfisUtils.isNullOrEmptyStr(bagDetails.getBagInfo()
            .getBagClass())) {
          if (!HpBeltConfig.getBusinessClassBagList().isEmpty()
              && HpBeltConfig.getBusinessClassBagList().contains(
                  bagDetails.getBagInfo().getBagClass())) {
            loadBagMove.setBagClass("J");
          } else if (!HpBeltConfig.getFirstClassBagList().isEmpty()
              && HpBeltConfig.getFirstClassBagList().contains(
                  bagDetails.getBagInfo().getBagClass())) {
            loadBagMove.setBagClass("F");
          } else if (!HpBeltConfig.getEconomyClassBagList().isEmpty()
              && HpBeltConfig.getEconomyClassBagList().contains(
                  bagDetails.getBagInfo().getBagClass())) {
            loadBagMove.setBagClass("Y");
          } else {
            LOG.info(
                "Specified Bag Class is not in configured list for the Flight :"
                    + "BagTag = {}, "
                    + "flight Number = {}, "
                    + "Flight Date= {}, ", new Object[] {
                    bagDetails.getBagInfo().getBagTag(),
                    bagDetails.getFlightInfo()
                        .getFlightNumber(),
                    bagDetails.getFlightInfo()
                        .getFlightDate() });

            if (HpCommonConfig.irmtab
                .equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
                    .name())) {
              if (!msgLogged) {
                irmtabRef = _irmfacade.storeRawMsg(message,
                    dtflStr);
                msgLogged = Boolean.TRUE;
              }
            }
            if (irmtabRef > 0) {
              sendErrInfo(EnumExceptionCodes.WBGCL,
                  "BagClass is not in config list.Bag Class: "
                      + bagDetails.getBagInfo()
                          .getBagClass()
                      + "  Bag Tag:"
                      + bagDetails.getBagInfo()
                          .getBagTag()
                      + "  Flight Number:"
                      + bagDetails.getFlightInfo()
                          .getFullFlightNumber()
                      + "  Flight Date:"
                      + bagDetails.getFlightInfo()
                          .getFlightDate(), irmtabRef);

            }

            loadBagMove.setBagClass(bagDetails.getBagInfo()
                .getBagClass());
          }
        }
        loadBagMove.setContainerId(bagDetails.getBagInfo()
            .getContainerID());
        loadBagMove.setContainerDest3(bagDetails.getBagInfo()
            .getContainerDest());
        loadBagMove.setPaxName(bagDetails.getBagInfo()
            .getPassengerName());
        loadBagMove.setPaxRefNum(bagDetails.getBagInfo()
            .getPassengerSeqNo());
        loadBagMove.setScanAction(bagDetails.getBagInfo()
            .getScanAction().value());
        loadBagMove.setScanLoc(bagDetails.getBagInfo()
            .getScanLocation());
        loadBagMove.setLocDesc(recStatus);
        loadBagMove.setBimLocCode(recStatus);
        loadBagMove.setNodeInfo(recStatus);
        loadBagMove.setRecStatus(recStatus);
        LOG.debug("Scan Location {}", loadBagMove.getScanLoc());
        // loadBagMove.setLocType(bagDetails.getBagInfo().getScanLocation()
        // .substring(0, 2));
        if (loadBagMove.getScanAction().equalsIgnoreCase(
            ScanAct.BHS_SCAN.value())) {
          String locType = bagDetails.getBagInfo().getScanLocation()
              .substring(0, 2);
          String location = bagDetails.getBagInfo().getScanLocation()
              .substring(2);
          if (_startupInitSingleton.isMdBagHandleLocOn()) {
            if (locType.equalsIgnoreCase("EN")
                || locType.equalsIgnoreCase("EX")) {
              if (!allHandleLocCodes.isEmpty()
                  && allHandleLocCodes.contains(location)
                  && !idHandleLocationMap.isEmpty()
                  && (locType.equalsIgnoreCase("EN") || (locType
                      .equalsIgnoreCase("EX")
                      && idHandleLocationNodeInfoMap
                          .containsKey(location)
                      && !HpUfisUtils
                          .isNullOrEmptyStr(idHandleLocationNodeInfoMap
                              .get(location)) && idHandleLocationNodeInfoMap
                      .get(location).substring(0, 2)
                      .equalsIgnoreCase(locType)))) {
                loadBagMove.setScanLoc(location);
                loadBagMove.setLocType(locType);
                loadBagMove
                    .setIdMdBagHandleLoc(idHandleLocationMap
                        .get(location));
                loadBagMove
                    .setLocDesc(locDescMap.get(location));
                loadBagMove.setBimLocCode(locBIMLocCodeMap
                    .get(location));
                loadBagMove
                    .setNodeInfo(idHandleLocationNodeInfoMap
                        .get(location));
              } else {
                LOG.error(
                    "Dropping the message .No Scan location related data found in master table MD_BAG_HANDLE_LOC , for the Flight details:"
                        + "BagTag = {}, "
                        + "flight Number = {}, "
                        + "Flight Date= {}, ",
                    new Object[] {
                        bagDetails.getBagInfo()
                            .getBagTag(),
                        flightNumber, fltDate });

                if (HpCommonConfig.irmtab
                    .equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
                        .name())) {
                  if (!msgLogged) {
                    irmtabRef = _irmfacade.storeRawMsg(
                        message, dtflStr);
                    msgLogged = Boolean.TRUE;
                  }
                }
                if (irmtabRef > 0) {
                  sendErrInfo(
                      EnumExceptionCodes.ENOMD,
                      "Scan Location not in MasterData.Scan Loc: "
                          + bagDetails.getBagInfo()
                              .getScanLocation()
                          + "  Bag Tag:"
                          + bagDetails.getBagInfo()
                              .getBagTag()
                          + "  Flight Number:"
                          + bagDetails
                              .getFlightInfo()
                              .getFullFlightNumber()
                          + "  Flight Date:"
                          + bagDetails
                              .getFlightInfo()
                              .getFlightDate(),
                      irmtabRef);

                }

                return false;
              }
            } else {
              if (!allHandleLocCodes.isEmpty()
                  && allHandleLocCodes.contains(loadBagMove
                      .getScanLoc())
                  && !idHandleLocationMap.isEmpty()) {
                loadBagMove
                    .setIdMdBagHandleLoc(idHandleLocationMap
                        .get(loadBagMove.getScanLoc()));
                loadBagMove.setLocDesc(locDescMap
                    .get(loadBagMove.getScanLoc()));
                loadBagMove.setBimLocCode(locBIMLocCodeMap
                    .get(loadBagMove.getScanLoc()));
                loadBagMove
                    .setNodeInfo(idHandleLocationNodeInfoMap
                        .get(loadBagMove.getScanLoc()));
              } else {
                LOG.error(
                    "Dropping the message(Not EN or EX) .No Scan location related data found in master table MD_BAG_HANDLE_LOC , for the Flight details:"
                        + "BagTag = {}, "
                        + "flight Number = {}, "
                        + "Flight Date= {}, ",
                    new Object[] {
                        bagDetails.getBagInfo()
                            .getBagTag(),
                        flightNumber, fltDate });
                if (HpCommonConfig.irmtab
                    .equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
                        .name())) {
                  if (!msgLogged) {
                    irmtabRef = _irmfacade.storeRawMsg(
                        message, dtflStr);
                    msgLogged = Boolean.TRUE;
                  }
                }
                if (irmtabRef > 0) {
                  sendErrInfo(
                      EnumExceptionCodes.ENOMD,
                      "Scan Loc(neither EN nor EX) not in MasterData.Scan Loc: "
                          + bagDetails.getBagInfo()
                              .getScanLocation()
                          + "  Bag Tag:"
                          + bagDetails.getBagInfo()
                              .getBagTag()
                          + "  Flight Number:"
                          + bagDetails
                              .getFlightInfo()
                              .getFullFlightNumber()
                          + "  Flight Date:"
                          + bagDetails
                              .getFlightInfo()
                              .getFlightDate(),
                      irmtabRef);

                }
                return false;
              }
            }
          } else {
            if (locType.equalsIgnoreCase("EN")
                || locType.equalsIgnoreCase("EX")) {
              loadBagMove.setScanLoc(location);
              loadBagMove.setLocType(locType);
            }
          }
        }

        else {
          if (_startupInitSingleton.isMdBagReconLocOn()) {
            if (!allReconLocCodes.isEmpty()
                && allReconLocCodes.contains(loadBagMove
                    .getScanLoc())
                && !idReconLocationMap.isEmpty()) {
              loadBagMove
                  .setIdMdBagReconcileLoc(idReconLocationMap
                      .get(loadBagMove.getScanLoc()));
            } else {
              LOG.error(
                  "Dropping the message .No Scan location related data found in master table MD_BAG_RECON_LOC , for the Flight details:"
                      + "BagTag = {}, "
                      + "flight Number = {}, "
                      + "Flight Date= {}, ",
                  new Object[] {
                      bagDetails.getBagInfo().getBagTag(),
                      flightNumber, fltDate });

              if (HpCommonConfig.irmtab
                  .equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
                      .name())) {
                if (!msgLogged) {
                  irmtabRef = _irmfacade.storeRawMsg(message,
                      dtflStr);
                  msgLogged = Boolean.TRUE;
                }
              }
              if (irmtabRef > 0) {
                sendErrInfo(EnumExceptionCodes.ENOMD,
                    "Scan Loc not in MasterData.Scan Loc: "
                        + bagDetails.getBagInfo()
                            .getScanLocation()
                        + "  Bag Tag:"
                        + bagDetails.getBagInfo()
                            .getBagTag()
                        + "  Flight Number:"
                        + bagDetails.getFlightInfo()
                            .getFullFlightNumber()
                        + "  Flight Date:"
                        + bagDetails.getFlightInfo()
                            .getFlightDate(),
                    irmtabRef);

              }

              return false;
            }
          }
        }
        loadBagMove.setChangeDate(chgStringToDate(
            chgStringToFltDate(bagDetails.getBagInfo()
                .getChangeDate()), bagDetails.getBagInfo()
                .getChangeTime()));

        if (bagDetails.getMeta().getMessageSubtype().value()
View Full Code Here

Examples of com.ufis_as.ek_if.belt.entities.EntDbLoadBagMove

  @Override 
  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public EntDbLoadBagMove updateLoadedBagMove(
      EntDbLoadBagMove loadBagMove) {   
    EntDbLoadBagMove entLoadBagMoveObj = null;
    try {
      entLoadBagMoveObj = em.merge(loadBagMove);
      // em.flush();
      // LOG.debug("Merge Successfull");
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.