nuget bump and userSecrets tasks and

query update for event
This commit is contained in:
Mike Phares 2023-03-17 09:52:48 -07:00
parent 994556d453
commit 243c8dd888
10 changed files with 97 additions and 9 deletions

26
.vscode/tasks.json vendored
View File

@ -167,6 +167,32 @@
"endsPattern": "^.*Application started.*" "endsPattern": "^.*Application started.*"
} }
} }
},
{
"label": "userSecretsInit",
"command": "dotnet",
"type": "process",
"args": [
"user-secrets",
"-p",
"${workspaceFolder}/Server/OI.Metrology.Server.csproj",
"init"
],
"problemMatcher": "$msCompile"
},
{
"label": "userSecretsSet",
"command": "dotnet",
"type": "process",
"args": [
"user-secrets",
"-p",
"${workspaceFolder}/Server/OI.Metrology.Server.csproj",
"set",
"asdf",
"123"
],
"problemMatcher": "$msCompile"
} }
] ]
} }

View File

@ -30,7 +30,7 @@
<PackageReference Include="Dapper" Version="2.0.123" /> <PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="EntityFramework" Version="6.4.4" /> <PackageReference Include="EntityFramework" Version="6.4.4" />
<PackageReference Include="jQuery" Version="3.6.3" /> <PackageReference Include="jQuery" Version="3.6.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0" />

View File

@ -28,14 +28,14 @@
<PackageReference Include="Dapper" Version="2.0.123" /> <PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="EntityFramework" Version="6.4.4" /> <PackageReference Include="EntityFramework" Version="6.4.4" />
<PackageReference Include="jQuery" Version="3.6.3" /> <PackageReference Include="jQuery" Version="3.6.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.3" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog.AspNetCore.Ingestion" Version="1.0.0-dev-00032" /> <PackageReference Include="Serilog.AspNetCore.Ingestion" Version="1.0.0-dev-00032" />
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" /> <PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" /> <PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />

View File

@ -177,6 +177,36 @@ public class InfinityQSRepository : IInfinityQSRepository
return result; return result;
} }
string IInfinityQSRepository.GetCommandText(InfinityQSBase infinityQSBase)
{
StringBuilder result = new();
if (string.IsNullOrEmpty(infinityQSBase.PR_NAME))
throw new ArgumentException(nameof(infinityQSBase.PR_NAME));
if (string.IsNullOrEmpty(infinityQSBase.PD_NAME))
throw new ArgumentException(nameof(infinityQSBase.PD_NAME));
if (infinityQSBase.SE_SGTM is null)
throw new ArgumentException(nameof(infinityQSBase.SE_SGTM));
_ = result
.AppendLine(" select ev.f_evnt, ")
.AppendLine(" ev.f_sgtm, ")
.AppendLine(" pr.f_name, ")
.AppendLine(" pd.f_name, ")
.AppendLine(" td.f_name, ")
.AppendLine(" ev.f_name ")
.AppendLine(" from [spcepiworld].[dbo].[evnt_inf] ev ")
.AppendLine(" join [spcepiworld].[dbo].[prcs_dat] pr ")
.AppendLine(" on ev.f_prcs = pr.f_prcs ")
.AppendLine(" join [spcepiworld].[dbo].[part_dat] pd ")
.AppendLine(" on ev.f_part = pd.f_part ")
.AppendLine(" join [spcepiworld].[dbo].[test_dat] td ")
.AppendLine(" on ev.f_test = td.f_test ")
.Append(" where pr.f_name = '").Append(infinityQSBase.PR_NAME).AppendLine("' ")
.Append(" and pd.f_name = '").Append(infinityQSBase.PD_NAME).AppendLine("' ")
.Append(" and ev.f_sgtm = ").Append(infinityQSBase.SE_SGTM).AppendLine(" ")
.AppendLine(" for json path ");
return result.ToString();
}
Result<InfinityQSEvent[]> IInfinityQSRepository.GetEvents(string subGroupId) Result<InfinityQSEvent[]> IInfinityQSRepository.GetEvents(string subGroupId)
{ {
Result<InfinityQSEvent[]>? result; Result<InfinityQSEvent[]>? result;
@ -196,7 +226,7 @@ public class InfinityQSRepository : IInfinityQSRepository
results = Array.Empty<InfinityQSEvent>(); results = Array.Empty<InfinityQSEvent>();
else else
{ {
string commandText = $"select * from [spcepiworld].[dbo].[evnt_inf] ev where ev.f_prcs = '{infinityQSBase.PR_NAME}' and ev.f_part = '{infinityQSBase.PD_NAME}' and ev.f_sgtm = {infinityQSBase.SE_SGTM} "; string commandText = infinityQSRepository.GetCommandText(infinityQSBase);
StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText); StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText);
results = JsonSerializer.Deserialize<InfinityQSEvent[]>(stringBuilder.ToString(), new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); results = JsonSerializer.Deserialize<InfinityQSEvent[]>(stringBuilder.ToString(), new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
if (results is null) if (results is null)

View File

@ -180,6 +180,36 @@ public class InfinityQSV2Repository : IInfinityQSV2Repository
return result; return result;
} }
string IInfinityQSV2Repository.GetCommandText(InfinityQSBaseV2 infinityQSBase)
{
StringBuilder result = new();
if (string.IsNullOrEmpty(infinityQSBase.Process))
throw new ArgumentException(nameof(infinityQSBase.Process));
if (string.IsNullOrEmpty(infinityQSBase.Part))
throw new ArgumentException(nameof(infinityQSBase.Part));
if (infinityQSBase.SubGroupDateTime is null)
throw new ArgumentException(nameof(infinityQSBase.SubGroupDateTime));
_ = result
.AppendLine(" select ev.f_evnt, ")
.AppendLine(" ev.f_sgtm, ")
.AppendLine(" pr.f_name, ")
.AppendLine(" pd.f_name, ")
.AppendLine(" td.f_name, ")
.AppendLine(" ev.f_name ")
.AppendLine(" from [spcepiworld].[dbo].[evnt_inf] ev ")
.AppendLine(" join [spcepiworld].[dbo].[prcs_dat] pr ")
.AppendLine(" on ev.f_prcs = pr.f_prcs ")
.AppendLine(" join [spcepiworld].[dbo].[part_dat] pd ")
.AppendLine(" on ev.f_part = pd.f_part ")
.AppendLine(" join [spcepiworld].[dbo].[test_dat] td ")
.AppendLine(" on ev.f_test = td.f_test ")
.Append(" where pr.f_name = '").Append(infinityQSBase.Process).AppendLine("' ")
.Append(" and pd.f_name = '").Append(infinityQSBase.Part).AppendLine("' ")
.Append(" and ev.f_sgtm = ").Append(infinityQSBase.SubGroupDateTime).AppendLine(" ")
.AppendLine(" for json path ");
return result.ToString();
}
Result<InfinityQSEventV2[]> IInfinityQSV2Repository.GetEvents(string subGroupId) Result<InfinityQSEventV2[]> IInfinityQSV2Repository.GetEvents(string subGroupId)
{ {
Result<InfinityQSEventV2[]>? result; Result<InfinityQSEventV2[]>? result;
@ -199,7 +229,7 @@ public class InfinityQSV2Repository : IInfinityQSV2Repository
collection = Array.Empty<InfinityQSEvent>(); collection = Array.Empty<InfinityQSEvent>();
else else
{ {
string commandText = $"select * from [spcepiworld].[dbo].[evnt_inf] ev where ev.f_prcs = '{infinityQSBase.Process}' and ev.f_part = '{infinityQSBase.Part}' and ev.f_sgtm = {infinityQSBase.SubGroupDateTime} "; string commandText = infinityQSV2Repository.GetCommandText(infinityQSBase);
StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText); StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText);
collection = JsonSerializer.Deserialize<InfinityQSEvent[]>(stringBuilder.ToString(), new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); collection = JsonSerializer.Deserialize<InfinityQSEvent[]>(stringBuilder.ToString(), new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
if (collection is null) if (collection is null)

View File

@ -6,6 +6,7 @@ public interface IInfinityQSRepository
{ {
string GetCommandText(string subGroupId); string GetCommandText(string subGroupId);
string GetCommandText(InfinityQSBase infinityQSBase);
string GetCommandText(string? subGroupId, string? process, string? job, string? part, string? lot, string? dateTime); string GetCommandText(string? subGroupId, string? process, string? job, string? part, string? lot, string? dateTime);
Result<InfinityQSBase[]> GetData(string subGroupId); Result<InfinityQSBase[]> GetData(string subGroupId);
Result<InfinityQSDescriptor[]> GetDescriptors(string subGroupId); Result<InfinityQSDescriptor[]> GetDescriptors(string subGroupId);

View File

@ -6,6 +6,7 @@ public interface IInfinityQSV2Repository
{ {
string GetCommandText(string subGroupId); string GetCommandText(string subGroupId);
string GetCommandText(InfinityQSBaseV2 infinityQSBase);
string GetCommandText(string? subGroupId, string? process, string? job, string? part, string? lot, string? dateTime); string GetCommandText(string? subGroupId, string? process, string? job, string? part, string? lot, string? dateTime);
Result<InfinityQSBaseV2[]> GetData(string subGroupId); Result<InfinityQSBaseV2[]> GetData(string subGroupId);
Result<InfinityQSDescriptorV2[]> GetDescriptors(string subGroupId); Result<InfinityQSDescriptorV2[]> GetDescriptors(string subGroupId);

View File

@ -31,7 +31,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Text.Json" Version="7.0.2" /> <PackageReference Include="System.Text.Json" Version="7.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -32,7 +32,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.3" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" /> <PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" /> <PackageReference Include="MSTest.TestFramework" Version="3.0.2" />

View File

@ -9,13 +9,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MudBlazor" Version="6.1.9" /> <PackageReference Include="MudBlazor" Version="6.1.9" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.3" /> <PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.4" />
<PackageReference Include="IgniteUI.Blazor" Version="22.2.24" /> <PackageReference Include="IgniteUI.Blazor" Version="22.2.24" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.BrowserConsole" Version="1.0.0" /> <PackageReference Include="Serilog.Sinks.BrowserConsole" Version="1.0.0" />
<PackageReference Include="Serilog.Sinks.BrowserHttp" Version="1.0.0-dev-00032" /> <PackageReference Include="Serilog.Sinks.BrowserHttp" Version="1.0.0-dev-00032" />
<PackageReference Include="System.Net.Http.Json" Version="7.0.0" /> <PackageReference Include="System.Net.Http.Json" Version="7.0.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Shared\OI.Metrology.Shared.csproj" /> <ProjectReference Include="..\Shared\OI.Metrology.Shared.csproj" />