feat(esppApi): метод FindOrdersAsync поиска нарядов в АСУ ЕСПП по свойствам

This commit is contained in:
Mikhail Kuznetsov
2023-10-24 12:10:19 +10:00
parent 57a72cfd9f
commit 4d30de36f5
12 changed files with 163 additions and 48 deletions

View File

@@ -9,6 +9,10 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,5 +1,6 @@
using PARR.EsppApi;
using PARR.Test;
using Serilog;
IHost host = Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
@@ -8,6 +9,12 @@ IHost host = Host.CreateDefaultBuilder(args)
services.AddHostedService<Worker>();
})
.UseSerilog((hostContext, services, config) =>
{
config
.WriteTo.Console()
.ReadFrom.Configuration(hostContext.Configuration);
})
.Build();
host.Run();

View File

@@ -28,8 +28,7 @@ namespace PARR.Test
private async Task TestEsppApi()
{
// var orders = await esppApiService.FindOrdersByPrefixAsync("ПАРР__");
var result = await esppApiService.FindOrdersAsync(new FindOrdersQuery { });
var result = await esppApiService.FindOrdersAsync(new FindOrdersQuery { ShortDescriptionContains = "описание", DateOpen = new DateTime(2023, 10, 10) });
if (result.IsSuccess)
{

View File

@@ -4,5 +4,29 @@
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Debug"
}
},
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "log/log-.txt",
"rollingInterval": "Day"
}
}
]
},
"EsppOrderSettings": {
"Url": "http://rzd-espp-t-rpa-app-1.gvc.oao.rzd:8080/espp_api/OperationExecutor/",
"UserName": "Auto-PTK-DVS",
"Password": "123456789"
}
}
}

View File

@@ -5,7 +5,27 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Debug"
}
},
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "log/log-.txt",
"rollingInterval": "Day"
}
}
]
},
"EsppOrderSettings": {
"Url": "http://dafsdf"
"Url": "http://rzd-espp-t-rpa-app-1.gvc.oao.rzd:8080/espp_api/OperationExecutor/",
"UserName": "Auto-PTK-DVS",
"Password": "123456789"
}
}