@groovy.transform.Trait trait WorkStateTrait extends java.lang.Object
Provides the Domain classes with a generic Work State. This object holds the work state of an operation or an overall object (e.g. Order or LSN). This work state contains the quantities in queue, work and done.
This abstract base class provides the basic quantity fields and interface methods. Sub-classes will normally provide foreign keys to link this work state to the parent object (e.g. Order or LSN).Note: Implementers of this trait should provide a meaningful toString() method (used for error messages).
Type | Name and description |
---|---|
java.util.Date |
dateFirstQueued |
java.util.Date |
dateFirstStarted |
java.util.Date |
dateQtyQueued |
java.util.Date |
dateQtyStarted |
BigDecimal |
qtyDone |
BigDecimal |
qtyInQueue |
BigDecimal |
qtyInWork |
Constructor and description |
---|
WorkStateTrait
() |
Type Params | Return Type | Name and description |
---|---|---|
|
BigDecimal |
completeQty(BigDecimal qty) Completes the given qty at this order (top-level) location. |
|
java.util.Date |
getDateFirstQueued() |
|
java.util.Date |
getDateFirstStarted() |
|
java.util.Date |
getDateQtyQueued() |
|
java.util.Date |
getDateQtyStarted() |
|
BigDecimal |
getQtyDone() |
|
BigDecimal |
getQtyInQueue() |
|
BigDecimal |
getQtyInWork() |
|
void |
queueQty(BigDecimal qty, java.util.Date dateTime) Queues the given qty at this workable. |
|
BigDecimal |
reverseCompleteQty(BigDecimal qty, java.util.Date dateTime) Reverses the complete of work on an Order/LSN. |
|
BigDecimal |
reverseStartQty(BigDecimal qty, java.util.Date dateTime) Reverses the start of work on an Order/LSN. |
|
void |
saveChanges() Implementers must provide a save() method. |
|
void |
setDateFirstQueued(java.util.Date dateFirstQueued) |
|
void |
setDateFirstStarted(java.util.Date dateFirstStarted) |
|
void |
setDateQtyQueued(java.util.Date dateQtyQueued) |
|
void |
setDateQtyStarted(java.util.Date dateQtyStarted) |
|
java.lang.Object |
setDatesAsNeeded(java.util.Date dateTime) Sets the dates queued/started if the appropriate qty is non-zero. |
|
void |
setQtyDone(BigDecimal qtyDone) |
|
void |
setQtyInQueue(BigDecimal qtyInQueue) Basic setter. |
|
void |
setQtyInWork(BigDecimal qtyInWork) Basic setter. |
|
BigDecimal |
startQty(BigDecimal qty, java.util.Date dateTime) Starts the given qty at this order (top-level) location. |
|
BigDecimal |
validateCompleteQty(BigDecimal qty) Validates that the given qty can be completed at this workable location. |
|
BigDecimal |
validateReverseCompleteQty(BigDecimal qty) Validates that the given qty can be reverse completed at this workable location. |
|
BigDecimal |
validateStartQty(BigDecimal qty) Validates that the given qty can be started at this workable location. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Completes the given qty at this order (top-level) location. This moves the qty from 'in work' to 'done'.
qty
- The quantity to complete. Default: all quantity in workQueues the given qty at this workable. This method does not trigger the save() on the workable element.
qty
- The quantity to queue.dateTime
- The date/time this qty is queued (Default: now).Reverses the complete of work on an Order/LSN. This moves the in work qty back to in queue.
qty
- The quantity to reverse the complete for.dateTime
- The date/time this qty completed is reversed (Default: now).Reverses the start of work on an Order/LSN. This moves the in work qty back to in queue.
qty
- The quantity to reverse the start for.dateTime
- The date/time this qty start is reversed (Default: now).Implementers must provide a save() method. This should save() changes to the record.
Sets the dates queued/started if the appropriate qty is non-zero.
dateTime
- The date/time this qty is started (Default: now).Basic setter. Also sets the dateFirstQueued is needed.
qtyInQueue
- The qty.Basic setter. Also sets the dateFirstStarted is needed.
qtyInWork
- The qty.Starts the given qty at this order (top-level) location. This moves the qty from 'in queue' to 'in work'. Saves the changes to the order.
qty
- The quantity to start (Default: all quantity in queue).dateTime
- The date/time this qty is started (Default: now).Validates that the given qty can be completed at this workable location.
qty
- The quantity to complete. Default: all quantity in workValidates that the given qty can be reverse completed at this workable location.
qty
- The quantity to reverse complete. Default: all quantity doneValidates that the given qty can be started at this workable location.
qty
- The quantity to start. Default: all quantity in queue