Package com.commander4j.db

Examples of com.commander4j.db.JDBInterfaceLog


    listStatement = query.getPreparedStatement()

  }

  private void populateList() {
    JDBInterfaceLog interfaceLog = new JDBInterfaceLog(Common.selectedHostID, Common.sessionID);
    JDBInterfaceLogTableModel interfaceLogTable = new JDBInterfaceLogTableModel(interfaceLog.getInterfaceDataResultSet(listStatement));
    TableRowSorter<JDBInterfaceLogTableModel> sorter = new TableRowSorter<JDBInterfaceLogTableModel>(interfaceLogTable);

    jTable1.setRowSorter(sorter);
    jTable1.setModel(interfaceLogTable);
View Full Code Here


  public Boolean processMessage(String unique)

  {
    Boolean result = false;
    String path = "";
    JDBInterfaceLog il = new JDBInterfaceLog(getHostID(), getSessionID());
    GenericMessageHeader gmh = new GenericMessageHeader();
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
    JDBMaterial mat = new JDBMaterial(getHostID(), getSessionID());
    JDBCustomer cust = new JDBCustomer(getHostID(), getSessionID());
    inter.getInterfaceProperties("Label Data", "Output");
    String device = inter.getDevice();
    String format = inter.getFormat();
    JDBLabelData labdata = new JDBLabelData(getHostID(), getSessionID());

    if (labdata.getProperties(unique))
    {

      try
      {
        if (format.equals("CSV"))
        {

          if (device.equals("Disk"))
          {
            String heading[] = labdata.getDataArray(unique, "heading");
            String data[] = labdata.getDataArray(unique, "data");

            path = inter.getRealPath();

            path = path.replace("\\", java.io.File.separator);
            path = path.replace("/", java.io.File.separator);

            if (path.length() > 0)
            {
              if (path.substring(path.length() - 1).equals(java.io.File.separator) == false)
              {
                path = path + java.io.File.separator;
              }
            }
            String filename = path + "LabelData_"+labdata.getLine() + "_" + unique + ".csv";

            CSVWriter writer = new CSVWriter(new FileWriter(filename), ',');
            writer.writeNext(heading);
            writer.writeNext(data);
            writer.close();
            result = true;
            il.write(gmh, GenericMessageHeader.msgStatusSuccess, "Processed OK", "File Write", filename);
            setErrorMessage("");
          }
        }

        if (format.equals("XML"))
        {

          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          DocumentBuilder builder = factory.newDocumentBuilder();

          Document document = builder.newDocument();

          Element message = (Element) document.createElement("message");

          Element hostUniqueID = addElement(document, "hostRef", Common.hostList.getHost(getHostID()).getUniqueID());
          message.appendChild(hostUniqueID);

          Element messageRef = addElement(document, "messageRef", unique);
          message.appendChild(messageRef);

          Element messageType = addElement(document, "interfaceType", "Label Data");
          message.appendChild(messageType);

          Element messageInformation = addElement(document, "messageInformation", "UniqueID=" + unique);
          message.appendChild(messageInformation);

          Element messageDirection = addElement(document, "interfaceDirection", "Output");
          message.appendChild(messageDirection);

          Element messageDate = addElement(document, "messageDate", JUtility.getISOTimeStampStringFormat(JUtility.getSQLDateTime()));
          message.appendChild(messageDate);

          Element labelData = (Element) document.createElement("labelData");

          Element unq = addElement(document, "uniqueID", unique);
          labelData.appendChild(unq);

          Element lt = addElement(document, "labelType", labdata.getLabelType());
          labelData.appendChild(lt);

          Element line = addElement(document, "line", labdata.getLine());
          labelData.appendChild(line);

          Element printDate = addElement(document, "printDate", JUtility.getISOTimeStampStringFormat(labdata.getPrintDate()));
          labelData.appendChild(printDate);

          Element user = addElement(document, "userID", labdata.getUserID());
          labelData.appendChild(user);

          Element workstation = addElement(document, "workstation", labdata.getWorkstationID());
          labelData.appendChild(workstation);

          Element material = addElement(document, "material", labdata.getMaterial());
          labelData.appendChild(material);

          if (mat.getMaterialProperties(labdata.getMaterial()))
          {
            Element materialDesc = addElement(document, "materialDescription", mat.getDescription());
            labelData.appendChild(materialDesc);
          }

          Element materialType = addElement(document, "materialType", labdata.getMaterialType());
          labelData.appendChild(materialType);

          Element po = addElement(document, "processOrder", labdata.getProcessOrder());
          labelData.appendChild(po);

          Element rr = addElement(document, "requiredResource", labdata.getRequiredResource());
          labelData.appendChild(rr);

          Element location = addElement(document, "location", labdata.getLocationID());
          labelData.appendChild(location);

          Element batch = addElement(document, "batch", labdata.getBatchNumber());
          labelData.appendChild(batch);

          Element batchPrefix = addElement(document, "batchPrefix", labdata.getBatchPrefix());
          labelData.appendChild(batchPrefix);

          Element ovbatchPrefix = addElement(document, "overrideBatchPrefix", labdata.getOverrideBatchPrefix());
          labelData.appendChild(ovbatchPrefix);

          Element batchSuffix = addElement(document, "batchSuffix", labdata.getBatchSuffix());
          labelData.appendChild(batchSuffix);

          Element prodquantity = addElement(document, "prodQuantity", labdata.getProdQuantity().toString());
          labelData.appendChild(prodquantity);

          Element produom = addElement(document, "prodUom", labdata.getProdUom());
          labelData.appendChild(produom);

          Element prodEAN = addElement(document, "prodEAN", labdata.getProdEAN());
          labelData.appendChild(prodEAN);

          Element prodVar = addElement(document, "prodVariant", labdata.getProdVariant());
          labelData.appendChild(prodVar);

          Element basequantity = addElement(document, "baseQuantity", labdata.getBaseQuantity().toString());
          labelData.appendChild(basequantity);

          Element baseuom = addElement(document, "baseUom", labdata.getBaseUom());
          labelData.appendChild(baseuom);

          Element baseEAN = addElement(document, "baseEAN", labdata.getBaseEAN());
          labelData.appendChild(baseEAN);

          Element baseVar = addElement(document, "baseVariant", labdata.getBaseVariant());
          labelData.appendChild(baseVar);

          Element dom = addElement(document, "dateOfManufacture", JUtility.getISOTimeStampStringFormat(labdata.getDateofManufacture()));
          labelData.appendChild(dom);

          Element ovdom = addElement(document, "overrideDateofManufacture", labdata.getOverrideDateofManufacture());
          labelData.appendChild(ovdom);

          Element expiry = addElement(document, "expiryDate", JUtility.getISOTimeStampStringFormat(labdata.getExpirtDate()));
          labelData.appendChild(expiry);

          Element ovexpiry = addElement(document, "overrideExpiryDate", labdata.getOverrideExpiryDate());
          labelData.appendChild(ovexpiry);

          Element expiryMode = addElement(document, "expiryMode", labdata.getExpiryMode());
          labelData.appendChild(expiryMode);

          Element custid = addElement(document, "customer", labdata.getCustomer());
          labelData.appendChild(custid);

          if (cust.getCustomerProperties(labdata.getCustomer()))
          {
            Element custName = addElement(document, "customerName", cust.getName());
            labelData.appendChild(custName);
          }

          Element copies = addElement(document, "copies", labdata.getPrintCopies().toString());
          labelData.appendChild(copies);

          Element queueName = addElement(document, "queueName", labdata.getPrintQueue());
          labelData.appendChild(queueName);

          Element module = addElement(document, "moduleID", labdata.getModuleID());
          labelData.appendChild(module);

          Element messageData = (Element) document.createElement("messageData");
          messageData.appendChild(labelData);

          message.appendChild(messageData);

          document.appendChild(message);

          JXMLDocument xmld = new JXMLDocument();
          xmld.setDocument(document);
          gmh.decodeHeader(xmld);

          if (device.equals("Disk") | device.equals("Email"))
          {

            path = inter.getRealPath();
            if (fio.writeToDisk(path, document, -1, labdata.getLine() + "_" + unique + "_LabelData.xml") == true)
            {
              result = true;
              il.write(gmh, GenericMessageHeader.msgStatusSuccess, "Processed OK", "File Write", fio.getFilename());
              setErrorMessage("");

              if (device.equals("Email"))
              {
                ogm = new JeMailOutGoingMessage(inter, (long) 0, fio);
                ogm.sendEmail();
              }
            } else
            {
              result = false;
              il.write(gmh, GenericMessageHeader.msgStatusError, fio.getErrorMessage(), "File Write", fio.getFilename());
              setErrorMessage(fio.getErrorMessage());
            }
          }
        }
      }
View Full Code Here

  public Boolean processMessage(Long transactionRef)

  {
    Boolean result = false;
    String path = "";
    JDBInterfaceLog il = new JDBInterfaceLog(getHostID(), getSessionID());
    GenericMessageHeader gmh = new GenericMessageHeader();
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());

    inter.getInterfaceProperties("Pallet Split", "Output");
    String device = inter.getDevice();

    JDBPalletHistory palhistbefore = new JDBPalletHistory(getHostID(), getSessionID());
    JDBPalletHistory palhistafter = new JDBPalletHistory(getHostID(), getSessionID());
    JDBPalletHistory palhistcreate = new JDBPalletHistory(getHostID(), getSessionID());
    
    ResultSet rsBefore = palhistbefore.getInterfacingData(transactionRef, "SPLIT", "BEFORE", Long.valueOf(1), "SSCC", "asc");

    ResultSet rsAfter = palhistafter.getInterfacingData(transactionRef, "SPLIT", "AFTER", Long.valueOf(1), "SSCC", "asc");

    ResultSet rsCreate = palhistcreate.getInterfacingData(transactionRef, "SPLIT", "CREATE", Long.valueOf(1), "SSCC", "asc");

    try
    {
      if (rsBefore.next())
      {
        if (rsAfter.next())
        {
          if (rsCreate.next())
          {
            palhistbefore.getPropertiesfromResultSet(rsBefore);
            palhistafter.getPropertiesfromResultSet(rsAfter);
            palhistcreate.getPropertiesfromResultSet(rsCreate);
           
            String locn =palhistbefore.getPallet().getLocationID();

            try
            {
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = factory.newDocumentBuilder();

              Document document = builder.newDocument();

              Element message = (Element) document.createElement("message");

              Element hostUniqueID = addElement(document, "hostRef", Common.hostList.getHost(getHostID()).getUniqueID());
              message.appendChild(hostUniqueID);

              Element messageRef = addElement(document, "messageRef", String.valueOf(transactionRef));
              message.appendChild(messageRef);

              Element messageType = addElement(document, "interfaceType", "Pallet Split");
              message.appendChild(messageType);

              Element messageInformation = addElement(document, "messageInformation", "SSCC=" + palhistbefore.getPallet().getSSCC());
              message.appendChild(messageInformation);

              Element messageDirection = addElement(document, "interfaceDirection", "Output");
              message.appendChild(messageDirection);

              Element messageDate = addElement(document, "messageDate", JUtility.getISOTimeStampStringFormat(JUtility.getSQLDateTime()));
              message.appendChild(messageDate);

              Element messageData = (Element) document.createElement("messageData");
             
              //-----------------------INPUT PALLET - BEFORE ------------------------//
             
              Element palletSplitBefore = (Element) document.createElement("palletSplitBefore");

              Element ssccBefore = addElement(document, "SSCC", palhistbefore.getPallet().getSSCC());
              palletSplitBefore.appendChild(ssccBefore);

              Element materialBefore = addElement(document, "material", palhistbefore.getPallet().getMaterial());
              palletSplitBefore.appendChild(materialBefore);

              Element batchBefore = addElement(document, "batch", palhistbefore.getPallet().getBatchNumber());
              palletSplitBefore.appendChild(batchBefore);

              Element locationBefore = addElement(document, "location", palhistbefore.getPallet().getLocationID());
              palletSplitBefore.appendChild(locationBefore);

              //---
           
              Element processOrderBefore = addElement(document, "processOrder", palhistbefore.getPallet().getProcessOrder());
              palletSplitBefore.appendChild(processOrderBefore);           

              Element statusBefore = addElement(document, "status", palhistbefore.getPallet().getStatus());
              palletSplitBefore.appendChild(statusBefore)
             
              Element plantBefore = addElement(document, "plant", palhistbefore.getPallet().getLocationObj().getPlant());
              palletSplitBefore.appendChild(plantBefore);

              Element warehouseBefore= addElement(document, "warehouse", palhistbefore.getPallet().getLocationObj().getWarehouse());
              palletSplitBefore.appendChild(warehouseBefore);

              Element binBefore = addElement(document, "bin", palhistbefore.getPallet().getLocationObj().getStorageBin());
              palletSplitBefore.appendChild(binBefore);
             
              Element storageLocationBefore = addElement(document, "storageLocation", palhistbefore.getPallet().getLocationObj().getStorageLocation());
              palletSplitBefore.appendChild(storageLocationBefore);

              Element storageTypeBefore = addElement(document, "storageType", palhistbefore.getPallet().getLocationObj().getStorageType());
              palletSplitBefore.appendChild(storageTypeBefore);
              //----
             
              Element quantityBefore = addElement(document, "quantity", palhistbefore.getPallet().getQuantity().toString());
              palletSplitBefore.appendChild(quantityBefore);

              Element uomBefore = addElement(document, "uom", palhistbefore.getPallet().getUom().toString());
              palletSplitBefore.appendChild(uomBefore);

              messageData.appendChild(palletSplitBefore);

              //-----------------------INPUT PALLET - AFTER ------------------------//
             
              Element palletSplitAfter = (Element) document.createElement("palletSplitAfter");

              Element ssccAfter = addElement(document, "SSCC", palhistafter.getPallet().getSSCC());
              palletSplitAfter.appendChild(ssccAfter);

              Element materialAfter = addElement(document, "material", palhistafter.getPallet().getMaterial());
              palletSplitAfter.appendChild(materialAfter);

              Element batchAfter = addElement(document, "batch", palhistafter.getPallet().getBatchNumber());
              palletSplitAfter.appendChild(batchAfter);

              Element locationAfter = addElement(document, "location", palhistafter.getPallet().getLocationID());
              palletSplitAfter.appendChild(locationAfter);
             
              //---
             
              Element processOrderAfter = addElement(document, "processOrder", palhistafter.getPallet().getProcessOrder());
              palletSplitAfter.appendChild(processOrderAfter);           

              Element statusAfter = addElement(document, "status", palhistafter.getPallet().getStatus());
              palletSplitAfter.appendChild(statusAfter)
             
              Element plantAfter = addElement(document, "plant", palhistafter.getPallet().getLocationObj().getPlant());
              palletSplitAfter.appendChild(plantAfter);

              Element warehouseAfter = addElement(document, "warehouse", palhistafter.getPallet().getLocationObj().getWarehouse());
              palletSplitAfter.appendChild(warehouseAfter);

              Element binAfter = addElement(document, "bin", palhistafter.getPallet().getLocationObj().getStorageBin());
              palletSplitAfter.appendChild(binAfter);
             
              Element storageLocationAfter = addElement(document, "storageLocation", palhistafter.getPallet().getLocationObj().getStorageLocation());
              palletSplitAfter.appendChild(storageLocationAfter);

              Element storageTypeAfter = addElement(document, "storageType", palhistafter.getPallet().getLocationObj().getStorageType());
              palletSplitAfter.appendChild(storageTypeAfter);
              //----
             
              Element quantityAfter = addElement(document, "quantity", palhistafter.getPallet().getQuantity().toString());
              palletSplitAfter.appendChild(quantityAfter);

              Element uomAfter = addElement(document, "uom", palhistafter.getPallet().getUom().toString());
              palletSplitAfter.appendChild(uomAfter);

              messageData.appendChild(palletSplitAfter);
             
              //-----------------------OUTPUT PALLET - NEW ------------------------//           
             
              Element palletSplitCreated = (Element) document.createElement("palletSplitCreated");

              Element ssccCreated = addElement(document, "SSCC", palhistcreate.getPallet().getSSCC());
              palletSplitCreated.appendChild(ssccCreated);

              Element materialCreated = addElement(document, "material", palhistcreate.getPallet().getMaterial());
              palletSplitCreated.appendChild(materialCreated);

              Element batchCreated = addElement(document, "batch", palhistcreate.getPallet().getBatchNumber());
              palletSplitCreated.appendChild(batchCreated);

              Element locationCreated = addElement(document, "location", palhistcreate.getPallet().getLocationID());
              palletSplitCreated.appendChild(locationCreated);
             
              //---
             
              Element processOrderCreated = addElement(document, "processOrder", palhistcreate.getPallet().getProcessOrder());
              palletSplitCreated.appendChild(processOrderCreated);           

              Element statusCreated = addElement(document, "status", palhistcreate.getPallet().getStatus());
              palletSplitCreated.appendChild(statusCreated)
             
              Element plantCreated = addElement(document, "plant", palhistcreate.getPallet().getLocationObj().getPlant());
              palletSplitCreated.appendChild(plantCreated);

              Element warehouseCreated = addElement(document, "warehouse", palhistcreate.getPallet().getLocationObj().getWarehouse());
              palletSplitCreated.appendChild(warehouseCreated);

              Element binCreated = addElement(document, "bin", palhistcreate.getPallet().getLocationObj().getStorageBin());
              palletSplitCreated.appendChild(binCreated);
             
              Element storageLocationCreated = addElement(document, "storageLocation", palhistcreate.getPallet().getLocationObj().getStorageLocation());
              palletSplitCreated.appendChild(storageLocationCreated);

              Element storageTypeCreated = addElement(document, "storageType", palhistcreate.getPallet().getLocationObj().getStorageType());
              palletSplitCreated.appendChild(storageTypeCreated);
              //----             

              Element quantityCreated = addElement(document, "quantity", palhistcreate.getPallet().getQuantity().toString());
              palletSplitCreated.appendChild(quantityCreated);

              Element uomCreated = addElement(document, "uom", palhistcreate.getPallet().getUom().toString());
              palletSplitCreated.appendChild(uomCreated);

              messageData.appendChild(palletSplitCreated);
             
              //--------------------------------------------------------------//   
             
              message.appendChild(messageData);

              document.appendChild(message);

              JXMLDocument xmld = new JXMLDocument();
              xmld.setDocument(document);
              gmh.decodeHeader(xmld);

              if (device.equals("Disk") | device.equals("Email"))
              {

                path = inter.getRealPath();
                if (fio.writeToDisk(path, document, transactionRef, "_" + locn.replace(" ", "_") + "_PalletSplit.xml") == true)
                {
                  result = true;
                  il.write(gmh, GenericMessageHeader.msgStatusSuccess, "Processed OK", "File Write", fio.getFilename());
                  setErrorMessage("");

                  if (device.equals("Email"))
                  {
                    ogm = new JeMailOutGoingMessage(inter, transactionRef, fio);
                    ogm.sendEmail();
                  }
                } else
                {
                  result = false;
                  il.write(gmh, GenericMessageHeader.msgStatusError, fio.getErrorMessage(), "File Write", fio.getFilename());
                  setErrorMessage(fio.getErrorMessage());
                }
              }

            }
View Full Code Here

  private void archive() {
    int n = JOptionPane.showConfirmDialog(Common.mainForm, "Archive Successful/Resolved Log Records ?", "Confirm", JOptionPane.YES_NO_OPTION);
    if (n == 0)
    {
      JDBInterfaceLog interfaceLog = new JDBInterfaceLog(Common.selectedHostID, Common.sessionID);
      interfaceLog.archive();
      buildSQL();
      populateList();
    }
  }
View Full Code Here

  private void delete() {
    int n = JOptionPane.showConfirmDialog(Common.mainForm, "Delete selected Log record(s) ?", "Confirm", JOptionPane.YES_NO_OPTION);
    if (n == 0)
    {

      JDBInterfaceLog interfaceLog = new JDBInterfaceLog(Common.selectedHostID, Common.sessionID);

      if (jTable1.getSelectedRowCount() > 0)
      {
        int first = jTable1.getSelectionModel().getMinSelectionIndex();
        int last = jTable1.getSelectionModel().getMaxSelectionIndex();
        for (int x = first; x <= last; x++)
        {
          if (jTable1.getSelectionModel().isSelectedIndex(x))
          {
            jTable1.getModel().getValueAt(x, 2);
            Long logID = (Long) jTable1.getModel().getValueAt(x, 0);
            interfaceLog.setInterfaceLogID(logID);
            interfaceLog.delete();
          }
        }
      }
      buildSQL();
      populateList();
View Full Code Here

    listStatement = query.getPreparedStatement()

  }

  private void populateList() {
    JDBInterfaceLog interfaceLog = new JDBInterfaceLog(Common.selectedHostID, Common.sessionID);
    JDBInterfaceLogTableModel interfaceLogTable = new JDBInterfaceLogTableModel(interfaceLog.getInterfaceDataResultSet(listStatement));
    TableRowSorter<JDBInterfaceLogTableModel> sorter = new TableRowSorter<JDBInterfaceLogTableModel>(interfaceLogTable);

    jTable1.setRowSorter(sorter);
    jTable1.setModel(interfaceLogTable);
View Full Code Here

  public Boolean processMessage(Long transactionRef)

  {
    Boolean result = false;
    String path = "";
    JDBInterfaceLog il = new JDBInterfaceLog(getHostID(), getSessionID());
    GenericMessageHeader gmh = new GenericMessageHeader();
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
    JDBUom uom = new JDBUom(getHostID(), getSessionID());
    JDBMaterial mat = new JDBMaterial(getHostID(), getSessionID());
    JDBControl ctrl = new JDBControl(getHostID(), getSessionID());

    String expiryMode;
    expiryMode = ctrl.getKeyValue("EXPIRY DATE MODE");

    inter.getInterfaceProperties("Production Declaration", "Output");
    String device = inter.getDevice();

    JDBPalletHistory palhist = new JDBPalletHistory(getHostID(), getSessionID());
    ResultSet rs = palhist.getInterfacingData(transactionRef, "PROD DEC", "CONFIRM", Long.valueOf(1), "SSCC", "asc");
    try
    {
      if (rs.next())
      {
        palhist.getPropertiesfromResultSet(rs);

        try
        {
          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          DocumentBuilder builder = factory.newDocumentBuilder();

          Document document = builder.newDocument();

          Element message = (Element) document.createElement("message");

          Element hostUniqueID = addElement(document, "hostRef", Common.hostList.getHost(getHostID()).getUniqueID());
          message.appendChild(hostUniqueID);

          Element messageRef = addElement(document, "messageRef", String.valueOf(transactionRef));
          message.appendChild(messageRef);

          Element messageType = addElement(document, "interfaceType", "Production Declaration");
          message.appendChild(messageType);

          Element messageInformation = addElement(document, "messageInformation", "SSCC=" + palhist.getPallet().getSSCC());
          message.appendChild(messageInformation);

          Element messageDirection = addElement(document, "interfaceDirection", "Output");
          message.appendChild(messageDirection);

          Element messageDate = addElement(document, "messageDate", JUtility.getISOTimeStampStringFormat(JUtility.getSQLDateTime()));
          message.appendChild(messageDate);

          Element productionDeclaration = (Element) document.createElement("productionDeclaration");

          Element sscc = addElement(document, "SSCC", palhist.getPallet().getSSCC());
          productionDeclaration.appendChild(sscc);

          Element processOrder = addElement(document, "processOrder", palhist.getPallet().getProcessOrder());
          productionDeclaration.appendChild(processOrder);

          Element recipe = addElement(document, "recipe", palhist.getPallet().getProcessOrderObj(false).getRecipe());
          productionDeclaration.appendChild(recipe);

          Element required_resource = addElement(document, "requiredResource", palhist.getPallet().getProcessOrderObj(false).getRequiredResource());
          productionDeclaration.appendChild(required_resource);
         
          Element material = addElement(document, "material", palhist.getPallet().getMaterial());
          productionDeclaration.appendChild(material);

          if (mat.getMaterialProperties(palhist.getPallet().getMaterial()) == true)
          {
            Element description = addElement(document, "description", mat.getDescription());
            productionDeclaration.appendChild(description);
            Element old_code = addElement(document,"old_code",mat.getOldMaterial());
            productionDeclaration.appendChild(old_code);
          }
          else
          {
            Element description = addElement(document, "description", "");
            productionDeclaration.appendChild(description);
            Element old_code = addElement(document,"old_code","");
            productionDeclaration.appendChild(old_code);
          }

          Element ean = addElement(document, "ean", palhist.getPallet().getEAN());
          productionDeclaration.appendChild(ean);

          Element variant = addElement(document, "variant", palhist.getPallet().getVariant());
          productionDeclaration.appendChild(variant);

          Element status = addElement(document, "status", palhist.getPallet().getStatus());
          productionDeclaration.appendChild(status);

          Element batch = addElement(document, "batch", palhist.getPallet().getBatchNumber());
          productionDeclaration.appendChild(batch);

          Element batchStatus = addElement(document, "batchStatus", palhist.getPallet().getMaterialBatchStatus());
          productionDeclaration.appendChild(batchStatus);

          Element expiryDateMode = addElement(document, "expiry_Mode", expiryMode);
          productionDeclaration.appendChild(expiryDateMode);

          if (expiryMode.equals("BATCH") == true)
          {
            Element expiryDate = addElement(document, "expiryDate", JUtility.getISOTimeStampStringFormat(palhist.getPallet().getMaterialBatchExpiryDate()));
            productionDeclaration.appendChild(expiryDate);
          }
          else
          {
            Element expiryDate = addElement(document, "expiryDate", JUtility.getISOTimeStampStringFormat(palhist.getPallet().getBatchExpiry()));
            productionDeclaration.appendChild(expiryDate);
          }

          Element location = addElement(document, "location", palhist.getPallet().getLocationID());
          productionDeclaration.appendChild(location);

          Element name = addElement(document, "name", palhist.getPallet().getLocationObj().getDescription());
          productionDeclaration.appendChild(name);

          Element gln = addElement(document, "gln", palhist.getPallet().getLocationObj().getGLN());
          productionDeclaration.appendChild(gln);

          Element plant = addElement(document, "plant", palhist.getPallet().getLocationObj().getPlant());
          productionDeclaration.appendChild(plant);

          Element warehouse = addElement(document, "warehouse", palhist.getPallet().getLocationObj().getWarehouse());
          productionDeclaration.appendChild(warehouse);

          Element storageLocation = addElement(document, "storageLocation", palhist.getPallet().getLocationObj().getStorageLocation());
          productionDeclaration.appendChild(storageLocation);

          Element storageSection = addElement(document, "storageSection", palhist.getPallet().getLocationObj().getStorageSection());
          productionDeclaration.appendChild(storageSection);

          Element storageBin = addElement(document, "storageBin", palhist.getPallet().getLocationObj().getStorageBin());
          productionDeclaration.appendChild(storageBin);

          Element storageType = addElement(document, "storageType", palhist.getPallet().getLocationObj().getStorageType());
          productionDeclaration.appendChild(storageType);

          Element productionQuantity = addElement(document, "productionQuantity", String.valueOf(palhist.getPallet().getQuantity()));
          productionDeclaration.appendChild(productionQuantity);

          String paluom = palhist.getPallet().getUom();
          paluom = uom.convertUom(inter.getUOMConversion(), paluom);

          Element productionUOM = addElement(document, "productionUOM", paluom);
          productionDeclaration.appendChild(productionUOM);

          Element productionConfirmed = addElement(document, "confirmed", palhist.getPallet().getConfirmed());
          productionDeclaration.appendChild(productionConfirmed);

          Element productionDate = addElement(document, "productionDate", JUtility.getISOTimeStampStringFormat(palhist.getPallet().getDateOfManufacture()));
          productionDeclaration.appendChild(productionDate);

          Element messageData = (Element) document.createElement("messageData");
          messageData.appendChild(productionDeclaration);

          message.appendChild(messageData);

          document.appendChild(message);

          JXMLDocument xmld = new JXMLDocument();
          xmld.setDocument(document);
          gmh.decodeHeader(xmld);

          if (device.equals("Disk") | device.equals("Email"))
          {

            path = inter.getRealPath();
            if (fio.writeToDisk(path, document, transactionRef,"_"+ palhist.getPallet().getLocationID().replace(" ", "_")+"_ProductionDeclaration.xml") == true)
            {
              result = true;
              il.write(gmh, GenericMessageHeader.msgStatusSuccess, "Processed OK", "File Write", fio.getFilename());
              setErrorMessage("");
             
              if (device.equals("Email"))
              {
                ogm = new JeMailOutGoingMessage(inter,transactionRef,fio);
                ogm.sendEmail();
              }
            }
            else
            {
              result = false;
              il.write(gmh, GenericMessageHeader.msgStatusError, fio.getErrorMessage(), "File Write", fio.getFilename());
              setErrorMessage(fio.getErrorMessage());
            }
          }

        }
View Full Code Here

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

TOP

Related Classes of com.commander4j.db.JDBInterfaceLog

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.