Package org.openwms.wms.shipping.impl
Class AbstractShippingOrderPosition<S extends AbstractShippingOrderPositionSplit>
java.lang.Object
org.ameba.integration.jpa.BaseEntity
org.ameba.integration.jpa.ApplicationEntity
org.openwms.wms.shipping.impl.AbstractShippingOrderPosition<S>
- All Implemented Interfaces:
Serializable
,org.ameba.integration.TypedEntity<Long>
- Direct Known Subclasses:
ShippingOrderPosition
,ShippingTransportUnitOrderPosition
@Entity
public abstract class AbstractShippingOrderPosition<S extends AbstractShippingOrderPositionSplit>
extends org.ameba.integration.jpa.ApplicationEntity
implements Serializable
A AbstractShippingOrderPosition.
- Author:
- Heiko Scherrer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ZonedDateTime
Date when the Position should be started earliest - inherited from the Order.private ZonedDateTime
Latest finish date of this Position - inherited from the Order.private boolean
Property to lock/unlock a Position.private ZonedDateTime
Date when the Position will be tried to be allocated next time.private @NotNull(message="{owms.wms.shp.order}",groups=Create.class) ShippingOrder
The Order instance, the position belongs to.private @NotNull OrderState
Current position state.private @NotNull(message="{owms.wms.shp.positionNo}",groups=Create.class) Integer
The position number is a unique index within a single Order instance.private int
Current priority of the Position.private Problem
Latest problem that is occurred on this Position.A list of LocationGroup names where the demanded quantity for the position shall be search in.private @NotNull OrderStartMode
Defines how the Position is started - inherited from the Order.private Target
Target Location or LocationGroup where the Position should be delivered to.Fields inherited from class org.ameba.integration.jpa.ApplicationEntity
C_ID
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Used by the JPA provider.protected
AbstractShippingOrderPosition
(@NotNull ShippingOrder order, @NotNull Integer positionNo) Create a new AbstractShippingOrderPosition with the mandatory attributes. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Add one or more Splits to this Position.void
changeOrderState
(org.ameba.i18n.Translator translator, org.springframework.context.ApplicationEventPublisher eventPublisher, OrderState orderState) Change the state of thisShippingOrderPosition
.void
changePriority
(int priority) Change the priority of the Position and of all Splitsboolean
No splits.Get the arbitrary details of the Position.int
Get the next assignable Split number.@NotNull(message="{owms.wms.shp.order}",groups=Create.class) ShippingOrder
getOrder()
Get all created OrderPositionSplits that belong to this Position.@NotNull(message="{owms.wms.shp.positionNo}",groups=Create.class) Integer
int
int
hashCode()
No splits.boolean
Check weather this Position has astartMode
set or not.abstract boolean
Check if the demand of this Position is fulfilled by the sum of all Splits.boolean
isLocked()
abstract void
setDetails
(Map<String, String> details) Set arbitrary details for the Position.void
setEarliestStartDate
(ZonedDateTime earliestStartDate) void
setLatestDueDate
(ZonedDateTime latestDueDate) void
setLocked
(boolean locked) void
setNextAllocationDate
(ZonedDateTime nextAllocationDate) void
setOrder
(@NotNull(message="{owms.wms.shp.order}",groups=Create.class) ShippingOrder order) abstract void
setOrderPositionSplits
(Set<S> orderPositionSplits) Set the OrderPositionSplits of this Position.void
setOrderState
(OrderState orderState) void
setPersistentKey
(String pKey) void
setPositionNo
(@NotNull(message="{owms.wms.shp.positionNo}",groups=Create.class) Integer positionNo) void
setPriority
(int priority) void
setProblem
(Problem problem) void
setSourceLocationGroupNames
(@Size(max=1024) List<String> sourceLocationGroupNames) void
setStartMode
(OrderStartMode startMode) void
toString()
Combination of orderId / positionNoMethods 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
-
order
@NotNull(message="{owms.wms.shp.order}", groups=Create.class) private @NotNull(message="{owms.wms.shp.order}",groups=Create.class) ShippingOrder orderThe Order instance, the position belongs to. -
positionNo
@NotNull(message="{owms.wms.shp.positionNo}", groups=Create.class) private @NotNull(message="{owms.wms.shp.positionNo}",groups=Create.class) Integer positionNoThe position number is a unique index within a single Order instance. -
orderState
Current position state. -
locked
private boolean lockedProperty to lock/unlock a Position. This is usually done via the Order.- true: locked
- false: unlocked
-
priority
private int priorityCurrent priority of the Position. -
latestDueDate
Latest finish date of this Position - inherited from the Order. -
problem
Latest problem that is occurred on this Position. -
earliestStartDate
Date when the Position should be started earliest - inherited from the Order. -
startMode
Defines how the Position is started - inherited from the Order. -
sourceLocationGroupNames
A list of LocationGroup names where the demanded quantity for the position shall be search in. -
target
Target Location or LocationGroup where the Position should be delivered to. -
nextAllocationDate
Date when the Position will be tried to be allocated next time.
-
-
Constructor Details
-
AbstractShippingOrderPosition
protected AbstractShippingOrderPosition()Used by the JPA provider. -
AbstractShippingOrderPosition
protected AbstractShippingOrderPosition(@NotNull @NotNull ShippingOrder order, @NotNull @NotNull Integer positionNo) Create a new AbstractShippingOrderPosition with the mandatory attributes.- Parameters:
order
- The OrderpositionNo
- The position number
-
-
Method Details
-
setPersistentKey
- Overrides:
setPersistentKey
in classorg.ameba.integration.jpa.ApplicationEntity
-
changePriority
public void changePriority(int priority) Change the priority of the Position and of all Splits- Parameters:
priority
- The new Priority
-
changeOrderState
public void changeOrderState(org.ameba.i18n.Translator translator, org.springframework.context.ApplicationEventPublisher eventPublisher, OrderState orderState) Change the state of thisShippingOrderPosition
.- Parameters:
translator
- An instance of Translator to translate messagesorderState
- The new order state to set- Throws:
org.ameba.exception.BusinessRuntimeException
- In case a state change is not allowed
-
getNextSplitNumber
public int getNextSplitNumber()Get the next assignable Split number.- Returns:
- Get 1 plus the number of Splits or start with 1 if no Splits are assigned
-
hasStartMode
public boolean hasStartMode()Check weather this Position has astartMode
set or not.- Returns:
- true if startMode is set otherwise false
-
getDetails
Get the arbitrary details of the Position.- Returns:
- The details as Map
-
setDetails
Set arbitrary details for the Position.- Parameters:
details
- The details to set as Map
-
addSplits
Add one or more Splits to this Position.- Parameters:
splits
- Splits to add
-
isAllocated
public abstract boolean isAllocated()Check if the demand of this Position is fulfilled by the sum of all Splits.- Returns:
- true if demand is fulfilled, otherwise false
-
getOrderPositionSplits
Get all created OrderPositionSplits that belong to this Position.- Returns:
- The splits as Set
-
setOrderPositionSplits
Set the OrderPositionSplits of this Position.- Parameters:
orderPositionSplits
- The splits to set
-
equals
No splits.- Overrides:
equals
in classorg.ameba.integration.jpa.ApplicationEntity
-
hashCode
public int hashCode()No splits.- Overrides:
hashCode
in classorg.ameba.integration.jpa.ApplicationEntity
-
toString
Combination of orderId / positionNo -
getOrder
@NotNull(message="{owms.wms.shp.order}", groups=Create.class) public @NotNull(message="{owms.wms.shp.order}",groups=Create.class) ShippingOrder getOrder() -
setOrder
public void setOrder(@NotNull(message="{owms.wms.shp.order}",groups=Create.class) @NotNull(message="{owms.wms.shp.order}",groups=Create.class) ShippingOrder order) -
getPositionNo
@NotNull(message="{owms.wms.shp.positionNo}", groups=Create.class) public @NotNull(message="{owms.wms.shp.positionNo}",groups=Create.class) Integer getPositionNo() -
setPositionNo
public void setPositionNo(@NotNull(message="{owms.wms.shp.positionNo}",groups=Create.class) @NotNull(message="{owms.wms.shp.positionNo}",groups=Create.class) Integer positionNo) -
getOrderState
-
setOrderState
-
isLocked
public boolean isLocked() -
setLocked
public void setLocked(boolean locked) -
getPriority
public int getPriority() -
setPriority
public void setPriority(int priority) -
getLatestDueDate
-
setLatestDueDate
-
getProblem
-
setProblem
-
getEarliestStartDate
-
setEarliestStartDate
-
getStartMode
-
setStartMode
-
getSourceLocationGroupNames
-
setSourceLocationGroupNames
-
getTarget
-
setTarget
-
getNextAllocationDate
-
setNextAllocationDate
-