Administrator
3 years ago
14 changed files with 358 additions and 99 deletions
@ -0,0 +1,80 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using TaskJob.EventArgs; |
|||
using TaskJob.Interfaces; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; |
|||
using Win.Sfs.SettleAccount.Repository.SettleAccount; |
|||
using Win.Sfs.SettleAccount.Repository.SettleAccountJob; |
|||
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; |
|||
|
|||
namespace SettleAccount.Job.Services |
|||
{ |
|||
/// <summary>
|
|||
/// 2.大众发票与结算核对明细表-准时化
|
|||
/// </summary>
|
|||
public class InvoiceSettledDetailDiffExportService : ITransientDependency, IExportJob |
|||
{ |
|||
|
|||
private readonly InvoiceSettledDetailDiffDapperRepository _dapperRepository; |
|||
private readonly ErpPartDapperRepository _erpdapperRepository; |
|||
|
|||
private readonly OutputService _outputService; |
|||
private readonly InputService _inputService; |
|||
|
|||
public InvoiceSettledDetailDiffExportService( |
|||
|
|||
ErpPartDapperRepository erpdapperRepository, |
|||
InvoiceSettledDetailDiffDapperRepository dapperRepository, |
|||
OutputService outputService, |
|||
InputService inputService |
|||
) |
|||
{ |
|||
_inputService = inputService; |
|||
_outputService = outputService; |
|||
_erpdapperRepository= erpdapperRepository; |
|||
//_repository = repository;
|
|||
//_versionRepository = versionRepository;
|
|||
_dapperRepository =dapperRepository; |
|||
} |
|||
|
|||
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list) |
|||
{ |
|||
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; |
|||
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; |
|||
var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value; |
|||
var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; |
|||
var cp7begin = p_list.Where(p => p.Name == "Cp7BeginTime").FirstOrDefault().Value; |
|||
var cp7end = p_list.Where(p => p.Name == "Cp7EndTime").FirstOrDefault().Value; |
|||
var kenncode = p_list.Where(p => p.Name == "KennCode").FirstOrDefault().Value; |
|||
var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; |
|||
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber); |
|||
var _list = _ls.GroupBy(p => p.ParentSapMaterialCode).Select(p => p.FirstOrDefault()).ToList(); |
|||
|
|||
var rangeList = _erpdapperRepository.GetSapList<InvoiceSettledDetailDiff>(_list); |
|||
rangeList.ForEach(p => { |
|||
p.Qty = 1; |
|||
p.InvoiceQty = 1; |
|||
p.SettledQty = 1; |
|||
p.DiffSettleFisQty = 0; |
|||
p.DiffSettleInvQty = 0; |
|||
|
|||
}); |
|||
|
|||
|
|||
_ls.AddRange(rangeList); |
|||
_ls.OrderBy(p => new { p.ChassisNumber, p.KENNCode }); |
|||
_outputService.Export<InvoiceSettledDetailDiff>(id, string.Format("大众发票与结算核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _ls); |
|||
|
|||
|
|||
|
|||
//_repository.Insert(_list);
|
|||
//_versionRepository.Insert(_id, version, customerCode, customerCode, string.Empty, string.Empty, projectName);
|
|||
return id.ToString(); |
|||
} |
|||
|
|||
} |
|||
} |
Loading…
Reference in new issue