From 65b63efdfd80174bee73a73b0dea1e1436b780ee Mon Sep 17 00:00:00 2001 From: junjun Date: Fri, 3 Jan 2025 11:31:57 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/dataset/manage/DatasetGroupManage.java | 4 ++-- .../java/io/dataease/dataset/manage/DatasetSQLManage.java | 2 +- .../io/dataease/dataset/manage/DatasetTableFieldManage.java | 6 +++--- .../src/main/resources/i18n/core_en_US.properties | 5 +++++ .../src/main/resources/i18n/core_zh_CN.properties | 5 ++++- .../src/main/resources/i18n/core_zh_TW.properties | 6 ++++++ 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetGroupManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetGroupManage.java index 6ebe0c1994..bea8a13949 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetGroupManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetGroupManage.java @@ -266,7 +266,7 @@ public class DatasetGroupManage { Set ids = new LinkedHashSet(); coreDatasetTables.forEach(ele -> ids.add(ele.getDatasourceId())); if (CollectionUtils.isEmpty(ids)) { - DEException.throwException("数据集因异常导致无法使用,请重新创建"); + DEException.throwException(Translator.get("i18n_dataset_create_error")); } QueryWrapper datasourceQueryWrapper = new QueryWrapper<>(); @@ -278,7 +278,7 @@ public class DatasetGroupManage { return dto; }).collect(Collectors.toList()); if (ids.size() != datasourceDTOList.size()) { - DEException.throwException("由于数据集所用的数据源已被删除,无法显示数据集"); + DEException.throwException(Translator.get("i18n_dataset_ds_delete")); } return datasourceDTOList; } diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLManage.java index 3a3be01c44..16808e0c92 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLManage.java @@ -425,7 +425,7 @@ public class DatasetSQLManage { dto.setSuffix(first.getSuffix()); return dto; } else { - DEException.throwException("当前数据源插件不存在"); + DEException.throwException(Translator.get("i18n_dataset_plugin_error")); } } return null; diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java index 7831068c0d..a9c7f0f07c 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java @@ -217,7 +217,7 @@ public class DatasetTableFieldManage { Map dsMap = (Map) sqlMap.get("dsMap"); boolean crossDs = Utils.isCrossDs(dsMap); if (crossDs) { - DEException.throwException("跨源数据集不支持该功能"); + DEException.throwException(Translator.get("i18n_dataset_cross_error")); } QueryWrapper wrapper = new QueryWrapper<>(); @@ -279,7 +279,7 @@ public class DatasetTableFieldManage { } public List transDTO(List list) { - if(!CollectionUtils.isEmpty(list)){ + if (!CollectionUtils.isEmpty(list)) { return list.stream().map(ele -> { DatasetTableFieldDTO dto = new DatasetTableFieldDTO(); if (ele == null) return null; @@ -292,7 +292,7 @@ public class DatasetTableFieldManage { } return dto; }).collect(Collectors.toList()); - }else{ + } else { return new ArrayList<>(); } diff --git a/core/core-backend/src/main/resources/i18n/core_en_US.properties b/core/core-backend/src/main/resources/i18n/core_en_US.properties index 825c02f32d..e7c98be5ca 100644 --- a/core/core-backend/src/main/resources/i18n/core_en_US.properties +++ b/core/core-backend/src/main/resources/i18n/core_en_US.properties @@ -186,4 +186,9 @@ i18n_time_date_next=Tomorrow i18n_time_date_start=Beginning of the month i18n_time_date_end=End of the month +i18n_dataset_create_error=Create error,please try again +i18n_dataset_ds_delete=Datasource deleted,this dataset can not be show +i18n_dataset_plugin_error=Datasource plugin is not exist +i18n_dataset_cross_error=Dataset with more than two data sources is not supported + diff --git a/core/core-backend/src/main/resources/i18n/core_zh_CN.properties b/core/core-backend/src/main/resources/i18n/core_zh_CN.properties index 5e2e62a50d..6719736432 100644 --- a/core/core-backend/src/main/resources/i18n/core_zh_CN.properties +++ b/core/core-backend/src/main/resources/i18n/core_zh_CN.properties @@ -185,4 +185,7 @@ i18n_time_date_next=\u660E\u5929 i18n_time_date_start=\u6708\u521D i18n_time_date_end=\u6708\u672B - +i18n_dataset_create_error=\u6570\u636e\u96c6\u56e0\u5f02\u5e38\u5bfc\u81f4\u65e0\u6cd5\u4f7f\u7528\uff0c\u8bf7\u91cd\u65b0\u521b\u5efa +i18n_dataset_ds_delete=\u7531\u4e8e\u6570\u636e\u96c6\u6240\u7528\u7684\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\2c\u65e0\u6cd5\u663e\u793a\u6570\u636e\u96c6 +i18n_dataset_plugin_error=\u5f53\u524d\u6570\u636e\u6e90\u63d2\u4ef6\u4e0d\u5b58\u5728 +i18n_dataset_cross_error=\u8de8\u6e90\u6570\u636e\u96c6\u4e0d\u652f\u6301\u8be5\u529f\u80fd diff --git a/core/core-backend/src/main/resources/i18n/core_zh_TW.properties b/core/core-backend/src/main/resources/i18n/core_zh_TW.properties index e6da261ceb..930e643284 100644 --- a/core/core-backend/src/main/resources/i18n/core_zh_TW.properties +++ b/core/core-backend/src/main/resources/i18n/core_zh_TW.properties @@ -184,3 +184,9 @@ i18n_time_date_last=\u6628\u5929 i18n_time_date_next=\u660E\u5929 i18n_time_date_start=\u6708\u521D i18n_time_date_end=\u6708\u672B + +i18n_dataset_create_error=\u6578\u64da\u96c6\u56e0\u7570\u5e38\u5c0e\u81f4\u7121\u6cd5\u4f7f\u7528\uff0c\u8acb\u91cd\u65b0\u5275\u5efa +i18n_dataset_ds_delete=\u7531\u4e8e\u6578\u64da\u96c6\u6240\u7528\u7684\u6578\u64da\u6e90\u5df2\u88ab\u522a\u9664\2c\u7121\u6cd5\u986f\u793a\u6578\u64da\u96c6 +i18n_dataset_plugin_error=\u7576\u524d\u6578\u64da\u6e90\u63d2\u4ef6\u4e0d\u5b58\u5728 +i18n_dataset_cross_error=\u8de8\u6e90\u6578\u64da\u96c6\u4e0d\u652f\u6301\u8a72\u529f\u80fd +