Class LoadUnit

java.lang.Object
org.ameba.integration.jpa.BaseEntity
org.ameba.integration.jpa.ApplicationEntity
org.openwms.wms.inventory.LoadUnit
All Implemented Interfaces:
Serializable, org.ameba.integration.TypedEntity<Long>

@Entity public class LoadUnit extends org.ameba.integration.jpa.ApplicationEntity implements Serializable
A LoadUnit is used to divide a TransportUnit into multiple physical areas. It always requires a TransportUnit to be moved around, but it may contain PackagingUnits of arbitrary Product types or it may dedicated to one particular Product type only.
Author:
Heiko Scherrer
See Also:
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • transportUnit

      @NotNull private @NotNull TransportUnit transportUnit
      The TransportUnit where this LoadUnit belongs to.
    • physicalPosition

      @NotEmpty private @NotEmpty String physicalPosition
      Where this LoadUnit is located on the TransportUnit.
    • label

      private String label
      An identifying label of the LoadUnit.
    • type

      @NotNull private @NotNull LoadUnitType type
      The LoadUnitType the LoadUnit is of.
    • locked

      private boolean locked
      Locked for allocation.
    • mixedProductsDefault

      @Autowired @Value("${owms.wms.inventory.mixedProductsInLuAllowed:true}") private boolean mixedProductsDefault
    • mixedProducts

      private boolean mixedProducts
      Whether it is allowed to store different Products in this LoadUnit.
    • product

      private Product product
      The Product that is carried within the LoadUnit.
    • dimension

      private Dimension dimension
      The current dimension of the LoadUnit.
    • packagingUnits

      private List<PackagingUnit> packagingUnits
      All PackagingUnits that belong to this LoadUnit.
  • Constructor Details

    • LoadUnit

      protected LoadUnit()
      Dear JPA ...
    • LoadUnit

      public LoadUnit(TransportUnit transportUnit, String physicalPosition, LoadUnitType type)
      Create a new LoadUnit.
      Parameters:
      transportUnit - The TransportUnit where this LoadUnit stands on.
      physicalPosition - The physical position within the TransportUnit where this LoadUnit stands on
      type - The LoadUnitType to assign the LoadUnit to
  • Method Details

    • getTransportUnit

      public TransportUnit getTransportUnit()
      Get the transportUnit.
      Returns:
      the transportUnit.
    • getPhysicalPosition

      public String getPhysicalPosition()
      Get the physicalPosition.
      Returns:
      the physicalPosition.
    • getLabel

      public String getLabel()
    • isLocked

      public boolean isLocked()
      Get the locked.
      Returns:
      the locked.
    • setLocked

      public void setLocked(boolean locked)
      Set the locked.
      Parameters:
      locked - The locked to set.
    • isMixedProducts

      public boolean isMixedProducts()
    • setMixedProducts

      public void setMixedProducts(boolean mixedProducts)
    • getProduct

      public Product getProduct()
      Get the product.
      Returns:
      the product.
    • assignProduct

      public void assignProduct(Product p)
      Assign a Product to this LoadUnit.
      Parameters:
      p - The product to assign.
    • unassignProduct

      public void unassignProduct()
      Unassign the product from this LoadUnit - set it to null.
    • getType

      public LoadUnitType getType()
    • isMixedProductsDefault

      public boolean isMixedProductsDefault()
    • getDimension

      public Dimension getDimension()
    • getPackagingUnits

      public List<PackagingUnit> getPackagingUnits()
      Get the packagingUnits.
      Returns:
      the packagingUnits.
    • hasPackagingUnits

      public boolean hasPackagingUnits()
      Check whether this LoadUnit has PackagingUnits.
      Returns:
      true if so
    • initializeAndGet

      private List<PackagingUnit> initializeAndGet()
    • addPackagingUnit

      public void addPackagingUnit(PackagingUnit packagingUnit)
      Add one PackagingUnit to this LoadUnit.
      Parameters:
      packagingUnit - PackagingUnit to add
    • removePackagingUnits

      public void removePackagingUnits(PackagingUnit... pUnits)
      Remove one or more PackagingUnits from this LoadUnit.
      Parameters:
      pUnits - PackagingUnits to remove
    • toString

      public String toString()

      Return a combination of the barcode and the physicalPosition.

      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)

      Use the TransportUnit and the Position only

      Overrides:
      equals in class org.ameba.integration.jpa.ApplicationEntity
    • hashCode

      public int hashCode()

      Use the TransportUnit and the Position only

      Overrides:
      hashCode in class org.ameba.integration.jpa.ApplicationEntity