|
@ -130,7 +130,7 @@ public class TransactionAppService |
|
|
/// <param name="endDateTime"></param>
|
|
|
/// <param name="endDateTime"></param>
|
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("item-serial-list")] |
|
|
[HttpPost("item-serial-list")] |
|
|
public virtual async Task<List<ReportItemSerialDto>> GetItemSerialList(List<string> itemCodes,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>(); |
|
|
foreach (var itemCode in itemCodes) |
|
|
foreach (var itemCode in itemCodes) |
|
@ -151,6 +151,10 @@ 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)) |
|
|
|
|
|
{ |
|
|
|
|
|
transactions = transactions.Where(p => p.LocationErpCode == erpLocationCode).ToList(); |
|
|
|
|
|
} |
|
|
var locationDtos=await _locationAppService.GetAllAsync().ConfigureAwait(false); |
|
|
var locationDtos=await _locationAppService.GetAllAsync().ConfigureAwait(false); |
|
|
|
|
|
|
|
|
var groupKey= locationDtos.GroupBy(p => p.ErpLocationCode); |
|
|
var groupKey= locationDtos.GroupBy(p => p.ErpLocationCode); |
|
@ -240,6 +244,12 @@ public class TransactionAppService |
|
|
itemSerialDto.ReportErpLocationSerialDtos.Add(reportErpLocationSerialDto); |
|
|
itemSerialDto.ReportErpLocationSerialDtos.Add(reportErpLocationSerialDto); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
itemSerialDto.FirstQty = itemSerialDto.ReportErpLocationSerialDtos.Sum(p => p.FirstQty); |
|
|
|
|
|
itemSerialDto.NowQty = itemSerialDto.ReportErpLocationSerialDtos.Sum(p => p.NowQty); |
|
|
|
|
|
itemSerialDto.LastQty = itemSerialDto.ReportErpLocationSerialDtos.Sum(p => p.LastQty); |
|
|
|
|
|
itemSerialDto.SumOutQty = itemSerialDto.ReportErpLocationSerialDtos.Sum(p => p.SumOutQty); |
|
|
|
|
|
itemSerialDto.SumInQty = itemSerialDto.ReportErpLocationSerialDtos.Sum(p => p.SumInQty); |
|
|
|
|
|
|
|
|
itemSerialDtos.Add(itemSerialDto); |
|
|
itemSerialDtos.Add(itemSerialDto); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|