Class CancelOrderPageController


@Controller @RequestMapping("/my-account/order") public class CancelOrderPageController extends AbstractSearchPageController
Controller for cancel order pages
  • Constructor Details

    • CancelOrderPageController

      public CancelOrderPageController()
  • Method Details

    • showCancelOrderPage

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

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

      @RequestMapping(value="/{orderCode:.*}/cancel/submit", method=POST) public String submitCancelOrderPage(@PathVariable("orderCode") String orderCode, @ModelAttribute("orderEntryCancelForm") OrderEntryCancelForm orderEntryCancelForm, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • 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
    • setCancellablePrice

      protected void setCancellablePrice(Long qty, OrderEntryData orderEntryData)
      Updates the OrderEntryData.cancelledItemsPrice for the given requested cancel quantity
      Parameters:
      qty - the quantity to be cancelled from the given OrderEntryData
      orderEntryData - the OrderEntryData
    • prepareOrderCancelRequestData

      protected OrderCancelRequestData prepareOrderCancelRequestData(String orderCode, Map<Integer,Integer> cancelEntryQuantityMap)
      It prepares the OrderCancelRequestData object by taking the order code and a map of order entry and cancel quantity and sets the user
      Parameters:
      orderCode - which we want to request to cancel
      cancelEntryQuantityMap - map of order entry and cancel quantity
      Returns:
      Populated OrderCancelRequestData
    • prepareOrderCancelEntryData

      protected List<OrderCancelEntryData> prepareOrderCancelEntryData(Map<Integer,Integer> cancelEntryQuantityMap)
      It prepares a list of OrderCancelEntryData object to be set in the entries of OrderCancelRequestData
      Parameters:
      cancelEntryQuantityMap - map of order entry and cancel quantity
      Returns:
      list of OrderCancelEntryData representing the map of order entry and cancel quantity
    • initializeForm

      protected OrderEntryCancelForm initializeForm(OrderData orderData)
      initialize the input form and takes care of the multiD case
      Parameters:
      orderData - The order to be cancelled
      Returns:
      initialized form with initial values of 0
    • populateOrderCancelEntries

      protected void populateOrderCancelEntries(OrderData orderData, Map<Integer,Integer> cancelEntryQuantity)
      Populates the order cancel entries quantity map
      Parameters:
      orderData - the OrderData which is used to populate the map
      cancelEntryQuantity - the map to be populated