|
@@ -253,7 +253,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
RBucket<Object> bucket = redissonClient.getBucket(key);
|
|
|
//原子操作 抢锁成功为true
|
|
|
if (!bucket.trySet(tenantId, 3L, TimeUnit.MINUTES)) {
|
|
|
- throw new BizException("该机构数正在开通中请勿频繁操作");
|
|
|
+ throw new BizException("机构正在开通中请勿频繁操作");
|
|
|
}
|
|
|
//获取产品信息得到服务id
|
|
|
TenantProductInfo productInfo = tenantProductInfoService.getOne(new WrapperUtil<TenantProductInfo>()
|
|
@@ -269,7 +269,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
//拆分菜单获取菜单ID
|
|
|
List<Integer> collectMenuId = getMenuId(menuIdList);
|
|
|
//建立角色
|
|
|
- Integer roleId = createRole(tenantId);
|
|
|
+ Integer roleId = createRole(tenantInfo);
|
|
|
//建立角色和菜单关系数据
|
|
|
employeeService.batchInsertRoleMenu(roleId, collectMenuId);
|
|
|
// 创建账号、用户信息、用户和角色关系
|
|
@@ -287,13 +287,15 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
}
|
|
|
|
|
|
//创建角色
|
|
|
- private Integer createRole(Integer tenantId) {
|
|
|
+ private Integer createRole(TenantInfo tenantInfo) {
|
|
|
SysRole sysRole = new SysRole();
|
|
|
sysRole.setRoleName("管理员");
|
|
|
sysRole.setRoleDesc("管理员");
|
|
|
sysRole.setCreateTime(new Date());
|
|
|
sysRole.setDelFlag("0");
|
|
|
- sysRole.setTenantId(tenantId);
|
|
|
+ sysRole.setTenantId(tenantInfo.getId());
|
|
|
+ Organization organization = organizationDao.getByName(tenantInfo.getName(), tenantInfo.getId());
|
|
|
+ sysRole.setOrganId(organization.getId());
|
|
|
employeeService.insertSysRole(sysRole);
|
|
|
return sysRole.getId();
|
|
|
}
|
|
@@ -306,6 +308,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
e.setJobNature(JobNatureEnum.FULL_TIME);
|
|
|
e.setEntryDate(LocalDate.now().toDate());
|
|
|
e.setRoles(roles);
|
|
|
+ e.setRoleIds(roles);
|
|
|
try {
|
|
|
employeeService.add(e);
|
|
|
} catch (Exception ex) {
|