Package com.commander4j.db

Examples of com.commander4j.db.JDBPallet


    }
  }

  private void populateList()
  {
    JDBPallet pallet = new JDBPallet(Common.selectedHostID, Common.sessionID);

    JDBPalletTableModel palletTable = new JDBPalletTableModel(pallet.getPalletDataResultSet(listStatement));

    TableRowSorter<JDBPalletTableModel> sorter = new TableRowSorter<JDBPalletTableModel>(palletTable);

    jTable1.setRowSorter(sorter);
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);
      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);
                          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

            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

    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)
      {
      case SSCC_Col:
View Full Code Here

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

      JDBPallet temp = new JDBPallet(Common.selectedHostID, Common.sessionID);
      JDBControl ctrl = new JDBControl(Common.selectedHostID, Common.sessionID);
      JDBMHNDecisions decis = new JDBMHNDecisions(Common.selectedHostID, Common.sessionID);

      int n = JOptionPane.showConfirmDialog(Common.mainForm, "Assign selected SSCC's to Master Hold Notice [" + mhnnumber + "  ?", "Confirm", JOptionPane.YES_NO_OPTION);
      if (n == 0)
      {

        String initalDecision = ctrl.getKeyValueWithDefault("MHN INITIAL DECISION", "Pending", "Decision for pallets added to MHN");
        String initialStatus = "";
        if (decis.getDecisionProperties(initalDecision) == true)
        {
          initialStatus = decis.getStatus();
        }
        else
        {
          initialStatus = "";
        }

        for (int l = 0; l < rows.length; l++)
        {
          String sscc = jTable1.getValueAt(rows[l], JDBMHNPalletTableModelAssign.SSCC_Col).toString();
          temp.getPalletProperties(sscc);
          temp.updateMHNNumber(mhnnumber);
          temp.updateMHNDecision(initalDecision);
          if (initialStatus.equals("") == false)
          {
            temp.updateStatus(initialStatus);
          }
          jStatusText.setText("SSCC "+sscc+" added to MHN "+mhnnumber);
          Rectangle progressRect = jStatusText.getBounds()
          progressRect.x = 0
          progressRect.y = 0
View Full Code Here

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

    JDBPallet pal = new JDBPallet(getHostID(), getSessionID());
    JDBMaterial mat = new JDBMaterial(getHostID(), getSessionID());

    String sscc = gmh.getXMLDocument().findXPath("//message/messageData/productionDeclaration/SSCC").trim();
    confirmed = gmh.getXMLDocument().findXPath("//message/messageData/productionDeclaration/confirmed").trim().toUpperCase();

    if (pal.getPalletProperties(sscc) == false)
    {
      pal.setSSCC(sscc);
      pal.setProcessOrder(gmh.getXMLDocument().findXPath("//message/messageData/productionDeclaration/processOrder").trim());
      pal.setUom(gmh.getXMLDocument().findXPath("//message/messageData/productionDeclaration/productionUOM").trim());
      if (pal.populateFromProcessOrder() == true)
      {

        pal.setBatchNumber(gmh.getXMLDocument().findXPath("//message/messageData/productionDeclaration/batch").trim());
        pal.setQuantity(new BigDecimal(gmh.getXMLDocument().findXPath("//message/messageData/productionDeclaration/productionQuantity").trim()));

        String prodDateString = gmh.getXMLDocument().findXPath("//message/messageData/productionDeclaration/productionDate").trim();
        Timestamp prodDateTime = JUtility.getTimeStampFromISOString(prodDateString);

        String expireString = gmh.getXMLDocument().findXPath("//message/messageData/productionDeclaration/expiryDate").trim();
        Timestamp expireTime = JUtility.getTimeStampFromISOString(expireString);

        if (expireTime == null)
        {
          result = false;
          setErrorMessage("SSCC " + pal.getSSCC() + " Expiry Date in wrong format (" + expireString + ") yyyy-mm-ddThh:mm:ss");
        }
        else
        {

          pal.setBatchExpiry(JUtility.getTimestampFromDate(mat.getRoundedExpiryTime(expireTime)));

          if (pal.getBatchExpiry().before(prodDateTime))
          {
            result = false;
            setErrorMessage("SSCC " + pal.getSSCC() + " has Expiry Date before Production Date.");
          }
          else
          {

            if (pal.create("PROD DEC", "CREATE") == false)
            {
              result = false;
              setErrorMessage("SSCC " + pal.getSSCC() + " "+pal.getErrorMessage());
            }
            else
            {
              result = true;
              setErrorMessage("SSCC " + pal.getSSCC() + " created.");
            }
          }
        }

      }
      else
      {
        result = false;
        setErrorMessage("SSCC " + pal.getSSCC() + " " +pal.getErrorMessage());
      }

    }
    else
    {
      result = true;
      // setErrorMessage("SSCC " + pal.getSSCC() + " already exists.");
    }

    if (result == true)
    {
      if (confirmed.equals("Y"))
      {
        if (pal.isConfirmed() == false)
        {

          String prodDateString = gmh.getXMLDocument().findXPath("//message/messageData/productionDeclaration/productionDate").trim();
          Timestamp prodDateTime = JUtility.getTimeStampFromISOString(prodDateString);

          pal.setDateOfManufacture(prodDateTime);

          if (pal.confirm() == false)
          {
            result = false;
            setErrorMessage(pal.getErrorMessage());
          }
          else
          {
            setErrorMessage("SSCC " + pal.getSSCC() + " confirmed.");
          }
        }
        else
        {
          setErrorMessage("SSCC " + pal.getSSCC() + " already confirmed.");
          result = false;
        }
      }
    }
    pal = null;
View Full Code Here

   
    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;
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.