@groovy.util.logging.Slf4j @groovy.lang.Singleton @java.lang.SuppressWarnings(value: GrMethodMayBeStatic) class OrderService extends java.lang.Object
This service provided methods to manipulate orders in SimpleMES. This contains the core business logic for orders. This provides methods to release an order for production and close an order when completed early.
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
ACTION_RELEASE_LSN |
The ActionLog entry used for Release LSN actions. |
static java.lang.String |
ACTION_RELEASE_ORDER |
The ActionLog entry used for Release order actions. |
Type | Name and description |
---|---|
private long |
lastLogTime The time the last log warning message was triggered. |
Constructor and description |
---|
OrderService
() |
Type Params | Return Type | Name and description |
---|---|---|
|
java.util.List<java.lang.String> |
archiveOld(BigDecimal ageDays, java.lang.Long maxOrdersPerTxn, java.lang.Integer maxTxns) Archive old, done orders based on the date that they were completed. |
|
void |
delete(Order order) Deletes the given order and related records. |
|
java.util.List<WorkableInterface> |
determineQtyStates(Order order) Finds all places the given order is in queue or in work. |
|
java.util.List<WorkableInterface> |
determineQtyStates(LSN lsn) Finds all places the given LSN is in queue or in work. |
|
OrderReleaseResponse |
release(OrderReleaseRequest orderReleaseRequest) Release the given order for production. |
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() |
The ActionLog entry used for Release LSN actions.
The ActionLog entry used for Release order actions.
Archive old, done orders based on the date that they were completed. There are options for the age (days) and the max number of orders to archive in one batch (transaction). There is also an option to limit the number batches archived at a time. This last option is used to limit the slowdown from archiving during 'catch-up' scenarios when archiving has not been run recently. Values that exceed the maximum will be ignored and the maximum will be used.
This method is typically called automatically once per day using the job scheduler.Note: This method creates new transactions when archiving each batch of records. If called from within an existing transaction, then no new transactions will be created.
ageDays
- Any orders completed more than this number of days in the past are eligible for archive.
If 0 (default), then the config setting org.simplemes.eframe.archive.ageDays is used.
Fractions allowed. Default: 100maxOrdersPerTxn
- The max number of orders to archive per transaction. Default: 100. Maximum: 500.maxTxns
- The max number of orders to archive per transaction. Default: 5. Maximum: 50.Deletes the given order and related records. There is no confirmation for this delete. It relies on the Order#findRelatedRecords()#findRelatedRecords()
order
- The order to delete.Finds all places the given order is in queue or in work.
order
- The order to query.Finds all places the given LSN is in queue or in work.
lsn
- The LSN to query.Release the given order for production. The order cannot be worked on the shop floor until it is released. This method makes the quantity released available for production by queueing it the appropriate entry point (first operation if there is a routing needed).
Note: This method is part of the Stable API.
orderReleaseRequest
- The details of the release request (order and qty).Groovy Documentation