fix: 【数据集】api数据源和自定义sql关联后的数据集不显示,提示数据源已被删除

This commit is contained in:
taojinlong
2025-12-01 17:14:29 +08:00
committed by taojinlong
parent 7465cdad1f
commit d96955c55d

View File

@@ -293,7 +293,11 @@ public class DatasetGroupManage {
private List<DatasourceDTO> getDatasource(Long datasetId) {
List<CoreDatasetTable> coreDatasetTables = coreDatasetTableRepository.findByDatasetGroupId(datasetId);
List<Long> ids = new ArrayList<>();
coreDatasetTables.forEach(ele -> ids.add(ele.getDatasourceId()));
coreDatasetTables.forEach(ele -> {
if (!ids.contains(ele.getDatasourceId())) {
ids.add(ele.getDatasourceId());
}
});
if (CollectionUtils.isEmpty(ids)) {
DEException.throwException(Translator.get("i18n_dataset_create_error"));
}