Map<String, Object> parameters = ServletUtils
.getParametersStartingWith(parameterMap, "_user_attr_");
// 再进行数据复制
UserBase dest = null;
Long id = userBase.getId();
if (id != null) {
dest = userBaseManager.get(id);
dest.setStatus(0);
beanMapper.copy(userBase, dest);
userService.updateUser(dest, userRepoId, parameters);
} else {
dest = userBase;
dest.setAvatar((String) httpSession.getAttribute("temporaryAvatar"));
userService.insertUser(dest, userRepoId, parameters);
httpSession.removeAttribute("temporaryAvatar");
}
messageHelper.addFlashMessage(redirectAttributes, "core.success.save",
"保存成功");
UserDTO userDto = new UserDTO();
userDto.setId(Long.toString(dest.getId()));
userDto.setUsername(dest.getUsername());
userDto.setRef(dest.getRef());
userDto.setUserRepoRef(Long.toString(userRepoId));
userCache.removeUser(userDto);
return "redirect:/user/user-base-list.do";
}