public class DefaultReturnService extends AbstractBusinessService implements ReturnService, ReturnCallbackService
AbstractService.SerializableDTOmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultReturnService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addReplacementOrderEntries(ReplacementOrderModel order,
List<ReplacementEntryModel> replacements)
Adds
ReplacementOrderEntryModel entries from the specified ReplacementEntryModel. |
RefundEntryModel |
createRefund(ReturnRequestModel request,
AbstractOrderEntryModel entry,
String notes,
Long expectedQuantity,
ReturnAction action,
RefundReason reason)
Creates a ReplRefundacement based on the assigned OrderEntry instance
|
ReplacementEntryModel |
createReplacement(ReturnRequestModel request,
AbstractOrderEntryModel entry,
String notes,
Long expectedQuantity,
ReturnAction action,
ReplacementReason reason)
Creates a Replacement based on the assigned OrderEntry instance
|
ReplacementOrderModel |
createReplacementOrder(ReturnRequestModel request)
Creates a
ReplacementOrderModel |
ReturnRequestModel |
createReturnRequest(OrderModel order)
Creates an "authorization" object (@link ReturnRequest} for the order to be returned, if there doesn't exists one
for that order so far
|
String |
createRMA(ReturnRequestModel request)
creates "Return Merchandise Authorization" aka "Return Material Authorization" (RMA) and assigns it to the
assigned
ReturnRequestModel |
Map<AbstractOrderEntryModel,Long> |
getAllReturnableEntries(OrderModel order)
Returns all returnable
OrderEntry's. |
protected FlexibleSearchService |
getFlexibleSearchService() |
protected RMAGenerator |
getGenerator() |
OrderModel |
getOrderByCode(String code)
Returns an order by its code
|
OrderReturnRecordModel |
getOrderReturnRecordForOrder(OrderModel order)
Gets order return record for a given order.
|
protected RefundOrderProcessor |
getRefundOrderProcessor() |
protected RefundService |
getRefundService() |
ReplacementOrderModel |
getReplacementOrder(String rma)
Returns the
ReplacementOrderModel by the specified 'RMA value' |
protected ReplacementOrderProcessor |
getReplacementOrderProcessor() |
List<ReplacementEntryModel> |
getReplacements(ReturnRequestModel request)
Returns all Replacements for the specified returns request
|
protected List<ReturnableCheck> |
getReturnableChecks() |
protected ReturnActionRequestExecutor |
getReturnActionRequestExecutor() |
List<ReturnEntryModel> |
getReturnEntries(ProductModel product)
Returns the ReturnsEntries for the specified product
|
List<ReturnEntryModel> |
getReturnEntry(AbstractOrderEntryModel entry)
Returns the ReturnsEntries for the specified order entry
|
List<ReturnRequestModel> |
getReturnRequests(String code)
Returns the "return request" for the specified order
|
protected ReturnEntryProcessor |
getReturnsEntryProcessor() |
String |
getRMA(ReturnRequestModel request)
returns a "Return Merchandise Authorization" aka "Return Material Authorization" (RMA).
|
boolean |
isReturnable(OrderModel order,
AbstractOrderEntryModel entry,
long returnQuantity)
Determines if the product is 'returnable' by using the injected
ReturnableCheck implementations. |
void |
onReturnApprovalResponse(ReturnActionResponse approvalResponse)
Callback method used by the adapter to pass approval operation result.
|
void |
onReturnCancelResponse(ReturnActionResponse cancelResponse)
Callback method used by the adapter to pass cancellation operation result.
|
void |
onReturnReceptionResponse(ReturnActionResponse receptionResponse)
Callback method used by the adapter to pass reception operation result.
|
void |
processRefundOrder(OrderModel order)
Here you have the chance to 'inject' your final Refund order processing.
|
void |
processReplacementOrder(ReplacementOrderModel order)
Here you have the chance to 'inject' your final Replacement order processing.
|
void |
processReturnEntries(List<ReturnEntryModel> entries)
Here you have the chance to 'inject' your final Returns Entry processing.
|
void |
requestManualPaymentReversalForReturnRequest(ReturnRequestModel returnRequest)
Request manual payment reversal for the (@link ReturnRequest}.
|
void |
requestManualTaxReversalForReturnRequest(ReturnRequestModel returnRequest)
Request manual tax reversal for the (@link ReturnRequest}.
|
void |
setFlexibleSearchService(FlexibleSearchService flexibleSearchService) |
void |
setGenerator(RMAGenerator generator) |
void |
setModificationHandler(OrderReturnRecordHandler modificationHandler) |
void |
setRefundOrderProcessor(RefundOrderProcessor refundOrderProcessor) |
void |
setRefundService(RefundService refundService) |
void |
setReplacementOrderDao(ReplacementOrderDao replacementOrderDao) |
void |
setReplacementOrderProcessor(ReplacementOrderProcessor replacementOrderProcessor) |
void |
setReturnableChecks(List<ReturnableCheck> returnableChecks) |
void |
setReturnActionRequestExecutor(ReturnActionRequestExecutor returnActionRequestExecutor) |
void |
setReturnRequestDao(ReturnRequestDao returnRequestDao) |
void |
setReturnsEntryProcessor(ReturnEntryProcessor returnEntryProcessor) |
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplaceprotected RefundService getRefundService()
public void setRefundService(RefundService refundService)
refundService - the service to setpublic void setReturnsEntryProcessor(ReturnEntryProcessor returnEntryProcessor)
protected ReturnEntryProcessor getReturnsEntryProcessor()
public void setReplacementOrderProcessor(ReplacementOrderProcessor replacementOrderProcessor)
protected ReplacementOrderProcessor getReplacementOrderProcessor()
public void setRefundOrderProcessor(RefundOrderProcessor refundOrderProcessor)
protected RefundOrderProcessor getRefundOrderProcessor()
public void setReplacementOrderDao(ReplacementOrderDao replacementOrderDao)
replacementOrderDao - the replacementOrderDao to setpublic void setReturnRequestDao(ReturnRequestDao returnRequestDao)
returnRequestDao - the returnRequestDao to setprotected List<ReturnableCheck> getReturnableChecks()
public void setReturnableChecks(List<ReturnableCheck> returnableChecks)
returnableChecks - the strategiesList to setpublic void setGenerator(RMAGenerator generator)
protected RMAGenerator getGenerator()
public String getRMA(ReturnRequestModel request)
getRMA in interface ReturnServicerequest - reference of the related ReturnsRequestpublic void setModificationHandler(OrderReturnRecordHandler modificationHandler)
modificationHandler - the modificationHandler to setpublic String createRMA(ReturnRequestModel request)
ReturnRequestModelcreateRMA in interface ReturnServicerequest - reference of the related "ReturnRequest" for which this RMA will be createdpublic ReturnRequestModel createReturnRequest(OrderModel order)
createReturnRequest in interface ReturnServiceorder - the order which should be returnedpublic List<ReturnRequestModel> getReturnRequests(String code)
ReturnServicegetReturnRequests in interface ReturnServicecode - code of the order we ask for the "return request"public OrderModel getOrderByCode(String code)
code - the code of the orderpublic ReplacementOrderModel getReplacementOrder(String rma)
ReturnServiceReplacementOrderModel by the specified 'RMA value'getReplacementOrder in interface ReturnServicerma - valuepublic ReplacementOrderModel createReplacementOrder(ReturnRequestModel request)
ReplacementOrderModelcreateReplacementOrder in interface ReturnServicerequest - the returns request to which the order will be assignedpublic ReplacementEntryModel createReplacement(ReturnRequestModel request, AbstractOrderEntryModel entry, String notes, Long expectedQuantity, ReturnAction action, ReplacementReason reason)
createReplacement in interface ReturnServicerequest - we use this for the verification process (order)entry - the original OrderEntrynotes - some notesexpectedQuantity - the amount of products which the customer wants to return.action - action which indicates if the 'returns process' will be executed immediately or is still on hold
(waiting for the article to be send back)reason - reason for the replacementpublic RefundEntryModel createRefund(ReturnRequestModel request, AbstractOrderEntryModel entry, String notes, Long expectedQuantity, ReturnAction action, RefundReason reason)
createRefund in interface ReturnServicerequest - we use this for the verification process (order)entry - the original OrderEntrynotes - some notesexpectedQuantity - the amount of products which the customer wants to got a refund.action - action which indicates if the 'returns process' will be executed immediately or is still on hold
(waiting for the article to be send back)reason - reason for the refundpublic void addReplacementOrderEntries(ReplacementOrderModel order, List<ReplacementEntryModel> replacements)
ReplacementOrderEntryModel entries from the specified ReplacementEntryModel. Caution: This
impl. only accepts ReplacementEntryModel which are not on HOLD ReturnAction.addReplacementOrderEntries in interface ReturnServiceorder - the replacement orderreplacements - the 'replacement' entries (instances which are on HOLD will be ignored)public List<ReturnEntryModel> getReturnEntries(ProductModel product)
getReturnEntries in interface ReturnServiceproduct - the productpublic List<ReturnEntryModel> getReturnEntry(AbstractOrderEntryModel entry)
getReturnEntry in interface ReturnServiceentry - the OrderEntrypublic List<ReplacementEntryModel> getReplacements(ReturnRequestModel request)
getReplacements in interface ReturnServicerequest - the ReturnRequestModelpublic boolean isReturnable(OrderModel order, AbstractOrderEntryModel entry, long returnQuantity)
ReturnableCheck implementations. To be
successful every strategy has to return 'true'. If no strategies were injected at all, 'true' will be returned as
default.isReturnable in interface ReturnServiceorder - the related original orderentry - the ordered product which will be returnedreturnQuantity - the quantity of entries to be returnedpublic Map<AbstractOrderEntryModel,Long> getAllReturnableEntries(OrderModel order)
OrderEntry's. The algorithm returns the max. returnable quantity for every
single(!) order entry.getAllReturnableEntries in interface ReturnServiceorder - the related orderOrderEntry and their returnable quantitypublic OrderReturnRecordModel getOrderReturnRecordForOrder(OrderModel order) throws OrderReturnException
ReturnServicegetOrderReturnRecordForOrder in interface ReturnServiceorder - OrderOrderReturnExceptionpublic void requestManualPaymentReversalForReturnRequest(ReturnRequestModel returnRequest) throws OrderReturnException
ReturnServicerequestManualPaymentReversalForReturnRequest in interface ReturnServicereturnRequest - the return request for which payment should be manually reversedOrderReturnExceptionpublic void requestManualTaxReversalForReturnRequest(ReturnRequestModel returnRequest) throws OrderReturnException
ReturnServicerequestManualTaxReversalForReturnRequest in interface ReturnServicereturnRequest - the return request for which tax should be manually reversedOrderReturnExceptionpublic void processReturnEntries(List<ReturnEntryModel> entries)
processReturnEntries in interface ReturnServiceentries - the entries to be processpublic void processReplacementOrder(ReplacementOrderModel order)
processReplacementOrder in interface ReturnServiceorder - the order to be processpublic void processRefundOrder(OrderModel order)
processRefundOrder in interface ReturnServiceorder - the order to be processpublic void onReturnApprovalResponse(ReturnActionResponse approvalResponse) throws OrderReturnException
ReturnCallbackServiceonReturnApprovalResponse in interface ReturnCallbackServiceOrderReturnExceptionpublic void onReturnCancelResponse(ReturnActionResponse cancelResponse) throws OrderReturnException
ReturnCallbackServiceonReturnCancelResponse in interface ReturnCallbackServiceOrderReturnExceptionpublic void onReturnReceptionResponse(ReturnActionResponse receptionResponse) throws OrderReturnException
ReturnCallbackServiceonReturnReceptionResponse in interface ReturnCallbackServiceOrderReturnExceptionprotected FlexibleSearchService getFlexibleSearchService()
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
protected ReturnActionRequestExecutor getReturnActionRequestExecutor()
public void setReturnActionRequestExecutor(ReturnActionRequestExecutor returnActionRequestExecutor)
Copyright © 2017 SAP SE. All Rights Reserved.