| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import javafx.geometry.Pos; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.ibatis.mapping.Environment; |
| | | import org.springblade.common.constant.TenantConstant; |
| | | 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; |
| | | import org.springblade.core.tenant.TenantId; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.DesUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.system.cache.ParamCache; |
| | |
| | | import org.springblade.system.user.enums.UserEnum; |
| | | import org.springblade.system.user.feign.IUserClient; |
| | | import org.springblade.system.vo.TenantVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | 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()); |
| | | } |
| | |
| | | @Override |
| | | public List<Map<String,Object>> selectMaps(){ |
| | | List<Map<String, Object>> maps = listMaps(new QueryWrapper<Tenant>().select("TENANT_ID", "TENANT_NAME")); |
| | | System.out.println(maps); |
| | | return maps; |
| | | } |
| | | |
| | |
| | | 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); |