mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-04-26 11:09:36 +08:00
update 优化 使用动态租户重构业务对租户的逻辑
This commit is contained in:
@@ -57,9 +57,8 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
new LambdaQueryWrapper<SysOssConfig>().orderByAsc(TenantEntity::getTenantId))
|
||||
);
|
||||
Map<String, List<SysOssConfig>> map = StreamUtils.groupByKey(list, SysOssConfig::getTenantId);
|
||||
try {
|
||||
for (String tenantId : map.keySet()) {
|
||||
TenantHelper.setDynamic(tenantId);
|
||||
for (String tenantId : map.keySet()) {
|
||||
TenantHelper.dynamic(tenantId, () -> {
|
||||
// 加载OSS初始化配置
|
||||
for (SysOssConfig config : map.get(tenantId)) {
|
||||
String configKey = config.getConfigKey();
|
||||
@@ -68,9 +67,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
}
|
||||
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config));
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
TenantHelper.clearDynamic();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user