* Further improvements

This commit is contained in:
2025-06-17 22:05:15 +02:00
parent a8e3a8be66
commit 30d2984add
6 changed files with 133 additions and 58 deletions

View File

@@ -1,5 +1,6 @@
using System.Net;
using System.Web;
using OrdersManagement.Models;
using SytelineSaAppEfDataModel.Dtos;
namespace OrdersManagement.Services;
@@ -100,7 +101,18 @@ public class WarehouseService(IHttpClientFactory httpClientFactory)
response.EnsureSuccessStatusCode();
return await response.Content.ReadFromJsonAsync<IEnumerable<WzRowMeyleDto>>();
}
public async Task<IDictionary<string, List<TransactionModel>>> GetTransactionsModels()
{
var response = await _httpClient.GetAsync($"api/WzRowMeyle/transactions-with-part-number");
response.EnsureSuccessStatusCode();
IEnumerable<MaterialTransactionDto> materialTransactions =
await response.Content.ReadFromJsonAsync<IEnumerable<MaterialTransactionDto>>();
return materialTransactions.GroupBy(x => x.NR_KARTY_KONTROLNEJ).ToDictionary(x => x.Key ?? "",
y => y.Select(z => new TransactionModel() { ItemNumber = z.Item, PartNumber = z.NR_KARTY_KONTROLNEJ, Quantity = z.Qty }).ToList());
}
public async Task UpdateWzRowsMeyleAsync(IEnumerable<WzRowMeyleDto?> wzRowsMeyle)
{
if (wzRowsMeyle == null || !wzRowsMeyle.Any())