Class LabelWorkflowService

java.lang.Object
com.tbg.wms.cli.gui.LabelWorkflowService

public final class LabelWorkflowService extends Object
GUI workflow service that loads shipment data, builds preview math, and executes label printing.
  • Constructor Details

    • LabelWorkflowService

      public LabelWorkflowService(AppConfig config)
  • Method Details

    • loadPrinters

      public List<LabelWorkflowService.PrinterOption> loadPrinters() throws Exception
      Loads enabled printers from routing configuration.
      Returns:
      list of available printers sorted by ID
      Throws:
      Exception - when routing config cannot be loaded
    • clearCaches

      public void clearCaches()
    • resolvePrinter

      public PrinterConfig resolvePrinter(String printerId) throws Exception
      Resolves a printer config by ID using cached routing data.
      Throws:
      Exception
    • prepareJob

      public LabelWorkflowService.PreparedJob prepareJob(String shipmentId) throws Exception
      Loads shipment data and prepares the label plan for GUI preview.
      Parameters:
      shipmentId - WMS shipment identifier
      Returns:
      prepared job with shipment, labels, and planning results
      Throws:
      Exception - when data is missing or cannot be loaded
    • print

      public LabelWorkflowService.PrintResult print(LabelWorkflowService.PreparedJob job, String printerId, Path outputDir, boolean printToFile) throws Exception
      Generates ZPL output and prints labels for the prepared job.
      Parameters:
      job - prepared job from preview
      printerId - printer identifier to use
      outputDir - output directory for ZPL artifacts
      printToFile - when true, skip network printing
      Returns:
      summary of labels printed and output path
      Throws:
      Exception - when printing fails