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
-
Field Summary
Modifier and TypeFieldDescriptionprivate Account
TheLocation
might be assigned to anAccount
.private @Size(max=255) String
TheLocation
may be classified, like 'hazardous'.private Boolean
Determines whether theLocation
is considered in the allocation procedure.private static final String
static final boolean
Default value ofconsideredInAllocation
.static final boolean
Default value ofincomingActive
.static final boolean
Default value oflocationGroupCountingActive
.static final int
Default value ofnoMaxTransportUnits
.static final boolean
Default value ofoutgoingActive
.static final int
Default value ofplcState
.private @Size(max=255) String
Description of theLocation
.private String
ERP code of theLocation
.private String
Some group theLocation
belongs to.private boolean
Signals the incoming state of theLocation
.ALocation
can be assigned to a particular labels.private LocalDateTime
Date of last movement.private LocationGroup
TheLocationGroup
theLocation
belongs to.private Boolean
private @NotNull LocationPK
Unique natural key.private LocationType
TheLocationType
theLocation
belongs to.private BigDecimal
Maximum allowed weight on theLocation
.StoredMessage
s on theLocation
.private int
Maximum number ofTransportUnit
s allowed on theLocation
.private boolean
Signals the outgoing state of theLocation
.private String
PLC code of theLocation
.private int
The PLC is able to change the state of aLocation
.private Integer
Sort order index used by strategies for putaway, or picking.private String
Might be assigned to a particular zone in stock.static final String
Table name.Fields inherited from class org.ameba.integration.jpa.ApplicationEntity
C_ID
-
Constructor Summary
ModifierConstructorDescriptionprotected
Location()
Dear JPA...protected
Location
(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 TypeMethodDescriptionboolean
addMessage
(Message message) Add a newMessage
to this Location.boolean
Checks whether thisLocation
belongs NOT to aLocationGroup
.boolean
Checks whether thisLocation
belongs to aLocationGroup
.static Location
create
(LocationPK locationId) Create a new Location with the business key.boolean
Return theAccount
thisLocation
is 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 theLocationGroup
where 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 ofMessage
s stored for the Location.int
Returns the maximum number ofTransportUnit
s allowed on the Location.Get the PLC Code of the Location.int
Return the current set plc state.Get the sortOrder.Returns the stockZone.int
hashCode()
boolean
Check if the Location has alocationId
set.boolean
Determine whether the Location is considered during allocation.boolean
Determine whether incoming mode is activated andTransportUnit
s can be put on this Location.boolean
Check whether infeed is blocked and movingTransportUnit
s to here is forbidden.boolean
Determine whether the Location is part of the parentLocationGroup
s calculation procedure ofTransportUnit
s.boolean
Determine whether outgoing mode is activated andTransportUnit
s can leave this Location.boolean
Check whether outfeed is blocked and movingTransportUnit
s from here is forbidden.boolean
removeMessages
(Message... msgs) Remove one or moreMessage
s from this Location.void
setClassification
(String classification) Set the classification.void
setDescription
(String description) Set the description text of the Location.void
setInfeed
(boolean infeedActive) Set the incoming mode of this Location.void
Set a list of labels to the Location.void
setLastMovement
(LocalDateTime lastMovement) Change the date when a TransportUnit was put or left the Location the last time.(package private) void
setLocationGroup
(LocationGroup locationGroup) Add thisLocation
to the locationGroup.void
setLocationGroupCountingActive
(boolean locationGroupCountingActive) Define whether or not the Location shall be considered in countingTransportUnit
s of the parentLocationGroup
.void
setLocationType
(LocationType locationType) void
setOutfeed
(boolean outfeedActive) Set the outfeed mode of this Location.void
setPersistentKey
(String pKey) Required for the Mapper.void
setPlcState
(int plcState) Set the plc state.toString()
Return theLocationPK
as String.(package private) void
Set the locationGroup to null.Methods inherited from class org.ameba.integration.jpa.ApplicationEntity
getPersistentKey, hasPersistentKey, onEntityPersist, onPersist
Methods 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
TheLocation
might 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
ALocation
can be assigned to a particular labels. -
noMaxTransportUnits
private int noMaxTransportUnitsMaximum number ofTransportUnit
s 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 aTransportUnit
is moving to or away from theLocation
,lastMovement
is updated. This is useful to get the history ofTransportUnit
s as well as for inventory calculation. -
locationGroupCountingActive
Shall theLocation
be included in the calculation ofTransportUnit
s of the parentLocationGroup
.- true :
Location
is included in calculation ofTransportUnit
s. - false:
Location
is not included in calculation ofTransportUnit
s.
- 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
.Location
s which are blocked for incoming movements do not acceptTransportUnit
s.- true :
Location
is ready to pick upTransportUnit
s. - false:
Location
is locked, and cannot pick upTransportUnit
s.
- true :
-
DEF_INCOMING_ACTIVE
public static final boolean DEF_INCOMING_ACTIVEDefault value ofincomingActive
.- See Also:
-
outgoingActive
private boolean outgoingActiveSignals the outgoing state of theLocation
.Location
s which are blocked for outgoing do not accept to moveTransportUnit
s away.- true :
Location
is enabled for outgoingTransportUnit
s. - false:
Location
is locked,TransportUnit
s 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 theLocation
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.
- true : The
-
DEF_CONSIDERED_IN_ALLOCATION
public static final boolean DEF_CONSIDERED_IN_ALLOCATIONDefault value ofconsideredInAllocation
.- See Also:
-
locationType
TheLocationType
theLocation
belongs to. -
group
Some group theLocation
belongs to. -
classification
TheLocation
may be classified, like 'hazardous'. -
locationGroup
TheLocationGroup
theLocation
belongs to. -
messages
StoredMessage
s 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:
setPersistentKey
in classorg.ameba.integration.jpa.ApplicationEntity
-
hasLocationId
public boolean hasLocationId()Check if the Location has alocationId
set.- Returns:
- true if so
-
getAccount
Return theAccount
thisLocation
is 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 newMessage
to 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 andTransportUnit
s 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 movingTransportUnit
s 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 theLocationGroup
where the Location belongs to.- Returns:
- The
LocationGroup
of the Location
-
isLocationGroupCountingActive
public boolean isLocationGroupCountingActive()Determine whether the Location is part of the parentLocationGroup
s calculation procedure ofTransportUnit
s.- 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 ofMessage
s stored for the Location.- Returns:
- An unmodifiable Set
-
getNoMaxTransportUnits
public int getNoMaxTransportUnits()Returns the maximum number ofTransportUnit
s allowed on the Location.- Returns:
- The maximum number of
TransportUnit
s
-
isOutfeedActive
public boolean isOutfeedActive()Determine whether outgoing mode is activated andTransportUnit
s can leave this Location.- Returns:
- true when outgoing mode is activated, otherwise false
-
isOutfeedBlocked
public boolean isOutfeedBlocked()Check whether outfeed is blocked and movingTransportUnit
s 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 moreMessage
s from this Location.- Parameters:
msgs
- An array ofMessage
s to be removed- Returns:
- true if the
Message
s were found and removed, otherwise false - Throws:
IllegalArgumentException
- when messages is null
-
setLocationGroup
Add thisLocation
to the locationGroup. When the argument is null an existingLocationGroup
is removed from theLocation
.- Parameters:
locationGroup
- TheLocationGroup
to be assigned
-
setLocationGroupCountingActive
public void setLocationGroupCountingActive(boolean locationGroupCountingActive) Define whether or not the Location shall be considered in countingTransportUnit
s of the parentLocationGroup
.- Parameters:
locationGroupCountingActive
- true if considered, otherwise false
-
belongsToLocationGroup
public boolean belongsToLocationGroup()Checks whether thisLocation
belongs to aLocationGroup
.- Returns:
- true if it belongs to a
LocationGroup
, otherwise false
-
belongsNotToLocationGroup
public boolean belongsNotToLocationGroup()Checks whether thisLocation
belongs 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:
equals
in classorg.ameba.integration.jpa.ApplicationEntity
-
hashCode
public int hashCode()Only use the unique natural key for hashCode calculation.
- Overrides:
hashCode
in classorg.ameba.integration.jpa.ApplicationEntity
-
toString
Return theLocationPK
as String.
-