Merge pull request #12711 from dataease/dev-v2@fixexportdata

fix:  数据导出超过100w时,分多个sheet
This commit is contained in:
taojinlong 2024-10-15 16:02:56 +08:00 committed by GitHub
commit 4ba403795f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -509,7 +509,7 @@ public class ExportCenterManage implements BaseExportApi {
for (Long s = 1L; s < sheetCount + 1; s++) { for (Long s = 1L; s < sheetCount + 1; s++) {
Long sheetSize; Long sheetSize;
if (s.equals(sheetCount)) { if (s.equals(sheetCount)) {
sheetSize = totalCount - sheetCount * (s - 1) * sheetLimit; sheetSize = totalCount - (s - 1) * sheetLimit;
} else { } else {
sheetSize = sheetLimit; sheetSize = sheetLimit;
} }
@ -590,8 +590,8 @@ public class ExportCenterManage implements BaseExportApi {
} }
} }
exportTask.setExportStatus("IN_PROGRESS"); exportTask.setExportStatus("IN_PROGRESS");
double exportRogress2 = (double) ((double) s - 1 / (double) sheetCount); double exportRogress2 = (double) ((double) s - 1) / ((double) sheetCount);
double exportRogress = (double) ((double) p / (double) pageSize) * ((double) 1 / sheetCount); double exportRogress = (double) ((double) (p + 1) / (double) pageSize) * ((double) 1 / sheetCount);
DecimalFormat df = new DecimalFormat("#.##"); DecimalFormat df = new DecimalFormat("#.##");
String formattedResult = df.format((exportRogress + exportRogress2) * 100); String formattedResult = df.format((exportRogress + exportRogress2) * 100);
exportTask.setExportProgress(formattedResult); exportTask.setExportProgress(formattedResult);