Merge pull request #308 from dataease/pr@dev@fix_编辑字段后全不选弹框报错

fix: 编辑字段全不选后弹框报错
This commit is contained in:
XiaJunjie2020 2021-07-23 12:45:57 +08:00 committed by GitHub
commit 35dfa1b6d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,6 +299,12 @@ public class DataSetTableService {
datasetTableField.setTableId(dataSetTableRequest.getId()); datasetTableField.setTableId(dataSetTableRequest.getId());
datasetTableField.setChecked(Boolean.TRUE); datasetTableField.setChecked(Boolean.TRUE);
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField); List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
if (CollectionUtils.isEmpty(fields)) {
map.put("fields", fields);
map.put("data", new ArrayList<>());
map.put("page", new DataSetPreviewPage());
return map;
}
String[] fieldArray = fields.stream().map(DatasetTableField::getDataeaseName).toArray(String[]::new); String[] fieldArray = fields.stream().map(DatasetTableField::getDataeaseName).toArray(String[]::new);
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(dataSetTableRequest.getInfo(), DataTableInfoDTO.class); DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(dataSetTableRequest.getInfo(), DataTableInfoDTO.class);