|
|
@@ -641,7 +641,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
user.setPassword(DigestUtil.encrypt(user.getPassword()));
|
|
|
}
|
|
|
Integer userCount = baseMapper.selectCount(Wrappers.<User>query().lambda().eq(User::getTenantId, user.getTenantId())
|
|
|
- .eq(User::getAccount, user.getAccount()).eq(User::getDeptId, user.getDeptId()));
|
|
|
+ .eq(User::getDeptId, user.getDeptId()).and(i -> i.eq(User::getAccount, user.getAccount()).or().eq(User::getPhone, user.getPhone())));
|
|
|
if (userCount > 0 && Func.isEmpty(user.getId())) {
|
|
|
throw new RuntimeException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
|
|
|
}
|