@RequestMapping("perm-save")
public String save(@ModelAttribute Perm perm,
@RequestParam("permTypeId") Long permTypeId,
RedirectAttributes redirectAttributes) {
Perm dest = null;
Long id = perm.getId();
if (id != null) {
dest = permManager.get(id);
beanMapper.copy(perm, dest);
} else {
dest = perm;
}
if (id == null) {
dest.setScopeId(ScopeHolder.getScopeId());
}
dest.setPermType(permTypeManager.get(permTypeId));
permManager.save(dest);
messageHelper.addFlashMessage(redirectAttributes, "core.success.save",
"保存成功");