|
@ -37,7 +37,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
/// <param name="sheetName">页签名称</param>
|
|
|
/// <param name="sheetName">页签名称</param>
|
|
|
/// <param name="data">数据</param>
|
|
|
/// <param name="data">数据</param>
|
|
|
/// <param name="chunkSize">缓存文件行数</param>
|
|
|
/// <param name="chunkSize">缓存文件行数</param>
|
|
|
public async Task<string> WriteDataToExcelInParallel(string sheetName, List<T> data, int chunkSize,string zipFileName, List<SaSeEdiCompareSumReport> sumdata) |
|
|
public async Task<string> WriteDataToExcelInParallel(string sheetName, List<T> data, int chunkSize,string zipFileName, List<SaSeEdiCompareSumReport> sumdata,bool isFinish) |
|
|
{ |
|
|
{ |
|
|
var count = data.Count / 1000000 + ((data.Count % 1000000) > 0 ? 1 : 0); |
|
|
var count = data.Count / 1000000 + ((data.Count % 1000000) > 0 ? 1 : 0); |
|
|
for (var i = 1; i <= count; i++) |
|
|
for (var i = 1; i <= count; i++) |
|
@ -61,6 +61,8 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(isFinish) |
|
|
|
|
|
{ |
|
|
string[] filePaths = excelFiles.Select(x => x.FileName).ToArray(); |
|
|
string[] filePaths = excelFiles.Select(x => x.FileName).ToArray(); |
|
|
string zipPath = zipFileName; |
|
|
string zipPath = zipFileName; |
|
|
using (var archive = ZipFile.Open(zipPath, ZipArchiveMode.Create)) |
|
|
using (var archive = ZipFile.Open(zipPath, ZipArchiveMode.Create)) |
|
@ -86,7 +88,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
var minioClient = new MinioClient(EndPoint, AccessKey, SecretKey, ""); |
|
|
var minioClient = new MinioClient(EndPoint, AccessKey, SecretKey, ""); |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
await minioClient.PutObjectAsync(BucketName, "host/"+zipPath, fileStream, fileStream.Length, "application/zip").ConfigureAwait(false); |
|
|
await minioClient.PutObjectAsync(BucketName, "host/" + zipPath, fileStream, fileStream.Length, "application/zip").ConfigureAwait(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -105,10 +107,9 @@ namespace SettleAccount.Job.Services.Report |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
//using (FileStream fileStream = new FileStream(zipPath, FileMode.Open))
|
|
|
|
|
|
//{
|
|
|
} |
|
|
// return fileStream.GetAllBytes();
|
|
|
|
|
|
//}
|
|
|
|
|
|
return zipFileName; |
|
|
return zipFileName; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|