public class AdminOrderBatchMgr extends AdminBatchBaseMgr
Modifier and Type | Class and Description |
---|---|
protected class |
AdminOrderBatchMgr.OrderProdList
A return object containing a list of OrderProducts and the last OrderId processed
|
protected class |
AdminOrderBatchMgr.OrderProdStatus
Object stored in the hash maps
|
AdminBatchBaseMgr.CustTagCounter
AdminBaseMgr.StaticData
log
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, debugStackTraceExclusions, kkAdminPropsFilePath, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
Constructor and Description |
---|
AdminOrderBatchMgr(KKAdminIf eng) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createInvoicesBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr)
The method creates invoices for all orders that currently have a null invoice_filename.
|
java.lang.String |
freeReservedPointsBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr,
java.lang.String orderSearchStateIdsStr,
java.lang.String numMinutesStr,
java.lang.String orderEndStateIdStr)
FreeReservedPointsBatch is used to free up a customer's reward points that were reserved
after an order was confirmed, but have never been deleted or freed since the order was never
paid for or cancelled.
|
protected com.konakart.db.KKCriteria |
getfreeReservedPointsOrderCriteria(int size,
int numMinutes,
int[] orderSearchStateIdArray)
Create a criteria object for reading orders that have reserved points
|
protected com.konakart.db.KKCriteria |
getInvoiceOrderCriteria(int size)
Create a criteria object for reading the Orders for creating invoices
|
protected AdminOrder[] |
getOrderArrayFromList(java.util.List<AdminOrder> ordersForCustomer)
Creates an array of Orders from a list.
|
protected AdminOrderProduct[] |
getOrderProdArrayFromList(java.util.List<AdminOrderProduct> opForOrderList)
Creates an array of Order Products from a list.
|
protected com.konakart.db.KKCriteria |
getOrderProductCriteria(int size)
Create a criteria object for reading the OrderProducts
|
protected AdminOrderBatchMgr.OrderProdList |
getOrderProducts(com.konakart.db.KKCriteria c,
int orderId,
java.util.HashMap<java.lang.String,AdminOrderBatchMgr.OrderProdStatus> skuHM,
java.util.HashMap<java.lang.Integer,AdminOrderBatchMgr.OrderProdStatus> idHM)
The method returns null when all of the order products have been read.
|
protected java.util.List<AdminOrder> |
getOrdersForCriteria(com.konakart.db.KKCriteria c)
The method returns null when all of the orders have been read.
|
protected com.konakart.db.KKCriteria |
getRemoveOrdersCriteria(int size,
int numDays,
int[] orderStates)
Create a criteria object for reading orders to remove
|
protected java.util.List<AdminOrder> |
getReservedPointsOrders(com.konakart.db.KKCriteria c)
The method returns null when all of the orders have been read.
|
protected com.konakart.db.KKCriteria |
getUnpaidOrderCriteria(int size,
int numDays,
int[] validOrderStates)
Create a criteria object for reading unpaid orders
|
protected java.util.List<AdminOrder> |
getUnpaidOrders(com.konakart.db.KKCriteria c)
The method returns null when all of the orders have been read.
|
java.lang.String |
productAvailabilityNotificationBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr,
java.lang.String emailTemplateName,
java.lang.String numEmailThreadsStr)
The method detects orders that haven't been fully delivered because one or more products were
out of stock when the order was placed.
|
java.lang.String |
recurringBillingBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr)
The method loops through all active subscriptions that have a next billing date set to the
current date.
|
java.lang.String |
removeOrdersBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String numDaysStr,
java.lang.String orderStatesStr)
Removes orders older than a specified number of dates that are in one of the specified order
statuses.
|
protected void |
sendProductAvailabilityEmail(java.io.BufferedWriter bw,
AdminOrderMgrIf orderMgr,
AdminCustomerMgrIf custMgr,
AdminOrderProduct[] opArray,
com.konakart.db.KKCriteria selectCrit,
com.konakart.db.KKCriteria updateCrit,
java.lang.String templateName,
java.util.concurrent.ExecutorService executor)
protected method to send the mail and then reset the order products
|
protected void |
sendUnpaidOrderEmail(java.io.BufferedWriter bw,
AdminOrderMgrIf orderMgr,
AdminCustomerMgrIf custMgr,
AdminOrder[] orderArray,
com.konakart.db.KKCriteria selectCrit,
com.konakart.db.KKCriteria updateCrit,
java.lang.String templateName,
java.util.concurrent.ExecutorService executor,
int newState)
protected method to send the eMail and then change the order states.
|
protected void |
setOrderProductState(AdminOrderProduct[] orderProds,
int newState,
com.konakart.db.KKCriteria selectCrit,
com.konakart.db.KKCriteria updateCrit)
Set the state of the list of order products passed in.
|
protected void |
setOrderState(AdminOrder[] orders,
int newState,
com.konakart.db.KKCriteria selectCrit,
com.konakart.db.KKCriteria updateCrit)
Set the state of the list of orders passed in.
|
java.lang.String |
unpaidOrderNotificationBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr,
java.lang.String emailTemplateName,
java.lang.String numEmailThreadsStr,
java.lang.String numDaysStr,
java.lang.String validOrderStatesStr,
java.lang.String newStateStr)
An email is sent to all customers when a number of days has passed since they submitted their
order and the order is not in one of the valid order states.
|
ensureCustomerTagIsPresent, getAdEngConf, getAdminJsonEngine, getBatchLogName, getBoolean, getCustomerTagsHash, getInt, getIntArray, getIntArray, getLiteCustomerCriteria, getLiteCustomers, getLogName, getOrders, getSkuForProduct, insertOrUpdateCustomerTag, trimMultiTag, validateTemplate
addInsertAttr, addInsertAttr, addStringRuleConstraint, addStringRuleConstraint, checkAPICallEnabled, checkIntInRange, checkIntIsSet, checkRequired, executeQuery, executeQuery, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminContentMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustPwdHistMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminEngineCacheMgr, getAdminEventMgr, getAdminExecuteMgr, getAdminFileMgr, getAdminFilterMgr, getAdminHtmlMgr, getAdminImportMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminMiscPriceMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminServletMgr, getAdminShipmentMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminSuggestionMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getDebugStackTraceExclusions, getEmailThreadGracefulShutdownTimeout, getExportMgr, getExportMgr, getExportXMLData, getIntFromString, getKkAdminPropsFilePath, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getNewCriteria, getNewCriteria, getOtherModuleByName, getPostSearchText, getPreSearchText, getProductsToCategoresCriteria, getPropertyValue, getPropertyValue, getPropertyValueAsBool, getPropertyValueAsInt, getPropertyValueAsLong, getRecordCount, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, insertKKEvent, insertKKEvent, isBusiness, isBusinessOrEnterprise, isCommunity, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareCustomersOrProducts, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, isUnix, isWindows, manageException, manageThrowable, refreshConfigs, removeCData, sendMQMessages, setAdminEng, setDebugStackTraceExclusions, setKkAdminPropsFilePath, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr, updateStaticVariablesNow
public AdminOrderBatchMgr(KKAdminIf eng) throws java.lang.Exception
eng
- the engjava.lang.Exception
- an unexpected exceptionpublic java.lang.String unpaidOrderNotificationBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr, java.lang.String emailTemplateName, java.lang.String numEmailThreadsStr, java.lang.String numDaysStr, java.lang.String validOrderStatesStr, java.lang.String newStateStr) throws java.lang.Exception
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.emailTemplateName
- The name of the eMail template if the batch involves sending eMails to customers.
The name should not include the extension or the underscore+country code. i.e. It
should be myTemplate rather than myTemplate_en.vm. The country code and file
extension will be added automatically.numEmailThreadsStr
- If the batch involves sending eMails to customers, this determines how many eMail
sender threads are used. It defaults to 5.numDaysStr
- The number of days that needs to have passed before a mail is sentvalidOrderStatesStr
- An array of integers that determine valid order states. If the order is in a valid
state then a mail is not sent. They are in a format "1-4-7" where "-" is the
delimiter.newStateStr
- The state that the order should be set to once a mail has been sent.java.lang.Exception
- an unexpected exceptionpublic java.lang.String productAvailabilityNotificationBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr, java.lang.String emailTemplateName, java.lang.String numEmailThreadsStr) throws java.lang.Exception
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.emailTemplateName
- The name of the eMail template if the batch involves sending eMails to customers.
The name should not include the extension or the underscore+country code. i.e. It
should be myTemplate rather than myTemplate_en.vm. The country code and file
extension will be added automatically.numEmailThreadsStr
- If the batch involves sending eMails to customers, this determines how many eMail
sender threads are used. It defaults to 5.java.lang.Exception
- an unexpected exceptionpublic java.lang.String createInvoicesBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr) throws java.lang.Exception
Once the invoice has been created the order is updated with the name of the filename of the invoice.
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.java.lang.Exception
- an unexpected exceptionpublic java.lang.String recurringBillingBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr) throws java.lang.Exception
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.java.lang.Exception
- an unexpected exceptionprotected AdminOrderProduct[] getOrderProdArrayFromList(java.util.List<AdminOrderProduct> opForOrderList)
opForOrderList
- the opForOrderListprotected AdminOrder[] getOrderArrayFromList(java.util.List<AdminOrder> ordersForCustomer)
ordersForCustomer
- the ordersForCustomerprotected void sendUnpaidOrderEmail(java.io.BufferedWriter bw, AdminOrderMgrIf orderMgr, AdminCustomerMgrIf custMgr, AdminOrder[] orderArray, com.konakart.db.KKCriteria selectCrit, com.konakart.db.KKCriteria updateCrit, java.lang.String templateName, java.util.concurrent.ExecutorService executor, int newState) throws java.lang.Exception
bw
- the bworderMgr
- the orderMgrcustMgr
- the custMgrorderArray
- the orderArrayselectCrit
- the selectCritupdateCrit
- the updateCrittemplateName
- the templateNameexecutor
- the executornewState
- the newStatejava.lang.Exception
- an unexpected exceptionprotected void sendProductAvailabilityEmail(java.io.BufferedWriter bw, AdminOrderMgrIf orderMgr, AdminCustomerMgrIf custMgr, AdminOrderProduct[] opArray, com.konakart.db.KKCriteria selectCrit, com.konakart.db.KKCriteria updateCrit, java.lang.String templateName, java.util.concurrent.ExecutorService executor) throws java.lang.Exception
bw
- the bworderMgr
- the orderMgrcustMgr
- the custMgropArray
- the opArrayselectCrit
- the selectCritupdateCrit
- the updateCrittemplateName
- the templateNameexecutor
- the executorjava.lang.Exception
- an unexpected exceptionprotected java.util.List<AdminOrder> getUnpaidOrders(com.konakart.db.KKCriteria c) throws java.lang.Exception
c
- the cjava.lang.Exception
- an unexpected exceptionprotected java.util.List<AdminOrder> getOrdersForCriteria(com.konakart.db.KKCriteria c) throws java.lang.Exception
c
- the cjava.lang.Exception
- an unexpected exceptionprotected AdminOrderBatchMgr.OrderProdList getOrderProducts(com.konakart.db.KKCriteria c, int orderId, java.util.HashMap<java.lang.String,AdminOrderBatchMgr.OrderProdStatus> skuHM, java.util.HashMap<java.lang.Integer,AdminOrderBatchMgr.OrderProdStatus> idHM) throws java.lang.Exception
c
- the corderId
- We only fetch order products for orders with an id >= to thisskuHM
- the skuHMidHM
- the idHMjava.lang.Exception
- an unexpected exceptionprotected void setOrderProductState(AdminOrderProduct[] orderProds, int newState, com.konakart.db.KKCriteria selectCrit, com.konakart.db.KKCriteria updateCrit) throws org.apache.torque.TorqueException
orderProds
- the orderProdsnewState
- the newStateselectCrit
- the selectCritupdateCrit
- the updateCritorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)protected void setOrderState(AdminOrder[] orders, int newState, com.konakart.db.KKCriteria selectCrit, com.konakart.db.KKCriteria updateCrit) throws org.apache.torque.TorqueException
orders
- the ordersnewState
- the newStateselectCrit
- the selectCritupdateCrit
- the updateCritorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)protected com.konakart.db.KKCriteria getUnpaidOrderCriteria(int size, int numDays, int[] validOrderStates)
size
- the sizenumDays
- the numDaysvalidOrderStates
- the validOrderStatesprotected com.konakart.db.KKCriteria getOrderProductCriteria(int size)
size
- the sizeprotected com.konakart.db.KKCriteria getInvoiceOrderCriteria(int size)
size
- the sizepublic java.lang.String freeReservedPointsBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr, java.lang.String orderSearchStateIdsStr, java.lang.String numMinutesStr, java.lang.String orderEndStateIdStr) throws java.lang.Exception
If orderEndStateStr
is set then the order is moved into this state. Once the
reserved points have been returned to the customer, the pointsReservationId
attribute of the order is reset and the pointsRedeemed
attribute is set to zero.
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- This determines the maximum number of orders read in any one loop. It defaults to
100.orderSearchStateIdsStr
- Comma separated string containing numeric order state ids. We search only for
orders in these states that have pointReservation idsnumMinutesStr
- We only search for orders that are at least this number of minutes old.orderEndStateIdStr
- If given a numeric value, we change the order to this state once the points have
been freed.java.lang.Exception
- an unexpected exceptionprotected com.konakart.db.KKCriteria getfreeReservedPointsOrderCriteria(int size, int numMinutes, int[] orderSearchStateIdArray)
size
- the sizenumMinutes
- the numMinutesorderSearchStateIdArray
- the orderSearchStateIdArrayprotected java.util.List<AdminOrder> getReservedPointsOrders(com.konakart.db.KKCriteria c) throws java.lang.Exception
c
- the cjava.lang.Exception
- an unexpected exceptionpublic java.lang.String removeOrdersBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String numDaysStr, java.lang.String orderStatesStr) throws java.lang.Exception
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.numDaysStr
- The number of days that needs to have passed before orders are removedorderStatesStr
- An array of integers that determine the order states to remove.java.lang.Exception
- an unexpected exceptionprotected com.konakart.db.KKCriteria getRemoveOrdersCriteria(int size, int numDays, int[] orderStates)
size
- the sizenumDays
- the numDaysorderStates
- the orderStatesCopyright © 2018 DS Data Systems UK Ltd.