| | |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | |
| | | private final IRoleMenuService roleMenuService; |
| | | private final IDictBizService dictBizService; |
| | | private final IUserClient userClient; |
| | | private final IStrategyService strategyService; |
| | | private final IUserPwdstrategyService userPwdstrategyService; |
| | | |
| | | /** |
| | | * 获取是否允许自行控制三员是否开启 |
| | | */ |
| | |
| | | LinkedList<DictBiz> dictBizs = new LinkedList<>(); |
| | | List<DictBiz> dictBizList = getDictBizs(tenantId, dictBizs); |
| | | dictBizService.saveBatch(dictBizList); |
| | | // 新建租户对应的默认管理用户 |
| | | User userInfo = generateUser(tenantId, role, dept, postInfo); |
| | | // 新建租户对应的默认管理用 |
| | | User user = generateUser(tenantId, role, dept, postInfo); |
| | | // 先保存租户 |
| | | boolean temp = super.saveOrUpdate(tenant); |
| | | // 创建用户 |
| | | R<Boolean> result = userClient.saveUser(userInfo); |
| | | R<Boolean> result = userClient.saveUser(user); |
| | | //生成用户密码策略管理记录 |
| | | if (!result.isSuccess()) { |
| | | throw new ServiceException(result.getMsg()); |
| | | } |
| | |
| | | user.setName(role.getRoleAlias()); |
| | | user.setRealName(role.getRoleName()); |
| | | user.setAccount(role.getRoleAlias()); |
| | | user.setStrategyUpdateStatus(CommonConstant.TOP_PARENT_ID); |
| | | user.setPwdUpdateTime(new Date()); |
| | | // 获取参数配置的密码 |
| | | String password = Func.toStr(ParamCache.getValue(PASSWORD_KEY), DEFAULT_PASSWORD); |
| | | user.setPassword(password); |