* Added new Controllers to API

* Added methods to get WZs for specific client
This commit is contained in:
2025-05-08 20:44:20 +02:00
parent 1f08ae05f0
commit da1eae8ca9
8 changed files with 125 additions and 59 deletions

View File

@@ -66,4 +66,21 @@ public class MaterialTransactionService(SytelineSaAppDbContext context, IMapper
return result.Select(x => mapper.Map<MaterialTransactionDto>(x));
}
public async Task<IEnumerable<MaterialTransactionDto>> GetByCustomerNumber(string customerNumber, int customerSequence)
{
IList<string> coNumbers = await context.CustomerOrders
.Where(x => x.CustNum == customerNumber && x.CustSeq == customerSequence && (x.Stat == "P" || x.Stat == "O"))
.Select(x => x.CoNum).ToListAsync();
List<MaterialTransactionDto> result = new List<MaterialTransactionDto>();
foreach (string coNumber in coNumbers)
{
IEnumerable<MaterialTransactionDto> materialTransactions = await GetByOrderNumber(coNumber);
result.AddRange(materialTransactions);
}
return result.OrderByDescending(x => x.CreateDate);
}
}