Class DefaultOmsOrderFacade
java.lang.Object
de.hybris.platform.ordermanagementfacades.OmsBaseFacade
de.hybris.platform.ordermanagementfacades.order.impl.DefaultOmsOrderFacade
- All Implemented Interfaces:
OmsOrderFacade
- Direct Known Subclasses:
DefaultOmsB2bOrderFacade
Default implementation of
OmsOrderFacade-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapprovePotentiallyFraudulentOrder(String orderCode) API to approve a potentially fraudulent orderprotected OrderCancelRequestbuildOrderCancelRequest(OrderCancelRequestData orderCancelRequestData, OrderModel order) Builds anOrderCancelRequest.protected booleancanPerformFraudCheck(OrderModel order) Verifies if a fraud check can be performed on this order depending on its status.protected StringcreateGuestCustomerModel(CustomerData customerData) Create a guest CustomerModel fromCustomerDataprotected StringcreateGuestIfNotExisting(CustomerData customerData) FindCustomerModelbased on givenPrincipalData.getUid(), otherwise a new guest user will be created based onCustomerData.If thePrincipalData.getUid()exists, it extracts the existing user using this id, and ignores the otherCustomerData's properties provided in the request.createRequestOrderCancel(OrderCancelRequestData orderCancelRequestData) API to request a order cancelOrderCancelRequestprotected voidexecuteFraudCheckOperation(OrderModel order, Boolean fraudulent) Save the order with the new attribute value for fraudulent.protected voidexecuteManualReleaseStepOperation(OrderModel order, String event, OrderStatus orderStatus) Executes a manual release step for the given event by calling theBusinessProcessService.protected BaseSiteServiceprotected BaseStoreServiceprotected BusinessProcessServiceprotected CalculationServiceAPI to get all order cancel reasonsprotected Converter<CustomerData,CustomerModel> protected EnumerationServiceprotected Converter<FraudReportModel,FraudReportData> protected GenericDao<FraudReportModel>protected ImpersonationServiceprotected OrderByNullVersionIdPagedDaoprotected OrderCancelServiceprotected Converter<OrderModel,OrderData> getOrderEntriesForOrderCode(String orderCode, PageableData pageableData) API to get orderEntries for the givenAbstractOrderModel.CODEprotected Converter<OrderEntryModel,OrderEntryData> getOrderEntryForOrderCodeAndEntryNumber(String orderCode, Integer entryNumber) API to get an orderEntry by it's entryNumber and its order's codeprotected PagedGenericDao<OrderEntryModel>getOrderForCode(String orderCode) API to get an order by it's codegetOrderFraudReports(String orderCode) API to get an order's fraud reportsprotected Converter<OrderRequestData,OrderModel> getOrders(PageableData pageableData) API to get all orders in the systemgetOrdersByStatuses(PageableData pageableData, Set<OrderStatus> orderStatusSet) API to get all orders in the system that have certain status(es)protected SearchByStatusPagedGenericDao<OrderModel>protected OrderServiceAPI to get all order statusesprotected UserServiceprotected BooleanisCancelQuantityPossible(OrderCancelRequestData orderCancelRequestData, OrderModel order, UserModel user) check the given quantity is valid to cancelprotected BooleanisPartialCancel(OrderCancelRequestData orderCancelRequestData, OrderModel order) check if is a partial cancelprotected BooleanisPartialEntryCancel(OrderCancelRequestData orderCancelRequestData, OrderModel order) check if is a partial order entry cancelvoidmanuallyReleaseDeliveryCostCommit(String orderCode) API to manually commit delivery cost taxes and releaseOrderModelfrom waiting step.voidmanuallyReleasePaymentReauth(String orderCode) API to manually reauth payment and releaseOrderModelfrom waiting step.voidmanuallyReleasePaymentVoid(String orderCode) API to manually release void payment in waiting step.voidmanuallyReleaseTaxCommit(String orderCode) API to manually commit tax and releaseOrderModelfrom waiting step.voidmanuallyReleaseTaxRequote(String orderCode) API to manually requote tax and releaseOrderModelfrom waiting step.voidmanuallyReleaseTaxVoid(String orderCode) API to manually release void tax in waiting step.voidrejectPotentiallyFraudulentOrder(String orderCode) API to reject a potentially fraudulent ordervoidsetBaseSiteService(BaseSiteService baseSiteService) voidsetBaseStoreService(BaseStoreService baseStoreService) voidsetBusinessProcessService(BusinessProcessService businessProcessService) voidsetCalculationService(CalculationService calculationService) voidsetCustomerReverseConverter(Converter<CustomerData, CustomerModel> customerReverseConverter) voidsetEnumerationService(EnumerationService enumerationService) voidsetFraudReportConverter(Converter<FraudReportModel, FraudReportData> fraudReportConverter) voidsetFraudReportGenericDao(GenericDao<FraudReportModel> fraudReportGenericDao) voidsetImpersonationService(ImpersonationService impersonationService) voidsetOrderByNullVersionIdPagedDao(OrderByNullVersionIdPagedDao orderByNullVersionIdPagedDao) voidsetOrderCancelRecordEntryConverter(Converter<OrderCancelRecordEntryModel, OrderCancelRecordEntryData> orderCancelRecordEntryConverter) voidsetOrderCancelService(OrderCancelService orderCancelService) voidsetOrderConverter(Converter<OrderModel, OrderData> orderConverter) voidsetOrderEntryConverter(Converter<OrderEntryModel, OrderEntryData> orderEntryConverter) voidsetOrderEntryPagedGenericDao(PagedGenericDao<OrderEntryModel> orderEntryPagedGenericDao) voidsetOrderRequestReverseConverter(Converter<OrderRequestData, OrderModel> orderRequestReverseConverter) voidsetOrderSearchByStatusPagedDao(SearchByStatusPagedGenericDao<OrderModel> orderSearchByStatusPagedDao) voidsetOrderService(OrderService orderService) voidsetUserService(UserService userService) submitOrder(OrderRequestData orderRequestData) API to submit anOrderModelin the systemprotected OrderDatasubmitOrderInContext(OrderModel orderModel) prepare impersonation context and submit ordersubmitValidatedOrder(OrderRequestData orderRequestData) submit order after the validation appliedprotected voidvalidateAddressData(AddressData addressData) Validates for null check and essential fields inAddressDataprotected voidvalidateBaseStoreInSite(String storeUid, String siteUid) protected voidValidates for null check and mandatory fields in OrderCancelEntryDataprotected voidvalidateOrderData(OrderRequestData orderRequestData) Validates for null check and essential fields inOrderRequestDataprotected voidvalidateOrderEntryRequestData(List<OrderEntryRequestData> orderEntryRequestData) Validates for null check and essential fields inOrderEntryRequestDataprotected voidvalidatePaymentTransactions(List<PaymentTransactionData> paymentTransactionDatas) Validates for null check and essential fields inPaymentTransactionDataIf PaymentTransactions not provide correctly, manual refund payment action may require during the return processprotected voidvalidateReturnRequestData(OrderCancelRequestData orderCancelRequestData) Validates for null check and mandatory fields in OrderCancelRequestDataprotected voidvalidateUserData(CustomerData customerData) Validates for essential fields to assignUserModelto the submittedOrderModelMethods inherited from class de.hybris.platform.ordermanagementfacades.OmsBaseFacade
convertSearchPageData, createPaginationData, discardOrderSnapshot, getModelService, getOrderGenericDao, getOrderModelForCode, setModelService, setOrderGenericDao
-
Field Details
-
ORDER_EVENT_NAME
- See Also:
-
MANUAL_VOID_PAYMENT_EVENT
- See Also:
-
MANUAL_VOID_TAX_EVENT
- See Also:
-
MANUAL_COMMIT_TAX_EVENT
- See Also:
-
MANUAL_REQUOTE_TAX_EVENT
- See Also:
-
MANUAL_REAUTH_PAYMENT_EVENT
- See Also:
-
MANUAL_DELIVERY_COST_COMMIT_EVENT
- See Also:
-
-
Constructor Details
-
DefaultOmsOrderFacade
public DefaultOmsOrderFacade()
-
-
Method Details
-
getOrders
Description copied from interface:OmsOrderFacadeAPI to get all orders in the system- Specified by:
getOrdersin interfaceOmsOrderFacade- Parameters:
pageableData- pageable object that contains info on the number or pages and how many items in each page in addition the sorting info- Returns:
- SearchPageData that contains a list of orders
-
getOrderForCode
Description copied from interface:OmsOrderFacadeAPI to get an order by it's code- Specified by:
getOrderForCodein interfaceOmsOrderFacade- Parameters:
orderCode- the order's code- Returns:
- the order
-
getOrdersByStatuses
public SearchPageData<OrderData> getOrdersByStatuses(PageableData pageableData, Set<OrderStatus> orderStatusSet) Description copied from interface:OmsOrderFacadeAPI to get all orders in the system that have certain status(es)- Specified by:
getOrdersByStatusesin interfaceOmsOrderFacade- Parameters:
pageableData- pageable object that contains info on the number or pages and how many items in each page in addition the sorting infoorderStatusSet- set of order status(s) in which we want to get list of orders for- Returns:
- SearchPageData that contains a list of orders that complies with passed order status(es)
-
getOrderStatuses
Description copied from interface:OmsOrderFacadeAPI to get all order statuses- Specified by:
getOrderStatusesin interfaceOmsOrderFacade- Returns:
- a list of
OrderStatus
-
getOrderEntriesForOrderCode
public SearchPageData<OrderEntryData> getOrderEntriesForOrderCode(String orderCode, PageableData pageableData) Description copied from interface:OmsOrderFacadeAPI to get orderEntries for the givenAbstractOrderModel.CODE- Specified by:
getOrderEntriesForOrderCodein interfaceOmsOrderFacade- Parameters:
orderCode- the order's codepageableData- pageable object that contains info on the number or pages and how many items in each page in addition the sorting info- Returns:
- SearchPageData that contains a list of the orderEntries for the given order
-
getOrderEntryForOrderCodeAndEntryNumber
public OrderEntryData getOrderEntryForOrderCodeAndEntryNumber(String orderCode, Integer entryNumber) Description copied from interface:OmsOrderFacadeAPI to get an orderEntry by it's entryNumber and its order's code- Specified by:
getOrderEntryForOrderCodeAndEntryNumberin interfaceOmsOrderFacade- Parameters:
orderCode- the order's codeentryNumber- the order entry's number- Returns:
- the order entry
-
getOrderFraudReports
Description copied from interface:OmsOrderFacadeAPI to get an order's fraud reports- Specified by:
getOrderFraudReportsin interfaceOmsOrderFacade- Parameters:
orderCode- code of the order for which to get the fraud reports- Returns:
- a list of fraud reports
-
approvePotentiallyFraudulentOrder
Description copied from interface:OmsOrderFacadeAPI to approve a potentially fraudulent order- Specified by:
approvePotentiallyFraudulentOrderin interfaceOmsOrderFacade- Parameters:
orderCode- code of the order for which to approve the fraud check- Throws:
IllegalStateException
-
rejectPotentiallyFraudulentOrder
Description copied from interface:OmsOrderFacadeAPI to reject a potentially fraudulent order- Specified by:
rejectPotentiallyFraudulentOrderin interfaceOmsOrderFacade- Parameters:
orderCode- code of the order for which to reject the fraud check- Throws:
IllegalStateException
-
getCancelReasons
Description copied from interface:OmsOrderFacadeAPI to get all order cancel reasons- Specified by:
getCancelReasonsin interfaceOmsOrderFacade- Returns:
- a list of
CancelReason
-
createRequestOrderCancel
public OrderCancelRecordEntryData createRequestOrderCancel(OrderCancelRequestData orderCancelRequestData) Description copied from interface:OmsOrderFacadeAPI to request a order cancelOrderCancelRequest- Specified by:
createRequestOrderCancelin interfaceOmsOrderFacade- Parameters:
orderCancelRequestData- theOrderCancelRequestDatato createOrderCancelRequestData- Returns:
OrderCancelRecordEntryDatarepresenting the cancel request that was created
-
submitOrder
Description copied from interface:OmsOrderFacadeAPI to submit anOrderModelin the system- Specified by:
submitOrderin interfaceOmsOrderFacade- Parameters:
orderRequestData- theOrderRequestDatato submit anOrderModel- Returns:
- the submitted
OrderData
-
manuallyReleasePaymentVoid
Description copied from interface:OmsOrderFacadeAPI to manually release void payment in waiting step.- Specified by:
manuallyReleasePaymentVoidin interfaceOmsOrderFacade- Parameters:
orderCode- theAbstractOrderModel.CODE
-
manuallyReleaseTaxVoid
Description copied from interface:OmsOrderFacadeAPI to manually release void tax in waiting step.- Specified by:
manuallyReleaseTaxVoidin interfaceOmsOrderFacade- Parameters:
orderCode- theAbstractOrderModel.CODE
-
manuallyReleaseTaxCommit
Description copied from interface:OmsOrderFacadeAPI to manually commit tax and releaseOrderModelfrom waiting step.- Specified by:
manuallyReleaseTaxCommitin interfaceOmsOrderFacade- Parameters:
orderCode- theAbstractOrderModel.CODE
-
manuallyReleaseTaxRequote
Description copied from interface:OmsOrderFacadeAPI to manually requote tax and releaseOrderModelfrom waiting step.- Specified by:
manuallyReleaseTaxRequotein interfaceOmsOrderFacade- Parameters:
orderCode- theAbstractOrderModel.CODE
-
manuallyReleasePaymentReauth
Description copied from interface:OmsOrderFacadeAPI to manually reauth payment and releaseOrderModelfrom waiting step.- Specified by:
manuallyReleasePaymentReauthin interfaceOmsOrderFacade- Parameters:
orderCode- theAbstractOrderModel.CODE
-
manuallyReleaseDeliveryCostCommit
Description copied from interface:OmsOrderFacadeAPI to manually commit delivery cost taxes and releaseOrderModelfrom waiting step.- Specified by:
manuallyReleaseDeliveryCostCommitin interfaceOmsOrderFacade- Parameters:
orderCode- theAbstractOrderModel.CODE
-
executeManualReleaseStepOperation
protected void executeManualReleaseStepOperation(OrderModel order, String event, OrderStatus orderStatus) Executes a manual release step for the given event by calling theBusinessProcessService.- Parameters:
order- theOrderModelto be releasedevent- the business process event to be triggered
-
buildOrderCancelRequest
protected OrderCancelRequest buildOrderCancelRequest(OrderCancelRequestData orderCancelRequestData, OrderModel order) Builds anOrderCancelRequest.- Parameters:
orderCancelRequestData- theOrderCancelRequestDataout of which the request will be builtorder- theOrderModelassociated with this request- Returns:
- the created
OrderCancelRequest
-
submitValidatedOrder
submit order after the validation applied- Parameters:
orderRequestData-OrderRequestData- Returns:
OrderData
-
submitOrderInContext
prepare impersonation context and submit order- Parameters:
orderModel-OrderModel- Returns:
OrderData
-
validateOrderData
Validates for null check and essential fields inOrderRequestData- Parameters:
orderRequestData-OrderRequestDatato be validated
-
validateUserData
Validates for essential fields to assignUserModelto the submittedOrderModel- Parameters:
customerData- theCustomerData
-
validateBaseStoreInSite
-
validatePaymentTransactions
Validates for null check and essential fields inPaymentTransactionDataIf PaymentTransactions not provide correctly, manual refund payment action may require during the return process- Parameters:
paymentTransactionDatas- thePaymentTransactionData(s) to be validated
-
validateAddressData
Validates for null check and essential fields inAddressData- Parameters:
addressData- address to be validated
-
validateOrderEntryRequestData
Validates for null check and essential fields inOrderEntryRequestData- Parameters:
orderEntryRequestData-OrderEntryRequestDatato be validated
-
executeFraudCheckOperation
Save the order with the new attribute value for fraudulent.
Send the event to business process service.- Parameters:
order- anOrderModelfraudulent- whether the order is actually fraudulent
-
canPerformFraudCheck
Verifies if a fraud check can be performed on this order depending on its status.- Parameters:
order- the order whose status will be checked- Returns:
- true whether the fraud check can be performed; false otherwise
-
validateReturnRequestData
Validates for null check and mandatory fields in OrderCancelRequestData- Parameters:
orderCancelRequestData- orderCancelRequest to be validated
-
validateCancelEntryData
Validates for null check and mandatory fields in OrderCancelEntryData- Parameters:
entry-
-
isPartialCancel
check if is a partial cancel- Parameters:
orderCancelRequestData-order-- Returns:
- true if is a partial cancel
-
isPartialEntryCancel
protected Boolean isPartialEntryCancel(OrderCancelRequestData orderCancelRequestData, OrderModel order) check if is a partial order entry cancel- Parameters:
orderCancelRequestData-order-- Returns:
- true if is a partial entry cancel
-
isCancelQuantityPossible
protected Boolean isCancelQuantityPossible(OrderCancelRequestData orderCancelRequestData, OrderModel order, UserModel user) check the given quantity is valid to cancel- Parameters:
orderCancelRequestData-order-user-- Returns:
- true if quantity is valid to cancel
-
createGuestCustomerModel
Create a guest CustomerModel fromCustomerData- Parameters:
customerData- theCustomerData- Returns:
- the customer uid
-
createGuestIfNotExisting
FindCustomerModelbased on givenPrincipalData.getUid(), otherwise a new guest user will be created based onCustomerData.If thePrincipalData.getUid()exists, it extracts the existing user using this id, and ignores the otherCustomerData's properties provided in the request.- Parameters:
customerData- theCustomerData- Returns:
- the customer uid
-
getEnumerationService
-
setEnumerationService
-
getCalculationService
-
setCalculationService
-
getOrderConverter
-
setOrderConverter
-
getOrderEntryConverter
-
setOrderEntryConverter
-
getOrderService
-
setOrderService
-
getBusinessProcessService
-
setBusinessProcessService
-
getFraudReportConverter
-
setFraudReportConverter
public void setFraudReportConverter(Converter<FraudReportModel, FraudReportData> fraudReportConverter) -
getFraudReportGenericDao
-
setFraudReportGenericDao
-
getImpersonationService
-
setImpersonationService
-
getOrderRequestReverseConverter
-
setOrderRequestReverseConverter
public void setOrderRequestReverseConverter(Converter<OrderRequestData, OrderModel> orderRequestReverseConverter) -
getOrderCancelService
-
setOrderCancelService
-
getUserService
-
setUserService
-
getBaseSiteService
-
setBaseSiteService
-
getBaseStoreService
-
setBaseStoreService
-
getCustomerReverseConverter
-
setCustomerReverseConverter
public void setCustomerReverseConverter(Converter<CustomerData, CustomerModel> customerReverseConverter) -
getOrderSearchByStatusPagedDao
-
setOrderSearchByStatusPagedDao
public void setOrderSearchByStatusPagedDao(SearchByStatusPagedGenericDao<OrderModel> orderSearchByStatusPagedDao) -
getOrderByNullVersionIdPagedDao
-
setOrderByNullVersionIdPagedDao
public void setOrderByNullVersionIdPagedDao(OrderByNullVersionIdPagedDao orderByNullVersionIdPagedDao) -
getOrderEntryPagedGenericDao
-
setOrderEntryPagedGenericDao
public void setOrderEntryPagedGenericDao(PagedGenericDao<OrderEntryModel> orderEntryPagedGenericDao) -
getOrderCancelRecordEntryConverter
protected Converter<OrderCancelRecordEntryModel,OrderCancelRecordEntryData> getOrderCancelRecordEntryConverter() -
setOrderCancelRecordEntryConverter
public void setOrderCancelRecordEntryConverter(Converter<OrderCancelRecordEntryModel, OrderCancelRecordEntryData> orderCancelRecordEntryConverter)
-