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 Details

    • order

      @NotNull(message="{owms.wms.shp.order}", groups=Create.class) private @NotNull(message="{owms.wms.shp.order}",groups=Create.class) ShippingOrder order
      The 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 positionNo
      The position number is a unique index within a single Order instance.
    • orderState

      @NotNull private @NotNull OrderState orderState
      Current position state.
    • locked

      private boolean locked
      Property to lock/unlock a Position. This is usually done via the Order.
      • true: locked
      • false: unlocked
      Default is false
    • priority

      private int priority
      Current priority of the Position.
    • latestDueDate

      private ZonedDateTime latestDueDate
      Latest finish date of this Position - inherited from the Order.
    • problem

      private Problem problem
      Latest problem that is occurred on this Position.
    • earliestStartDate

      private ZonedDateTime earliestStartDate
      Date when the Position should be started earliest - inherited from the Order.
    • startMode

      @NotNull private @NotNull OrderStartMode startMode
      Defines how the Position is started - inherited from the Order.
    • sourceLocationGroupNames

      @Size(max=1024) private @Size(max=1024) List<String> sourceLocationGroupNames
      A list of LocationGroup names where the demanded quantity for the position shall be search in.
    • target

      private Target target
      Target Location or LocationGroup where the Position should be delivered to.
    • nextAllocationDate

      private ZonedDateTime 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 Order
      positionNo - The position number
  • Method Details

    • setPersistentKey

      public void setPersistentKey(String pKey)
      Overrides:
      setPersistentKey in class org.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 this ShippingOrderPosition.
      Parameters:
      translator - An instance of Translator to translate messages
      orderState - 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 a startMode set or not.
      Returns:
      true if startMode is set otherwise false
    • getDetails

      public abstract Map<String,String> getDetails()
      Get the arbitrary details of the Position.
      Returns:
      The details as Map
    • setDetails

      public abstract void setDetails(Map<String,String> details)
      Set arbitrary details for the Position.
      Parameters:
      details - The details to set as Map
    • addSplits

      public abstract void addSplits(List<S> splits)
      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

      public abstract Set<S> getOrderPositionSplits()
      Get all created OrderPositionSplits that belong to this Position.
      Returns:
      The splits as Set
    • setOrderPositionSplits

      public abstract void setOrderPositionSplits(Set<S> orderPositionSplits)
      Set the OrderPositionSplits of this Position.
      Parameters:
      orderPositionSplits - The splits to set
    • equals

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

      public int hashCode()
      No splits.
      Overrides:
      hashCode in class org.ameba.integration.jpa.ApplicationEntity
    • toString

      public String toString()
      Combination of orderId / positionNo
      Overrides:
      toString in class Object
    • 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

      public OrderState getOrderState()
    • setOrderState

      public void setOrderState(OrderState orderState)
    • isLocked

      public boolean isLocked()
    • setLocked

      public void setLocked(boolean locked)
    • getPriority

      public int getPriority()
    • setPriority

      public void setPriority(int priority)
    • getLatestDueDate

      public ZonedDateTime getLatestDueDate()
    • setLatestDueDate

      public void setLatestDueDate(ZonedDateTime latestDueDate)
    • getProblem

      public Problem getProblem()
    • setProblem

      public void setProblem(Problem problem)
    • getEarliestStartDate

      public ZonedDateTime getEarliestStartDate()
    • setEarliestStartDate

      public void setEarliestStartDate(ZonedDateTime earliestStartDate)
    • getStartMode

      public OrderStartMode getStartMode()
    • setStartMode

      public void setStartMode(OrderStartMode startMode)
    • getSourceLocationGroupNames

      @Size(max=1024) public @Size(max=1024) List<String> getSourceLocationGroupNames()
    • setSourceLocationGroupNames

      public void setSourceLocationGroupNames(@Size(max=1024) @Size(max=1024) List<String> sourceLocationGroupNames)
    • getTarget

      public Target getTarget()
    • setTarget

      public void setTarget(Target target)
    • getNextAllocationDate

      public ZonedDateTime getNextAllocationDate()
    • setNextAllocationDate

      public void setNextAllocationDate(ZonedDateTime nextAllocationDate)