commit
6b96b42107
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dataease-mobile",
|
||||
"version": "1.18.20",
|
||||
"version": "1.18.21",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "npm run dev:h5",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user