работает хоть не очень красиво
This commit is contained in:
parent
c83a68d282
commit
a410427c9b
@ -92,7 +92,6 @@ namespace SushiBarBusinessLogic.BusinessLogics
|
|||||||
model.Status = newStatus;
|
model.Status = newStatus;
|
||||||
if (model.Status == OrderStatus.Готов || viewModel.Status == OrderStatus.Ожидание)
|
if (model.Status == OrderStatus.Готов || viewModel.Status == OrderStatus.Ожидание)
|
||||||
{
|
{
|
||||||
model.DateImplement = DateTime.Now;
|
|
||||||
var sushi = _sushiStorage.GetElement(new() { Id = viewModel.SushiId });
|
var sushi = _sushiStorage.GetElement(new() { Id = viewModel.SushiId });
|
||||||
if (sushi == null)
|
if (sushi == null)
|
||||||
{
|
{
|
||||||
@ -103,6 +102,10 @@ namespace SushiBarBusinessLogic.BusinessLogics
|
|||||||
model.Status = OrderStatus.Ожидание;
|
model.Status = OrderStatus.Ожидание;
|
||||||
_logger.LogWarning($"AddSushi operation failed. Shop is full.");
|
_logger.LogWarning($"AddSushi operation failed. Shop is full.");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
model.DateImplement = DateTime.Now;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -30,10 +30,22 @@ namespace SushiBarBusinessLogic.BusinessLogics
|
|||||||
_logger.LogWarning("DoWork. Implementers is null");
|
_logger.LogWarning("DoWork. Implementers is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var orders = _orderLogic.ReadList(new OrderSearchModel { OrderStatus = OrderStatus.Принят });
|
List<OrderViewModel>? orders = _orderLogic.ReadList(new OrderSearchModel { OrderStatus = OrderStatus.Принят });
|
||||||
if (orders == null || orders.Count == 0)
|
List<OrderViewModel>? ordersInWork = _orderLogic.ReadList(new OrderSearchModel { OrderStatus = OrderStatus.Выполняется });
|
||||||
|
List<OrderViewModel>? ordersInWaiting = _orderLogic.ReadList(new OrderSearchModel { OrderStatus = OrderStatus.Ожидание });
|
||||||
|
if (orders == null || ordersInWork == null || ordersInWaiting == null)
|
||||||
{
|
{
|
||||||
_logger.LogWarning("DoWork. Orders is null or empty");
|
_logger.LogWarning("DoWork. Orders are null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
orders.AddRange(ordersInWork);
|
||||||
|
orders.AddRange(ordersInWaiting);
|
||||||
|
}
|
||||||
|
if (orders.Count == 0)
|
||||||
|
{
|
||||||
|
_logger.LogWarning("DoWork. Orders are empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_logger.LogDebug("DoWork for {Count} orders", orders.Count);
|
_logger.LogDebug("DoWork for {Count} orders", orders.Count);
|
||||||
|
Loading…
Reference in New Issue
Block a user