Commit 5450c936 by fudahua

feat: 新版本的下载

parent 681e41fc
...@@ -893,7 +893,6 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService { ...@@ -893,7 +893,6 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
xlsxFiles.add(currentFile.get().filepath); xlsxFiles.add(currentFile.get().filepath);
} }
saveXlsSplitNew(currentFile.get().filepath,cells,titles,currentFile.get(),count,false); saveXlsSplitNew(currentFile.get().filepath,cells,titles,currentFile.get(),count,false);
count.incrementAndGet();
}); });
//结束 //结束
saveXlsSplitNew(currentFile.get().filepath,null,null,currentFile.get(),count,true); saveXlsSplitNew(currentFile.get().filepath,null,null,currentFile.get(),count,true);
...@@ -1225,8 +1224,8 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService { ...@@ -1225,8 +1224,8 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
DataFormat yyyyMMddDataFormat = xlsxFileInfo.workbook.createDataFormat(); DataFormat yyyyMMddDataFormat = xlsxFileInfo.workbook.createDataFormat();
yyyyMMdd.setDataFormat(yyyyMMddDataFormat.getFormat("yyyy-MM-dd")); yyyyMMdd.setDataFormat(yyyyMMddDataFormat.getFormat("yyyy-MM-dd"));
xlsxFileInfo.yyyyMMdd=yyyyMMdd; xlsxFileInfo.yyyyMMdd=yyyyMMdd;
count.incrementAndGet();
} }
count.incrementAndGet();
SXSSFWorkbook wb = xlsxFileInfo.workbook; // 内存中保留 100 行 SXSSFWorkbook wb = xlsxFileInfo.workbook; // 内存中保留 100 行
if (!endFlag) { if (!endFlag) {
...@@ -1265,7 +1264,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService { ...@@ -1265,7 +1264,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
} }
Integer limitSize = FileUtil.getLimitSize(); Integer limitSize = FileUtil.getLimitSize();
int c = count.get(); int c = count.get();
if (c>limitSize||endFlag) { if (c>=limitSize.intValue()||endFlag) {
logger.info("{}-count:{}",originalFilePath,count.get()); logger.info("{}-count:{}",originalFilePath,count.get());
FileOutputStream fileOut = new FileOutputStream(originalFilePath); FileOutputStream fileOut = new FileOutputStream(originalFilePath);
wb.write(fileOut); wb.write(fileOut);
......
...@@ -21,10 +21,6 @@ public class ExcelTest { ...@@ -21,10 +21,6 @@ public class ExcelTest {
DataFormat format = wb.createDataFormat(); DataFormat format = wb.createDataFormat();
cellStyle.setDataFormat(format.getFormat("yyyy-MM-dd HH:mm:ss")); cellStyle.setDataFormat(format.getFormat("yyyy-MM-dd HH:mm:ss"));
// CellStyle cellStyle = wb.createCellStyle();
// DataFormat format = wb.createDataFormat();
// cellStyle.setDataFormat(format.getFormat("yyyy-MM-dd HH:mm:ss"));
int n=0; int n=0;
do { do {
Row row = sheet.createRow(n); Row row = sheet.createRow(n);
......
...@@ -20,13 +20,13 @@ public class hdfs { ...@@ -20,13 +20,13 @@ public class hdfs {
// e.printStackTrace(); // e.printStackTrace();
// } // }
// HDFSUtil.getInstance().downloadFile("/data/emr/order-1.csv","D:\\testorder"); HDFSUtil.getInstance().downloadFile("/data/hook/hdfs1680836264869","D:\\testorder");
Integer[] arr=new Integer[]{1,2,3,4,5,6}; // Integer[] arr=new Integer[]{1,2,3,4,5,6};
Arrays.asList(arr).parallelStream().forEach(mid->{ // Arrays.asList(arr).parallelStream().forEach(mid->{
Thread thread = Thread.currentThread(); // Thread thread = Thread.currentThread();
String name = thread.getName(); // String name = thread.getName();
System.out.println(name); // System.out.println(name);
}); // });
// try{ // try{
// CSVReader csvReader = new CSVReader(new FileReader("C:\\Users\\hua\\Desktop\\part-00000-fa2dd286-1eda-452d-91a3-a222beb0f327-c000.csv")); // CSVReader csvReader = new CSVReader(new FileReader("C:\\Users\\hua\\Desktop\\part-00000-fa2dd286-1eda-452d-91a3-a222beb0f327-c000.csv"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment