From 86d9885259591cbd0fd7968efe02e2ffaa47222d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= Date: Wed, 21 Nov 2018 20:45:06 +0800 Subject: [PATCH] :bug: Fixing a bug. fix #IOWMD --- .../com/github/pig/admin/controller/UserController.java | 7 +++---- .../github/pig/admin/service/impl/SysUserServiceImpl.java | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/controller/UserController.java b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/controller/UserController.java index 1926ae51..9d7e4006 100644 --- a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/controller/UserController.java +++ b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/controller/UserController.java @@ -130,8 +130,7 @@ public class UserController extends BaseController { */ @PutMapping public R userUpdate(@RequestBody UserDTO userDto) { - SysUser user = userService.selectById(userDto.getUserId()); - return new R<>(userService.updateUser(userDto, user.getUsername())); + return new R<>(userService.updateUser(userDto)); } /** @@ -175,8 +174,8 @@ public class UserController extends BaseController { * @return 用户集合 */ @RequestMapping("/userPage") - public Page userPage(@RequestParam Map params,UserVO userVO) { - return userService.selectWithRolePage(new Query(params),userVO); + public Page userPage(@RequestParam Map params, UserVO userVO) { + return userService.selectWithRolePage(new Query(params), userVO); } /** diff --git a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/service/impl/SysUserServiceImpl.java b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/service/impl/SysUserServiceImpl.java index 8f0c9825..ec735c04 100644 --- a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/service/impl/SysUserServiceImpl.java +++ b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/service/impl/SysUserServiceImpl.java @@ -250,8 +250,8 @@ public class SysUserServiceImpl extends ServiceImpl impl } @Override - @CacheEvict(value = "user_details", key = "#username") - public Boolean updateUser(UserDTO userDto, String username) { + @CacheEvict(value = "user_details", key = "#userDto.username") + public Boolean updateUser(UserDTO userDto) { SysUser sysUser = new SysUser(); BeanUtils.copyProperties(userDto, sysUser); sysUser.setUpdateTime(new Date());