Package com.skava.oms.helper
Class OrderHelper
java.lang.Object
com.skava.oms.helper.OrderHelperExtended
com.skava.oms.helper.OrderHelper
The class contains the helper for order
- Author:
- Infosys Equinox
-
Field Summary
FieldsFields inherited from class com.skava.oms.helper.OrderHelperExtended
collectionAttributeRepository, getOrderLock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkOrderValues
(OrderItem orderItem, String orderType) This method is used to check the parent order valuesstatic boolean
checkSpecialProductsHasStatus
(OrderItem parentOrderItem, String skuId, List<String> collectionPropStatus) void
createTransitionForReturn
(String responseCode, String responseMessage, String workItem, String nextStatus, OrderItem f, Order order) This method is used to create transition for return order.void
returnOrderInitialCreationCheck
(Order parentOrder, OrderDTO orderDTO, Order order, Collection collection) This method is used to check and process the creation return orderspiltforChildOrder
(Order order, OrderItemPatchDTO patchitemdto, org.camunda.bpm.engine.delegate.DelegateExecution execution, String[] nextPossiblestatus, String processStatus, Order parentOrder, String[] parentNextStatus) static void
splitForCancelOrReturn
(org.camunda.bpm.engine.delegate.DelegateExecution execution, OrderProcessData orderProcessData, Order order, PatchOrderRequest patchOrderRequest, List<OrderItem> itemsPatched, List<OrderItem> mapReturns) This method is used to spilt the cancel or return ordersplitForReturnTypeOrder
(OrderItemPatchDTO orderItemPatch, String[] nextPossibleStatus, String displayStatus, Order order, Order parentOrder) This method splits the orderitemsplitForReturnTypeOrder
(OrderItemPatchDTO orderItemPatch, String[] nextPossibleStatus, String displayStatus, Map<String, Order> orders, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap, String[] parentNextStatus) This method splits the orderitem Debug logger has been added to this method.void
transitionStateForReturnOrderItem
(String nextState, String[] nextPossibleStates, OrderItem oi, String displayStatus, Order order, Order parentOrder) This method transition the return order item state.void
transitionStateForReturnOrderItem
(Map<String, String> status, String[] nextPossibleStates, OrderItem oi, Order order, Order parentOrder, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap) This method transition the return order item state.void
updateParentOrder
(List<OrderItem> splitForCancelOrReturn, Order order, Order parentOrder, String processStatus, String[] parentNextStatus) This method is used to update the parent order status and make next possible status as nullvoid
updateParentOrderStatus
(OrderItem oi, Order parentOrder, String processStatus, String[] parentNextStatus) This method is used to update the parent order statusupdateTransitionStateForSpecialProductItem
(OrderItemPatchDTO orderItemPatch, OrderItem oi, Map<String, String> statusMap, String[] nextPossibleStatus, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap, Order parentOrder) This method is used to updateTransitionStateForSpecialProductItemMethods inherited from class com.skava.oms.helper.OrderHelperExtended
checkOrderTypesValidation, createLockOrderRequest, getCollectionPropAllowedStatus, getDefaultPropertyValue, getOtherChargesIncludingTax, lockParentOrder, releaseOrder
-
Field Details
-
orderRepository
-
-
Constructor Details
-
OrderHelper
protected OrderHelper()The Order Helper
-
-
Method Details
-
returnOrderInitialCreationCheck
public void returnOrderInitialCreationCheck(Order parentOrder, OrderDTO orderDTO, Order order, Collection collection) This method is used to check and process the creation return order- Parameters:
parentOrder
- Indicates the parent orderorderDTO
- Indicates the order data transfer objectorder
- Indicates the order from entitycollection
- Indicates the collection
-
checkOrderValues
This method is used to check the parent order values- Parameters:
orderItem
- Indicates the order item whose return type is falseorderType
- Indicates the order type
-
checkSpecialProductsHasStatus
-
spiltforChildOrder
public List<OrderItem> spiltforChildOrder(Order order, OrderItemPatchDTO patchitemdto, org.camunda.bpm.engine.delegate.DelegateExecution execution, String[] nextPossiblestatus, String processStatus, Order parentOrder, String[] parentNextStatus) - Parameters:
order
- Indicates the orderpatchitemdto
- Indicates the order patch itemexecution
- Indicates the delegate executionnextPossiblestatus
- Indicates the next statusprocessStatus
- Indicates the process statusparentOrder
- Indicates the parent orderparentNextStatus
-- Returns:
- Returns the list of order Items
-
updateParentOrder
public void updateParentOrder(List<OrderItem> splitForCancelOrReturn, Order order, Order parentOrder, String processStatus, String[] parentNextStatus) This method is used to update the parent order status and make next possible status as null- Parameters:
splitForCancelOrReturn
- Indicates the list of order items used for patchingorder
- Indicates the child orderparentOrder
- Indicates the parent orderprocessStatus
- Indicates the process statusparentNextStatus
-
-
splitForReturnTypeOrder
public List<OrderItem> splitForReturnTypeOrder(OrderItemPatchDTO orderItemPatch, String[] nextPossibleStatus, String displayStatus, Map<String, Order> orders, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap, String[] parentNextStatus) This method splits the orderitem Debug logger has been added to this method.- Parameters:
orderItemPatch
- - orderitem information to be updatednextPossibleStatus
- - next status the item could be moved todisplayStatus
- - display status the item could be moved toorders
- - conains child,parentOrder details.orderStatusMap
- - orderStatusConfiguration for the Order status array.orderDisplayStatusMap
- - order display status configuration for the orderstatusparentNextStatus
-- Returns:
- the list if orderitem
-
updateTransitionStateForSpecialProductItem
public OrderItem updateTransitionStateForSpecialProductItem(OrderItemPatchDTO orderItemPatch, OrderItem oi, Map<String, String> statusMap, String[] nextPossibleStatus, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap, Order parentOrder) This method is used to updateTransitionStateForSpecialProductItem- Parameters:
orderItemPatch
- - orderitem information to be updatedoi
- - orderitem informationstatusMap
- - map conataining nextState , displayStatus, responseCode and responseMessgaenextPossibleStatus
- - next status the item could be moved toorderStatusMap
- - orderStatusConfiguration for the Order status array.orderDisplayStatusMap
- - order display status configuration for the orderstatusparentOrder
- - parder order details- Returns:
- orderItem oredrItem
-
splitForReturnTypeOrder
public List<OrderItem> splitForReturnTypeOrder(OrderItemPatchDTO orderItemPatch, String[] nextPossibleStatus, String displayStatus, Order order, Order parentOrder) This method splits the orderitem- Parameters:
orderItemPatch
- - orderitem information to be updatednextPossibleStatus
- - next status the item could be moved todisplayStatus
- - display status the item could be moved toorder
- - Indicates child orderparentOrder
- - Indicates parent order- Returns:
- the list if orderitem
Use
splitForReturnTypeOrder(OrderItemPatchDTO, String[], String, Map, Map, Map, String[])
instead to update with orderstatus and orderdisplaystatus
-
createTransitionForReturn
public void createTransitionForReturn(String responseCode, String responseMessage, String workItem, String nextStatus, OrderItem f, Order order) This method is used to create transition for return order.- Parameters:
responseCode
- Indicates the response coderesponseMessage
- Indicates the response messageworkItem
- Indicates the work item status of the ordernextStatus
- Indicates the next status of the orderf
- Indicates the child order item of the orderorder
- Indicates the child order
-
transitionStateForReturnOrderItem
public void transitionStateForReturnOrderItem(Map<String, String> status, String[] nextPossibleStates, OrderItem oi, Order order, Order parentOrder, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap) This method transition the return order item state. Debug logger has been added to this method.- Parameters:
status
- - map containing state of the item to be moved to and status to be displayednextPossibleStates
- -next possible states of the itemoi
- - order item to be updatedorder
- Indicates the orderparentOrder
- Indicates parent orderorderStatusMap
- - orderStatusConfiguration for the Order status array.orderDisplayStatusMap
- - order display status configuration for the orderstatus
-
transitionStateForReturnOrderItem
public void transitionStateForReturnOrderItem(String nextState, String[] nextPossibleStates, OrderItem oi, String displayStatus, Order order, Order parentOrder) This method transition the return order item state. Debug logger has been added to this method.- Parameters:
nextState
- - state of the item to be moved tonextPossibleStates
- -next possible states of the itemoi
- - order item to be updateddisplayStatus
- status to be displayedorder
- Indicates the orderparentOrder
- Indicates parent order UsetransitionStateForReturnOrderItem(Map, String[], OrderItem, Order, Order, Map, Map)
instead to update with orderstatus and orderdisplaystatus
-
splitForCancelOrReturn
public static void splitForCancelOrReturn(org.camunda.bpm.engine.delegate.DelegateExecution execution, OrderProcessData orderProcessData, Order order, PatchOrderRequest patchOrderRequest, List<OrderItem> itemsPatched, List<OrderItem> mapReturns) This method is used to spilt the cancel or return order- Parameters:
execution
- Indicates the delegate executionorderProcessData
- Indicates the order processed dataorder
- Indicates the orderpatchOrderRequest
- Indicates the patch order requestitemsPatched
- Indicates the list of order items to be patchedmapReturns
- Indicates the list of order items patched
-
updateParentOrderStatus
public void updateParentOrderStatus(OrderItem oi, Order parentOrder, String processStatus, String[] parentNextStatus) This method is used to update the parent order status- Parameters:
oi
- Indicates the order itemparentOrder
- Indicates the parent orderprocessStatus
- holds the process statusparentNextStatus
-
-