Browse Source

三方比对按类别生成

master
zhouhongjun 5 months ago
parent
commit
ab16c5eb60
  1. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/NopiDataToExcel.cs
  2. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs
  3. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs

11
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/NopiDataToExcel.cs

@ -37,7 +37,7 @@ namespace SettleAccount.Job.Services.Report
/// <param name="sheetName">页签名称</param>
/// <param name="data">数据</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);
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 zipPath = zipFileName;
using (var archive = ZipFile.Open(zipPath, ZipArchiveMode.Create))
@ -105,10 +107,9 @@ namespace SettleAccount.Job.Services.Report
}
}
//using (FileStream fileStream = new FileStream(zipPath, FileMode.Open))
//{
// return fileStream.GetAllBytes();
//}
}
return zipFileName;
}

11
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs

@ -308,9 +308,9 @@ namespace SettleAccount.Job.Services.Report
#region 多线程生成Excel
haveSaNotHaveSeExport.AddRange(notHaveSaHaveSeExports);
//haveSaNotHaveSeExport.AddRange(notHaveSaHaveSeExports);
haveSaNotHaveSeExport.AddRange(haveSaHaveSeExport);
//haveSaNotHaveSeExport.AddRange(haveSaHaveSeExport);
NopiExtendExcel<T> nopiExcel = new NopiExtendExcel<T>();
@ -322,8 +322,13 @@ namespace SettleAccount.Job.Services.Report
nopiExcel.EndPoint = _cfg.GetValue("MinIO:EndPoint", "localhost:10684");
var uploadResult = nopiExcel.WriteDataToExcelInParallel($"{businessTypeDisplayName}结算数据和发货对比", haveSaNotHaveSeExport, 500000, fileName, haveSaHaveSeSumExports).ConfigureAwait(false);
//var uploadResult = nopiExcel.WriteDataToExcelInParallel($"{businessTypeDisplayName}结算数据和发货对比", haveSaNotHaveSeExport, 500000, fileName, haveSaHaveSeSumExports, false).ConfigureAwait(false);
nopiExcel.WriteDataToExcelInParallel($"{businessTypeDisplayName}结算和发货对比_有结无发", haveSaNotHaveSeExport, 500000, fileName, null, false).ConfigureAwait(false);
nopiExcel.WriteDataToExcelInParallel($"{businessTypeDisplayName}结算和发货对比_有发无结", notHaveSaHaveSeExports, 500000, fileName, null, false).ConfigureAwait(false);
nopiExcel.WriteDataToExcelInParallel($"{businessTypeDisplayName}结算和发货对比_有结有发", haveSaHaveSeExport, 500000, fileName, haveSaHaveSeSumExports, true).ConfigureAwait(false);
return fileName;
#endregion

2
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs

@ -232,7 +232,7 @@ namespace SettleAccount.Job.Services.Report
nopiExcelHaveEdiNotHaveSe.EndPoint = _cfg.GetValue("MinIO:EndPoint", "localhost:10684");
var uploadResult = nopiExcelHaveEdiNotHaveSe.WriteDataToExcelInParallel($"{businessTypeDisplayName}EDI数据和发货对比", haveEdiNotHaveSeList, 500000,fileName,null).ConfigureAwait(false);
var uploadResult = nopiExcelHaveEdiNotHaveSe.WriteDataToExcelInParallel($"{businessTypeDisplayName}EDI数据和发货对比", haveEdiNotHaveSeList, 500000,fileName,null,true).ConfigureAwait(false);
return fileName;

Loading…
Cancel
Save