|
|
@ -133,6 +133,17 @@ public class TransactionAppService |
|
|
|
public virtual async Task<List<ReportItemSerialDto>> GetItemSerialList(List<string> itemCodes,string erpLocationCode,DateTime startDateTime,DateTime endDateTime) |
|
|
|
{ |
|
|
|
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) |
|
|
|
{ |
|
|
|
var itemSerialDto = new ReportItemSerialDto(); |
|
|
@ -151,12 +162,16 @@ public class TransactionAppService |
|
|
|
|
|
|
|
//所有这个零件的事务
|
|
|
|
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(); |
|
|
|
} |
|
|
|
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); |
|
|
|
|
|
|
|
foreach (var keyGroup in groupKey) |
|
|
|