|
@ -1,11 +1,15 @@ |
|
|
using System; |
|
|
using Magicodes.ExporterAndImporter.Excel; |
|
|
|
|
|
using Shouldly; |
|
|
|
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using TaskJob.EventArgs; |
|
|
using TaskJob.EventArgs; |
|
|
using TaskJob.Interfaces; |
|
|
using TaskJob.Interfaces; |
|
|
|
|
|
using Volo.Abp.BlobStoring; |
|
|
using Volo.Abp.DependencyInjection; |
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
|
using Win.Sfs.SettleAccount.Reports.SettledPartAndErpPartPriceDiffs; |
|
|
using Win.Sfs.SettleAccount.Reports.SettledPartAndErpPartPriceDiffs; |
|
|
using Win.Sfs.SettleAccount.Repository.Report; |
|
|
using Win.Sfs.SettleAccount.Repository.Report; |
|
|
|
|
|
|
|
@ -16,11 +20,16 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
|
|
|
|
|
private readonly SettledPartAndErpPartPriceDiffRepository _dapper; |
|
|
private readonly SettledPartAndErpPartPriceDiffRepository _dapper; |
|
|
private readonly OutputService _outputService; |
|
|
private readonly OutputService _outputService; |
|
|
|
|
|
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
|
|
|
|
|
|
|
|
public SettledPartAndErpPartPriceDiffExportService(SettledPartAndErpPartPriceDiffRepository dapper, OutputService outputService) |
|
|
public SettledPartAndErpPartPriceDiffExportService(SettledPartAndErpPartPriceDiffRepository dapper, |
|
|
|
|
|
|
|
|
|
|
|
IBlobContainer<MyFileContainer> fileContainer, |
|
|
|
|
|
OutputService outputService) |
|
|
{ |
|
|
{ |
|
|
_dapper = dapper; |
|
|
_dapper = dapper; |
|
|
_outputService = outputService; |
|
|
_outputService = outputService; |
|
|
|
|
|
_fileContainer = fileContainer; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -31,7 +40,25 @@ namespace SettleAccount.Job.Services.Report |
|
|
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; |
|
|
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; |
|
|
var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value; |
|
|
var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value; |
|
|
var _list= _dapper.GetDiffReport(DateTime.Now.Year.ToString(), customerCode, version); |
|
|
var _list= _dapper.GetDiffReport(DateTime.Now.Year.ToString(), customerCode, version); |
|
|
_outputService.Export<SettledPartAndErpPartPriceDiff>(id,string.Format("Bom定价对比_{0}.xlsx",Guid.NewGuid().ToString()), _list); |
|
|
var _childList= _dapper.GetDiffDetailReport(DateTime.Now.Year.ToString(), customerCode, version); |
|
|
|
|
|
var _filename = exportName.FirstOrDefault(); |
|
|
|
|
|
ExcelExporter _exporter = new ExcelExporter();//导出Excel
|
|
|
|
|
|
|
|
|
|
|
|
var result = _exporter |
|
|
|
|
|
.Append(_list, "BOM价格对比明细") |
|
|
|
|
|
.SeparateBySheet() |
|
|
|
|
|
.Append(_childList, "无价格零件") |
|
|
|
|
|
.SeparateBySheet() |
|
|
|
|
|
|
|
|
|
|
|
.ExportAppendDataAsByteArray(); |
|
|
|
|
|
result.ShouldNotBeNull(); |
|
|
|
|
|
_fileContainer.SaveAsync(_filename, result.Result, true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//_outputService.Export<SettledPartAndErpPartPriceDiff>(id,string.Format("Bom定价对比_{0}.xlsx",Guid.NewGuid().ToString()), _list);
|
|
|
return id.ToString(); |
|
|
return id.ToString(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|