mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 05:22:13 +08:00
fix(数据大屏、仪表板): 导出App应用时增加飞书数据源无效提示 (#16719)
This commit is contained in:
@@ -165,7 +165,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
|
||||
@Override
|
||||
public DataVisualizationVO findCopyResource(Long dvId, String busiFlag) {
|
||||
DataVisualizationVO result = Objects.requireNonNull(CommonBeanFactory.proxy(this.getClass())).findById(new DataVisualizationBaseRequest(dvId, busiFlag, CommonConstants.RESOURCE_TABLE.SNAPSHOT,DataVisualizationConstants.QUERY_SOURCE.MAIN_EDIT));
|
||||
DataVisualizationVO result = Objects.requireNonNull(CommonBeanFactory.proxy(this.getClass())).findById(new DataVisualizationBaseRequest(dvId, busiFlag, CommonConstants.RESOURCE_TABLE.SNAPSHOT, DataVisualizationConstants.QUERY_SOURCE.MAIN_EDIT));
|
||||
if (result != null && result.getPid() == -1) {
|
||||
return result;
|
||||
} else {
|
||||
@@ -392,14 +392,14 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
dsGroup.setName(dsGroup.getName() + "-" + UUID.randomUUID().toString());
|
||||
}
|
||||
dsGroupNameSave.add(dsGroup.getName());
|
||||
if(dsGroup.getIsCross() == null){
|
||||
if(dsGroup.getUnion() == null){
|
||||
if (dsGroup.getIsCross() == null) {
|
||||
if (dsGroup.getUnion() == null) {
|
||||
dsGroup.setUnion(JsonUtil.parseList(dsGroup.getInfo(), new TypeReference<>() {
|
||||
}));
|
||||
}
|
||||
datasetSQLManage.mergeDatasetCrossDefault(dsGroup);
|
||||
}
|
||||
excelAdaptor(dsGroup,excelTableNamesMap,excelDatasourceId);
|
||||
excelAdaptor(dsGroup, excelTableNamesMap, excelDatasourceId);
|
||||
datasetGroupManage.innerSave(dsGroup);
|
||||
});
|
||||
|
||||
@@ -488,24 +488,24 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
return newDvId.toString();
|
||||
}
|
||||
|
||||
private void excelAdaptor(DatasetGroupInfoDTO dsInfo,Map<String, String> excelTableNamesMap ,List<Long> excelDsId) {
|
||||
private void excelAdaptor(DatasetGroupInfoDTO dsInfo, Map<String, String> excelTableNamesMap, List<Long> excelDsId) {
|
||||
List<UnionDTO> unionDTOList = JsonUtil.parseList(dsInfo.getInfo(), new TypeReference<>() {
|
||||
});
|
||||
if(CollectionUtils.isNotEmpty(excelDsId) && MapUtils.isNotEmpty(excelTableNamesMap)){
|
||||
for(UnionDTO unionDTO : unionDTOList) {
|
||||
DatasetTableDTO tableDTO =unionDTO.getCurrentDs();
|
||||
if(excelDsId.contains(tableDTO.getDatasourceId())){
|
||||
if (CollectionUtils.isNotEmpty(excelDsId) && MapUtils.isNotEmpty(excelTableNamesMap)) {
|
||||
for (UnionDTO unionDTO : unionDTOList) {
|
||||
DatasetTableDTO tableDTO = unionDTO.getCurrentDs();
|
||||
if (excelDsId.contains(tableDTO.getDatasourceId())) {
|
||||
DatasetTableInfoDTO infoDTO = JsonUtil.parseObject(tableDTO.getInfo(), DatasetTableInfoDTO.class);
|
||||
String s = new String(Base64.getDecoder().decode(infoDTO.getSql()));
|
||||
excelTableNamesMap.forEach((key, value) -> {
|
||||
infoDTO.setSql(Base64.getEncoder().encodeToString(s.replaceAll(key, value).getBytes()));
|
||||
});
|
||||
tableDTO.setInfo((String)JsonUtil.toJSONString(infoDTO));
|
||||
tableDTO.setInfo((String) JsonUtil.toJSONString(infoDTO));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
dsInfo.setInfo((String)JsonUtil.toJSONString(unionDTOList));
|
||||
dsInfo.setInfo((String) JsonUtil.toJSONString(unionDTOList));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -761,7 +761,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
@Override
|
||||
public String findDvType(Long dvId) {
|
||||
String result = extDataVisualizationMapper.findDvType(dvId);
|
||||
if(StringUtils.isEmpty(result)){
|
||||
if (StringUtils.isEmpty(result)) {
|
||||
DEException.throwException(Translator.get("i18n_resource_not_exists"));
|
||||
}
|
||||
return result;
|
||||
@@ -939,7 +939,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
if (CollectionUtils.isEmpty(datasourceVOInfo)) {
|
||||
DEException.throwException("当前不存在数据源无法导出");
|
||||
} else if (datasourceVOInfo.stream()
|
||||
.anyMatch(datasource -> DatasourceConfiguration.DatasourceType.API.name().equals(datasource.getType()))) {
|
||||
.anyMatch(datasource -> DatasourceConfiguration.DatasourceType.API.name().equals(datasource.getType()) || DatasourceConfiguration.DatasourceType.APILark.name().equals(datasource.getType()))) {
|
||||
DEException.throwException(Translator.get("i18n_app_error_no_api"));
|
||||
}
|
||||
|
||||
|
||||
@@ -210,5 +210,5 @@ i18n_unsupported_file_format=Unsupported file format!
|
||||
i18n_invalid_address=Invalid address!
|
||||
i18n_unsupported_protocol=Unsupported protocol!
|
||||
i18n_excel_error_first_row=Empty cells are not allowed in the middle of the first row!
|
||||
i18n_app_error_no_api=Current API data source is not supported.
|
||||
i18n_app_error_no_api=Currently, API and Lark data sources are not supported.
|
||||
i18n_resource_not_exists=Resource does not exist or has been deleted...
|
||||
@@ -209,5 +209,5 @@ i18n_unsupported_file_format=\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u683C\u5F0F\uF
|
||||
i18n_invalid_address=\u65E0\u6548\u7684\u5730\u5740\uFF01
|
||||
i18n_unsupported_protocol=\u4E0D\u652F\u6301\u7684\u534F\u8BAE\uFF01
|
||||
i18n_excel_error_first_row=\u9996\u884C\u884C\u4E2D\u4E0D\u5141\u8BB8\u6709\u7A7A\u5355\u5143\u683C\uFF01
|
||||
i18n_app_error_no_api=\u5F53\u524D\u4E0D\u652F\u6301API\u6570\u636E\u6E90\u3002
|
||||
i18n_app_error_no_api=\u5F53\u524D\u4E0D\u652F\u6301API\u548C\u98DE\u4E66\u6570\u636E\u6E90
|
||||
i18n_resource_not_exists=\u8d44\u6e90\u4e0d\u5b58\u5728\u6216\u5df2\u7ecf\u88ab\u5220\u9664...
|
||||
@@ -209,5 +209,5 @@ i18n_unsupported_file_format=\u4E0D\u652F\u63F4\u7684\u6587\u4EF6\u683C\u5F0F\uF
|
||||
i18n_invalid_address=\u7121\u6548\u7684\u5730\u5740\uFF01
|
||||
i18n_unsupported_protocol=\u4E0D\u652F\u63F4\u7684\u5354\u8B70\uFF01
|
||||
i18n_excel_error_first_row=\u9996\u884C\u884C\u4E2D\u4E0D\u5141\u8A31\u6709\u7A7A\u5132\u5B58\u683C\uFF01
|
||||
i18n_app_error_no_api=\u7576\u524D\u4E0D\u652F\u63F4API\u6578\u64DA\u6E90\u3002
|
||||
i18n_app_error_no_api=\u7576\u524D\u4E0D\u652F\u63F4API\u548C\u98DB\u66F8\u6578\u64DA\u6E90
|
||||
i18n_resource_not_exists=\u8cc7\u6e90\u4e0d\u5b58\u5728\u6216\u5df2\u7d93\u88ab\u522a\u9664...
|
||||
@@ -13,6 +13,7 @@ public class DatasourceConfiguration extends Configuration {
|
||||
static public enum DatasourceType {
|
||||
folder("folder", "folder", "folder", null, null, 25),
|
||||
API("API", "API", "API", "`", "`", 15),
|
||||
APILark("APILark", "APILark", "APILark", "`", "`", 17),
|
||||
Excel("Excel", "Excel", "LOCALFILE", "`", "`", 16),
|
||||
ExcelRemote("ExcelRemote", "ExcelRemote", "LOCALFILE", "`", "`", 29),
|
||||
mysql("mysql", "Mysql", "OLTP", "`", "`", 27),
|
||||
|
||||
Reference in New Issue
Block a user