修改bug

master
wangwei 2 years ago
parent b50b669c4e
commit 8769aa038c

@ -8,16 +8,14 @@ import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.auth.DeptUserEntity;
import com.glxp.api.entity.auth.SysRole;
import com.glxp.api.entity.auth.SysUserRole;
import com.glxp.api.entity.auth.*;
import com.glxp.api.req.auth.FilterAuthUserRequest;
import com.glxp.api.req.auth.AuthUserSaveRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.auth.AuthAdminResponse;
import com.glxp.api.res.auth.DeptUserResponse;
import com.glxp.api.service.auth.AuthAdminService;
import com.glxp.api.service.auth.CustomerInfoService;
import com.glxp.api.service.auth.DeptUserService;
import com.glxp.api.service.auth.ISysRoleService;
import com.glxp.api.util.PasswordUtils;
@ -52,6 +50,12 @@ public class SysUserController extends BaseController {
@Resource
ISysRoleService sysRoleService;
@Resource
private CustomerInfoService customerInfoService;
@Resource
private AuthAdminService authAdminService;
@GetMapping("/list")
public BaseResponse list(FilterAuthUserRequest filterAuthUserRequest, BindingResult bindingResult) {
@ -146,7 +150,16 @@ public class SysUserController extends BaseController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
AuthAdmin curUser = getUser();
//先获取账号最大用户量
CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(curUser.getCustomerId());
//获取此账号下存在的用户量
List<AuthAdmin> byCustomerld = authAdminService.findByCustomerld(curUser.getCustomerId());
if(customerInfoEntity.getUserMax() <=byCustomerld.size()){
return ResultVOUtils.error(500, "已到达最大用户量");
}
// 检查是否存在相同名称的管理员
AuthAdmin byUserName = userService.findByUserName(authUserSaveRequest.getUserName());
if (byUserName != null) {

Loading…
Cancel
Save