Class OrderHelper


@Component public class OrderHelper extends OrderHelperExtended
The class contains the helper for order
Author:
Infosys Equinox
  • Field Details

  • 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 order
      orderDTO - Indicates the order data transfer object
      order - Indicates the order from entity
      collection - Indicates the collection
    • checkOrderValues

      public void checkOrderValues(OrderItem orderItem, String orderType)
      This method is used to check the parent order values
      Parameters:
      orderItem - Indicates the order item whose return type is false
      orderType - Indicates the order type
    • checkSpecialProductsHasStatus

      public static boolean checkSpecialProductsHasStatus(OrderItem parentOrderItem, String skuId, List<String> collectionPropStatus)
    • 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 order
      patchitemdto - Indicates the order patch item
      execution - Indicates the delegate execution
      nextPossiblestatus - Indicates the next status
      processStatus - Indicates the process status
      parentOrder - Indicates the parent order
      parentNextStatus -
      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 patching
      order - Indicates the child order
      parentOrder - Indicates the parent order
      processStatus - Indicates the process status
      parentNextStatus -
    • 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 updated
      nextPossibleStatus - - next status the item could be moved to
      displayStatus - - display status the item could be moved to
      orders - - conains child,parentOrder details.
      orderStatusMap - - orderStatusConfiguration for the Order status array.
      orderDisplayStatusMap - - order display status configuration for the orderstatus
      parentNextStatus -
      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 updated
      oi - - orderitem information
      statusMap - - map conataining nextState , displayStatus, responseCode and responseMessgae
      nextPossibleStatus - - next status the item could be moved to
      orderStatusMap - - orderStatusConfiguration for the Order status array.
      orderDisplayStatusMap - - order display status configuration for the orderstatus
      parentOrder - - 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 updated
      nextPossibleStatus - - next status the item could be moved to
      displayStatus - - display status the item could be moved to
      order - - Indicates child order
      parentOrder - - 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 code
      responseMessage - Indicates the response message
      workItem - Indicates the work item status of the order
      nextStatus - Indicates the next status of the order
      f - Indicates the child order item of the order
      order - 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 displayed
      nextPossibleStates - -next possible states of the item
      oi - - order item to be updated
      order - Indicates the order
      parentOrder - Indicates parent order
      orderStatusMap - - 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 to
      nextPossibleStates - -next possible states of the item
      oi - - order item to be updated
      displayStatus - status to be displayed
      order - Indicates the order
      parentOrder - Indicates parent order Use transitionStateForReturnOrderItem(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 execution
      orderProcessData - Indicates the order processed data
      order - Indicates the order
      patchOrderRequest - Indicates the patch order request
      itemsPatched - Indicates the list of order items to be patched
      mapReturns - 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 item
      parentOrder - Indicates the parent order
      processStatus - holds the process status
      parentNextStatus -