PDSF (Process Data Standard Format) to use EAF for

pushing to OI
This commit is contained in:
2023-07-24 13:29:13 -07:00
parent 6668806432
commit 4cc5219409
28 changed files with 268 additions and 329 deletions

View File

@ -27,13 +27,13 @@
<Content Remove="compilerconfig.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Dapper" Version="2.0.143" />
<PackageReference Include="EntityFramework" Version="6.4.4" />
<PackageReference Include="jQuery" Version="3.6.4" />
<PackageReference Include="jQuery" Version="3.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" 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.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
<PackageReference Include="Serilog.AspNetCore.Ingestion" Version="1.0.0-dev-00032" />

View File

@ -308,13 +308,9 @@ public class MetrologyRepository : IMetrologyRepository
public DataTable GetHeaders(int toolTypeId, DateTime? startTime, DateTime? endTime, int? pageNo, int? pageSize, long? headerId, out long totalRecords)
{
ToolType tt = GetToolTypeByID(toolTypeId);
if (tt is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId) ?? throw new Exception("Invalid tool type ID");
IEnumerable<ToolTypeMetadata> md = GetToolTypeMetadataByToolTypeID(toolTypeId);
if (md is null)
throw new Exception("Invalid tool type metadata");
IEnumerable<ToolTypeMetadata> md = GetToolTypeMetadataByToolTypeID(toolTypeId) ?? throw new Exception("Invalid tool type metadata");
DataTable dt = new();
@ -404,13 +400,9 @@ public class MetrologyRepository : IMetrologyRepository
// Go Here Next
public DataTable GetData(int toolTypeId, long headerid)
{
ToolType tt = GetToolTypeByID(toolTypeId);
if (tt is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId) ?? throw new Exception("Invalid tool type ID");
IEnumerable<ToolTypeMetadata> md = GetToolTypeMetadataByToolTypeID(toolTypeId);
if (md is null)
throw new Exception("Invalid tool type metadata");
IEnumerable<ToolTypeMetadata> md = GetToolTypeMetadataByToolTypeID(toolTypeId) ?? throw new Exception("Invalid tool type metadata");
DataTable dt = new();
@ -515,13 +507,9 @@ public class MetrologyRepository : IMetrologyRepository
}
public DataTable GetDataSharePoint(int toolTypeId, string headerid)
{
ToolType tt = GetToolTypeByID(toolTypeId);
if (tt is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId) ?? throw new Exception("Invalid tool type ID");
IEnumerable<ToolTypeMetadata> md = GetToolTypeMetadataByToolTypeID(toolTypeId);
if (md is null)
throw new Exception("Invalid tool type metadata");
IEnumerable<ToolTypeMetadata> md = GetToolTypeMetadataByToolTypeID(toolTypeId) ?? throw new Exception("Invalid tool type metadata");
DataTable dt = new();
@ -610,9 +598,7 @@ public class MetrologyRepository : IMetrologyRepository
}
public Guid GetHeaderAttachmentID(int toolTypeId, long headerId)
{
ToolType tt = GetToolTypeByID(toolTypeId);
if (tt is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId) ?? throw new Exception("Invalid tool type ID");
using DbConnection conn = GetDbConnection();
string sql =
@ -623,9 +609,7 @@ public class MetrologyRepository : IMetrologyRepository
public Guid GetDataAttachmentID(int toolTypeId, long headerId, string title)
{
ToolType tt = GetToolTypeByID(toolTypeId);
if (tt is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId) ?? throw new Exception("Invalid tool type ID");
using DbConnection conn = GetDbConnection();
string sql =
@ -642,9 +626,7 @@ public class MetrologyRepository : IMetrologyRepository
public DataSet GetOIExportData(int toolTypeId, long headerid)
{
ToolType tt = GetToolTypeByID(toolTypeId);
if (tt is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId) ?? throw new Exception("Invalid tool type ID");
if (string.IsNullOrWhiteSpace(tt.OIExportSPName))
throw new Exception("OpenInsight export not available for " + tt.ToolTypeName);
@ -674,9 +656,7 @@ public class MetrologyRepository : IMetrologyRepository
if (toolTypeId is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId.Value);
if (tt is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId.Value) ?? throw new Exception("Invalid tool type ID");
DbConnection conn = GetDbConnection();
using (conn)
@ -706,13 +686,9 @@ public class MetrologyRepository : IMetrologyRepository
public IEnumerable<KeyValuePair<string, string>> GetHeaderFields(int toolTypeId, long headerid)
{
ToolType tt = GetToolTypeByID(toolTypeId);
if (tt is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId) ?? throw new Exception("Invalid tool type ID");
IEnumerable<ToolTypeMetadata> md = GetToolTypeMetadataByToolTypeID(toolTypeId);
if (md is null)
throw new Exception("Invalid tool type metadata");
IEnumerable<ToolTypeMetadata> md = GetToolTypeMetadataByToolTypeID(toolTypeId) ?? throw new Exception("Invalid tool type metadata");
List<KeyValuePair<string, string>> r = new();
@ -760,9 +736,7 @@ public class MetrologyRepository : IMetrologyRepository
// Jonathan changed this to remove the reviewDate update on the database.
public int UpdateReviewDate(int toolTypeId, long headerId, bool clearDate)
{
ToolType tt = GetToolTypeByID(toolTypeId);
if (tt is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId) ?? throw new Exception("Invalid tool type ID");
using DbConnection conn = GetDbConnection();
if (clearDate)
@ -781,9 +755,7 @@ public class MetrologyRepository : IMetrologyRepository
public Guid GetHeaderAttachmentIDByTitle(int toolTypeId, string title)
{
ToolType tt = GetToolTypeByID(toolTypeId);
if (tt is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId) ?? throw new Exception("Invalid tool type ID");
using DbConnection conn = GetDbConnection();
string sql =
@ -793,9 +765,7 @@ public class MetrologyRepository : IMetrologyRepository
public Guid GetDataAttachmentIDByTitle(int toolTypeId, string title)
{
ToolType tt = GetToolTypeByID(toolTypeId);
if (tt is null)
throw new Exception("Invalid tool type ID");
ToolType tt = GetToolTypeByID(toolTypeId) ?? throw new Exception("Invalid tool type ID");
using DbConnection conn = GetDbConnection();
string sql =

View File

@ -175,4 +175,7 @@ public class AttachmentsService : IAttachmentsService
SaveAttachment(toolType, headerId, dataUniqueId, filename, formFile);
}
string IAttachmentsService.GetProcessDataStandardFormat(IMetrologyRepository metrologyRepository, string attachmentPath, int toolTypeId, long headerId) =>
throw new NotImplementedException();
}