fix: 修复不能创建关联数据集问题

This commit is contained in:
wangjiahao 2022-06-02 18:25:10 +08:00
parent 3a1e4db6e0
commit 6bee78446f

View File

@ -1,6 +1,7 @@
package io.dataease.service.dataset; package io.dataease.service.dataset;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
import io.dataease.auth.annotation.DeCleaner; import io.dataease.auth.annotation.DeCleaner;
@ -1346,7 +1347,11 @@ public class DataSetTableService {
String configuration = ds.getConfiguration(); String configuration = ds.getConfiguration();
JsonObject jsonObject = JsonParser.parseString(configuration).getAsJsonObject(); JsonObject jsonObject = JsonParser.parseString(configuration).getAsJsonObject();
String schema = jsonObject.get("schema").getAsString(); JsonElement schemaJson = jsonObject.get("schema");
String schema = null;
if (schemaJson != null) {
schema = schemaJson.getAsString();
}
String joinPrefix = ""; String joinPrefix = "";
if (StringUtils.isNotEmpty(schema) && (StringUtils.equalsIgnoreCase(ds.getType(), DatasourceTypes.db2.getType()) || if (StringUtils.isNotEmpty(schema) && (StringUtils.equalsIgnoreCase(ds.getType(), DatasourceTypes.db2.getType()) ||
StringUtils.equalsIgnoreCase(ds.getType(), DatasourceTypes.sqlServer.getType()) || StringUtils.equalsIgnoreCase(ds.getType(), DatasourceTypes.sqlServer.getType()) ||