add biz sql

This commit is contained in:
2025-10-06 13:38:53 +08:00
parent 8199fa6719
commit 5dda521897
7 changed files with 234 additions and 10 deletions

View File

@@ -93,7 +93,7 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
user.setPhone(request.getPhone());
user.setEmail(request.getEmail());
if (UserType.KIOSK.getCategory()!=user.getUserType()){
if (UserType.KIOSK.getCategory() != user.getUserType()) {
// 校验用户格式
validateUser(user);
}

View File

@@ -112,11 +112,13 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
}
Long userCount = baseMapper.selectCount(Wrappers.<User>query().lambda().eq(User::getTenantId, tenantId).eq(User::getAccount, user.getAccount()));
if (userCount > 0L && Func.isEmpty(user.getId())) {
throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
throw new ServiceException(StringUtil.format("Current user [{}] has been existed!", user.getAccount()));
}
Long phoneCount = baseMapper.selectCount(Wrappers.<User>query().lambda().eq(User::getTenantId, tenantId).eq(User::getPhone, user.getPhone()));
if (phoneCount > 0L && StringUtil.isNotBlank(user.getPhone())) {
throw new ServiceException(StringUtil.format("当前手机 [{}] 已存在!", user.getPhone()));
if (UserType.KIOSK.getCategory() != user.getUserType()) {
Long phoneCount = baseMapper.selectCount(Wrappers.<User>query().lambda().eq(User::getTenantId, tenantId).eq(User::getPhone, user.getPhone()));
if (phoneCount > 0L && StringUtil.isNotBlank(user.getPhone())) {
throw new ServiceException(StringUtil.format("Current phone [{}] has been existed!", user.getPhone()));
}
}
CacheUtil.clear(USER_CACHE);
return save(user) && submitUserDept(user);
@@ -133,7 +135,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
.ne(User::getId, user.getId())
);
if (userCount > 0L) {
throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
throw new ServiceException(StringUtil.format("Current user [{}] has been existed!", user.getAccount()));
}
Long phoneCount = baseMapper.selectCount(
Wrappers.<User>query().lambda()
@@ -142,7 +144,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
.ne(User::getId, user.getId())
);
if (phoneCount > 0L && StringUtil.isNotBlank(user.getPhone())) {
throw new ServiceException(StringUtil.format("当前手机 [{}] 已存在!", user.getPhone()));
throw new ServiceException(StringUtil.format("Current phone [{}] has been existed!", user.getPhone()));
}
CacheUtil.clear(USER_CACHE);
return submitUserInfo(user) && submitUserDept(user);
@@ -164,7 +166,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
.ne(User::getId, user.getId())
);
if (phoneCount > 0L && StringUtil.isNotBlank(user.getPhone())) {
throw new ServiceException(StringUtil.format("当前手机 [{}] 已存在!", user.getPhone()));
throw new ServiceException(StringUtil.format("Current phone [{}] has been existed!", user.getPhone()));
}
user.setPassword(null);
return updateById(user);

View File

@@ -256,7 +256,7 @@ blade:
- /blade-saber/**
- client-id: kiosk
path-patterns:
- /blade-kiosk/**
- /blade-desk/**
#多租户配置
tenant:
#多租户增强