|
|
@ -205,11 +205,21 @@ public class UmsUserServiceImpl extends ServiceImpl<UmsUserMapper, UmsUser> impl |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean updateUms(UmsUser umsUser) { |
|
|
|
public boolean updateUms(UmsUser umsUser) { |
|
|
|
List<UmsUser> adminList = lambdaQuery().eq(UmsUser::getUsername, umsUser.getUsername()) |
|
|
|
List<UmsUser> userList = lambdaQuery().eq(UmsUser::getUsername, umsUser.getUsername()) |
|
|
|
.list(); |
|
|
|
.list(); |
|
|
|
if (adminList.size() > 0){ |
|
|
|
if (userList.size() == 0){ |
|
|
|
|
|
|
|
UmsUser user = lambdaQuery().eq(UmsUser::getId, umsUser.getId()) |
|
|
|
|
|
|
|
.one(); |
|
|
|
|
|
|
|
if (user == null){ |
|
|
|
|
|
|
|
throw new BusinessException(400,"用户不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return umsUserMapper.updateUserInformation(umsUser); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (UmsUser user : userList) { |
|
|
|
|
|
|
|
if (user.getId() != umsUser.getId()){ |
|
|
|
throw new BusinessException(400,"用户名已存在"); |
|
|
|
throw new BusinessException(400,"用户名已存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (!StrUtil.isEmpty(umsUser.getPassword())){ |
|
|
|
if (!StrUtil.isEmpty(umsUser.getPassword())){ |
|
|
|
throw new BusinessException(400,"修改操作错误1"); |
|
|
|
throw new BusinessException(400,"修改操作错误1"); |
|
|
|
} |
|
|
|
} |
|
|
|