Package org.openwms.common.location
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>
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:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AccountTheLocationmight be assigned to anAccount.private @Size(max=255) StringTheLocationmay be classified, like 'hazardous'.private BooleanDetermines whether theLocationis considered in the allocation procedure.private static final Stringstatic final booleanDefault value ofconsideredInAllocation.static final booleanDefault value ofincomingActive.static final booleanDefault value oflocationGroupCountingActive.static final intDefault value ofnoMaxTransportUnits.static final booleanDefault value ofoutgoingActive.static final intDefault value ofplcState.private @Size(max=255) StringDescription of theLocation.private StringERP code of theLocation.private StringSome group theLocationbelongs to.private booleanSignals the incoming state of theLocation.ALocationcan be assigned to a particular labels.private LocalDateTimeDate of last movement.private LocationGroupTheLocationGrouptheLocationbelongs to.private Booleanprivate @NotNull LocationPKUnique natural key.private LocationTypeTheLocationTypetheLocationbelongs to.private BigDecimalMaximum allowed weight on theLocation.StoredMessages on theLocation.private intMaximum number ofTransportUnits allowed on theLocation.private booleanSignals the outgoing state of theLocation.private StringPLC code of theLocation.private intThe PLC is able to change the state of aLocation.private IntegerSort order index used by strategies for putaway, or picking.private StringMight be assigned to a particular zone in stock.static final StringTable name.Fields inherited from class org.ameba.integration.jpa.ApplicationEntity
C_ID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLocation()Dear JPA...protectedLocation(LocationPK locationId) Create a new Location with the business key.(package private)Location(LocationPK locationId, Account account, LocationGroup locationGroup, LocationType locationType, String erpCode, String plcCode, Integer sortOrder, String stockZone) Create a new Location. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddMessage(Message message) Add a newMessageto this Location.booleanChecks whether thisLocationbelongs NOT to aLocationGroup.booleanChecks whether thisLocationbelongs to aLocationGroup.static Locationcreate(LocationPK locationId) Create a new Location with the business key.booleanReturn theAccountthisLocationis assigned to.Returns the classification of the Location.Returns the description of the Location.Get the ERP Code of the Location.getGroup()Returns the group the Location belongs to.Returns the list of Strings set as labels for the Location.Return the date when the Location was updated the last time.Return theLocationGroupwhere the Location belongs to.Returns the locationId (natural key) of the Location.Returns the type of Location.Return the maximum allowed weight on the Location.Returns an unmodifiable Set ofMessages stored for the Location.intReturns the maximum number ofTransportUnits allowed on the Location.Get the PLC Code of the Location.intReturn the current set plc state.Get the sortOrder.Returns the stockZone.inthashCode()booleanCheck if the Location has alocationIdset.booleanDetermine whether the Location is considered during allocation.booleanDetermine whether incoming mode is activated andTransportUnits can be put on this Location.booleanCheck whether infeed is blocked and movingTransportUnits to here is forbidden.booleanDetermine whether the Location is part of the parentLocationGroups calculation procedure ofTransportUnits.booleanDetermine whether outgoing mode is activated andTransportUnits can leave this Location.booleanCheck whether outfeed is blocked and movingTransportUnits from here is forbidden.booleanremoveMessages(Message... msgs) Remove one or moreMessages from this Location.voidsetClassification(String classification) Set the classification.voidsetDescription(String description) Set the description text of the Location.voidsetInfeed(boolean infeedActive) Set the incoming mode of this Location.voidSet a list of labels to the Location.voidsetLastMovement(LocalDateTime lastMovement) Change the date when a TransportUnit was put or left the Location the last time.(package private) voidsetLocationGroup(LocationGroup locationGroup) Add thisLocationto the locationGroup.voidsetLocationGroupCountingActive(boolean locationGroupCountingActive) Define whether or not the Location shall be considered in countingTransportUnits of the parentLocationGroup.voidsetLocationType(LocationType locationType) voidsetOutfeed(boolean outfeedActive) Set the outfeed mode of this Location.voidsetPersistentKey(String pKey) Required for the Mapper.voidsetPlcState(int plcState) Set the plc state.toString()Return theLocationPKas String.(package private) voidSet the locationGroup to null.Methods inherited from class org.ameba.integration.jpa.ApplicationEntity
getPersistentKey, hasPersistentKey, onEntityPersist, onPersistMethods inherited from class org.ameba.integration.jpa.BaseEntity
getCreatedBy, getCreateDt, getLastModifiedBy, getLastModifiedDt, getOl, getPk, isNew, setCreatedBy, setCreateDt, setLastModifiedBy, setLastModifiedDt, setOl
-
Field Details
-
TABLE
Table name.- See Also:
-
CREATION_OF_LOCATION_WITH_LOCATION_ID_NULL
- See Also:
-
locationId
Unique natural key. -
account
TheLocationmight be assigned to anAccount. -
plcCode
PLC code of theLocation. -
erpCode
ERP code of theLocation. -
description
Description of theLocation. -
sortOrder
Sort order index used by strategies for putaway, or picking. -
stockZone
Might be assigned to a particular zone in stock. -
labels
ALocationcan be assigned to a particular labels. -
noMaxTransportUnits
private int noMaxTransportUnitsMaximum number ofTransportUnits allowed on theLocation. -
DEF_MAX_TU
public static final int DEF_MAX_TUDefault value ofnoMaxTransportUnits.- See Also:
-
maximumWeight
Maximum allowed weight on theLocation. -
lastMovement
Date of last movement. When aTransportUnitis moving to or away from theLocation,lastMovementis updated. This is useful to get the history ofTransportUnits as well as for inventory calculation. -
locationGroupCountingActive
Shall theLocationbe included in the calculation ofTransportUnits of the parentLocationGroup.- true :
Locationis included in calculation ofTransportUnits. - false:
Locationis not included in calculation ofTransportUnits.
- true :
-
DEF_LG_COUNTING_ACTIVE
public static final boolean DEF_LG_COUNTING_ACTIVEDefault value oflocationGroupCountingActive.- See Also:
-
incomingActive
private boolean incomingActiveSignals the incoming state of theLocation.Locations which are blocked for incoming movements do not acceptTransportUnits.- true :
Locationis ready to pick upTransportUnits. - false:
Locationis locked, and cannot pick upTransportUnits.
- true :
-
DEF_INCOMING_ACTIVE
public static final boolean DEF_INCOMING_ACTIVEDefault value ofincomingActive.- See Also:
-
outgoingActive
private boolean outgoingActiveSignals the outgoing state of theLocation.Locations which are blocked for outgoing do not accept to moveTransportUnits away.- true :
Locationis enabled for outgoingTransportUnits. - false:
Locationis locked,TransportUnits can't leave theLocation.
- true :
-
DEF_OUTGOING_ACTIVE
public static final boolean DEF_OUTGOING_ACTIVEDefault value ofoutgoingActive.- See Also:
-
plcState
private int plcStateThe PLC is able to change the state of aLocation. 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_STATEDefault value ofplcState.- See Also:
-
consideredInAllocation
Determines whether theLocationis considered in the allocation procedure.- true : The
Locationis considered in storage calculation by an allocation procedure. - false : The
Locationis not considered in the allocation process.
- true : The
-
DEF_CONSIDERED_IN_ALLOCATION
public static final boolean DEF_CONSIDERED_IN_ALLOCATIONDefault value ofconsideredInAllocation.- See Also:
-
locationType
TheLocationTypetheLocationbelongs to. -
group
Some group theLocationbelongs to. -
classification
TheLocationmay be classified, like 'hazardous'. -
locationGroup
TheLocationGrouptheLocationbelongs to. -
messages
StoredMessages on theLocation.
-
-
Constructor Details
-
Location
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 LocationlocationGroup- The LocationGroup the Location belongs to
-
Location
protected Location()Dear JPA...
-
-
Method Details
-
create
Create a new Location with the business key.- Parameters:
locationId- The unique natural key of the Location- Returns:
- The Location
-
setPersistentKey
Required for the Mapper.- Overrides:
setPersistentKeyin classorg.ameba.integration.jpa.ApplicationEntity
-
hasLocationId
public boolean hasLocationId()Check if the Location has alocationIdset.- Returns:
- true if so
-
getAccount
Return theAccountthisLocationis assigned to.- Returns:
- The Account
-
getErpCode
Get the ERP Code of the Location.- Returns:
- The ERP code
-
getPlcCode
Get the PLC Code of the Location.- Returns:
- The PLC code
-
addMessage
Add a newMessageto this Location. -
isConsideredInAllocation
public boolean isConsideredInAllocation()Determine whether the Location is considered during allocation.- Returns:
- true when considered in allocation, otherwise false
-
getDescription
Returns the description of the Location.- Returns:
- The description text
-
setDescription
Set the description text of the Location.- Parameters:
description- The description text
-
getSortOrder
Get the sortOrder.- Returns:
- A sequence number
-
getStockZone
Returns the stockZone.- Returns:
- As string
-
getLabels
Returns the list of Strings set as labels for the Location.- Returns:
- A list of Strings or an empty list
-
setLabels
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 andTransportUnits 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 movingTransportUnits to here is forbidden.- Returns:
- true is blocked, otherwise false
-
getLastMovement
Return the date when the Location was updated the last time.- Returns:
- Timestamp of the last update
-
setLastMovement
Change the date when a TransportUnit was put or left the Location the last time.- Parameters:
lastMovement- The date of change.
-
getLocationGroup
Return theLocationGroupwhere the Location belongs to.- Returns:
- The
LocationGroupof the Location
-
isLocationGroupCountingActive
public boolean isLocationGroupCountingActive()Determine whether the Location is part of the parentLocationGroups calculation procedure ofTransportUnits.- Returns:
- true if calculation is activated, otherwise false
-
getLocationId
Returns the locationId (natural key) of the Location.- Returns:
- The locationId
-
getLocationType
Returns the type of Location.- Returns:
- The type
-
setLocationType
-
getGroup
Returns the group the Location belongs to.- Returns:
- The group as String
-
getClassification
Returns the classification of the Location.- Returns:
- As a String
-
setClassification
Set the classification.- Parameters:
classification- As an arbitrary String
-
getMaximumWeight
Return the maximum allowed weight on the Location.- Returns:
- The maximum allowed weight
-
getMessages
Returns an unmodifiable Set ofMessages stored for the Location.- Returns:
- An unmodifiable Set
-
getNoMaxTransportUnits
public int getNoMaxTransportUnits()Returns the maximum number ofTransportUnits allowed on the Location.- Returns:
- The maximum number of
TransportUnits
-
isOutfeedActive
public boolean isOutfeedActive()Determine whether outgoing mode is activated andTransportUnits can leave this Location.- Returns:
- true when outgoing mode is activated, otherwise false
-
isOutfeedBlocked
public boolean isOutfeedBlocked()Check whether outfeed is blocked and movingTransportUnits 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
Remove one or moreMessages from this Location.- Parameters:
msgs- An array ofMessages to be removed- Returns:
- true if the
Messages were found and removed, otherwise false - Throws:
IllegalArgumentException- when messages is null
-
setLocationGroup
Add thisLocationto the locationGroup. When the argument is null an existingLocationGroupis removed from theLocation.- Parameters:
locationGroup- TheLocationGroupto be assigned
-
setLocationGroupCountingActive
public void setLocationGroupCountingActive(boolean locationGroupCountingActive) Define whether or not the Location shall be considered in countingTransportUnits of the parentLocationGroup.- Parameters:
locationGroupCountingActive- true if considered, otherwise false
-
belongsToLocationGroup
public boolean belongsToLocationGroup()Checks whether thisLocationbelongs to aLocationGroup.- Returns:
- true if it belongs to a
LocationGroup, otherwise false
-
belongsNotToLocationGroup
public boolean belongsNotToLocationGroup()Checks whether thisLocationbelongs NOT to aLocationGroup.- Returns:
- true if it does not belong to a
LocationGroup, otherwise false
-
unsetLocationGroup
void unsetLocationGroup()Set the locationGroup to null. -
equals
Only use the unique natural key for comparison.
- Overrides:
equalsin classorg.ameba.integration.jpa.ApplicationEntity
-
hashCode
public int hashCode()Only use the unique natural key for hashCode calculation.
- Overrides:
hashCodein classorg.ameba.integration.jpa.ApplicationEntity
-
toString
Return theLocationPKas String.
-