Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#100 improve performance qoh job #111

Merged
merged 6 commits into from
Oct 4, 2015
Prev Previous commit
Next Next commit
added some documentation to describe conditions under which the job i…
…s triggered
  • Loading branch information
jmiranda committed Oct 4, 2015
commit c9d338a254eb31f3899ef218ff025b6b1281c5da
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,35 @@ class CalculateQuantityJob {

// System uses yesterday by default if a date is not provided
if (!date) {
log.info "Date is being set to yesterday"
log.info "Date is being set to midnight tonight"
date = new Date()
date.clearTime()
//date.clearTime()
}

log.info "Executing calculate quantity job for date=${date}, user=${user}, location=${location}, product=${product}, mergedJobDataMap=${context.mergedJobDataMap}"


// Triggered ??
if (product && date && location) {
println "Triggered calculate quantity job for product ${product} at ${location} on ${date}"
inventoryService.createOrUpdateInventorySnapshot(date, location, product)
}
// Triggered by the inventory snapshot tab off the product page
else if (product && location) {
println "Triggered calculate quantity job for product ${product} at ${location} on ${date}"
inventoryService.createOrUpdateInventorySnapshot(location, product)
}
// Triggered by the Inventory Snapshot page
else if (date && location) {
println "Triggered calculate quantity job for all products at ${location} on ${date}"
inventoryService.createOrUpdateInventorySnapshot(date, location)
inventoryService.createOrUpdateInventoryItemSnapshot(date, location)
}
// Triggered by the CalculateQuantityJob
else if (date) {
println "Triggered calculate quantity job for all locations and products on ${date}"
inventoryService.createOrUpdateInventorySnapshot(date)
inventoryService.createOrUpdateInventoryItemSnapshot(date)
}
else if (location) {
println "Triggered calculate quantity job for all products at location ${location} over all dates"
inventoryService.createOrUpdateInventorySnapshot(location)
}
else {
println "Triggered calculate quantity job for all dates, locations, products"
def transactionDates = inventoryService.getTransactionDates()
Expand Down