|
@ -78,85 +78,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); |
|
|
await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); |
|
|
return fileName; |
|
|
return fileName; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
|
|
public async Task<string> TextExportAsync() |
|
|
|
|
|
{ |
|
|
|
|
|
var fileName = $"发运数据_{Guid.NewGuid()}.xlsx"; |
|
|
|
|
|
var haveEdiHaveSeList = new List<SeEidCompareReportJisBBAC>(); |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 2_000_000; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
haveEdiHaveSeList.Add(new SeEidCompareReportJisBBAC() |
|
|
|
|
|
{ |
|
|
|
|
|
Category = "JIS", |
|
|
|
|
|
WmsBillNum = i.ToString(), |
|
|
|
|
|
CarModeCode = i.ToString(), |
|
|
|
|
|
LineStationcode = i.ToString(), |
|
|
|
|
|
SequenceNumber = i.ToString(), |
|
|
|
|
|
ParType = i.ToString(), |
|
|
|
|
|
MESConfigCode = i.ToString(), |
|
|
|
|
|
ShippingDate = DateTime.Now, |
|
|
|
|
|
PN = i.ToString(), |
|
|
|
|
|
Seq = i.ToString(), |
|
|
|
|
|
PjsNum = i.ToString(), |
|
|
|
|
|
MaterialNumber = i.ToString(), |
|
|
|
|
|
MaterialDes = i.ToString(), |
|
|
|
|
|
SEQty = 1, |
|
|
|
|
|
EdiQty = 1, |
|
|
|
|
|
AssemblyDate = DateTime.Now, |
|
|
|
|
|
MatchNumber = i.ToString(), |
|
|
|
|
|
InjectionCode = i.ToString(), |
|
|
|
|
|
DiffDesc = "WMS有发货EDI有订单" |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var jisBBACEidSeCompareEexcelExporterAttribute = typeof(SeEidCompareReportJisBBAC).GetAttribute<ExcelExporterAttribute>(); |
|
|
|
|
|
var jisBBACEidSeCompareEexcelMaxRowNumberOnASheet = 9_000_000; |
|
|
|
|
|
if (jisBBACEidSeCompareEexcelExporterAttribute != null) |
|
|
|
|
|
{ |
|
|
|
|
|
jisBBACEidSeCompareEexcelMaxRowNumberOnASheet = jisBBACEidSeCompareEexcelExporterAttribute.MaxRowNumberOnASheet > 0 ? jisBBACEidSeCompareEexcelExporterAttribute.MaxRowNumberOnASheet : jisBBACEidSeCompareEexcelMaxRowNumberOnASheet; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ExcelExporter excelExporter = new ExcelExporter(); |
|
|
|
|
|
excelExporter.Append(haveEdiHaveSeList.Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList(), $"BBACEDI数据和发货对比"); |
|
|
|
|
|
|
|
|
|
|
|
var ediSheetCount = (int)(haveEdiHaveSeList.Count / jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) + ((haveEdiHaveSeList.Count % jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) > 0 ? 1 : 0); |
|
|
|
|
|
if (ediSheetCount > 1) |
|
|
|
|
|
{ |
|
|
|
|
|
for (int i = 1; i < ediSheetCount; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
var sheetDataItems = haveEdiHaveSeList.Skip(i * jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) |
|
|
|
|
|
.Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList(); |
|
|
|
|
|
excelExporter.SeparateBySheet(); |
|
|
|
|
|
excelExporter.Append(sheetDataItems, $"BBACEDI数据和发货对比-{i}"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
excelExporter.Append(haveEdiHaveSeList.Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList(), $"BBAC发货和EDI数据对比"); |
|
|
|
|
|
var seSheetCount = (int)(haveEdiHaveSeList.Count / jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) + ((haveEdiHaveSeList.Count % jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) > 0 ? 1 : 0); |
|
|
|
|
|
if (seSheetCount > 1) |
|
|
|
|
|
{ |
|
|
|
|
|
for (int i = 1; i < seSheetCount; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
var sheetDataItems = haveEdiHaveSeList.Skip(i * jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) |
|
|
|
|
|
.Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList(); |
|
|
|
|
|
excelExporter.SeparateBySheet(); |
|
|
|
|
|
excelExporter.Append(sheetDataItems, $"BBAC发货和EDI数据对比-{i}"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//excelExporter
|
|
|
|
|
|
// .Append(haveEdiHaveSeList, $"BBACEDI数据和发货对比");
|
|
|
|
|
|
//.SeparateBySheet()
|
|
|
|
|
|
////.Append(haveEdiHaveSeList, $"BBAC发货和EDI数据对比");
|
|
|
|
|
|
|
|
|
|
|
|
var result = excelExporter.ExportAppendDataAsByteArray(); |
|
|
|
|
|
await result.ShouldNotBeNull().ConfigureAwait(false); |
|
|
|
|
|
await _fileContainer.SaveAsync(fileName, result.Result, true).ConfigureAwait(false); |
|
|
|
|
|
return fileName; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
#region 查询
|
|
|
#region 查询
|
|
|