Browse Source

🐛 修复用户基本信息修改的bug

test
smallchill 5 years ago
parent
commit
13394e33f8
  1. 13
      blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java
  2. 10
      blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java
  3. 6
      blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

13
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<List<User>> userList(User user, BladeUser bladeUser) {
QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user);

10
blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java

@ -45,11 +45,21 @@ public interface IUserService extends BaseService<User> {
*/
boolean updateUser(User user);
/**
* 修改用户基本信息
*
* @param user
* @return
*/
boolean updateUserInfo(User user);
/**
* 自定义分页
*
* @param page
* @param user
* @param deptId
* @param tenantId
* @return
*/
IPage<User> selectUserPage(IPage<User> page, User user, Long deptId, String tenantId);

6
blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@ -89,6 +89,12 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
return updateById(user) && submitUserDept(user);
}
@Override
public boolean updateUserInfo(User user) {
user.setPassword(null);
return updateById(user);
}
private boolean submitUserDept(User user) {
List<Long> deptIdList = Func.toLongList(user.getDeptId());
List<UserDept> userDeptList = new ArrayList<>();

Loading…
Cancel
Save