| | |
| | | SystemUser queryUserDto = new SystemUser(); |
| | | queryUserDto.setUsername(systemUser.getUsername()); |
| | | queryUserDto.setDeleted(Boolean.FALSE); |
| | | queryUserDto.setType(Constants.ZERO); |
| | | SystemUser user = systemUserService.findOne(queryUserDto); |
| | | if (user != null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "用户名已存在"); |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "登录账号已存在"); |
| | | } |
| | | // 验证工号 |
| | | if (StringUtils.isNotBlank(systemUser.getEmpNo())) { |
| | |
| | | queryUserDto.setDeleted(Boolean.FALSE); |
| | | user = systemUserService.findOne(queryUserDto); |
| | | if (user != null && !user.getId().equals(systemUser.getId())) { |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "用户名已存在"); |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "登录账号已存在"); |
| | | } |
| | | } |
| | | |
| | |
| | | queryUserDto.setDeleted(Boolean.FALSE); |
| | | SystemUser user = systemUserService.findOne(queryUserDto); |
| | | if (user != null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "用户名已存在"); |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "登录账号已存在"); |
| | | } |
| | | if(createCompanyUserDTO.getType().equals(Constants.UserType.ZHUBO.getKey())){ |
| | | Company company = companyService.findById(loginUserInfo.getCompanyId()); |
| | |
| | | zbUserNum.setCompanyId(loginUserInfo.getCompanyId()); |
| | | zbUserNum.setDeleted(Boolean.FALSE); |
| | | zbUserNum.setType(Constants.UserType.ZHUBO.getKey()); |
| | | if(systemUserService.findList(zbUserNum).size()>=company.getUserNum()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,已超出企业可分配主播数量,如有疑问请联系系统管理员!"); |
| | | if(!Objects.isNull(company.getUserNum())&&company.getUserNum()!=Constants.ZERO){ |
| | | if(systemUserService.findList(zbUserNum).size()>=company.getUserNum()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,已超出企业可分配主播数量,如有疑问请联系系统管理员!"); |
| | | } |
| | | } |
| | | } |
| | | SystemUser systemUser = new SystemUser(); |