lab6
This commit is contained in:
parent
ada93c8c0a
commit
26094e7ed8
@ -50,6 +50,7 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogic
|
|||||||
_logger.LogInformation("ReadElement. FIO:{FIO}.Id:{ Id}",
|
_logger.LogInformation("ReadElement. FIO:{FIO}.Id:{ Id}",
|
||||||
model.ImplementerFIO, model.Id);
|
model.ImplementerFIO, model.Id);
|
||||||
var element = _implementerStorage.GetElement(model);
|
var element = _implementerStorage.GetElement(model);
|
||||||
|
|
||||||
if (element == null)
|
if (element == null)
|
||||||
{
|
{
|
||||||
_logger.LogWarning("ReadElement element not found");
|
_logger.LogWarning("ReadElement element not found");
|
||||||
|
@ -37,7 +37,9 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogic
|
|||||||
_logger.LogWarning("DoWork. Orders is null or empty");
|
_logger.LogWarning("DoWork. Orders is null or empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogDebug("DoWork for {Count} orders", orders.Count);
|
_logger.LogDebug("DoWork for {Count} orders", orders.Count);
|
||||||
|
|
||||||
foreach (var implementer in implementers)
|
foreach (var implementer in implementers)
|
||||||
{
|
{
|
||||||
Task.Run(() => WorkerWorkAsync(implementer, orders));
|
Task.Run(() => WorkerWorkAsync(implementer, orders));
|
||||||
@ -68,6 +70,7 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogic
|
|||||||
|
|
||||||
Thread.Sleep(implementer.WorkExperience * _rnd.Next(100, 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
|
||||||
{
|
{
|
||||||
Id = order.Id
|
Id = order.Id
|
||||||
@ -98,7 +101,6 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogic
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
var runOrder = await Task.Run(() => allOrders.FirstOrDefault(x => x.ImplementerId == implementer.Id && x.Status == OrderStatus.Выполняется));
|
var runOrder = await Task.Run(() => allOrders.FirstOrDefault(x => x.ImplementerId == implementer.Id && x.Status == OrderStatus.Выполняется));
|
||||||
if (runOrder == null)
|
if (runOrder == null)
|
||||||
{
|
{
|
||||||
|
@ -12,8 +12,8 @@ using SoftwareInstallationDataBaseImplement;
|
|||||||
namespace SoftwareInstallationDataBaseImplement.Migrations
|
namespace SoftwareInstallationDataBaseImplement.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(SoftwareInstallationDataBase))]
|
[DbContext(typeof(SoftwareInstallationDataBase))]
|
||||||
[Migration("20230410192808_CreateBD")]
|
[Migration("20230411045909_CreateDB")]
|
||||||
partial class CreateBD
|
partial class CreateDB
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||||||
namespace SoftwareInstallationDataBaseImplement.Migrations
|
namespace SoftwareInstallationDataBaseImplement.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class CreateBD : Migration
|
public partial class CreateDB : Migration
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
@ -9,7 +9,7 @@ namespace SoftwareInstallationDataBaseImplement
|
|||||||
{
|
{
|
||||||
if (optionsBuilder.IsConfigured == false)
|
if (optionsBuilder.IsConfigured == false)
|
||||||
{
|
{
|
||||||
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-VG5USAH\SQLEXPRESS;Initial Catalog=SoftwareInstallationDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
optionsBuilder.UseSqlServer(@"Data Source=COMP-AVZH\SQLEXPRESS;Initial Catalog=SoftwareInstallationDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||||
}
|
}
|
||||||
base.OnConfiguring(optionsBuilder);
|
base.OnConfiguring(optionsBuilder);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user