public ModelAndView orderDetails(final HttpServletRequest request, final Model model) throws Exception {
ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.ORDER_DETAILS.getVelocityPage());
final RequestData requestData = requestUtil.getRequestData(request);
final String orderNum = request.getParameter(RequestConstants.REQUEST_PARAMETER_ORDER_NUM);
final OrderCustomer orderCustomer = orderCustomerService.getOrderByOrderNum(orderNum);
if(orderCustomer != null){
modelAndView.addObject(ModelConstants.ORDER_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanOrder(requestUtil.getRequestData(request), orderCustomer));
} else {
final String url = requestUtil.getLastRequestUrl(request);
return new ModelAndView(new RedirectView(url));
}
model.addAttribute(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.ORDER_LIST, requestData));
Object[] params = {orderCustomer.getOrderNum()};
overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.ORDER_DETAILS.getKey(), params);
return modelAndView;
}