@ModelAttribute public void getModel( @RequestParam(value = "id", required = false) Long id, @RequestParam(value = "roleId", required = false) Long roleId, Model model) { if (null != id) { model.addAttribute("tdManager", tdManagerService.findOne(id)); } if (null != roleId) { model.addAttribute("tdManagerRole", tdManagerRoleService.findOne(roleId)); } }
@RequestMapping(value = "/edit") public String managerEdit(Long id, String __VIEWSTATE, ModelMap map, HttpServletRequest req) { String username = (String) req.getSession().getAttribute("manager"); if (null == username) { return "redirect:/Verwalter/login"; } map.addAttribute("__VIEWSTATE", __VIEWSTATE); /** @author lc @注释:添加角色类型 */ map.addAttribute("role_list", tdManagerRoleService.findAll()); if (null != id) { map.addAttribute("tdManager", tdManagerService.findOne(id)); } return "/site_mag/manager_edit"; }
private void btnSave(Long[] ids, Long[] sortIds) { if (null == ids || null == sortIds || ids.length < 1 || sortIds.length < 1) { return; } for (int i = 0; i < ids.length; i++) { Long id = ids[i]; TdManager e = tdManagerService.findOne(id); if (null != e) { if (sortIds.length > i) { e.setSortId(sortIds[i]); tdManagerService.save(e); } } } }