done
This commit is contained in:
parent
fac932873e
commit
6355549293
@ -153,7 +153,7 @@ namespace AbstractShowClientApp.Controllers
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
return
|
||||
View(APIClient.GetRequest<List<MessageInfoViewModel>>($"api/client/getmessages?clientId ={APIClient.Client.Id}"));
|
||||
View(APIClient.GetRequest<List<MessageInfoViewModel>>($"api/client/getmessages?clientId={APIClient.Client.Id}"));
|
||||
}
|
||||
}
|
||||
}
|
@ -123,24 +123,23 @@ namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic
|
||||
{
|
||||
model.ImplementerId = rawModel.ImplementerId;
|
||||
}
|
||||
if (viewModel.Status + 1 != _newStatus)
|
||||
|
||||
CheckModel(model, false);
|
||||
if (model.Status + 1 != _newStatus)
|
||||
{
|
||||
_logger.LogWarning("Status update to " + _newStatus.ToString() + " operation failed. Order status incorrect.");
|
||||
return false;
|
||||
}
|
||||
rawModel.Status = _newStatus;
|
||||
if (rawModel.Status == OrderStatus.Выдан) rawModel.DateImplement = DateTime.Now;
|
||||
else
|
||||
model.Status = _newStatus;
|
||||
if (model.Status == OrderStatus.Выдан) model.DateImplement = DateTime.Now;
|
||||
var result = _orderStorage.Update(model);
|
||||
if (result == null)
|
||||
{
|
||||
rawModel.DateImplement = viewModel.DateImplement;
|
||||
}
|
||||
CheckModel(rawModel, false);
|
||||
if (_orderStorage.Update(rawModel) == null)
|
||||
{
|
||||
rawModel.Status--;
|
||||
model.Status--;
|
||||
_logger.LogWarning("Update operation failed");
|
||||
return false;
|
||||
}
|
||||
SendOrderStatusMail(result.ClientId, $"Изменен статус заказа #{result.Id}", $"Заказ #{result.Id} изменен статус на {result.Status}");
|
||||
return true;
|
||||
}
|
||||
public OrderViewModel? ReadElement(OrderSearchModel model)
|
||||
|
@ -71,7 +71,7 @@ namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic
|
||||
}))
|
||||
{
|
||||
// делаем работу
|
||||
Thread.Sleep(implementer.WorkExperience * _rnd.Next(100, 1000) * order.Count);
|
||||
Thread.Sleep(implementer.WorkExperience * _rnd.Next(1000, 10000) * order.Count);
|
||||
_logger.LogDebug("DoWork. Worker {Id} finish order {Order}", implementer.Id, order.Id);
|
||||
_orderLogic.FinishOrder(new OrderBindingModel
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user