|
@@ -105,6 +105,10 @@ public class DingServiceImpl implements DingService {
|
|
TenantInfo tenantInfo = tenantInfoService.getOne(Wrappers.<TenantInfo>lambdaQuery()
|
|
TenantInfo tenantInfo = tenantInfoService.getOne(Wrappers.<TenantInfo>lambdaQuery()
|
|
.eq(TenantInfo::getCorpid, dto.getCorpId()));
|
|
.eq(TenantInfo::getCorpid, dto.getCorpId()));
|
|
|
|
|
|
|
|
+ if (tenantInfo == null) {
|
|
|
|
+ throw new ServiceException("未知corpId");
|
|
|
|
+ }
|
|
|
|
+
|
|
sysUser = new SysUser();
|
|
sysUser = new SysUser();
|
|
OapiV2UserGetResponse.UserGetResponse userDetail = DingUtil.getUserDetail(dto.getCorpId(), userid);
|
|
OapiV2UserGetResponse.UserGetResponse userDetail = DingUtil.getUserDetail(dto.getCorpId(), userid);
|
|
List<Long> deptIdList = userDetail.getDeptIdList();
|
|
List<Long> deptIdList = userDetail.getDeptIdList();
|
|
@@ -225,14 +229,11 @@ public class DingServiceImpl implements DingService {
|
|
List<String> tenantIdList = list.stream().map(TenantInfo::getTenantId).collect(Collectors.toList());
|
|
List<String> tenantIdList = list.stream().map(TenantInfo::getTenantId).collect(Collectors.toList());
|
|
|
|
|
|
if (list.size() > 0) {
|
|
if (list.size() > 0) {
|
|
-
|
|
|
|
String tempTenantId;
|
|
String tempTenantId;
|
|
do {
|
|
do {
|
|
tempTenantId = tenantId + "-" + RandomUtil.randomString(3);
|
|
tempTenantId = tenantId + "-" + RandomUtil.randomString(3);
|
|
} while (!tenantIdList.contains(tempTenantId));
|
|
} while (!tenantIdList.contains(tempTenantId));
|
|
-
|
|
|
|
tenantId = tempTenantId;
|
|
tenantId = tempTenantId;
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 创建租户
|
|
// 创建租户
|