Removed not needed properties from api

This commit is contained in:
Mike Phares 2023-08-02 15:28:45 -07:00
parent 2614782d58
commit c5e3acc3e4
5 changed files with 132 additions and 118 deletions

View File

@ -6,6 +6,7 @@ using System.Globalization;
using System.IO;
using System.Net.Http;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace Adaptation.FileHandlers.MoveAllFiles.ApiController;
@ -49,6 +50,38 @@ public class BarcodeHelper
return result;
}
private static Root? GetRoot(string rds)
{
HttpClient httpClient = new();
string url = $"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/{rds}";
string httpClientResult = httpClient.GetStringAsync(url).Result;
Root? root = JsonSerializer.Deserialize<Root>(httpClientResult);
httpClient.Dispose();
return root;
}
private static void SetQaMetTests(string toolClass, Root root, Dictionary<string, List<QaMetTest>> qaMetTests)
{
List<QaMetTest>? collection;
foreach (PrsStage prsStage in root.Rds.ProdSpec.PrsStages)
{
if (prsStage.QaMetTests is null)
continue;
foreach (QaMetTest qaMetTest in prsStage.QaMetTests)
{
if (qaMetTest.ToolClass != toolClass)
continue;
if (!qaMetTests.TryGetValue(prsStage.Stage, out collection))
{
qaMetTests.Add(prsStage.Stage, new());
if (!qaMetTests.TryGetValue(prsStage.Stage, out collection))
throw new Exception();
}
collection.Add(qaMetTest);
}
}
}
internal static PostReplay? Post(string id, HttpContent? httpContent)
{
PostReplay? result;
@ -64,42 +97,20 @@ public class BarcodeHelper
{
Job? job;
string? mid;
List<QaMetTest>? collection;
Dictionary<string, List<QaMetTest>> qaMetTests = new();
Write(TIBCO.FileRead.BarcodeHostFileShare, id, notification.Value);
try
{
const string hyphen = "-";
HttpClient httpClient = new();
job = GetJob(TIBCO.FileRead.LSL2SQLConnectionString, TIBCO.FileRead.MetrologyFileShare, TIBCO.FileRead.BarcodeHostFileShare, id, notification.Value);
mid = job.SpecName == hyphen || job.ProcessSpecName == hyphen ? $"{job.ProcessType}" : $"{job.ProcessType}.{job.SpecName}.{job.ProcessSpecName}";
string httpClientResult = httpClient.GetStringAsync($"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/{job.LotName}").Result;
Root? root = JsonSerializer.Deserialize<Root>(httpClientResult);
httpClient.Dispose();
Root? root = GetRoot(job.LotName);
if (root is not null)
{
foreach (PrsStage prsStage in root.Rds.ProdSpec.PrsStages)
{
if (prsStage.QaMetTests is null)
continue;
foreach (QaMetTest qaMetTest in prsStage.QaMetTests)
{
if (qaMetTest.ToolClass != notification.Value.ToolClass)
continue;
if (!qaMetTests.TryGetValue(prsStage.Stage, out collection))
{
qaMetTests.Add(prsStage.Stage, new());
if (!qaMetTests.TryGetValue(prsStage.Stage, out collection))
throw new Exception();
SetQaMetTests(notification.Value.ToolClass, root, qaMetTests);
}
collection.Add(qaMetTest);
}
}
}
}
catch (Exception)
catch (Exception ex)
{
mid = null;
mid = string.Concat(ex.Message, Environment.NewLine, ex.StackTrace);
}
result = new(mid, qaMetTests); // .ProdSpec.PrsStages[0].QaMetTests[0].Recipe);
}

View File

@ -5,44 +5,44 @@ namespace Adaptation.FileHandlers.MoveAllFiles.OpenInsight;
public class ProdSpec
{
[JsonPropertyName("keyId")]
public int KeyId { get; set; }
// [JsonPropertyName("keyId")]
// public int KeyId { get; set; }
[JsonPropertyName("specType")]
public string SpecType { get; set; }
// [JsonPropertyName("specType")]
// public string SpecType { get; set; }
[JsonPropertyName("status")]
public string Status { get; set; }
// [JsonPropertyName("status")]
// public string Status { get; set; }
[JsonPropertyName("minutesPerWafer")]
public double MinutesPerWafer { get; set; }
// [JsonPropertyName("minutesPerWafer")]
// public double MinutesPerWafer { get; set; }
[JsonPropertyName("proveInTime")]
public double ProveInTime { get; set; }
// [JsonPropertyName("proveInTime")]
// public double ProveInTime { get; set; }
[JsonPropertyName("layerType")]
public string LayerType { get; set; }
// [JsonPropertyName("layerType")]
// public string LayerType { get; set; }
[JsonPropertyName("reactorType")]
public string ReactorType { get; set; }
// [JsonPropertyName("reactorType")]
// public string ReactorType { get; set; }
[JsonPropertyName("susceptorType")]
public string SusceptorType { get; set; }
// [JsonPropertyName("susceptorType")]
// public string SusceptorType { get; set; }
[JsonPropertyName("tubePressureType")]
public string TubePressureType { get; set; }
// [JsonPropertyName("tubePressureType")]
// public string TubePressureType { get; set; }
[JsonPropertyName("recipeLayers")]
public List<RecipeLayer> RecipeLayers { get; set; }
// [JsonPropertyName("recipeLayers")]
// public List<RecipeLayer> RecipeLayers { get; set; }
[JsonPropertyName("prodVers")]
public List<ProdVer> ProdVers { get; set; }
// [JsonPropertyName("prodVers")]
// public List<ProdVer> ProdVers { get; set; }
[JsonPropertyName("epiPart")]
public EpiPart EpiPart { get; set; }
// [JsonPropertyName("epiPart")]
// public EpiPart EpiPart { get; set; }
[JsonPropertyName("custEpiParts")]
public List<CustEpiPart> CustEpiParts { get; set; }
// [JsonPropertyName("custEpiParts")]
// public List<CustEpiPart> CustEpiParts { get; set; }
[JsonPropertyName("prsStages")]
public List<PrsStage> PrsStages { get; set; }

View File

@ -5,23 +5,23 @@ namespace Adaptation.FileHandlers.MoveAllFiles.OpenInsight;
public class PrsStage
{
[JsonPropertyName("keyId")]
public string KeyId { get; set; }
// [JsonPropertyName("keyId")]
// public string KeyId { get; set; }
[JsonPropertyName("psn")]
public int Psn { get; set; }
// [JsonPropertyName("psn")]
// public int Psn { get; set; }
[JsonPropertyName("stage")]
public string Stage { get; set; }
[JsonPropertyName("cleans")]
public Cleans Cleans { get; set; }
// [JsonPropertyName("cleans")]
// public Cleans Cleans { get; set; }
[JsonPropertyName("inspection")]
public Inspection Inspection { get; set; }
// [JsonPropertyName("inspection")]
// public Inspection Inspection { get; set; }
[JsonPropertyName("surfscan")]
public SurfScan Surfscan { get; set; }
// [JsonPropertyName("surfscan")]
// public SurfScan Surfscan { get; set; }
[JsonPropertyName("qaMetTests")]
public List<QaMetTest> QaMetTests { get; set; }

View File

@ -11,87 +11,87 @@ public class Rds
[JsonPropertyName("reactor")]
public int Reactor { get; set; }
[JsonPropertyName("workOrder")]
public int WorkOrder { get; set; }
// [JsonPropertyName("workOrder")]
// public int WorkOrder { get; set; }
[JsonPropertyName("cassNo")]
public int CassNo { get; set; }
// [JsonPropertyName("cassNo")]
// public int CassNo { get; set; }
[JsonPropertyName("combStatus")]
public string CombStatus { get; set; }
// [JsonPropertyName("combStatus")]
// public string CombStatus { get; set; }
[JsonPropertyName("partNo")]
public int PartNo { get; set; }
// [JsonPropertyName("partNo")]
// public int PartNo { get; set; }
[JsonPropertyName("PSN")]
public int PSN { get; set; }
// [JsonPropertyName("PSN")]
// public int PSN { get; set; }
[JsonPropertyName("entryId")]
public string EntryId { get; set; }
// [JsonPropertyName("entryId")]
// public string EntryId { get; set; }
[JsonPropertyName("entryDtm")]
public string EntryDtm { get; set; }
// [JsonPropertyName("entryDtm")]
// public string EntryDtm { get; set; }
[JsonPropertyName("preEpiSig")]
public string PreEpiSig { get; set; }
// [JsonPropertyName("preEpiSig")]
// public string PreEpiSig { get; set; }
[JsonPropertyName("preEpiSigDtm")]
public string PreEpiSigDtm { get; set; }
// [JsonPropertyName("preEpiSigDtm")]
// public string PreEpiSigDtm { get; set; }
[JsonPropertyName("operatorIn")]
public string OperatorIn { get; set; }
// [JsonPropertyName("operatorIn")]
// public string OperatorIn { get; set; }
[JsonPropertyName("dtmIn")]
public string DtmIn { get; set; }
// [JsonPropertyName("dtmIn")]
// public string DtmIn { get; set; }
[JsonPropertyName("operatorOut")]
public string OperatorOut { get; set; }
// [JsonPropertyName("operatorOut")]
// public string OperatorOut { get; set; }
[JsonPropertyName("dtmOut")]
public string DtmOut { get; set; }
// [JsonPropertyName("dtmOut")]
// public string DtmOut { get; set; }
[JsonPropertyName("postEpiSig")]
public string PostEpiSig { get; set; }
// [JsonPropertyName("postEpiSig")]
// public string PostEpiSig { get; set; }
[JsonPropertyName("postEpiSigDtm")]
public string PostEpiSigDtm { get; set; }
// [JsonPropertyName("postEpiSigDtm")]
// public string PostEpiSigDtm { get; set; }
[JsonPropertyName("supVerSig")]
public string SupVerSig { get; set; }
// [JsonPropertyName("supVerSig")]
// public string SupVerSig { get; set; }
[JsonPropertyName("supVerSigDtm")]
public string SupVerSigDtm { get; set; }
// [JsonPropertyName("supVerSigDtm")]
// public string SupVerSigDtm { get; set; }
[JsonPropertyName("shipDtm")]
public object ShipDtm { get; set; }
// [JsonPropertyName("shipDtm")]
// public object ShipDtm { get; set; }
[JsonPropertyName("subPartNo")]
public int SubPartNo { get; set; }
// [JsonPropertyName("subPartNo")]
// public int SubPartNo { get; set; }
[JsonPropertyName("shipNo")]
public object ShipNo { get; set; }
// [JsonPropertyName("shipNo")]
// public object ShipNo { get; set; }
[JsonPropertyName("cassWaferQty")]
public int CassWaferQty { get; set; }
// [JsonPropertyName("cassWaferQty")]
// public int CassWaferQty { get; set; }
[JsonPropertyName("loadLockSide")]
public string LoadLockSide { get; set; }
// [JsonPropertyName("loadLockSide")]
// public string LoadLockSide { get; set; }
[JsonPropertyName("waferSize")]
public string WaferSize { get; set; }
// [JsonPropertyName("waferSize")]
// public string WaferSize { get; set; }
[JsonPropertyName("reactorType")]
public string ReactorType { get; set; }
// [JsonPropertyName("reactorType")]
// public string ReactorType { get; set; }
[JsonPropertyName("prodSpec")]
public ProdSpec ProdSpec { get; set; }
[JsonPropertyName("cleanInsp")]
public List<CleanInsp> CleanInsp { get; set; }
// [JsonPropertyName("cleanInsp")]
// public List<CleanInsp> CleanInsp { get; set; }
[JsonPropertyName("woMatQA")]
public WoMatQA WoMatQA { get; set; }
// [JsonPropertyName("woMatQA")]
// public WoMatQA WoMatQA { get; set; }
[JsonPropertyName("rdsLayers")]
public List<RdsLayer> RdsLayers { get; set; }
// [JsonPropertyName("rdsLayers")]
// public List<RdsLayer> RdsLayers { get; set; }
}

View File

@ -47,7 +47,7 @@ public class API : LoggingUnitTesting, IDisposable
catch (Exception) { }
}
#if true
#if (!true)
[Ignore]
#endif
[TestMethod]
@ -56,7 +56,10 @@ public class API : LoggingUnitTesting, IDisposable
MethodBase methodBase = new StackFrame().GetMethod();
#nullable enable
HttpClient httpClient = new();
string httpClientResult = httpClient.GetStringAsync($"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/601132").Result;
// string rds = "504162";
string rds = "601132";
string url = $"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/{rds}";
string httpClientResult = httpClient.GetStringAsync(url).Result;
FileHandlers.MoveAllFiles.OpenInsight.Root? root = JsonSerializer.Deserialize<FileHandlers.MoveAllFiles.OpenInsight.Root>(httpClientResult);
httpClient.Dispose();
Assert.IsNotNull(root?.Rds.ProdSpec.PrsStages);