This commit is contained in:
Loretta 2025-10-13 18:03:27 +02:00
parent 540c59d7c4
commit d36b647f2f
4 changed files with 4 additions and 5 deletions

View File

@ -24,7 +24,7 @@ public class CustomOrderSignalREndpoint(FruitBankDbContext ctx) : ICustomOrderSi
[SignalR(SignalRTags.GetPendingOrderDtos)] [SignalR(SignalRTags.GetPendingOrderDtos)]
public async Task<List<OrderDto>> GetPendingOrderDtos() public async Task<List<OrderDto>> GetPendingOrderDtos()
{ {
return await ctx.OrderDtos.GetAllByStatus(OrderStatus.Pending).ToListAsync(); return await ctx.OrderDtos.GetAllByOrderStatus(OrderStatus.Pending).ToListAsync();
} }
[SignalR(SignalRTags.GetAllByIdList)] [SignalR(SignalRTags.GetAllByIdList)]
@ -32,5 +32,4 @@ public class CustomOrderSignalREndpoint(FruitBankDbContext ctx) : ICustomOrderSi
{ {
return await ctx.OrderDtos.GetAllByIds(orderIds).ToListAsync(); return await ctx.OrderDtos.GetAllByIds(orderIds).ToListAsync();
} }
} }

View File

@ -275,7 +275,7 @@ public class FruitBankDbContext : MgDbContextBase,
foreach (var shippingItemPallet in shippingItem.ShippingItemPallets!.Where(x => x.IsMeasured && x.IsValidMeasuringValues(shippingItem.IsMeasurable))) foreach (var shippingItemPallet in shippingItem.ShippingItemPallets!.Where(x => x.IsMeasured && x.IsValidMeasuringValues(shippingItem.IsMeasurable)))
{ {
shippingItem.MeasuredQuantity += shippingItemPallet.Quantity; shippingItem.MeasuredQuantity += shippingItemPallet.TrayQuantity;
if (!shippingItem.IsMeasurable) continue; if (!shippingItem.IsMeasurable) continue;
shippingItem.MeasuredNetWeight += shippingItemPallet.NetWeight; shippingItem.MeasuredNetWeight += shippingItemPallet.NetWeight;

View File

@ -33,7 +33,7 @@ public class OrderDtoDbTable : MgDbTableBase<OrderDto>
return GetAll(true).Where(x => x.Id == orderId).FirstOrDefaultAsync(null); return GetAll(true).Where(x => x.Id == orderId).FirstOrDefaultAsync(null);
} }
public IQueryable<OrderDto> GetAllByStatus(OrderStatus orderStatus) public IQueryable<OrderDto> GetAllByOrderStatus(OrderStatus orderStatus)
=> GetAll(true).Where(o => o.OrderStatusId == (int)orderStatus); => GetAll(true).Where(o => o.OrderStatusId == (int)orderStatus);
public IQueryable<OrderDto> GetAllByIds(IEnumerable<int> orderIds) public IQueryable<OrderDto> GetAllByIds(IEnumerable<int> orderIds)

View File

@ -32,7 +32,7 @@ public class OrderItemPalletDbTable : MeasuringItemPalletBaseDbTable<OrderItemPa
public IQueryable<OrderItemPallet> GetAll(bool loadRelations) public IQueryable<OrderItemPallet> GetAll(bool loadRelations)
{ {
return loadRelations return loadRelations
? GetAll().LoadWith(oip => oip.OrderItem) ? GetAll().LoadWith(oip => oip.OrderItemDto).ThenLoad(oi => oi.ProductDto)
: GetAll(); : GetAll();
} }