|
@@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.concurrent.ConcurrentHashMap;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -29,7 +30,7 @@ public class SysTenantConfigServiceImpl extends BaseServiceImpl<Integer, SysTena
|
|
|
return sysTenantConfigDao;
|
|
|
}
|
|
|
|
|
|
- Map<Integer,Map<String,String>> tenantConfig;
|
|
|
+ ConcurrentHashMap<Integer,ConcurrentHashMap<String,String>> tenantConfig;
|
|
|
private ApplicationEventPublisher applicationEventPublisher;
|
|
|
|
|
|
@Override
|
|
@@ -39,18 +40,18 @@ public class SysTenantConfigServiceImpl extends BaseServiceImpl<Integer, SysTena
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void setTenantConfig(Map<Integer, Map<String, String>> tenantConfig) {
|
|
|
+ public void setTenantConfig(ConcurrentHashMap<Integer, ConcurrentHashMap<String, String>> tenantConfig) {
|
|
|
this.tenantConfig = tenantConfig;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, String> getTenantConfig(Integer tenantId) {
|
|
|
+ public ConcurrentHashMap<String, String> getTenantConfig(Integer tenantId) {
|
|
|
return tenantConfig.get(tenantId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public String getTenantConfigValue(Integer tenantId,String paramName) {
|
|
|
- Map<String, String> map = tenantConfig.get(tenantId);
|
|
|
+ ConcurrentHashMap<String, String> map = tenantConfig.get(tenantId);
|
|
|
if(map != null){
|
|
|
return map.get(paramName);
|
|
|
}
|
|
@@ -58,7 +59,7 @@ public class SysTenantConfigServiceImpl extends BaseServiceImpl<Integer, SysTena
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<Integer, Map<String, String>> getAllTenantConfig() {
|
|
|
+ public ConcurrentHashMap<Integer, ConcurrentHashMap<String, String>> getAllTenantConfig() {
|
|
|
return tenantConfig;
|
|
|
}
|
|
|
|
|
@@ -81,6 +82,9 @@ public class SysTenantConfigServiceImpl extends BaseServiceImpl<Integer, SysTena
|
|
|
|
|
|
@Override
|
|
|
public String getConfigValue(String paramName, Integer tenantId) {
|
|
|
+ if(tenantId == null){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
return sysTenantConfigDao.getConfigValue(paramName, tenantId);
|
|
|
}
|
|
|
|