Pārlūkot izejas kodu

fix: 优化升级工具类;优化组件数据查询方法

优化升级工具类;优化组件数据查询方法
hong.yang 1 gadu atpakaļ
vecāks
revīzija
f56e8438ca

+ 3 - 0
DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/module/chart/service/BaseChartDataService.java

@@ -55,6 +55,9 @@ public class BaseChartDataService {
             return null;
         }
         DataSetDataSource dataSetDataSource = (DataSetDataSource) dataSource;
+        if (StringUtils.isBlank(dataSetDataSource.getBusinessKey())) {
+            return null;
+        }
         IBaseDataSetService dataSetService = dataSetServiceFactory.buildById(dataSetDataSource.getBusinessKey());
         DatasetEntity datasetEntity = dataSetService.getById(dataSetDataSource.getBusinessKey());
         if (datasetEntity == null) {

+ 2 - 0
DataRoom/dataroom-server/src/test/java/DataMigrationTest.java

@@ -308,6 +308,8 @@ public class DataMigrationTest {
                 jsonConfig.put("className", "com.gccloud.dataset.entity.config.CustomDataSetConfig");
             }
             String config = JSON.toJSONString(jsonConfig);
+            // 将 \\' 替换成 \'
+            config = config.replaceAll("\\\\\\\\'", "\\\\'");
             String insertSql = getInsertSql(dataset, config);
             insertSqlList.add(insertSql);
         }