forked from github/dataease
Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
commit
fbb44672ef
@ -483,7 +483,14 @@ public class DataSetTableService {
|
||||
Map<String, String[]> customInfo = new TreeMap<>();
|
||||
dataTableInfoDTO.getList().forEach(ele -> {
|
||||
String table = DorisTableUtils.dorisName(ele.getTableId());
|
||||
DatasetTable datasetTable = datasetTableMapper.selectByPrimaryKey(ele.getTableId());
|
||||
if (ObjectUtils.isEmpty(datasetTable)) {
|
||||
throw new RuntimeException(Translator.get("i18n_custom_ds_delete"));
|
||||
}
|
||||
List<DatasetTableField> fields = dataSetTableFieldsService.getListByIdsEach(ele.getCheckedFields());
|
||||
if (CollectionUtils.isEmpty(fields)) {
|
||||
throw new RuntimeException(Translator.get("i18n_cst_ds_tb_or_field_deleted"));
|
||||
}
|
||||
String[] array = fields.stream().map(f -> table + "." + f.getDataeaseName() + " AS " + DorisTableUtils.dorisFieldName(ele.getTableId() + "_" + f.getDataeaseName())).toArray(String[]::new);
|
||||
customInfo.put(table, array);
|
||||
});
|
||||
@ -567,7 +574,7 @@ public class DataSetTableService {
|
||||
List<DataTableInfoCustomUnion> list = dataTableInfoDTO.getList();
|
||||
List<DatasetTableField> fieldList = new ArrayList<>();
|
||||
list.forEach(ele -> {
|
||||
List<DatasetTableField> listByIds = dataSetTableFieldsService.getListByIds(ele.getCheckedFields());
|
||||
List<DatasetTableField> listByIds = dataSetTableFieldsService.getListByIdsEach(ele.getCheckedFields());
|
||||
listByIds.forEach(f -> {
|
||||
f.setDataeaseName(DorisTableUtils.dorisFieldName(ele.getTableId() + "_" + f.getDataeaseName()));
|
||||
});
|
||||
@ -665,7 +672,7 @@ public class DataSetTableService {
|
||||
}
|
||||
|
||||
|
||||
public void saveIncrementalConfig(DatasetTableIncrementalConfig datasetTableIncrementalConfig) throws Exception{
|
||||
public void saveIncrementalConfig(DatasetTableIncrementalConfig datasetTableIncrementalConfig) throws Exception {
|
||||
if (datasetTableIncrementalConfig == null || StringUtils.isEmpty(datasetTableIncrementalConfig.getTableId())) {
|
||||
return;
|
||||
}
|
||||
@ -700,11 +707,11 @@ public class DataSetTableService {
|
||||
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
|
||||
datasourceRequest.setQuery(sql);
|
||||
List<String> sqlFileds = new ArrayList<>();
|
||||
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed ->{
|
||||
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> {
|
||||
sqlFileds.add(filed);
|
||||
});
|
||||
sort(sqlFileds);
|
||||
if(!originNameFileds.equals(sqlFileds)){
|
||||
if (!originNameFileds.equals(sqlFileds)) {
|
||||
throw new Exception(Translator.get("i18n_sql_add_not_matching") + sqlFileds.toString());
|
||||
}
|
||||
}
|
||||
@ -713,17 +720,17 @@ public class DataSetTableService {
|
||||
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
|
||||
datasourceRequest.setQuery(sql);
|
||||
List<String> sqlFileds = new ArrayList<>();
|
||||
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed ->{
|
||||
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> {
|
||||
sqlFileds.add(filed);
|
||||
});
|
||||
sort(sqlFileds);
|
||||
if(!originNameFileds.equals(sqlFileds)){
|
||||
if (!originNameFileds.equals(sqlFileds)) {
|
||||
throw new Exception(Translator.get("i18n_sql_delete_not_matching") + sqlFileds.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void sort(List<String> sqlFileds){
|
||||
private void sort(List<String> sqlFileds) {
|
||||
sqlFileds.sort((o1, o2) -> {
|
||||
if (o1 == null) {
|
||||
return -1;
|
||||
@ -734,6 +741,7 @@ public class DataSetTableService {
|
||||
return o1.compareTo(o2);
|
||||
});
|
||||
}
|
||||
|
||||
private void checkName(DatasetTable datasetTable) {
|
||||
// if (StringUtils.isEmpty(datasetTable.getId()) && StringUtils.equalsIgnoreCase("db", datasetTable.getType())) {
|
||||
// return;
|
||||
|
@ -256,4 +256,5 @@ i18n_not_exec_add_sync=There is no completed synchronization task. Incremental s
|
||||
i18n_excel_header_empty=Excel first row can not empty
|
||||
i18n_custom_ds_delete=Custom dataset union data is deleted,can not display
|
||||
i18n_sql_add_not_matching=The data column of incremental SQL does not match the dataset,
|
||||
i18n_sql_delete_not_matching=The data column of incremental delete SQL does not match the dataset,
|
||||
i18n_sql_delete_not_matching=The data column of incremental delete SQL does not match the dataset,
|
||||
i18n_cst_ds_tb_or_field_deleted=Custom dataset union data is deleted or field changed,can not display
|
@ -257,4 +257,5 @@ i18n_excel_header_empty=Excel第一行为空
|
||||
i18n_custom_ds_delete=自定义数据集所关联数据被删除,无法正常显示
|
||||
i18n_sql_add_not_matching=增量添加 sql 的数据列与数据集不匹配,
|
||||
i18n_sql_delete_not_matching=增量删除 sql 的数据列与数据集不匹配,
|
||||
i18n_cst_ds_tb_or_field_deleted=自定义数据集所关联数据被删除或字段发生变化,无法正常显示
|
||||
|
||||
|
@ -258,4 +258,5 @@ i18n_not_exec_add_sync=沒有已經完成的同步任務,無法進行增量同
|
||||
i18n_excel_header_empty=Excel第一行為空
|
||||
i18n_custom_ds_delete=自定義數據集所關聯數據被刪除,無法正常顯示
|
||||
i18n_sql_add_not_matching=增量添加 sql 的數據列與數據集不匹配,
|
||||
i18n_sql_delete_not_matching=增量刪除 sql 的數據列與數據集不匹配,
|
||||
i18n_sql_delete_not_matching=增量刪除 sql 的數據列與數據集不匹配,
|
||||
i18n_cst_ds_tb_or_field_deleted=自定義數據集所關聯數據被刪除或字段發生變化,無法正常顯示
|
@ -9,7 +9,7 @@
|
||||
:active-text-color="variables.topMenuActiveText"
|
||||
:default-active="activeMenu"
|
||||
mode="horizontal"
|
||||
:style="{'background-color': '#f1f3f8'}"
|
||||
:style="{'background-color': '#f1f3f8', 'margin-left': '260px', 'position': 'absolute'}"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<div v-for="item in permission_routes" :key="item.path" class="nav-item">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<topbar />
|
||||
|
||||
<de-container style="padding-top: 56px;">
|
||||
<de-aside-container v-if="!sidebar.hide">
|
||||
<de-aside-container v-if="!sidebar.hide" class="le-aside-container">
|
||||
<sidebar class="sidebar-container" />
|
||||
</de-aside-container>
|
||||
|
||||
@ -116,4 +116,10 @@ export default {
|
||||
.la-main-container {
|
||||
padding: 0px !important;
|
||||
}
|
||||
.le-aside-container {
|
||||
.sidebar-container {
|
||||
width: 100% !important;
|
||||
position: initial !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user