Package com.commander4j.db

Examples of com.commander4j.db.JDBDespatch


    boolean result = true;

    String sessionID = session.getId();

    JDBDespatch desp = new JDBDespatch(Common.sd.getData(sessionID, "selectedHost"), sessionID);

    desp.getDespatchProperties(despNo);

    if (desp.confirm() == false)
    {
      result = false;
      session.setAttribute("_ErrorMessage", desp.getErrorMessage());
      logger.debug("Cannot confirm Despatch " + despNo + " - " + desp.getErrorMessage());
    } else
    {
      logger.debug("Despatch " + despNo + " Confirmed");
      // saveData(session, "despatchNo","", true);
    }
View Full Code Here


    String result = "";
    String sessionID = session.getId();
    saveData(session, "despatchNo", "", true);

    JDBDespatch desp = new JDBDespatch(Common.sd.getData(sessionID, "selectedHost"), sessionID);
    String number = desp.generateNewDespatchNo();

    if (number.equals("") == false)
    {

      desp.setDespatchNo(number);

      if (desp.create())
      {
        desp.updateUserID(number, Common.sd.getData(sessionID, "username").toUpperCase());

        result = desp.getDespatchNo();
        logger.debug("Despatch " + number + " created.");
        session.setAttribute("_ErrorMessage", "");
        saveData(session, "despatchNo", number, true);
        saveData(session, "despatchFromLocation", "", true);
        saveData(session, "despatchToLocation", "", true);
        saveData(session, "despatchTrailer", "", true);
        saveData(session, "despatchHaulier", "", true);
        saveData(session, "despatchLoadNo", "", true);
      } else
      {
        result = "";
        session.setAttribute("_ErrorMessage", desp.getErrorMessage());
      }

      saveData(session, "despatchFromLocationCombo", locationDBComboBox("despatchFromLocation", "", session), true);
      saveData(session, "despatchToLocationCombo", locationDBComboBox("despatchToLocation", "", session), true);
    } else
    {
      session.setAttribute("_ErrorMessage", desp.getErrorMessage());
      result = "";
    }

    return result;
  }
View Full Code Here

    String sessionID = session.getId();
    saveData(session, "despatchNo", despNo, true);

    if (despNo.length() > 0)
    {
      JDBDespatch desp = new JDBDespatch(Common.sd.getData(sessionID, "selectedHost"), sessionID);

      if (desp.getDespatchProperties(Common.sd.getData(sessionID, "despatchNo")))
      {
        logger.debug("Despatch data for " + Common.sd.getData(sessionID, "despatchNo") + " retrieved.");
        saveData(session, "despatchFromLocation", desp.getLocationIDFrom(), true);
        saveData(session, "despatchToLocation", desp.getLocationIDTo(), true);
        saveData(session, "despatchTrailer", desp.getTrailer(), true);
        saveData(session, "despatchHaulier", desp.getHaulier(), true);
        saveData(session, "despatchLoadNo", desp.getLoadNo(), true);
        saveData(session, "despatchPalletCount", String.valueOf(desp.getDespatchPalletCount()), true);
        saveData(session, "despatchFromLocationCombo", locationDBComboBox("despatchFromLocation", desp.getLocationIDFrom(), session), true);
        saveData(session, "despatchToLocationCombo", locationDBComboBox("despatchToLocation", desp.getLocationIDTo(), session), true);
        result = true;
      } else
      {
        saveData(session, "despatchFromLocation", "", true);
        saveData(session, "despatchToLocation", "", true);
        saveData(session, "despatchTrailer", "", true);
        saveData(session, "despatchHaulier", "", true);
        saveData(session, "despatchLoadNo", "", true);
        saveData(session, "despatchPalletCount", "0", true);
        saveData(session, "despatchFromLocationCombo", locationDBComboBox("despatchFromLocation", "", session), true);
        saveData(session, "despatchToLocationCombo", locationDBComboBox("despatchToLocation", "", session), true);
        session.setAttribute("_ErrorMessage", desp.getErrorMessage());
        result = false;
      }
    }

    return result;
View Full Code Here

  public void run()
  {
    logger.debug("Background confirmation started.");
   
    JDBDespatch desp = new JDBDespatch(getHost(),getSession());
   
    if (desp.getDespatchProperties(getDespatchNo()))
    {
      Long txn = desp.getTransactionRef();
      LinkedList<String> assignedList = new LinkedList<String>();
      JDBPallet pal = new JDBPallet(getHost(),getSession());
      OutgoingDespatchConfirmation odc;
      OutgoingDespatchPreAdvice opa;
      OutgoingEquipmentTracking oet;
     
      assignedList.clear();
      assignedList.addAll(desp.getAssignedSSCCs());
     
      for (int j = 0; j < assignedList.size(); j++)
      {
        if (pal.getPalletProperties(assignedList.get(j)))
        {
          logger.debug("Background confirmation processing SSCC="+assignedList.get(j));
          pal.writePalletHistory(txn, "DESPATCH", "FROM");
          pal.setLocationID(desp.getLocationIDTo());
          pal.updateLocationID();
          pal.writePalletHistory(txn, "DESPATCH", "TO");
        }
      }
     
      pal = null;

      if (desp.getLocationDBTo().isDespatchConfirmationMessageRequired())
      {
        logger.debug("Background confirmation requesting Despatch Confirmation.");
        odc = new OutgoingDespatchConfirmation(getHost(),getSession());
        odc.submit(txn);
        odc = null;
      }

      if (desp.getLocationDBTo().isDespatchEquipmentTrackingMessageRequired())
      {
        logger.debug("Background confirmation requesting Equipment Tracking.");
        oet = new OutgoingEquipmentTracking(getHost(),getSession());
        oet.submit(txn);
        oet = null;
      }

      if (desp.getLocationDBTo().isDespatchPreAdviceMessageRequired())
      {
        logger.debug("Background confirmation requesting Pre Advice.");
        opa = new OutgoingDespatchPreAdvice(getHost(),getSession());
        opa.submit(txn);
        opa = null;
View Full Code Here

    boolean result = true;

    String sessionID = session.getId();

    JDBDespatch desp = new JDBDespatch(Common.sd.getData(sessionID, "selectedHost"), sessionID);

    saveData(session, "despatchFromLocation", request.getParameter("despatchFromLocation").toUpperCase(), true);
    saveData(session, "despatchToLocation", request.getParameter("despatchToLocation").toUpperCase(), true);
    saveData(session, "despatchTrailer", request.getParameter("despatchTrailer").toUpperCase(), true);
    saveData(session, "despatchHaulier", request.getParameter("despatchHaulier").toUpperCase(), true);
    saveData(session, "despatchLoadNo", request.getParameter("despatchLoadNo").toUpperCase(), true);
    logger.debug("Updating Despatch No " + despNo);

    if (desp.getDespatchProperties(despNo))
    {
      saveData(session, "despatchPalletCount", String.valueOf(desp.getDespatchPalletCount()), true);
      desp.setLocationIDTo(Common.sd.getData(sessionID, "despatchToLocation"));
      desp.setLocationIDFrom(Common.sd.getData(sessionID, "despatchFromLocation"));
      desp.setTrailer(Common.sd.getData(sessionID, "despatchTrailer"));
      desp.setHaulier(Common.sd.getData(sessionID, "despatchHaulier"));
      desp.setLoadNo(Common.sd.getData(sessionID, "despatchLoadNo"));
      desp.setDespatchDate(JUtility.getSQLDateTime());

      if (desp.update() == false)
      {
        result = false;
        session.setAttribute("_ErrorMessage", desp.getErrorMessage());
      } else
      {
        logger.debug("Despatch " + despNo + " updated.");
      }
    } else
    {
      result = false;
      session.setAttribute("_ErrorMessage", desp.getErrorMessage());
    }

    return result;
  }
View Full Code Here

            sscc = bcode.getStringforAppID("00");

            if (bcode.isValidSSCCformat(sscc) == true)
            {

              JDBDespatch desp = new JDBDespatch(Common.sd.getData(sessionID, "selectedHost"), sessionID);

              String despNo = Common.sd.getData(sessionID, "despatchNo");

              if (desp.getDespatchProperties(Common.sd.getData(sessionID, "despatchNo")) == true)
              {
                lastAddRemoveMode = addRemoveMode;
                if (addRemoveMode.equals("add") == true)
                {
                  if (desp.assignSSCC(sscc) == true)
                  {
                    logger.debug(sscc + " added to despatch " + despNo);
                    session.setAttribute("sscc", "");
                    session.setAttribute("_ErrorMessage", "");
                    saveData(session, "despatchPalletCount", String.valueOf(desp.getDespatchPalletCount()), true);
                  } else
                  {
                    session.setAttribute("_ErrorMessage", desp.getErrorMessage());
                  }
                }
                if (addRemoveMode.equals("remove") == true)
                {
                  if (desp.unassignSSCC(sscc) == true)
                  {
                    logger.debug(sscc + " sscc removed from despatch " + despNo);
                    session.setAttribute("sscc", "");
                    session.setAttribute("_ErrorMessage", "");
                    saveData(session, "despatchPalletCount", String.valueOf(desp.getDespatchPalletCount()), true);
                  } else
                  {
                    session.setAttribute("_ErrorMessage", desp.getErrorMessage());
                  }
                }
              } else
              {
                session.setAttribute("_ErrorMessage", "Despatch not found.");
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBDespatch

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.