Browse Source

修改 报表

集成Redis
郑勃旭 2 years ago
parent
commit
0addbbcc6a
  1. 19
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs

19
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs

@ -133,6 +133,17 @@ public class TransactionAppService
public virtual async Task<List<ReportItemSerialDto>> GetItemSerialList(List<string> itemCodes,string erpLocationCode,DateTime startDateTime,DateTime endDateTime) public virtual async Task<List<ReportItemSerialDto>> GetItemSerialList(List<string> itemCodes,string erpLocationCode,DateTime startDateTime,DateTime endDateTime)
{ {
var itemSerialDtos = new List<ReportItemSerialDto>(); var itemSerialDtos = new List<ReportItemSerialDto>();
if (!itemCodes.Any())
{
var itemBasicDtos_i= await _itemBasicAppService.GetAllListByFilterAsync(new SfsBaseDataRequestInputBase()).ConfigureAwait(false);
var itemBasicDtos_t = await _repository.GetListAsync().ConfigureAwait(false);
itemCodes.AddRange(itemBasicDtos_i.Select(p => p.Code));
itemCodes.AddRange(itemBasicDtos_t.Select(p => p.ItemCode));
itemCodes=itemCodes.Distinct().ToList();
}
foreach (var itemCode in itemCodes) foreach (var itemCode in itemCodes)
{ {
var itemSerialDto = new ReportItemSerialDto(); var itemSerialDto = new ReportItemSerialDto();
@ -151,12 +162,16 @@ public class TransactionAppService
//所有这个零件的事务 //所有这个零件的事务
var transactions=await _repository.GetListAsync(p => p.ItemCode == itemCode).ConfigureAwait(false); var transactions=await _repository.GetListAsync(p => p.ItemCode == itemCode).ConfigureAwait(false);
if (string.IsNullOrEmpty(erpLocationCode)) if (!string.IsNullOrEmpty(erpLocationCode))
{ {
transactions = transactions.Where(p => p.LocationErpCode == erpLocationCode).ToList(); transactions = transactions.Where(p => p.LocationErpCode == erpLocationCode).ToList();
} }
var locationDtos=await _locationAppService.GetAllAsync().ConfigureAwait(false);
var locationDtos=await _locationAppService.GetAllAsync().ConfigureAwait(false);
if (!string.IsNullOrEmpty(erpLocationCode))
{
locationDtos = locationDtos.Where(p => p.ErpLocationCode == erpLocationCode).ToList();
}
var groupKey= locationDtos.GroupBy(p => p.ErpLocationCode); var groupKey= locationDtos.GroupBy(p => p.ErpLocationCode);
foreach (var keyGroup in groupKey) foreach (var keyGroup in groupKey)

Loading…
Cancel
Save