@RequiresPermissions("wuyejiben:wuyeJiben:edit") @RequestMapping(value = "delete") public String delete(WuyeJiben wuyeJiben, RedirectAttributes redirectAttributes) { List<WuyeJiben> list = wuyeJibenService.loadSubById(wuyeJiben.getId()); if (list.size() == 0) { wuyeJibenService.delete(wuyeJiben); addMessage(redirectAttributes, "删除信息成功"); } else { addMessage(redirectAttributes, "请先删除公司下的小区!"); } return "redirect:" + Global.getAdminPath() + "/wuyejiben/wuyeJiben/?repage"; }
@RequiresPermissions("wuyejiben:wuyeJiben:view") @RequestMapping(value = {"list", ""}) public String list( WuyeJiben wuyeJiben, HttpServletRequest request, HttpServletResponse response, Model model) { Page<WuyeJiben> page = wuyeJibenService.findPage(new Page<WuyeJiben>(request, response), wuyeJiben); model.addAttribute("page", page); return "modules/wuyejiben/wuyeJibenList"; }
@RequiresPermissions("wuyejiben:wuyeJiben:edit") @RequestMapping(value = "save") public String save(WuyeJiben wuyeJiben, Model model, RedirectAttributes redirectAttributes) { if (!beanValidator(model, wuyeJiben)) { return form(wuyeJiben, model); } wuyeJibenService.save(wuyeJiben); addMessage(redirectAttributes, "保存信息成功"); return "redirect:" + Global.getAdminPath() + "/wuyejiben/wuyeJiben/?repage"; }
@ModelAttribute public WuyeJiben get(@RequestParam(required = false) String id) { WuyeJiben entity = null; if (StringUtils.isNotBlank(id)) { entity = wuyeJibenService.get(id); } if (entity == null) { entity = new WuyeJiben(); } return entity; }