Class Location

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

@Entity public class Location extends org.ameba.integration.jpa.ApplicationEntity implements Serializable
A Location represents any location in a warehouse with the attributes relevant for the WMS Inventory Service.
Author:
Heiko Scherrer
See Also:
  • Field Details

    • foreignPKey

      private String foreignPKey
      The foreign persistent key of the Location.
    • locationId

      @NotNull private @NotNull LocationPK locationId
      Unique natural key.
    • locationGroup

      private String locationGroup
      Unique identifier of a LocationGroup.
    • incomingActive

      private Boolean incomingActive
      Signals the incoming state of this Location. Locations which are blocked for incoming cannot pick up TransportUnits.
      • true : Location is ready to pick up TransportUnits
      • false: Location is locked, and cannot pick up TransportUnits
    • outgoingActive

      private Boolean outgoingActive
      Signals the outgoing state of this Location. Locations which are blocked for outgoing cannot release TransportUnits.
      • true : Location is enabled for outgoing TransportUnits.
      • false: Location is locked, TransportUnits can't leave this Location.
    • mixedProducts

      private Boolean mixedProducts
      Whether it is allowed to store different Products on this Location.
    • directBookingAllowed

      private Boolean directBookingAllowed
      Whether it is allowed to move Products without TransportUnit to this Location directly.
    • plcState

      private int plcState
      The PLC is able to change the state of a Location. This property stores the last state, received from the PLC.
      • 0 : No PLC error, everything okay
      • <0: Not defined
      • >0: Some kind of defined error code
    • erpCode

      private String erpCode
      ERP code of the Location.
    • description

      @Size(max=255) private @Size(max=255) String description
      Description of the Location.
    • stockZone

      private String stockZone
      Might be assigned to a particular zone in stock.
    • classification

      @Size(max=255) private @Size(max=255) String classification
      The Location may be classified, like 'hazardous'.
    • sortOrder

      private Integer sortOrder
      Sort order index used by Putaway strategies.
    • noMaxTransportUnits

      private int noMaxTransportUnits
      Maximum number of TransportUnits allowed on this Location.
    • DEF_MAX_TU

      public static final int DEF_MAX_TU
      Default value of noMaxTransportUnits.
      See Also:
    • lastPickingDate

      @DateTimeFormat(pattern="yyyy-MM-dd\'T\'HH:mm:ssXXX") private ZonedDateTime lastPickingDate
      When picking happened the last time on this Location.
    • lastInventoryDate

      @DateTimeFormat(pattern="yyyy-MM-dd\'T\'HH:mm:ssXXX") private ZonedDateTime lastInventoryDate
      When was this Location the last time under stock-taking.
  • Constructor Details

    • Location

      public Location(@NotNull @NotNull LocationPK locationId)
    • Location

      protected Location()
      Dear JPA ...
  • Method Details

    • hasFreeSpaceAvailable

      public boolean hasFreeSpaceAvailable(int currentNumberOfTransportUnits)
      Check whether this Location has free capacity to store TransportUnits.
      Parameters:
      currentNumberOfTransportUnits - The current amount of TransportUnits currently placed in the Location
      Returns:
      true If free capacity is left
    • verifyFreeSpaceAvailable

      public void verifyFreeSpaceAvailable(org.ameba.i18n.Translator translator, int currentNumberOfTransportUnits)
      Verify that additional capacity is available to store at least one TransportUnit.
      Parameters:
      translator - A Translator instance used to translate error messages
      currentNumberOfTransportUnits - The current amount of TransportUnits currently placed in the Location
      Throws:
      org.ameba.exception.BusinessRuntimeException - In case no space is left on Location
    • isPlcNotBlocked

      public boolean isPlcNotBlocked()
      Check whether the plcState marks the Location as free of blocked.
      Returns:
      true if free (not blocked)
    • toString

      public String toString()
      Just the locationId.
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      All fields.
      Overrides:
      equals in class org.ameba.integration.jpa.ApplicationEntity
    • hashCode

      public int hashCode()
      All fields.
      Overrides:
      hashCode in class org.ameba.integration.jpa.ApplicationEntity
    • setLocationEmpty

      public void setLocationEmpty(org.springframework.context.ApplicationEventPublisher eventPublisher, int plcState, boolean incomingActive, boolean outgoingActive)
      Set this Location empty.
      Parameters:
      eventPublisher - An ApplicationEventPublisher instance that is used to publish change events
      plcState - The PLC state to set, must be greater than 0
      incomingActive - The state of incoming movements
      outgoingActive - The state of outgoing movements
    • getForeignPKey

      public String getForeignPKey()
    • setForeignPKey

      public void setForeignPKey(String foreignPKey)
    • getLocationId

      public LocationPK getLocationId()
    • hasLocationId

      public boolean hasLocationId()
    • getLocationGroup

      public String getLocationGroup()
    • setLocationGroup

      public void setLocationGroup(String locationGroup)
    • setIncomingActive

      public void setIncomingActive(boolean incomingActive)
    • getIncomingActive

      public Boolean getIncomingActive()
    • getOutgoingActive

      public Boolean getOutgoingActive()
    • setOutgoingActive

      public void setOutgoingActive(boolean outgoingActive)
    • getMixedProducts

      public Boolean getMixedProducts()
    • getDirectBookingAllowed

      public Boolean getDirectBookingAllowed()
    • getPlcState

      public int getPlcState()
    • setPlcState

      public void setPlcState(int plcState)
    • getErpCode

      public String getErpCode()
    • hasErpCode

      public boolean hasErpCode()
    • setErpCode

      public void setErpCode(String erpCode)
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)
    • getStockZone

      public String getStockZone()
    • getClassification

      public String getClassification()
    • getSortOrder

      public Integer getSortOrder()
    • getNoMaxTransportUnits

      public int getNoMaxTransportUnits()
    • setNoMaxTransportUnits

      public void setNoMaxTransportUnits(int noMaxTransportUnits)
    • getLastPickingDate

      public ZonedDateTime getLastPickingDate()
    • getLastInventoryDate

      public ZonedDateTime getLastInventoryDate()
    • setLastInventoryDate

      public void setLastInventoryDate(ZonedDateTime lastInventoryDate)