|
@@ -180,35 +180,35 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Long createTenantAdmin(SysTenantAdminBo bo) {
|
|
|
- if(Validator.isEmpty(bo.getTenantName())){
|
|
|
- throw new CustomException("没有企业名称");
|
|
|
- }
|
|
|
+// if(Validator.isEmpty(bo.getTenantName())){
|
|
|
+// throw new CustomException("没有企业名称");
|
|
|
+// }
|
|
|
//中正后台企业ID
|
|
|
- Long tenantId = 867735392558919680L;
|
|
|
+ Long tenantId = 1L;
|
|
|
//设置新机构
|
|
|
- SysTenant sysTenant = getById(tenantId);
|
|
|
- sysTenant.setTenantName(bo.getTenantName());
|
|
|
- sysTenant.setHostPc(bo.getHostPc());
|
|
|
- sysTenant.setHostH5(bo.getHostH5());
|
|
|
- sysTenant.setHostLive(bo.getHostLive());
|
|
|
- sysTenant.setHostH5Seller(null);
|
|
|
- sysTenant.setHostAdmin(null);
|
|
|
+// SysTenant sysTenant = getById(tenantId);
|
|
|
+// sysTenant.setTenantName(bo.getTenantName());
|
|
|
+// sysTenant.setHostPc(bo.getHostPc());
|
|
|
+// sysTenant.setHostH5(bo.getHostH5());
|
|
|
+// sysTenant.setHostLive(bo.getHostLive());
|
|
|
+// sysTenant.setHostH5Seller(null);
|
|
|
+// sysTenant.setHostAdmin(null);
|
|
|
//生成tenantId
|
|
|
- Long newTenantId = createTenantId();
|
|
|
- sysTenant.setTenantId(newTenantId);
|
|
|
- if (!save(sysTenant)){
|
|
|
- throw new CustomException("创建企业失败");
|
|
|
- }
|
|
|
- //创建账号
|
|
|
- SysUser admin = userService.selectUserByTenant("admin",tenantId);
|
|
|
- admin.setTenantId(newTenantId);
|
|
|
- admin.setUserId(null);
|
|
|
- if(Validator.isNotEmpty(bo.getPassword())){
|
|
|
- admin.setPassword(SecurityUtils.encryptPassword(bo.getPassword()));
|
|
|
- }
|
|
|
- if (!userService.save(admin)){
|
|
|
- throw new CustomException("创建后台账号失败");
|
|
|
- }
|
|
|
+ Long newTenantId = bo.getTenantId();
|
|
|
+// sysTenant.setTenantId(newTenantId);
|
|
|
+// if (!save(sysTenant)){
|
|
|
+// throw new CustomException("创建企业失败");
|
|
|
+// }
|
|
|
+// //创建账号
|
|
|
+// SysUser admin = userService.selectUserByTenant("admin",tenantId);
|
|
|
+// admin.setTenantId(newTenantId);
|
|
|
+// admin.setUserId(null);
|
|
|
+// if(Validator.isNotEmpty(bo.getPassword())){
|
|
|
+// admin.setPassword(SecurityUtils.encryptPassword(bo.getPassword()));
|
|
|
+// }
|
|
|
+// if (!userService.save(admin)){
|
|
|
+// throw new CustomException("创建后台账号失败");
|
|
|
+// }
|
|
|
//创建菜单
|
|
|
List<SysMenu> list = menuService.listSysMenuByTenant(tenantId);
|
|
|
if (CollectionUtils.isEmpty(list)){
|
|
@@ -250,7 +250,7 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
|
|
});
|
|
|
|
|
|
//新增分销角色
|
|
|
- initRoles(newTenantId,tenantId);
|
|
|
+// initRoles(newTenantId,tenantId);
|
|
|
|
|
|
//初始化配置和字典
|
|
|
initConfigAndDict(newTenantId,tenantId);
|