From 13394e33f8b5f87c4268035c535de634358beecc Mon Sep 17 00:00:00 2001 From: smallchill Date: Thu, 5 Mar 2020 16:24:32 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/user/controller/UserController.java | 13 ++++++++++++- .../system/user/service/IUserService.java | 10 ++++++++++ .../system/user/service/impl/UserServiceImpl.java | 6 ++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java index b06a9eb3..fbd9748c 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java @@ -195,6 +195,17 @@ public class UserController { return R.status(temp); } + /** + * 修改基本信息 + */ + @PostMapping("/update-info") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "修改基本信息", notes = "传入User") + @CacheEvict(cacheNames = {USER_CACHE}, allEntries = true) + public R updateInfo(@Valid @RequestBody User user) { + return R.status(userService.updateUserInfo(user)); + } + /** * 用户列表 * @@ -202,7 +213,7 @@ public class UserController { * @return */ @GetMapping("/user-list") - @ApiOperationSupport(order = 10) + @ApiOperationSupport(order = 11) @ApiOperation(value = "用户列表", notes = "传入user") public R> userList(User user, BladeUser bladeUser) { QueryWrapper queryWrapper = Condition.getQueryWrapper(user); diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java index 4563d6e9..4efb661b 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java @@ -45,11 +45,21 @@ public interface IUserService extends BaseService { */ boolean updateUser(User user); + /** + * 修改用户基本信息 + * + * @param user + * @return + */ + boolean updateUserInfo(User user); + /** * 自定义分页 * * @param page * @param user + * @param deptId + * @param tenantId * @return */ IPage selectUserPage(IPage page, User user, Long deptId, String tenantId); diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java index 1e0ceb58..63f191de 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java @@ -89,6 +89,12 @@ public class UserServiceImpl extends BaseServiceImpl implement return updateById(user) && submitUserDept(user); } + @Override + public boolean updateUserInfo(User user) { + user.setPassword(null); + return updateById(user); + } + private boolean submitUserDept(User user) { List deptIdList = Func.toLongList(user.getDeptId()); List userDeptList = new ArrayList<>();