| | |
| | | .eq(SystemUser::getUsername,company.getUsername()))>0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该登录账号已存在,请更新重试~"); |
| | | } |
| | | if(systemUserMapper.selectCount(new QueryWrapper<SystemUser>().lambda() |
| | | .eq(SystemUser::getDeleted,Boolean.TRUE) |
| | | .eq(SystemUser::getMobile,company.getPhone()))>0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该手机号已存在,请更换重试~"); |
| | | } |
| | | |
| | | SystemUser user = new SystemUser(); |
| | | user.setUsername(company.getUsername()); |
| | | // 生成密码盐 |
| | |
| | | .eq(SystemUser::getUsername,company.getUsername()))>0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该登录账号已存在,请更新重试~"); |
| | | } |
| | | if(systemUserMapper.selectCount(new QueryWrapper<SystemUser>().lambda() |
| | | .eq(SystemUser::getDeleted,Boolean.TRUE) |
| | | .ne(SystemUser::getUsername,company.getUsername()) |
| | | .eq(SystemUser::getMobile,company.getPhone()))>0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该手机号已存在,请更新重试~"); |
| | | } |
| | | SystemUser model = systemUserMapper.selectOne(new QueryWrapper<SystemUser>().lambda() |
| | | .eq(SystemUser::getDeleted,Boolean.TRUE) |
| | | .eq(SystemUser::getUsername,oldUserName).last("limit 1")); |
| | |
| | | user.setStatus(Constants.ZERO); |
| | | systemUserMapper.insert(user);//插入新的管理员账号 |
| | | }else{ |
| | | model.setMobile(company.getPhone()); |
| | | model.setUsername(company.getUsername()); |
| | | model.setCreateUser(company.getCreator()); |
| | | model.setCreateTime(company.getCreateDate()); |