|
|
|
@ -205,10 +205,20 @@ public class UmsUserServiceImpl extends ServiceImpl<UmsUserMapper, UmsUser> impl |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean updateUms(UmsUser umsUser) { |
|
|
|
|
List<UmsUser> adminList = lambdaQuery().eq(UmsUser::getUsername, umsUser.getUsername()) |
|
|
|
|
List<UmsUser> userList = lambdaQuery().eq(UmsUser::getUsername, umsUser.getUsername()) |
|
|
|
|
.list(); |
|
|
|
|
if (adminList.size() > 0){ |
|
|
|
|
throw new BusinessException(400,"用户名已存在"); |
|
|
|
|
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,"用户名已存在"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!StrUtil.isEmpty(umsUser.getPassword())){ |
|
|
|
|
throw new BusinessException(400,"修改操作错误1"); |
|
|
|
|