mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 21:52:07 +08:00
处理创建组织时候,用户数量限制参数异常
This commit is contained in:
+4
-1
@@ -15,6 +15,7 @@ import com.cf.imes.framework.datapermission.core.util.DataPermissionUtils;
|
|||||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
import com.cf.imes.framework.organ.core.aop.OrganIgnore;
|
import com.cf.imes.framework.organ.core.aop.OrganIgnore;
|
||||||
|
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import com.cf.imes.module.infra.api.file.FileApi;
|
import com.cf.imes.module.infra.api.file.FileApi;
|
||||||
import com.cf.imes.module.system.api.user.dto.OrganAdminUserRespDTO;
|
import com.cf.imes.module.system.api.user.dto.OrganAdminUserRespDTO;
|
||||||
@@ -90,9 +91,11 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Long createUser(UserSaveReqVO createReqVO) {
|
public Long createUser(UserSaveReqVO createReqVO) {
|
||||||
|
Long organId = createReqVO.getOrganId() == null ? OrganContextHolder.getOrganId(): createReqVO.getOrganId();
|
||||||
// 校验账户配合
|
// 校验账户配合
|
||||||
organService.handleOrganInfo(organ -> {
|
organService.handleOrganInfo(organ -> {
|
||||||
long count = userMapper.selectCount();
|
long count = userMapper.selectCount(new LambdaQueryWrapperX<AdminUserDO>().eq(AdminUserDO::getOrganId, organId));
|
||||||
|
//long count = userMapper.selectCount();
|
||||||
if (count >= organ.getAccountCount()) {
|
if (count >= organ.getAccountCount()) {
|
||||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.USER_COUNT_MAX, organ.getAccountCount());
|
throw ServiceExceptionUtil.exception(ErrorCodeConstants.USER_COUNT_MAX, organ.getAccountCount());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user