все поломалос...

This commit is contained in:
kamilia 2024-05-19 14:21:43 +04:00
commit 96bb26dc1b
4 changed files with 73 additions and 30 deletions

View File

@ -0,0 +1,66 @@
2024-05-08 08:22:39,372 INFO Microsoft.Hosting.Lifetime.? [?] - MESSAGE: Now listening on: https://localhost:7282
2024-05-08 08:22:39,455 INFO Microsoft.Hosting.Lifetime.? [?] - MESSAGE: Now listening on: http://localhost:5121
2024-05-08 08:22:39,464 INFO Microsoft.Hosting.Lifetime.OnApplicationStarted [0] - MESSAGE: Application started. Press Ctrl+C to shut down.
2024-05-08 08:22:39,470 INFO Microsoft.Hosting.Lifetime.OnApplicationStarted [0] - MESSAGE: Hosting environment: Development
2024-05-08 08:22:39,472 INFO Microsoft.Hosting.Lifetime.OnApplicationStarted [0] - MESSAGE: Content root path: C:\Users\Admin\Desktop\4 семестр\rpp\AircraftPlant\AircraftPlantRestApi\
2024-05-08 08:26:53,009 INFO AircraftPlantBusinessLogic.BusinessLogics.ClientLogic.CheckModel [114] - MESSAGE: Client. ClientFIO: Самолетов С.С.. Email: client1@email.com. Id: 0
2024-05-08 08:27:07,660 INFO AircraftPlantBusinessLogic.BusinessLogics.ClientLogic.CheckModel [114] - MESSAGE: Client. ClientFIO: Полётов П.П.. Email: client2@email.com. Id: 0
2024-05-08 08:27:18,080 INFO AircraftPlantBusinessLogic.BusinessLogics.ClientLogic.CheckModel [114] - MESSAGE: Client. ClientFIO: Вертолетов В.В.. Email: client3@email.com. Id: 0
2024-05-08 08:29:04,202 INFO AircraftPlantBusinessLogic.BusinessLogics.ClientLogic.ReadElement [45] - MESSAGE: ReadElement. ClientEmail:client1@email.com.Id:(null)
2024-05-08 08:29:04,232 INFO AircraftPlantBusinessLogic.BusinessLogics.ClientLogic.ReadElement [54] - MESSAGE: ReadElement find. Id:8
2024-05-08 08:29:04,293 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [48] - MESSAGE: ReadList. Order.Id:(null)
2024-05-08 08:29:04,385 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [57] - MESSAGE: ReadList. Count:0
2024-05-08 08:29:06,832 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadList [47] - MESSAGE: ReadList. PlaneName:(null).Id:(null)
2024-05-08 08:29:06,931 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadList [56] - MESSAGE: ReadList. Count:3
2024-05-08 08:29:13,613 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [72] - MESSAGE: ReadElement. PlaneName:(null).Id:1
2024-05-08 08:29:13,653 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [81] - MESSAGE: ReadElement find. Id:1
2024-05-08 08:29:13,835 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [72] - MESSAGE: ReadElement. PlaneName:(null).Id:1
2024-05-08 08:29:13,844 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [81] - MESSAGE: ReadElement find. Id:1
2024-05-08 08:29:13,870 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.CheckModel [161] - MESSAGE: Order. OrderID:0.Sum:203500. PlaneId: 1
2024-05-08 08:29:13,962 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [48] - MESSAGE: ReadList. Order.Id:(null)
2024-05-08 08:29:13,974 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [57] - MESSAGE: ReadList. Count:1
2024-05-08 08:29:15,657 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadList [47] - MESSAGE: ReadList. PlaneName:(null).Id:(null)
2024-05-08 08:29:15,663 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadList [56] - MESSAGE: ReadList. Count:3
2024-05-08 08:29:21,197 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [72] - MESSAGE: ReadElement. PlaneName:(null).Id:2
2024-05-08 08:29:21,204 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [81] - MESSAGE: ReadElement find. Id:2
2024-05-08 08:29:21,425 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [72] - MESSAGE: ReadElement. PlaneName:(null).Id:2
2024-05-08 08:29:21,434 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [81] - MESSAGE: ReadElement find. Id:2
2024-05-08 08:29:21,441 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.CheckModel [161] - MESSAGE: Order. OrderID:0.Sum:114400. PlaneId: 2
2024-05-08 08:29:21,464 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [48] - MESSAGE: ReadList. Order.Id:(null)
2024-05-08 08:29:21,472 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [57] - MESSAGE: ReadList. Count:2
2024-05-08 08:29:27,241 INFO AircraftPlantBusinessLogic.BusinessLogics.ClientLogic.ReadElement [45] - MESSAGE: ReadElement. ClientEmail:client2@email.com.Id:(null)
2024-05-08 08:29:27,249 INFO AircraftPlantBusinessLogic.BusinessLogics.ClientLogic.ReadElement [54] - MESSAGE: ReadElement find. Id:9
2024-05-08 08:29:27,269 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [48] - MESSAGE: ReadList. Order.Id:(null)
2024-05-08 08:29:27,276 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [57] - MESSAGE: ReadList. Count:0
2024-05-08 08:29:28,892 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadList [47] - MESSAGE: ReadList. PlaneName:(null).Id:(null)
2024-05-08 08:29:28,899 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadList [56] - MESSAGE: ReadList. Count:3
2024-05-08 08:29:33,328 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [72] - MESSAGE: ReadElement. PlaneName:(null).Id:2
2024-05-08 08:29:33,370 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [81] - MESSAGE: ReadElement find. Id:2
2024-05-08 08:29:33,551 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [72] - MESSAGE: ReadElement. PlaneName:(null).Id:2
2024-05-08 08:29:33,583 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [81] - MESSAGE: ReadElement find. Id:2
2024-05-08 08:29:33,589 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.CheckModel [161] - MESSAGE: Order. OrderID:0.Sum:171600. PlaneId: 2
2024-05-08 08:29:33,635 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [48] - MESSAGE: ReadList. Order.Id:(null)
2024-05-08 08:29:33,652 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [57] - MESSAGE: ReadList. Count:1
2024-05-08 08:29:35,289 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadList [47] - MESSAGE: ReadList. PlaneName:(null).Id:(null)
2024-05-08 08:29:35,321 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadList [56] - MESSAGE: ReadList. Count:3
2024-05-08 08:29:39,872 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [72] - MESSAGE: ReadElement. PlaneName:(null).Id:3
2024-05-08 08:29:39,906 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [81] - MESSAGE: ReadElement find. Id:3
2024-05-08 08:29:40,095 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [72] - MESSAGE: ReadElement. PlaneName:(null).Id:3
2024-05-08 08:29:40,103 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [81] - MESSAGE: ReadElement find. Id:3
2024-05-08 08:29:40,109 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.CheckModel [161] - MESSAGE: Order. OrderID:0.Sum:228800. PlaneId: 3
2024-05-08 08:29:40,141 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [48] - MESSAGE: ReadList. Order.Id:(null)
2024-05-08 08:29:40,156 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [57] - MESSAGE: ReadList. Count:2
2024-05-08 08:29:45,863 INFO AircraftPlantBusinessLogic.BusinessLogics.ClientLogic.ReadElement [45] - MESSAGE: ReadElement. ClientEmail:client3@email.com.Id:(null)
2024-05-08 08:29:45,871 INFO AircraftPlantBusinessLogic.BusinessLogics.ClientLogic.ReadElement [54] - MESSAGE: ReadElement find. Id:10
2024-05-08 08:29:45,889 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [48] - MESSAGE: ReadList. Order.Id:(null)
2024-05-08 08:29:45,895 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [57] - MESSAGE: ReadList. Count:0
2024-05-08 08:29:47,770 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadList [47] - MESSAGE: ReadList. PlaneName:(null).Id:(null)
2024-05-08 08:29:47,789 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadList [56] - MESSAGE: ReadList. Count:3
2024-05-08 08:29:52,322 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [72] - MESSAGE: ReadElement. PlaneName:(null).Id:1
2024-05-08 08:29:52,330 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [81] - MESSAGE: ReadElement find. Id:1
2024-05-08 08:29:53,729 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [72] - MESSAGE: ReadElement. PlaneName:(null).Id:1
2024-05-08 08:29:53,734 INFO AircraftPlantBusinessLogic.BusinessLogics.PlaneLogic.ReadElement [81] - MESSAGE: ReadElement find. Id:1
2024-05-08 08:29:53,739 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.CheckModel [161] - MESSAGE: Order. OrderID:0.Sum:244200. PlaneId: 1
2024-05-08 08:29:53,756 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [48] - MESSAGE: ReadList. Order.Id:(null)
2024-05-08 08:29:53,759 INFO AircraftPlantBusinessLogic.BusinessLogics.OrderLogic.ReadList [57] - MESSAGE: ReadList. Count:1

View File

@ -78,7 +78,7 @@ namespace AircraftPlantBusinessLogic.BusinessLogics
} }
// делаем работу // делаем работу
Thread.Sleep(implementer.WorkExperience * _rnd.Next(500, 1000) * order.Count); Thread.Sleep(implementer.WorkExperience * _rnd.Next(100, 1000) * order.Count);
_logger.LogDebug("DoWork. Worker {Id} finish order {Order}", implementer.Id, order.Id); _logger.LogDebug("DoWork. Worker {Id} finish order {Order}", implementer.Id, order.Id);
_orderLogic.DeliveryOrder(new OrderBindingModel _orderLogic.DeliveryOrder(new OrderBindingModel
{ {
@ -86,7 +86,7 @@ namespace AircraftPlantBusinessLogic.BusinessLogics
}); });
// отдыхаем // отдыхаем
Thread.Sleep(implementer.Qualification * _rnd.Next(10, 20)); Thread.Sleep(implementer.Qualification * _rnd.Next(10, 100));
} }
// кто-то мог уже перехватить заказ, игнорируем ошибку // кто-то мог уже перехватить заказ, игнорируем ошибку
catch (InvalidOperationException ex) catch (InvalidOperationException ex)

View File

@ -15,7 +15,6 @@ namespace AircraftPlantDatabaseImplement.Implements
return context.Orders return context.Orders
.Include(x => x.Plane) .Include(x => x.Plane)
.Include(x => x.Client) .Include(x => x.Client)
.Include(x => x.Implementer)
.Select(x => x.GetViewModel) .Select(x => x.GetViewModel)
.ToList(); .ToList();
} }
@ -32,7 +31,6 @@ namespace AircraftPlantDatabaseImplement.Implements
return context.Orders return context.Orders
.Include(x => x.Client) .Include(x => x.Client)
.Include(x => x.Plane) .Include(x => x.Plane)
.Include(x => x.Implementer)
.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo)
.Select(x => x.GetViewModel) .Select(x => x.GetViewModel)
.ToList(); .ToList();
@ -43,38 +41,22 @@ namespace AircraftPlantDatabaseImplement.Implements
return context.Orders return context.Orders
.Include(x => x.Plane) .Include(x => x.Plane)
.Include(x => x.Client) .Include(x => x.Client)
.Include(x => x.Implementer)
.Where(x => x.ClientId == model.ClientId) .Where(x => x.ClientId == model.ClientId)
.Select(x => x.GetViewModel) .Select(x => x.GetViewModel)
.ToList(); .ToList();
} }
else if (model.ImplementerId.HasValue)
{
return context.Orders return context.Orders
.Include(x => x.Plane) .Include(x => x.Plane)
.Include(x => x.Client) .Include(x => x.Client)
.Include(x => x.Implementer) .Where(x => x.Id == model.Id)
.Where(x => x.ImplementerId == model.ImplementerId)
.Select(x => x.GetViewModel) .Select(x => x.GetViewModel)
.ToList(); .ToList();
} }
else if (model.Status != null)
{
return context.Orders
.Include(x => x.Plane)
.Include(x => x.Client)
.Include(x => x.Implementer)
.Where(x => x.Status.Equals(model.Status))
.Select(x => x.GetViewModel)
.ToList();
}
return new();
}
public OrderViewModel? GetElement(OrderSearchModel model) public OrderViewModel? GetElement(OrderSearchModel model)
{ {
if (!model.Id.HasValue && !model.ImplementerId.HasValue) if (!model.Id.HasValue)
{ {
return null; return null;
} }
@ -82,12 +64,8 @@ namespace AircraftPlantDatabaseImplement.Implements
return context.Orders return context.Orders
.Include(x => x.Plane) .Include(x => x.Plane)
.Include(x => x.Client) .Include(x => x.Client)
.Include(x => x.Implementer) .FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?
.FirstOrDefault(x => .GetViewModel;
model.ImplementerId.HasValue && x.ImplementerId == model.ImplementerId && model.Status != null && x.Status.Equals(model.Status)
|| model.Status == null && model.ImplementerId.HasValue && x.ImplementerId == model.ImplementerId
|| model.Id.HasValue && x.Id == model.Id)
?.GetViewModel;
} }
public OrderViewModel? Insert(OrderBindingModel model) public OrderViewModel? Insert(OrderBindingModel model)

View File

@ -113,7 +113,6 @@ namespace AircraftPlantView
private void ЗапускРаботToolStripMenuItem_Click(object sender, EventArgs e) private void ЗапускРаботToolStripMenuItem_Click(object sender, EventArgs e)
{ {
_workProcess.DoWork((Program.ServiceProvider?.GetService(typeof(IImplementerLogic )) as IImplementerLogic)!, _orderLogic); _workProcess.DoWork((Program.ServiceProvider?.GetService(typeof(IImplementerLogic )) as IImplementerLogic)!, _orderLogic);
MessageBox.Show("Процесс обработки запущен", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show("Процесс обработки запущен", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }