Commit 5450c936 by fudahua

feat: 新版本的下载

parent 681e41fc
......@@ -893,7 +893,6 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
xlsxFiles.add(currentFile.get().filepath);
}
saveXlsSplitNew(currentFile.get().filepath,cells,titles,currentFile.get(),count,false);
count.incrementAndGet();
});
//结束
saveXlsSplitNew(currentFile.get().filepath,null,null,currentFile.get(),count,true);
......@@ -1225,8 +1224,8 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
DataFormat yyyyMMddDataFormat = xlsxFileInfo.workbook.createDataFormat();
yyyyMMdd.setDataFormat(yyyyMMddDataFormat.getFormat("yyyy-MM-dd"));
xlsxFileInfo.yyyyMMdd=yyyyMMdd;
count.incrementAndGet();
}
count.incrementAndGet();
SXSSFWorkbook wb = xlsxFileInfo.workbook; // 内存中保留 100 行
if (!endFlag) {
......@@ -1265,7 +1264,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
}
Integer limitSize = FileUtil.getLimitSize();
int c = count.get();
if (c>limitSize||endFlag) {
if (c>=limitSize.intValue()||endFlag) {
logger.info("{}-count:{}",originalFilePath,count.get());
FileOutputStream fileOut = new FileOutputStream(originalFilePath);
wb.write(fileOut);
......
......@@ -21,10 +21,6 @@ public class ExcelTest {
DataFormat format = wb.createDataFormat();
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;
do {
Row row = sheet.createRow(n);
......
......@@ -20,13 +20,13 @@ public class hdfs {
// e.printStackTrace();
// }
// HDFSUtil.getInstance().downloadFile("/data/emr/order-1.csv","D:\\testorder");
Integer[] arr=new Integer[]{1,2,3,4,5,6};
Arrays.asList(arr).parallelStream().forEach(mid->{
Thread thread = Thread.currentThread();
String name = thread.getName();
System.out.println(name);
});
HDFSUtil.getInstance().downloadFile("/data/hook/hdfs1680836264869","D:\\testorder");
// Integer[] arr=new Integer[]{1,2,3,4,5,6};
// Arrays.asList(arr).parallelStream().forEach(mid->{
// Thread thread = Thread.currentThread();
// String name = thread.getName();
// System.out.println(name);
// });
// try{
// 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