Package com.commander4j.db

Examples of com.commander4j.db.JDBPallet


            sscc = bcode.getStringforAppID("00");

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

              JDBPallet pallet = new JDBPallet(Common.sd.getData(sessionID, "selectedHost"), sessionID);

              if (pallet.getPalletProperties(sscc))
              {
                pallet.setDateOfManufacture(JUtility.getSQLDateTime());

                if (pallet.confirm())
                {

                  int confirmCount = Integer.valueOf(Common.sd.getData(sessionID, "confirmCount"));
                  confirmCount++;
                  session.setAttribute("_ErrorMessage", "SSCC " + sscc + " confirmed.");
                  saveData(session, "confirmCount", String.valueOf(confirmCount), false);
                  logger.debug(sscc + " confirmed. (" + String.valueOf(confirmCount) + ")");
                } else
                {
                  session.setAttribute("_ErrorMessage", pallet.getErrorMessage());
                }
              } else
              {
                session.setAttribute("_ErrorMessage", "SSCC not found.");
              }
View Full Code Here


            sscc = bcode.getStringforAppID("00");

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

              JDBPallet pallet = new JDBPallet(Common.sd.getData(sessionID, "selectedHost"), sessionID);

              if (pallet.delete(sscc))
              {
                int deleteCount = Integer.valueOf(Common.sd.getData(sessionID, "deleteCount"));
                deleteCount++;
                session.setAttribute("_ErrorMessage", "SSCC " + sscc + " deleted.");
                saveData(session, "deleteCount", String.valueOf(deleteCount), false);
                logger.debug(sscc + " deleted. (" + String.valueOf(deleteCount) + ")");
              } else
              {
                session.setAttribute("_ErrorMessage", pallet.getErrorMessage());
              }

            } else
            {
              session.setAttribute("_ErrorMessage", bcode.getErrorMessage());
View Full Code Here

            sscc = bcode.getStringforAppID("00");

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

              JDBPallet pallet = new JDBPallet(Common.sd.getData(sessionID, "selectedHost"), sessionID);
              pallet.setDateOfManufacture(JUtility.getSQLDateTime());

              if (pallet.getPalletProperties(sscc))
              {

                session.setAttribute("_ErrorMessage", "");
                if (pallet.isConfirmed())
                {
                  session.setAttribute("material", pallet.getMaterial());
                  session.setAttribute("location", pallet.getLocationID());
                  session.setAttribute("despatchNo", pallet.getDespatchNo());
                  session.setAttribute("batch", pallet.getBatchNumber());
                  session.setAttribute("processOrder", pallet.getProcessOrder());
                  session.setAttribute("palletStatus", pallet.getStatus());
                  session.setAttribute("batchStatus", pallet.getMaterialBatchStatus());
                  session.setAttribute("quantity", String.valueOf(pallet.getQuantity()));
                  session.setAttribute("uom", pallet.getUom());
                  session.setAttribute("dom", pallet.getDateOfManufacture().toString().substring(0, 16));
                  session.setAttribute("expiry", pallet.getMaterialBatchExpiryDate().toString().substring(0, 16));
                  error = false;
                  saveData(session, "lastSSCCinfo", "", true);
                  response.sendRedirect("palletInfoDisplay.jsp");
                } else
                {
View Full Code Here

  public Boolean processMessage(GenericMessageHeader gmh) {
    Boolean result = true;

    JDBDespatch desp = new JDBDespatch(getHostID(), getSessionID());
    JDBPallet pal = new JDBPallet(getHostID(), getSessionID());
    JDBLocation loc = new JDBLocation(getHostID(), getSessionID());
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
    Integer palletCount = 0;

    inter.getInterfaceProperties("Despatch Confirmation", "Input");

    despatchNo = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/despatchConfirmation/despatchNo").trim());
    trailer = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/despatchConfirmation/trailer").trim());
    haulier = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/despatchConfirmation/haulier").trim());
    loadNo = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/despatchConfirmation/loadNo").trim());
    fromLocation = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/despatchConfirmation/fromLocation").trim());
    toLocation = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/despatchConfirmation/toLocation").trim());
    despatchDate = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/despatchConfirmation/despatchDate").trim());
    numberOfPallets = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/despatchConfirmation/numberOfPallets").trim());

    for (int run = 0; run <= 1; run++)
    {

      if (result == true)
      {

        if (desp.getDespatchProperties(despatchNo) == false)
        {

          if (run == validate)
          {
            // Check if Despatch already Exists and fail if it does.
            if (desp.getDespatchProperties(despatchNo) == true)
            {
              result = false;
              setErrorMessage("Despatch " + despatchNo + " already exists error.");
            }
          }
          else
          {
            // Attempt to create Despatch and fail if unsuccessful
            if (desp.create() == false)
            {
              result = false;
              setErrorMessage("Despatch " + despatchNo + " create error. " + desp.getErrorMessage());
            }
          }

          if (result == true)
          {

            if (run == validate)
            {
              // Check if FROM Location is valid
              if (loc.getLocationProperties(fromLocation) == false)
              {
                result = false;
                setErrorMessage("Invalid FROM Location : " + fromLocation);
              }
              // Check if TO Location is valid
              if (loc.getLocationProperties(toLocation) == false)
              {
                result = false;
                setErrorMessage("Invalid TO Location : " + toLocation);
              }
            }
            else
            {
              desp.setTrailer(trailer);
              desp.setHaulier(haulier);
              desp.setLoadNo(loadNo);
              desp.setDespatchDate(JUtility.getTimeStampFromISOString(despatchDate));
              desp.setTotalPallets(Integer.valueOf(numberOfPallets));
              desp.setLocationIDFrom(fromLocation);
              desp.setLocationIDTo(toLocation);

              if (desp.update() == false)
              {
                result = false;
                setErrorMessage("Despatch " + despatchNo + " update error. " + desp.getErrorMessage());
              }
            }

            if (result == true)
            {

              repeat = true;
              seq = 1;

              do
              {
                key = "//message/messageData/despatchConfirmation/contents/pallet[" + String.valueOf(seq) + "]/SSCC";
                sscc = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath(key).trim());

                if (sscc.length() > 0)
                {
                  if (pal.getPalletProperties(sscc) == true)
                  {
                   
                    boolean sourceLocationOK = true;
                    if (pal.getLocationID().equals(fromLocation) == false)
                    {
                      sourceLocationOK = false;
                    }

                    if (sourceLocationOK)
                    {
                      boolean alreadyAssigned = false;
                      if (pal.getDespatchNo().equals("") == false)
                      {
                        JDBDespatch altDesp = new JDBDespatch(getHostID(), getSessionID());
                        altDesp.getDespatchProperties(pal.getDespatchNo());
                        if (altDesp.getStatus().equals("Unconfirmed"))
                        {
                          alreadyAssigned = true;
                        }
                      }
                     
                      if (!alreadyAssigned)
                      {
                        if (pal.isConfirmed())
                        {
                          if (run == validate)
                          {
                            if (loc.isPalletStatusValidforLocation(pal.getStatus()) == false)
                            {
                              result = false;
                              setErrorMessage("SSCC " + pal.getSSCC() + " Pallet status " + pal.getStatus() + " invalid for location " + loc.getLocationID());
                            }

                            if (loc.isBatchStatusValidforLocation(pal.getMaterialBatchStatus()) == false)
                            {
                              result = false;
                              setErrorMessage("SSCC " + pal.getSSCC() + " Batch status " + pal.getMaterialBatchStatus() + " invalid for location " + loc.getLocationID());
                            }
                          }
                          else
                          {
                            if (desp.assignSSCC(sscc) == false)
                            {
                              result = false;
                              setErrorMessage(desp.getErrorMessage());
                            }
                            else
                            {
                              palletCount++;
                            }
                          }
                        }
                        else
                        {
                          result = false;
                          setErrorMessage("SSCC " + sscc + " has not been confirmed as made.");
                        }
                      }
                      else
                      {
                        result = false;
                        setErrorMessage("SSCC " + sscc + " already assigned to despatch " + pal.getDespatchNo());
                      }
                    }
                    else
                    {
                      result = false;
View Full Code Here

    try
    {
      if (cache.containsKey(row)==false)
      {
        mResultSet.absolute(row + 1);
        final JDBPallet prow = new JDBPallet(Common.selectedHostID, Common.sessionID);
        prow.getPropertiesfromResultSet(mResultSet);
        cache.put(row, prow);
      }
     
      switch (col)
      {
View Full Code Here

    if (rowCount >= 0)
    {
      int[] rows = jTable1.getSelectedRows();

      JDBPallet temp = new JDBPallet(Common.selectedHostID, Common.sessionID);

      int n = JOptionPane.showConfirmDialog(Common.mainForm, "Delete " + String.valueOf(rowCount) + " SSCC(s) from Master Hold Notice " + jTextFieldMHN.getText() + " ?", "Confirm",
          JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
      if (n == 0)
      {

        for (int l = 0; l < rows.length; l++)
        {
          String sscc = jTable1.getValueAt(rows[l], JDBMHNPalletTableModelProperties.SSCC_Col).toString();
          temp.getPalletProperties(sscc);
          if (temp.getStatus().equals("Unrestricted"))
          {
            temp.updateMHNDecision("");
            temp.updateMHNNumber("");
            jStatusText.setText("SSCC "+sscc+" removed from MHN "+masterHoldNoticeNumber);
            Rectangle progressRect = jStatusText.getBounds()
            progressRect.x = 0
            progressRect.y = 0
            jStatusText.paintImmediately( progressRect );
View Full Code Here

                        if (rowCount >= 0)
                        {
                          int[] rows = jTable1.getSelectedRows();

                          JDBPallet temp = new JDBPallet(Common.selectedHostID, Common.sessionID);

                          int n = JOptionPane.showConfirmDialog(Common.mainForm, "Update Decision  of " + String.valueOf(rowCount) + " SSCC(s) from Master Hold Notice "
                              + jTextFieldMHN.getText() + " to " + decisionList.get(xx).getDescription() + " ?", "Confirm", JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
                          if (n == 0)
                          {
                            save();
                            for (int l = 0; l < rows.length; l++)
                            {
                              String sscc = jTable1.getValueAt(rows[l], JDBMHNPalletTableModelProperties.SSCC_Col).toString();
                              temp.getPalletProperties(sscc);
                              temp.updateMHNDecision(decisionList.get(xx).getDecision());
                              if (decisionList.get(xx).getStatus().equals("")==false)
                              {
                                temp.updateStatus(decisionList.get(xx).getStatus());

                                jStatusText.setText("SSCC "+sscc+" updated to  "+decisionList.get(xx).getStatus());
                                Rectangle progressRect = jStatusText.getBounds()
                                progressRect.x = 0
                                progressRect.y = 0
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBPallet

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.