zhaoxinyu
11 months ago
4 changed files with 266 additions and 0 deletions
@ -0,0 +1,98 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Shouldly; |
|||
using TaskJob.EventArgs; |
|||
using TaskJob.Interfaces; |
|||
using Volo.Abp.BlobStoring; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Uow; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.Bases; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|||
{ |
|||
public class EdiWmsDiffService :BASE_SERVICE, ITransientDependency, IExportJob |
|||
{ |
|||
|
|||
protected readonly EdiWmsDapperRepository _dapper; |
|||
|
|||
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
|||
|
|||
|
|||
public EdiWmsDiffService(IBlobContainer<MyFileContainer> fileContainer, EdiWmsDapperRepository dapper, IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager) : base(excelImportService, snowflakeIdGenerator, commonManager) |
|||
{ |
|||
_dapper = dapper; |
|||
_fileContainer = fileContainer; |
|||
} |
|||
|
|||
[UnitOfWork(false)] |
|||
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
|||
{ |
|||
var _filename = exportName.FirstOrDefault(); |
|||
var year = property.Where(p => p.Name == "Year").FirstOrDefault().Value; |
|||
var list = _dapper.GetEdiWms(); |
|||
ExcelExporter _exporter = new ExcelExporter();//导出Excel
|
|||
var result = _exporter.Append(list.ToList(), "BBAC业务EDI发运对比表") |
|||
//.SeparateBySheet()
|
|||
//.Append(_reversels.ToList(), "有发货无结算对比")
|
|||
.ExportAppendDataAsByteArray(); |
|||
result.ShouldNotBeNull(); |
|||
_fileContainer.SaveAsync(_filename, result.Result, true); |
|||
return id.ToString(); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
public class HBPOEdiWmsDiffService : BASE_SERVICE, ITransientDependency, IExportJob |
|||
{ |
|||
|
|||
protected readonly EdiWmsDapperRepository _dapper; |
|||
|
|||
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
|||
|
|||
|
|||
public HBPOEdiWmsDiffService(IBlobContainer<MyFileContainer> fileContainer, EdiWmsDapperRepository dapper, IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager) : base(excelImportService, snowflakeIdGenerator, commonManager) |
|||
{ |
|||
_dapper = dapper; |
|||
_fileContainer = fileContainer; |
|||
} |
|||
|
|||
[UnitOfWork(false)] |
|||
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
|||
{ |
|||
var _filename = exportName.FirstOrDefault(); |
|||
var year = property.Where(p => p.Name == "Year").FirstOrDefault().Value; |
|||
var list = _dapper.GetHBPOEdiWms(); |
|||
ExcelExporter _exporter = new ExcelExporter();//导出Excel
|
|||
var result = _exporter.Append(list.ToList(), "HBPO业务EDI发运对比表") |
|||
//.SeparateBySheet()
|
|||
//.Append(_reversels.ToList(), "有发货无结算对比")
|
|||
.ExportAppendDataAsByteArray(); |
|||
result.ShouldNotBeNull(); |
|||
_fileContainer.SaveAsync(_filename, result.Result, true); |
|||
return id.ToString(); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
} |
Loading…
Reference in new issue