Browse Source

更新补货数据导出

master
学 赵 1 year ago
parent
commit
2ced338e80
  1. 40
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

40
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -408,15 +408,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public async Task<string> ReplenishedExportAsync(ARequestDto input)
{
RequestDto inputTemp = new RequestDto();
//inputTemp.Filters.Add(new FilterCondition("BillTime", input.startBillTime, EnumFilterAction.BiggerThanOrEqual, EnumFilterLogic.And));
//inputTemp.Filters.Add(new FilterCondition("BillTime", input.endBillTime, EnumFilterAction.SmallThanOrEqual, EnumFilterLogic.And));
//var entities = await _logRepository.GetListByFilterAsync(inputTemp.Filters,null,3,0).ConfigureAwait(false);
var beginDate= DateTime.Parse(input.startBillTime).ToString("yyyy/MM/dd") + " 00:00:00 ";
var endDate = DateTime.Parse(input.endBillTime).ToString("yyyy/MM/dd") + " 23:59:59 ";
DateTimeFormatInfo dtFormat = new DateTimeFormatInfo();
dtFormat.ShortDatePattern = "yyyy/MM/dd HH:mm:ss";
//DateTime aa= DateTime.ParseExact(DateTime.Parse(input.startBillTime).ToString("yyyy/MM/dd"), "yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture);
var result = (from temp1 in _logRepository
join temp2 in
@ -452,18 +448,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
) on new { temp1.VinCode, temp1.RealPartCode } equals new { temp2.VinCode, temp2.RealPartCode }
where temp1.ChangedQty > 0
select temp1).ToList();
//var temp2 = (from a in _logRepository
// where (int)a.LogType == 200
// group a by new { a.VinCode, a.RealPartCode } into g
@ -491,28 +475,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
// where a.MinChangedTime < b.MinChangedTime && a.SumChangedQty <= b.SumChangedQty
// select b);
// var entities = await _logRepository.Where(p => p.BillTime >= DateTime.Parse(beginDate) && p.BillTime <= DateTime.Parse(endDate)).ToListAsync();
var entities = await result.Where(p => p.BillTime >= DateTime.Parse(beginDate) && p.BillTime <= DateTime.Parse(endDate)).ToListAsync();
// IQueryable<VmiLog> query = _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiLog>());
var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx";
var content = this.GetContent(result, "补货数据_");
var content = this.GetContent(entities, "补货数据_");
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
return fileName;
}

Loading…
Cancel
Save