@RequiresPermissions("luxclub:sendorder:edit") @RequestMapping(value = "delete") public String delete(Order order, RedirectAttributes redirectAttributes) { orderService.delete(order); addMessage(redirectAttributes, "删除订单表成功"); return "redirect:" + Global.getAdminPath() + "/luxclub/sendorder/?repage"; }
@RequiresPermissions("luxclub:sendorder:view") @RequestMapping(value = {"list", ""}) public String list( Order order, HttpServletRequest request, HttpServletResponse response, Model model) { order.setState("0"); Page<Order> page = orderService.findPage(new Page<Order>(request, response), order); model.addAttribute("page", page); return "modules/luxclub/sendorderList"; }
@ModelAttribute public Order get(@RequestParam(required = false) Long id) { Order entity = null; if (id != null) { entity = orderService.get(id); } if (entity == null) { entity = new Order(); } return entity; }
@RequiresPermissions("luxclub:sendorder:edit") @RequestMapping(value = "save") public String save(Order order, Model model, RedirectAttributes redirectAttributes) { if (!beanValidator(model, order)) { return form(order, model); } String result = ""; try { result = orderService.sendOrder(order); } catch (Exception e) { log.info("取消订单异常:", e); } if (BusinessConstants.SUCCESS.equals(result)) { addMessage(redirectAttributes, "保存订单表成功"); } else { addMessage(redirectAttributes, result); } return "redirect:" + Global.getAdminPath() + "/luxclub/sendorder/?repage"; }