Class Location

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

@Entity public class Location extends Target implements Serializable
A Location, represents a physical or virtual place in a warehouse. Could be something like a storage location in the stock or a conveyor location. Even error locations can be represented with the Location. Multiple Locations with same characteristics are grouped to a LocationGroup.
Author:
Heiko Scherrer
See Also:
  • Field Details

    • TABLE

      public static final String TABLE
      Table name.
      See Also:
    • CREATION_OF_LOCATION_WITH_LOCATION_ID_NULL

      private static final String CREATION_OF_LOCATION_WITH_LOCATION_ID_NULL
      See Also:
    • locationId

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

      private Account account
      The Location might be assigned to an Account.
    • plcCode

      private String plcCode
      PLC code of the Location.
    • erpCode

      private String erpCode
      ERP code of the Location.
    • description

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

      private Integer sortOrder
      Sort order index used by strategies for putaway, or picking.
    • stockZone

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

      @Size(max=1024) private @Size(max=1024) List<String> labels
      A Location can be assigned to a particular labels.
    • noMaxTransportUnits

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

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

      private BigDecimal maximumWeight
      Maximum allowed weight on the Location.
    • lastMovement

      private LocalDateTime lastMovement
      Date of last movement. When a TransportUnit is moving to or away from the Location, lastMovement is updated. This is useful to get the history of TransportUnits as well as for inventory calculation.
    • locationGroupCountingActive

      private Boolean locationGroupCountingActive
      Shall the Location be included in the calculation of TransportUnits of the parent LocationGroup.
      • true : Location is included in calculation of TransportUnits.
      • false: Location is not included in calculation of TransportUnits.
    • DEF_LG_COUNTING_ACTIVE

      public static final boolean DEF_LG_COUNTING_ACTIVE
      Default value of locationGroupCountingActive.
      See Also:
    • incomingActive

      private boolean incomingActive
      Signals the incoming state of the Location. Locations which are blocked for incoming movements do not accept TransportUnits.
      • true : Location is ready to pick up TransportUnits.
      • false: Location is locked, and cannot pick up TransportUnits.
    • DEF_INCOMING_ACTIVE

      public static final boolean DEF_INCOMING_ACTIVE
      Default value of incomingActive.
      See Also:
    • outgoingActive

      private boolean outgoingActive
      Signals the outgoing state of the Location. Locations which are blocked for outgoing do not accept to move TransportUnits away.
      • true : Location is enabled for outgoing TransportUnits.
      • false: Location is locked, TransportUnits can't leave the Location.
    • DEF_OUTGOING_ACTIVE

      public static final boolean DEF_OUTGOING_ACTIVE
      Default value of outgoingActive.
      See Also:
    • 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 defined error code
    • DEF_PLC_STATE

      public static final int DEF_PLC_STATE
      Default value of plcState.
      See Also:
    • consideredInAllocation

      private Boolean consideredInAllocation
      Determines whether the Location is considered in the allocation procedure.
      • true : The Location is considered in storage calculation by an allocation procedure.
      • false : The Location is not considered in the allocation process.
    • DEF_CONSIDERED_IN_ALLOCATION

      public static final boolean DEF_CONSIDERED_IN_ALLOCATION
      Default value of consideredInAllocation.
      See Also:
    • locationType

      private LocationType locationType
      The LocationType the Location belongs to.
    • group

      private String group
      Some group the Location belongs to.
    • classification

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

      private LocationGroup locationGroup
      The LocationGroup the Location belongs to.
    • messages

      private Set<Message> messages
      Stored Messages on the Location.
  • Constructor Details

    • Location

      protected Location(LocationPK locationId)
      Create a new Location with the business key.
      Parameters:
      locationId - The unique natural key of the Location
    • Location

      Location(LocationPK locationId, Account account, LocationGroup locationGroup, LocationType locationType, String erpCode, String plcCode, Integer sortOrder, String stockZone)
      Create a new Location.
      Parameters:
      locationId - The unique natural key of the Location
      locationGroup - The LocationGroup the Location belongs to
    • Location

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

    • create

      public static Location create(LocationPK locationId)
      Create a new Location with the business key.
      Parameters:
      locationId - The unique natural key of the Location
      Returns:
      The Location
    • setPersistentKey

      public void setPersistentKey(String pKey)
      Required for the Mapper.
      Overrides:
      setPersistentKey in class org.ameba.integration.jpa.ApplicationEntity
    • hasLocationId

      public boolean hasLocationId()
      Check if the Location has a locationId set.
      Returns:
      true if so
    • getAccount

      public Account getAccount()
      Return the Account this Location is assigned to.
      Returns:
      The Account
    • getErpCode

      public String getErpCode()
      Get the ERP Code of the Location.
      Returns:
      The ERP code
    • getPlcCode

      public String getPlcCode()
      Get the PLC Code of the Location.
      Returns:
      The PLC code
    • addMessage

      public boolean addMessage(Message message)
      Add a new Message to this Location.
      Parameters:
      message - The Message to be added
      Returns:
      true if the Message is new in the collection of messages, otherwise false
    • isConsideredInAllocation

      public boolean isConsideredInAllocation()
      Determine whether the Location is considered during allocation.
      Returns:
      true when considered in allocation, otherwise false
    • getDescription

      public String getDescription()
      Returns the description of the Location.
      Returns:
      The description text
    • setDescription

      public void setDescription(String description)
      Set the description text of the Location.
      Parameters:
      description - The description text
    • getSortOrder

      public Integer getSortOrder()
      Get the sortOrder.
      Returns:
      A sequence number
    • getStockZone

      public String getStockZone()
      Returns the stockZone.
      Returns:
      As string
    • getLabels

      public List<String> getLabels()
      Returns the list of Strings set as labels for the Location.
      Returns:
      A list of Strings or an empty list
    • setLabels

      public void setLabels(List<String> labels)
      Set a list of labels to the Location.
      Parameters:
      labels - A comma-separated list of labels
    • isInfeedActive

      public boolean isInfeedActive()
      Determine whether incoming mode is activated and TransportUnits can be put on this Location.
      Returns:
      true when incoming mode is activated, otherwise false
    • setInfeed

      public void setInfeed(boolean infeedActive)
      Set the incoming mode of this Location.
      Parameters:
      infeedActive - true means Infeed movements are possible, false means Infeed movements are blocked
    • isInfeedBlocked

      public boolean isInfeedBlocked()
      Check whether infeed is blocked and moving TransportUnits to here is forbidden.
      Returns:
      true is blocked, otherwise false
    • getLastMovement

      public LocalDateTime getLastMovement()
      Return the date when the Location was updated the last time.
      Returns:
      Timestamp of the last update
    • setLastMovement

      public void setLastMovement(LocalDateTime lastMovement)
      Change the date when a TransportUnit was put or left the Location the last time.
      Parameters:
      lastMovement - The date of change.
    • getLocationGroup

      public LocationGroup getLocationGroup()
      Return the LocationGroup where the Location belongs to.
      Returns:
      The LocationGroup of the Location
    • isLocationGroupCountingActive

      public boolean isLocationGroupCountingActive()
      Determine whether the Location is part of the parent LocationGroups calculation procedure of TransportUnits.
      Returns:
      true if calculation is activated, otherwise false
    • getLocationId

      public LocationPK getLocationId()
      Returns the locationId (natural key) of the Location.
      Returns:
      The locationId
    • getLocationType

      public LocationType getLocationType()
      Returns the type of Location.
      Returns:
      The type
    • setLocationType

      public void setLocationType(LocationType locationType)
    • getGroup

      public String getGroup()
      Returns the group the Location belongs to.
      Returns:
      The group as String
    • getClassification

      public String getClassification()
      Returns the classification of the Location.
      Returns:
      As a String
    • setClassification

      public void setClassification(String classification)
      Set the classification.
      Parameters:
      classification - As an arbitrary String
    • getMaximumWeight

      public BigDecimal getMaximumWeight()
      Return the maximum allowed weight on the Location.
      Returns:
      The maximum allowed weight
    • getMessages

      public Set<Message> getMessages()
      Returns an unmodifiable Set of Messages stored for the Location.
      Returns:
      An unmodifiable Set
    • getNoMaxTransportUnits

      public int getNoMaxTransportUnits()
      Returns the maximum number of TransportUnits allowed on the Location.
      Returns:
      The maximum number of TransportUnits
    • isOutfeedActive

      public boolean isOutfeedActive()
      Determine whether outgoing mode is activated and TransportUnits can leave this Location.
      Returns:
      true when outgoing mode is activated, otherwise false
    • isOutfeedBlocked

      public boolean isOutfeedBlocked()
      Check whether outfeed is blocked and moving TransportUnits from here is forbidden.
      Returns:
      true is blocked, otherwise false
    • setOutfeed

      public void setOutfeed(boolean outfeedActive)
      Set the outfeed mode of this Location.
      Parameters:
      outfeedActive - true means Outfeed movements are possible, false means Outfeed movements are blocked
    • getPlcState

      public int getPlcState()
      Return the current set plc state.
      Returns:
      the plc state
    • setPlcState

      public void setPlcState(int plcState)
      Set the plc state.
      Parameters:
      plcState - the plc state
    • removeMessages

      public boolean removeMessages(Message... msgs)
      Remove one or more Messages from this Location.
      Parameters:
      msgs - An array of Messages to be removed
      Returns:
      true if the Messages were found and removed, otherwise false
      Throws:
      IllegalArgumentException - when messages is null
    • setLocationGroup

      void setLocationGroup(LocationGroup locationGroup)
      Add this Location to the locationGroup. When the argument is null an existing LocationGroup is removed from the Location.
      Parameters:
      locationGroup - The LocationGroup to be assigned
    • setLocationGroupCountingActive

      public void setLocationGroupCountingActive(boolean locationGroupCountingActive)
      Define whether or not the Location shall be considered in counting TransportUnits of the parent LocationGroup.
      Parameters:
      locationGroupCountingActive - true if considered, otherwise false
    • belongsToLocationGroup

      public boolean belongsToLocationGroup()
      Checks whether this Location belongs to a LocationGroup.
      Returns:
      true if it belongs to a LocationGroup, otherwise false
    • belongsNotToLocationGroup

      public boolean belongsNotToLocationGroup()
      Checks whether this Location belongs NOT to a LocationGroup.
      Returns:
      true if it does not belong to a LocationGroup, otherwise false
    • unsetLocationGroup

      void unsetLocationGroup()
      Set the locationGroup to null.
    • equals

      public boolean equals(Object o)

      Only use the unique natural key for comparison.

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

      public int hashCode()

      Only use the unique natural key for hashCode calculation.

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

      public String toString()
      Return the LocationPK as String.
      Overrides:
      toString in class Object
      Returns:
      String locationId
      See Also: