Merge pull request #10209 from dataease/dev

merge v1.18.21
This commit is contained in:
fit2cloudrd 2024-06-12 11:19:04 +08:00 committed by GitHub
commit 6b96b42107
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 17 additions and 16 deletions

View File

@ -54,6 +54,10 @@ public class AuthUtils {
return userDto;
}
public static void setUser(CurrentUserDto user) {
USER_INFO.set(user);
}
public static void setProxyUser(Long userId) {
CurrentUserDto currentUserDto = proxyAuthService.queryCacheUserDto(userId);
USER_INFO.set(currentUserDto);

View File

@ -951,7 +951,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
break;
case pg:
PgConfiguration pgConfiguration = new Gson().fromJson(datasource.getConfiguration(), PgConfiguration.class);
if (!pgConfiguration.getDataBase().matches("^[0-9a-zA-Z_]{1,}$")) {
if (!pgConfiguration.getDataBase().matches("^[0-9a-zA-Z_.-]{1,}$")) {
throw new Exception("Invalid database name");
}
break;

View File

@ -988,14 +988,8 @@ public class PgQueryProvider extends QueryProvider {
}
public String getTotalCount(boolean isTable, String sql, Datasource ds) {
if (isTable) {
String schema = new Gson().fromJson(ds.getConfiguration(), JdbcConfiguration.class).getSchema();
String tableWithSchema = String.format(PgConstants.KEYWORD_TABLE, schema) + "." + String.format(PgConstants.KEYWORD_TABLE, sql);
return "SELECT COUNT(*) from " + tableWithSchema;
} else {
return null;
}
}
@Override
public String createRawQuerySQL(String table, List<DatasetTableField> fields, Datasource ds) {
@ -1007,7 +1001,7 @@ public class PgQueryProvider extends QueryProvider {
if (ds != null) {
String schema = new Gson().fromJson(ds.getConfiguration(), JdbcConfiguration.class).getSchema();
String tableWithSchema = String.format(SqlServerSQLConstants.KEYWORD_TABLE, schema) + "." + String.format(SqlServerSQLConstants.KEYWORD_TABLE, table);
return MessageFormat.format("SELECT {0} FROM {1} LIMIT DE_PAGE_SIZE OFFSET DE_OFFSET ", StringUtils.join(array, ","), tableWithSchema);
return MessageFormat.format("SELECT {0} FROM {1} ", StringUtils.join(array, ","), tableWithSchema);
} else {
return MessageFormat.format("SELECT {0} FROM {1} ", StringUtils.join(array, ","), table);
}

View File

@ -181,7 +181,7 @@ public class DatasourceService {
});
if (!datasourceDTO.getType().equalsIgnoreCase(DatasourceTypes.api.toString())) {
JdbcConfiguration configuration = new Gson().fromJson(datasourceDTO.getConfiguration(), JdbcConfiguration.class);
if (StringUtils.isNotEmpty(configuration.getCustomDriver()) && !configuration.getCustomDriver().equalsIgnoreCase("default")) {
if (StringUtils.isNotEmpty(configuration.getCustomDriver()) && !configuration.getCustomDriver().startsWith("default-")) {
datasourceDTO.setCalculationMode(DatasourceCalculationMode.DIRECT);
}
JSONObject jsonObject = JSONObject.parseObject(datasourceDTO.getConfiguration());

View File

@ -322,7 +322,7 @@ public class ExportCenterService {
ChartViewDTO chartViewInfo = chartViewService.getData(request.getViewId(), componentFilterInfo);
List<Object[]> tableRow = (List) chartViewInfo.getData().get("sourceData");
request.setDetails(tableRow);
if("dataset".equals(request.getDownloadType())){
if ("dataset".equals(request.getDownloadType())) {
request.setHeader((String[]) chartViewInfo.getData().get("header"));
request.setExcelTypes((Integer[]) chartViewInfo.getData().get("dsTypes"));
}
@ -388,7 +388,9 @@ public class ExportCenterService {
String dataPath = exportData_path + exportTask.getId();
File directory = new File(dataPath);
boolean isCreated = directory.mkdir();
CurrentUserDto currentUserDto = AuthUtils.getUser();
Future future = scheduledThreadPoolExecutor.submit(() -> {
AuthUtils.setUser(currentUserDto);
try {
exportTask.setExportStatus("IN_PROGRESS");
exportTaskMapper.updateByPrimaryKey(exportTask);
@ -414,7 +416,7 @@ public class ExportCenterService {
cellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
//设置单元格填充样式(使用纯色背景颜色填充)
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
if ("table-info".equals(request.getViewType())||"dataset".equals(request.getDownloadType())) {
if ("table-info".equals(request.getViewType()) || "dataset".equals(request.getDownloadType())) {
exportTableDetails(request, wb, cellStyle, detailsSheet);
} else {
Boolean mergeHead = false;
@ -542,7 +544,7 @@ public class ExportCenterService {
}
wb.close();
if (ObjectUtils.isNotEmpty(AuthUtils.getUser())) {
if (ObjectUtils.isNotEmpty(currentUserDto)) {
String viewId = request.getViewId();
ChartViewWithBLOBs chartViewWithBLOBs = chartViewService.get(viewId);
String pid = chartViewWithBLOBs.getSceneId();
@ -1342,6 +1344,7 @@ public class ExportCenterService {
map.put("data", jsonArray);
return map;
}
private static final String LOG_RETENTION = "30";
public void cleanLog() {

View File

@ -1,6 +1,6 @@
{
"name": "dataease",
"version": "1.18.20",
"version": "1.18.21",
"description": "dataease front",
"private": true,
"scripts": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 202 KiB

View File

@ -1,6 +1,6 @@
{
"name": "dataease-mobile",
"version": "1.18.20",
"version": "1.18.21",
"private": true,
"scripts": {
"serve": "npm run dev:h5",

View File

@ -9,7 +9,7 @@
<packaging>pom</packaging>
<properties>
<dataease.version>1.18.20</dataease.version>
<dataease.version>1.18.21</dataease.version>
<poi.version>4.1.1</poi.version>
<xmlbeans.version>3.1.0</xmlbeans.version>
</properties>