Class ReturnOrderPageController


@Controller @RequestMapping("/my-account/order") public class ReturnOrderPageController extends AbstractSearchPageController
Controller for return order pages
  • Field Details

  • Constructor Details

    • ReturnOrderPageController

      public ReturnOrderPageController()
  • Method Details

    • showReturnOrderPage

      @RequestMapping(value="/{orderCode:.*}/returns", method={POST,GET}) public String showReturnOrderPage(@PathVariable("orderCode") String orderCode, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • confirmReturnOrderPage

      @RequestMapping(value="/{orderCode:.*}/returns/confirm", method=POST) public String confirmReturnOrderPage(@PathVariable("orderCode") String orderCode, @ModelAttribute("orderEntryReturnForm") OrderEntryReturnForm orderEntryReturnForm, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • submitCancelOrderPage

      @RequestMapping(value="/{orderCode:.*}/returns/submit", method=POST) public String submitCancelOrderPage(@PathVariable("orderCode") String orderCode, @ModelAttribute("orderEntryCancelForm") OrderEntryReturnForm orderEntryReturnForm, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • prepareReturnRequestData

      protected ReturnRequestData prepareReturnRequestData(OrderData order, OrderEntryReturnForm orderEntryReturnForm)
      It prepares the ReturnRequestData object by taking the order and the map of orderentries OrderEntryData number and returned quantities
      Parameters:
      order - order OrderData which we want to return
      orderEntryReturnForm - a OrderEntryReturnForm map of orderentries number and the returned quantities
      Returns:
      returnRequest ReturnRequestData
    • isMultidimensionalEntry

      protected boolean isMultidimensionalEntry(OrderEntryData orderEntry)
      Confirms if the given OrderEntryData is for multidimensional product
      Parameters:
      orderEntry - the given OrderEntryData
      Returns:
      true, if the given OrderEntryData is for multidimensional product
    • initializeForm

      protected OrderEntryReturnForm initializeForm(OrderData orderData)
      Initialize the input form and takes care of the multiD case
      Parameters:
      orderData - The given orderOrderData to be returned
      Returns:
      initialized form OrderEntryReturnForm with initial values of 0
    • populateMapForNestedEntries

      protected void populateMapForNestedEntries(Map<Integer,Long> returnEntryQuantityMap, OrderEntryData orderEntryData)
      Parameters:
      returnEntryQuantityMap - The map to populate with entry number and quantity to return
      orderEntryData - The order entry OrderEntryData that holds a MultiD product
    • isMultiD

      protected boolean isMultiD(OrderEntryData orderEntryData)
      A method that checks if the product associated with this orderEntry is a multi dimensional product
      Parameters:
      orderEntryData - the order entry OrderEntryData
      Returns:
      true if the product in the orderEntryData is multiD and false if it is not set or it is not.
    • setReturnedItemsPrice

      protected void setReturnedItemsPrice(Long qty, OrderEntryData orderEntryData)
      Updates the OrderEntryData.returnedItemsPrice for the given requested return quantity
      Parameters:
      qty - the quantity to be returned from the given OrderEntryData
      orderEntryData - the OrderEntryData
    • redirectToOrdersHistory

      protected String redirectToOrdersHistory(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
      Redirects the flow to the Orders History page and notifies the user with the RedirectAttributes.
      Parameters:
      redirectModel - the RedirectAttributes used to display a message to the user
      Returns:
      View String