Compare commits
	
		
			3 Commits
		
	
	
		
			5c9f0d1aff
			...
			red-hat
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 85fe0a7823 | |||
| 811f45a7df | |||
| 127634f5ab | 
							
								
								
									
										2
									
								
								.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							@ -221,7 +221,7 @@
 | 
			
		||||
        {
 | 
			
		||||
            "label": "File-Folder-Helper AOT s M Self .Kanbn Tasks",
 | 
			
		||||
            "type": "shell",
 | 
			
		||||
            "command": "L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net8.0/win-x64/publish/File-Folder-Helper.exe s M L:/DevOps/Mesa_FI/OI-Metrology -s L:/DevOps/Mesa_FI/OI-Metrology/.kanbn/tasks",
 | 
			
		||||
            "command": "& L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net7.0/win-x64/publish/File-Folder-Helper.exe s M '.kanbn/tasks'",
 | 
			
		||||
            "problemMatcher": []
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										51
									
								
								Server/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										51
									
								
								Server/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							@ -13,44 +13,6 @@
 | 
			
		||||
            ],
 | 
			
		||||
            "problemMatcher": "$msCompile"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "label": "buildTests",
 | 
			
		||||
            "command": "dotnet",
 | 
			
		||||
            "type": "process",
 | 
			
		||||
            "args": [
 | 
			
		||||
                "build",
 | 
			
		||||
                "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj",
 | 
			
		||||
                "/property:GenerateFullPaths=true",
 | 
			
		||||
                "/consoleloggerparameters:NoSummary"
 | 
			
		||||
            ],
 | 
			
		||||
            "problemMatcher": "$msCompile"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "label": "testDebug",
 | 
			
		||||
            "command": "dotnet",
 | 
			
		||||
            "type": "process",
 | 
			
		||||
            "args": [
 | 
			
		||||
                "test",
 | 
			
		||||
                "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj",
 | 
			
		||||
                "/property:GenerateFullPaths=true",
 | 
			
		||||
                "/consoleloggerparameters:NoSummary"
 | 
			
		||||
            ],
 | 
			
		||||
            "problemMatcher": "$msCompile"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "label": "testRelease",
 | 
			
		||||
            "command": "dotnet",
 | 
			
		||||
            "type": "process",
 | 
			
		||||
            "args": [
 | 
			
		||||
                "test",
 | 
			
		||||
                "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj",
 | 
			
		||||
                "/property:GenerateFullPaths=true",
 | 
			
		||||
                "/consoleloggerparameters:NoSummary",
 | 
			
		||||
                "-c",
 | 
			
		||||
                "Release"
 | 
			
		||||
            ],
 | 
			
		||||
            "problemMatcher": "$msCompile"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "label": "Format",
 | 
			
		||||
            "command": "dotnet",
 | 
			
		||||
@ -74,14 +36,7 @@
 | 
			
		||||
                "publish",
 | 
			
		||||
                "${workspaceFolder}/OI.Metrology.Server.csproj",
 | 
			
		||||
                "/property:GenerateFullPaths=true",
 | 
			
		||||
                "/consoleloggerparameters:NoSummary",
 | 
			
		||||
                "--configuration",
 | 
			
		||||
                "Release",
 | 
			
		||||
                "--runtime",
 | 
			
		||||
                "win-x64",
 | 
			
		||||
                "--self-contained",
 | 
			
		||||
                "-o",
 | 
			
		||||
                "D:/web-sites/OI-Metrology/hh-3498d1da-_______-OI-Metrology-Release/Server"
 | 
			
		||||
                "/consoleloggerparameters:NoSummary"
 | 
			
		||||
            ],
 | 
			
		||||
            "problemMatcher": "$msCompile"
 | 
			
		||||
        },
 | 
			
		||||
@ -132,9 +87,9 @@
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "label": "File-Folder-Helper AOT s X Server",
 | 
			
		||||
            "label": "File-Folder-Helper AOT s V Repositories",
 | 
			
		||||
            "type": "shell",
 | 
			
		||||
            "command": "L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net8.0/win-x64/publish/File-Folder-Helper.exe s X L:/DevOps/Mesa_FI/OI-Metrology Day-Helper-2024-01-08 L:/DevOps/Mesa_FI/OI-Metrology/Server",
 | 
			
		||||
            "command": "& L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net7.0/win-x64/publish/File-Folder-Helper.exe s V Repositories",
 | 
			
		||||
            "problemMatcher": []
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
@ -79,4 +79,12 @@ public class InfinityQSV4Controller : Controller, IInfinityQSV4Controller<IActio
 | 
			
		||||
    public IActionResult GetProductionSpecification(string part) =>
 | 
			
		||||
       Content(_InfinityQSRepositoryV4.GetProductionSpecification(part));
 | 
			
		||||
 | 
			
		||||
    [HttpGet("engineering-spc-review")]
 | 
			
		||||
    public IActionResult GetEngineeringSpcReview()
 | 
			
		||||
    {
 | 
			
		||||
        Dictionary<string, List<string>> results = _InfinityQSRepositoryV4.GetEngineeringSpcReview();
 | 
			
		||||
        string json = JsonSerializer.Serialize(results);
 | 
			
		||||
        return Content(json, "application/json", System.Text.Encoding.UTF8);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -3,7 +3,7 @@ using OI.Metrology.Shared.Models.Stateless;
 | 
			
		||||
 | 
			
		||||
namespace OI.Metrology.Server.ApiControllers;
 | 
			
		||||
 | 
			
		||||
[Route("api/v1/[controller]")]
 | 
			
		||||
[Route("api/v1/WaferCounter")]
 | 
			
		||||
public class WaferCounterController : Controller, IWaferCounterController<IActionResult>
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -15,4 +15,8 @@ public class WaferCounterController : Controller, IWaferCounterController<IActio
 | 
			
		||||
    [HttpGet("{waferSize}/last-quantity-and-slot-map")]
 | 
			
		||||
    public IActionResult GetLastQuantityAndSlotMap(string area, string waferSize) =>
 | 
			
		||||
        Json(_WaferCounterRepository.GetLastQuantityAndSlotMap(area, waferSize));
 | 
			
		||||
 | 
			
		||||
    [HttpGet("{waferSize}/last-quantity-and-slot-map-with-text")]
 | 
			
		||||
    public IActionResult GetLastQuantityAndSlotMapWithText(string area, string waferSize, string text) =>
 | 
			
		||||
        Json(_WaferCounterRepository.GetLastQuantityAndSlotMapWithText(area, waferSize, text));
 | 
			
		||||
}
 | 
			
		||||
@ -6,7 +6,6 @@
 | 
			
		||||
        <SccLocalPath>SAK</SccLocalPath>
 | 
			
		||||
    </PropertyGroup>
 | 
			
		||||
    <PropertyGroup>
 | 
			
		||||
        <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
 | 
			
		||||
        <ImplicitUsings>enable</ImplicitUsings>
 | 
			
		||||
        <IsPackable>false</IsPackable>
 | 
			
		||||
        <Nullable>enable</Nullable>
 | 
			
		||||
@ -25,10 +24,10 @@
 | 
			
		||||
        <Content Remove="compilerconfig.json" />
 | 
			
		||||
    </ItemGroup>
 | 
			
		||||
    <ItemGroup>
 | 
			
		||||
        <PackageReference Include="Dapper" Version="2.1.37" />
 | 
			
		||||
        <PackageReference Include="Dapper" Version="2.1.24" />
 | 
			
		||||
        <PackageReference Include="EntityFramework" Version="6.4.4" />
 | 
			
		||||
        <PackageReference Include="jQuery" Version="3.7.1" />
 | 
			
		||||
        <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.3" />
 | 
			
		||||
        <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.0" />
 | 
			
		||||
        <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
 | 
			
		||||
        <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
 | 
			
		||||
        <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
 | 
			
		||||
@ -39,8 +38,8 @@
 | 
			
		||||
        <PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.0" />
 | 
			
		||||
        <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
 | 
			
		||||
        <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
 | 
			
		||||
        <PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
 | 
			
		||||
        <PackageReference Include="System.Drawing.Common" Version="8.0.3" />
 | 
			
		||||
        <PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
 | 
			
		||||
        <PackageReference Include="System.Drawing.Common" Version="8.0.0" />
 | 
			
		||||
    </ItemGroup>
 | 
			
		||||
    <ItemGroup>
 | 
			
		||||
        <ProjectReference Include="..\Shared\OI.Metrology.Shared.csproj" />
 | 
			
		||||
 | 
			
		||||
@ -33,8 +33,6 @@ public class FileShareRepository : IFileShareRepository
 | 
			
		||||
        string directory = Path.GetDirectoryName(to) ?? throw new NullReferenceException();
 | 
			
		||||
        if (!Directory.Exists(directory))
 | 
			
		||||
            _ = Directory.CreateDirectory(directory);
 | 
			
		||||
        if (File.Exists(to))
 | 
			
		||||
            File.Move(to, $"{to}.{DateTime.Now.Ticks}.old");
 | 
			
		||||
        File.Move(from, to);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -6,6 +6,7 @@ using OI.Metrology.Shared.Repositories;
 | 
			
		||||
using System.Collections.ObjectModel;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.Data.Common;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Text.Json;
 | 
			
		||||
 | 
			
		||||
@ -152,22 +153,6 @@ public class InfinityQSV4Repository : IInfinityQSV4Repository
 | 
			
		||||
        return result.ToString();
 | 
			
		||||
    } // cSpell:enable
 | 
			
		||||
 | 
			
		||||
    private JsonElement[] GetAllReactorsAsJsonElementElement()
 | 
			
		||||
    {
 | 
			
		||||
        JsonElement[]? results;
 | 
			
		||||
        HttpClient httpClient = _HttpClientFactory.CreateClient();
 | 
			
		||||
        Task<string> task = httpClient.GetStringAsync($"{_OpenInsightApplicationProgrammingInterface}/reactors");
 | 
			
		||||
        task.Wait();
 | 
			
		||||
        JsonElement? jsonElement = JsonSerializer.Deserialize<JsonElement>(task.Result);
 | 
			
		||||
        if (jsonElement is null)
 | 
			
		||||
            throw new NullReferenceException(nameof(jsonElement));
 | 
			
		||||
        string json = jsonElement.Value.EnumerateObject().First().Value.ToString();
 | 
			
		||||
        results = JsonSerializer.Deserialize<JsonElement[]>(json);
 | 
			
		||||
        if (results is null)
 | 
			
		||||
            throw new NullReferenceException(nameof(results));
 | 
			
		||||
        return results;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static StringBuilder GetForJsonPath(IDbConnectionFactory dbConnectionFactory, string commandText, bool useIqsConnection)
 | 
			
		||||
    {
 | 
			
		||||
        StringBuilder stringBuilder = new();
 | 
			
		||||
@ -180,49 +165,6 @@ public class InfinityQSV4Repository : IInfinityQSV4Repository
 | 
			
		||||
        return stringBuilder;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void GetOI(InfinityQSV4 infinityQSV4)
 | 
			
		||||
    {
 | 
			
		||||
        IInfinityQSV4Repository infinityQSV4Repository = this;
 | 
			
		||||
        if (string.IsNullOrEmpty(infinityQSV4.Part))
 | 
			
		||||
            throw new ArgumentException(nameof(infinityQSV4.Part));
 | 
			
		||||
        string json = infinityQSV4Repository.GetProductionSpecification(infinityQSV4.Part);
 | 
			
		||||
        ProdSpecRoot? prodSpec = JsonSerializer.Deserialize(json, ProdSpecRootSourceGenerationContext.Default.ProdSpecRoot);
 | 
			
		||||
        if (prodSpec is null)
 | 
			
		||||
        {
 | 
			
		||||
            if (prodSpec is null)
 | 
			
		||||
            { }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static List<string> Convert(int[] night)
 | 
			
		||||
    {
 | 
			
		||||
        List<string> results = new();
 | 
			
		||||
        foreach (int reactor in night)
 | 
			
		||||
            results.Add(reactor.ToString());
 | 
			
		||||
        return results;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private ReadOnlyDictionary<int, Reactor> GetReactorsMatchingType(string? reactTypeFilter)
 | 
			
		||||
    {
 | 
			
		||||
        Dictionary<int, Reactor> results = new();
 | 
			
		||||
        string json;
 | 
			
		||||
        Reactor? reactor;
 | 
			
		||||
        JsonElement[]? jsonElements = GetAllReactorsAsJsonElementElement();
 | 
			
		||||
        foreach (JsonElement jsonElement in jsonElements)
 | 
			
		||||
        {
 | 
			
		||||
            json = jsonElement.EnumerateObject().First().Value.ToString();
 | 
			
		||||
            if (reactTypeFilter is not null && !json.Contains(reactTypeFilter))
 | 
			
		||||
                continue;
 | 
			
		||||
            try
 | 
			
		||||
            { reactor = JsonSerializer.Deserialize(json, ReactorSourceGenerationContext.Default.Reactor); }
 | 
			
		||||
            catch (Exception) { reactor = null; }
 | 
			
		||||
            if (reactor is null || (reactTypeFilter is not null && reactor.ReactType != reactTypeFilter))
 | 
			
		||||
                continue;
 | 
			
		||||
            results.Add(reactor.ReactorNo, reactor);
 | 
			
		||||
        }
 | 
			
		||||
        return new(results);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static InfinityQSV4 GetInfinityQSV4(IDbConnectionFactory dbConnectionFactory, IInfinityQSV4Repository infinityQSV4Repository, string subGroupId)
 | 
			
		||||
    {
 | 
			
		||||
        InfinityQSV4 result;
 | 
			
		||||
@ -391,6 +333,43 @@ public class InfinityQSV4Repository : IInfinityQSV4Repository
 | 
			
		||||
        return result.ToString();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private JsonElement[] GetAllReactorsAsJsonElementElement()
 | 
			
		||||
    {
 | 
			
		||||
        JsonElement[]? results;
 | 
			
		||||
        HttpClient httpClient = _HttpClientFactory.CreateClient();
 | 
			
		||||
        Task<string> task = httpClient.GetStringAsync($"{_OpenInsightApplicationProgrammingInterface}/reactors");
 | 
			
		||||
        task.Wait();
 | 
			
		||||
        JsonElement? jsonElement = JsonSerializer.Deserialize<JsonElement>(task.Result);
 | 
			
		||||
        if (jsonElement is null)
 | 
			
		||||
            throw new NullReferenceException(nameof(jsonElement));
 | 
			
		||||
        string json = jsonElement.Value.EnumerateObject().First().Value.ToString();
 | 
			
		||||
        results = JsonSerializer.Deserialize<JsonElement[]>(json);
 | 
			
		||||
        if (results is null)
 | 
			
		||||
            throw new NullReferenceException(nameof(results));
 | 
			
		||||
        return results;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private ReadOnlyDictionary<int, Reactor> GetReactorsMatchingType(string? reactTypeFilter)
 | 
			
		||||
    {
 | 
			
		||||
        Dictionary<int, Reactor> results = new();
 | 
			
		||||
        string json;
 | 
			
		||||
        Reactor? reactor;
 | 
			
		||||
        JsonElement[]? jsonElements = GetAllReactorsAsJsonElementElement();
 | 
			
		||||
        foreach (JsonElement jsonElement in jsonElements)
 | 
			
		||||
        {
 | 
			
		||||
            json = jsonElement.EnumerateObject().First().Value.ToString();
 | 
			
		||||
            if (reactTypeFilter is not null && !json.Contains(reactTypeFilter))
 | 
			
		||||
                continue;
 | 
			
		||||
            try
 | 
			
		||||
            { reactor = JsonSerializer.Deserialize(json, ReactorSourceGenerationContext.Default.Reactor); }
 | 
			
		||||
            catch (Exception) { reactor = null; }
 | 
			
		||||
            if (reactor is null || (reactTypeFilter is not null && reactor.ReactType != reactTypeFilter))
 | 
			
		||||
                continue;
 | 
			
		||||
            results.Add(reactor.ReactorNo, reactor);
 | 
			
		||||
        }
 | 
			
		||||
        return new(results);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    string IInfinityQSV4Repository.GetCommandText(List<string> eppReactorNumbers)
 | 
			
		||||
    { // cSpell:disable
 | 
			
		||||
        StringBuilder result = new();
 | 
			
		||||
@ -442,6 +421,14 @@ public class InfinityQSV4Repository : IInfinityQSV4Repository
 | 
			
		||||
        return result.ToString();
 | 
			
		||||
    } // cSpell:enable
 | 
			
		||||
 | 
			
		||||
    private static List<string> Convert(int[] night)
 | 
			
		||||
    {
 | 
			
		||||
        List<string> results = new();
 | 
			
		||||
        foreach (int reactor in night)
 | 
			
		||||
            results.Add(reactor.ToString());
 | 
			
		||||
        return results;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    List<string[]> IInfinityQSV4Repository.GetEpiProTempVerificationRows(int[] night)
 | 
			
		||||
    {
 | 
			
		||||
        List<string[]>? results;
 | 
			
		||||
@ -651,4 +638,171 @@ public class InfinityQSV4Repository : IInfinityQSV4Repository
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void GetOI(InfinityQSV4 infinityQSV4)
 | 
			
		||||
    {
 | 
			
		||||
        IInfinityQSV4Repository infinityQSV4Repository = this;
 | 
			
		||||
        if (string.IsNullOrEmpty(infinityQSV4.Part))
 | 
			
		||||
            throw new ArgumentException(nameof(infinityQSV4.Part));
 | 
			
		||||
        string json = infinityQSV4Repository.GetProductionSpecification(infinityQSV4.Part);
 | 
			
		||||
        ProdSpecRoot? prodSpec = JsonSerializer.Deserialize(json, ProdSpecRootSourceGenerationContext.Default.ProdSpecRoot);
 | 
			
		||||
        if (prodSpec is null)
 | 
			
		||||
        {
 | 
			
		||||
            if (prodSpec is null)
 | 
			
		||||
            { }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static Record? GetValue(AppSettings appSettings, string line)
 | 
			
		||||
    {
 | 
			
		||||
        Record? result;
 | 
			
		||||
        string[] attributes = line.Split('>');
 | 
			
		||||
        if (attributes.Length != 3)
 | 
			
		||||
            result = null;
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            string[] text = attributes[1].Replace(appSettings.IqsRed, "red").Replace(appSettings.IqsYellow, "Yellow").Split($"</{line[1]}{line[2]}");
 | 
			
		||||
            if (text.Length != 2)
 | 
			
		||||
                result = null;
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                string[] attributeValues = attributes[0].Split('"');
 | 
			
		||||
                if (attributeValues.Length != 3)
 | 
			
		||||
                    result = new(null, text[0]);
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    result = new(attributeValues[1], text[0]);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static ReadOnlyCollection<Record> GetRecords(AppSettings appSettings, string[] lines)
 | 
			
		||||
    {
 | 
			
		||||
        Record? record;
 | 
			
		||||
        List<Record> results = new();
 | 
			
		||||
        List<string> checkColumns = new();
 | 
			
		||||
        foreach (string line in lines)
 | 
			
		||||
        {
 | 
			
		||||
            if (line.StartsWith("<th"))
 | 
			
		||||
            {
 | 
			
		||||
                record = GetValue(appSettings, line);
 | 
			
		||||
                if (record is null)
 | 
			
		||||
                    continue;
 | 
			
		||||
                checkColumns.Add(record.Text);
 | 
			
		||||
            }
 | 
			
		||||
            if (line.StartsWith("<td"))
 | 
			
		||||
            {
 | 
			
		||||
                record = GetValue(appSettings, line);
 | 
			
		||||
                if (record is null)
 | 
			
		||||
                    continue;
 | 
			
		||||
                results.Add(record);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (string.Join(',', checkColumns) != appSettings.IqsColumns)
 | 
			
		||||
            throw new NotSupportedException("Columns don't match!");
 | 
			
		||||
        return new(results);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static List<Dictionary<string, Record>> GetCollection(string columns, ReadOnlyCollection<Record> records)
 | 
			
		||||
    {
 | 
			
		||||
        string[] columnNames = columns.Split(',');
 | 
			
		||||
        List<Dictionary<string, Record>> collection = new();
 | 
			
		||||
        Dictionary<string, Record> keyValuePairs;
 | 
			
		||||
        for (int i = 0; i < records.Count; i++)
 | 
			
		||||
        {
 | 
			
		||||
            keyValuePairs = new();
 | 
			
		||||
            for (int j = 0; j < columnNames.Length; j++)
 | 
			
		||||
            {
 | 
			
		||||
                keyValuePairs.Add(columnNames[j], records[i]);
 | 
			
		||||
                i++;
 | 
			
		||||
            }
 | 
			
		||||
            i--;
 | 
			
		||||
            collection.Add(keyValuePairs);
 | 
			
		||||
        }
 | 
			
		||||
        return collection;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static Dictionary<string, List<string>> GetResults(AppSettings appSettings, List<Dictionary<string, Record>> collection)
 | 
			
		||||
    {
 | 
			
		||||
        Dictionary<string, List<string>> results = new();
 | 
			
		||||
        Record record;
 | 
			
		||||
        List<string>? colors;
 | 
			
		||||
        foreach (Dictionary<string, Record> keyValuePairs in collection)
 | 
			
		||||
        {
 | 
			
		||||
            record = keyValuePairs[appSettings.IqsKey];
 | 
			
		||||
            if (!results.TryGetValue(record.Text, out colors))
 | 
			
		||||
            {
 | 
			
		||||
                results.Add(record.Text, new());
 | 
			
		||||
                if (!results.TryGetValue(record.Text, out colors))
 | 
			
		||||
                    throw new Exception();
 | 
			
		||||
            }
 | 
			
		||||
            if (record.Color is null)
 | 
			
		||||
                continue;
 | 
			
		||||
            colors.Add(record.Color.Replace(appSettings.IqsRed, "red").Replace(appSettings.IqsYellow, "Yellow"));
 | 
			
		||||
        }
 | 
			
		||||
        foreach (KeyValuePair<string, List<string>> keyValuePair in results)
 | 
			
		||||
            keyValuePair.Value.Sort();
 | 
			
		||||
        return results;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void FileFindReplaceAndSave(FileInfo fileInfo, string value)
 | 
			
		||||
    {
 | 
			
		||||
        string lines = value.Replace(_AppSettings.IqsRed, "red").Replace(_AppSettings.IqsYellow, "Yellow");
 | 
			
		||||
        File.WriteAllText(fileInfo.FullName, lines);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static string GetWwwRootDirectory()
 | 
			
		||||
    {
 | 
			
		||||
        string result;
 | 
			
		||||
        Assembly assembly = Assembly.GetExecutingAssembly();
 | 
			
		||||
        string? assemblyName = assembly.GetName()?.Name;
 | 
			
		||||
        if (string.IsNullOrEmpty(assemblyName))
 | 
			
		||||
            throw new Exception();
 | 
			
		||||
        result = Path.Combine(AppContext.BaseDirectory, "wwwroot");
 | 
			
		||||
        if (!Directory.Exists(result))
 | 
			
		||||
            _ = Directory.CreateDirectory(result);
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Dictionary<string, List<string>> IInfinityQSV4Repository.GetEngineeringSpcReview()
 | 
			
		||||
    {
 | 
			
		||||
        Dictionary<string, List<string>>? results;
 | 
			
		||||
        if (!string.IsNullOrEmpty(_MockRoot))
 | 
			
		||||
        {
 | 
			
		||||
            string json = File.ReadAllText(Path.Combine(string.Concat(AppContext.BaseDirectory, _MockRoot), $"{_RepositoryName}-{nameof(IInfinityQSV4Repository.GetEngineeringSpcReview)}.json"));
 | 
			
		||||
            results = JsonSerializer.Deserialize<Dictionary<string, List<string>>>(json);
 | 
			
		||||
            if (results is null)
 | 
			
		||||
                throw new NullReferenceException(nameof(results));
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            string wwwRootDirectory = GetWwwRootDirectory();
 | 
			
		||||
            HttpClient httpClient = _HttpClientFactory.CreateClient();
 | 
			
		||||
            FileInfo localFileInfo = new(Path.Combine(wwwRootDirectory, _AppSettings.IqsFileSegments.Last()));
 | 
			
		||||
            Uri uri = _FileShareRepository.Append(new Uri(_AppSettings.EcMesaFileShareCharacterizationSi), _AppSettings.IqsFileSegments[0..^1]);
 | 
			
		||||
            List<NginxFileSystemSortable> nginxFileSystemSortableCollection = _FileShareRepository.GetNginxFileSystemSortableCollection(httpClient, uri, ".html");
 | 
			
		||||
            if (!localFileInfo.Exists && nginxFileSystemSortableCollection.Count == 0)
 | 
			
		||||
                results = new();
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                string[] lines;
 | 
			
		||||
                HttpResponseMessage httpResponseMessage = _FileShareRepository.ReadFile(httpClient, nginxFileSystemSortableCollection[0].Uri);
 | 
			
		||||
                Task<string> value = httpResponseMessage.Content.ReadAsStringAsync();
 | 
			
		||||
                value.Wait();
 | 
			
		||||
                if (localFileInfo.Exists && localFileInfo.LastWriteTime == nginxFileSystemSortableCollection[0].DateTime)
 | 
			
		||||
                    lines = File.ReadAllLines(localFileInfo.FullName);
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    FileFindReplaceAndSave(localFileInfo, value.Result);
 | 
			
		||||
                    lines = value.Result.Split("\r\n");
 | 
			
		||||
                }
 | 
			
		||||
                ReadOnlyCollection<Record> records = GetRecords(_AppSettings, lines);
 | 
			
		||||
                List<Dictionary<string, Record>> collection = GetCollection(_AppSettings.IqsColumns, records);
 | 
			
		||||
                results = GetResults(_AppSettings, collection);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return results;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -45,84 +45,83 @@ public class WaferCounterRepository : IWaferCounterRepository
 | 
			
		||||
    private static Record GetRecord(string line1, string line2)
 | 
			
		||||
    {
 | 
			
		||||
        Record result;
 | 
			
		||||
        string? slotMap = string.IsNullOrEmpty(line2) || line2.Length != 8 ? null : line2.Substring(1, 1);
 | 
			
		||||
        int check = slotMap == "1" ? 1 : 0;
 | 
			
		||||
#pragma warning disable IDE0057
 | 
			
		||||
        int total = int.Parse(line1.Substring(1));
 | 
			
		||||
        foreach (char item in line2.Substring(2))
 | 
			
		||||
#pragma warning restore IDE0057
 | 
			
		||||
        string? waferMap = string.IsNullOrEmpty(line2) || line2.Length != 8 ? null : line2.Substring(1, 1);
 | 
			
		||||
        int check = waferMap == "1" ? 1 : 0;
 | 
			
		||||
        int total = int.Parse(line1[1..]);
 | 
			
		||||
        // string wafers = Array.from(line2[2..]);
 | 
			
		||||
        foreach (char item in line2[2..])
 | 
			
		||||
        {
 | 
			
		||||
            switch (item)
 | 
			
		||||
            {
 | 
			
		||||
                case '0':
 | 
			
		||||
                    check += 0;
 | 
			
		||||
                    slotMap += "0000";
 | 
			
		||||
                    waferMap += "0000";
 | 
			
		||||
                    break;
 | 
			
		||||
                case '1':
 | 
			
		||||
                    check += 1;
 | 
			
		||||
                    slotMap += "0001";
 | 
			
		||||
                    waferMap += "0001";
 | 
			
		||||
                    break;
 | 
			
		||||
                case '2':
 | 
			
		||||
                    check += 1;
 | 
			
		||||
                    slotMap += "0010";
 | 
			
		||||
                    waferMap += "0010";
 | 
			
		||||
                    break;
 | 
			
		||||
                case '3':
 | 
			
		||||
                    check += 2;
 | 
			
		||||
                    slotMap += "0011";
 | 
			
		||||
                    waferMap += "0011";
 | 
			
		||||
                    break;
 | 
			
		||||
                case '4':
 | 
			
		||||
                    check += 1;
 | 
			
		||||
                    slotMap += "0100";
 | 
			
		||||
                    waferMap += "0100";
 | 
			
		||||
                    break;
 | 
			
		||||
                case '5':
 | 
			
		||||
                    check += 2;
 | 
			
		||||
                    slotMap += "0101";
 | 
			
		||||
                    waferMap += "0101";
 | 
			
		||||
                    break;
 | 
			
		||||
                case '6':
 | 
			
		||||
                    check += 2;
 | 
			
		||||
                    slotMap += "0110";
 | 
			
		||||
                    waferMap += "0110";
 | 
			
		||||
                    break;
 | 
			
		||||
                case '7':
 | 
			
		||||
                    check += 3;
 | 
			
		||||
                    slotMap += "0111";
 | 
			
		||||
                    waferMap += "0111";
 | 
			
		||||
                    break;
 | 
			
		||||
                case '8':
 | 
			
		||||
                    check += 1;
 | 
			
		||||
                    slotMap += "1000";
 | 
			
		||||
                    waferMap += "1000";
 | 
			
		||||
                    break;
 | 
			
		||||
                case '9':
 | 
			
		||||
                    check += 2;
 | 
			
		||||
                    slotMap += "1001";
 | 
			
		||||
                    waferMap += "1001";
 | 
			
		||||
                    break;
 | 
			
		||||
                case 'A':
 | 
			
		||||
                    check += 2;
 | 
			
		||||
                    slotMap += "1010";
 | 
			
		||||
                    waferMap += "1010";
 | 
			
		||||
                    break;
 | 
			
		||||
                case 'B':
 | 
			
		||||
                    check += 3;
 | 
			
		||||
                    slotMap += "1011";
 | 
			
		||||
                    waferMap += "1011";
 | 
			
		||||
                    break;
 | 
			
		||||
                case 'C':
 | 
			
		||||
                    check += 2;
 | 
			
		||||
                    slotMap += "1100";
 | 
			
		||||
                    waferMap += "1100";
 | 
			
		||||
                    break;
 | 
			
		||||
                case 'D':
 | 
			
		||||
                    check += 3;
 | 
			
		||||
                    slotMap += "1101";
 | 
			
		||||
                    waferMap += "1101";
 | 
			
		||||
                    break;
 | 
			
		||||
                case 'E':
 | 
			
		||||
                    check += 3;
 | 
			
		||||
                    slotMap += "1110";
 | 
			
		||||
                    waferMap += "1110";
 | 
			
		||||
                    break;
 | 
			
		||||
                case 'F':
 | 
			
		||||
                    check += 4;
 | 
			
		||||
                    slotMap += "1111";
 | 
			
		||||
                    waferMap += "1111";
 | 
			
		||||
                    break;
 | 
			
		||||
                default:
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        result = new(check, total, slotMap);
 | 
			
		||||
        result = new(check, total, waferMap);
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -135,7 +134,7 @@ public class WaferCounterRepository : IWaferCounterRepository
 | 
			
		||||
    string? IWaferCounterRepository.GetSlotMap(string line1, string line2) =>
 | 
			
		||||
        GetRecord(line1, line2).SlotMap;
 | 
			
		||||
 | 
			
		||||
    private List<NginxFileSystemSortable> GetNginxFileSystemSortableCollection(HttpClient httpClient, Uri waferSizeUri)
 | 
			
		||||
    private List<NginxFileSystemSortable> GetNginxFileSystemSortableCollection(HttpClient httpClient, Uri waferSizeUri, string waferSizeDirectory)
 | 
			
		||||
    {
 | 
			
		||||
        List<NginxFileSystemSortable> results = new();
 | 
			
		||||
        DateTime dateTime = DateTime.Now;
 | 
			
		||||
@ -143,17 +142,18 @@ public class WaferCounterRepository : IWaferCounterRepository
 | 
			
		||||
        for (int i = 0; i < int.MaxValue; i++)
 | 
			
		||||
        {
 | 
			
		||||
            results = _FileShareRepository.GetNginxFileSystemSortableCollection(httpClient, waferSizeUri, ".wc");
 | 
			
		||||
            if (results.Count > 0 || DateTime.Now.Ticks > ticks)
 | 
			
		||||
            if (results.Count > 1 || DateTime.Now.Ticks > ticks)
 | 
			
		||||
                break;
 | 
			
		||||
            Thread.Sleep(250);
 | 
			
		||||
        }
 | 
			
		||||
        for (int i = 1; i < results.Count; i++)
 | 
			
		||||
            MoveFile(waferSizeDirectory, results[i]);
 | 
			
		||||
        return results;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static WaferCounter GetLastQuantityAndSlotMap(string waferSize, HttpClient httpClient, NginxFileSystemSortable nginxFileSystemSortable)
 | 
			
		||||
    private static WaferCounter GetLastQuantityAndSlotMapWithText(string waferSize, string text, HttpClient httpClient, NginxFileSystemSortable nginxFileSystemSortable)
 | 
			
		||||
    {
 | 
			
		||||
        WaferCounter result;
 | 
			
		||||
        string text = string.Empty;
 | 
			
		||||
        Task<string> value = httpClient.GetStringAsync(nginxFileSystemSortable.Uri);
 | 
			
		||||
        value.Wait();
 | 
			
		||||
        string[] lines = value.Result.Split("\r\n");
 | 
			
		||||
@ -163,9 +163,9 @@ public class WaferCounterRepository : IWaferCounterRepository
 | 
			
		||||
        Record record = GetRecord(lines[0], lines[1]);
 | 
			
		||||
        string equipmentId = segments.Length <= 1 ? nginxFileSystemSortable.Name : segments[1].Split('.')[0];
 | 
			
		||||
        if (string.IsNullOrEmpty(record.SlotMap) || record.SlotMap.Length != 25)
 | 
			
		||||
            throw new Exception("Wrong length for slot-map!");
 | 
			
		||||
            throw new Exception("Wrong length!");
 | 
			
		||||
        if (record.Total != record.Check)
 | 
			
		||||
            throw new Exception($"Invalid {record.Total} != {record.Check}");
 | 
			
		||||
            throw new Exception("Invalid!");
 | 
			
		||||
        result = new(nginxFileSystemSortable.DateTime, nginxFileSystemSortable.DateTime.ToString("yyyy-MM-dd hh:mm tt"), $"WC{waferSize}{equipmentId}", text, record.Total, record.SlotMap);
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
@ -176,12 +176,35 @@ public class WaferCounterRepository : IWaferCounterRepository
 | 
			
		||||
        Uri waferSizeUri = GetWaferSizeUri(area, waferSize);
 | 
			
		||||
        HttpClient httpClient = _HttpClientFactory.CreateClient();
 | 
			
		||||
        string waferSizeDirectory = GetWaferSizeDirectory(area, waferSize, destination: false);
 | 
			
		||||
        List<NginxFileSystemSortable> nginxFileSystemSortableCollection = GetNginxFileSystemSortableCollection(httpClient, waferSizeUri);
 | 
			
		||||
        List<NginxFileSystemSortable> nginxFileSystemSortableCollection = GetNginxFileSystemSortableCollection(httpClient, waferSizeUri, waferSizeDirectory);
 | 
			
		||||
        if (nginxFileSystemSortableCollection.Count < 1)
 | 
			
		||||
            throw new Exception("No files!");
 | 
			
		||||
        result = GetLastQuantityAndSlotMap(waferSize, httpClient, nginxFileSystemSortableCollection[0]);
 | 
			
		||||
        for (int i = 0; i < nginxFileSystemSortableCollection.Count; i++)
 | 
			
		||||
            MoveFile(waferSizeDirectory, nginxFileSystemSortableCollection[i]);
 | 
			
		||||
        string text = string.Empty;
 | 
			
		||||
        result = GetLastQuantityAndSlotMapWithText(waferSize, text, httpClient, nginxFileSystemSortableCollection[0]);
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void Save(string waferSizeDestinationDirectory, string area, string waferSize, string text, NginxFileSystemSortable nginxFileSystemSortable, WaferCounter result) =>
 | 
			
		||||
        _FileShareRepository.FileWrite(Path.Combine(waferSizeDestinationDirectory, $"{nginxFileSystemSortable.Name}.csv"), $"100,{waferSize},{area},{nginxFileSystemSortable.DateTime},{text},{result.Total:00},{result.SlotMap} ");
 | 
			
		||||
 | 
			
		||||
    WaferCounter IWaferCounterRepository.GetLastQuantityAndSlotMapWithText(string area, string waferSize, string text)
 | 
			
		||||
    {
 | 
			
		||||
        WaferCounter result;
 | 
			
		||||
        Uri waferSizeUri = GetWaferSizeUri(area, waferSize);
 | 
			
		||||
        HttpClient httpClient = _HttpClientFactory.CreateClient();
 | 
			
		||||
        string waferSizeDirectory = GetWaferSizeDirectory(area, waferSize, destination: false);
 | 
			
		||||
        List<NginxFileSystemSortable> nginxFileSystemSortableCollection = GetNginxFileSystemSortableCollection(httpClient, waferSizeUri, waferSizeDirectory);
 | 
			
		||||
        if (nginxFileSystemSortableCollection.Count < 1)
 | 
			
		||||
            throw new Exception("No files!");
 | 
			
		||||
        result = GetLastQuantityAndSlotMapWithText(waferSize, text, httpClient, nginxFileSystemSortableCollection[0]);
 | 
			
		||||
        if (result is not null)
 | 
			
		||||
        {
 | 
			
		||||
            string waferSizeDestinationDirectory = _AppSettings.WaferCounterDestinationDirectory;
 | 
			
		||||
            // string waferSizeDestinationDirectory = GetWaferSizeUri(area, waferSize, destination: true);
 | 
			
		||||
            Save(waferSizeDestinationDirectory, area, waferSize, text, nginxFileSystemSortableCollection[0], result);
 | 
			
		||||
        }
 | 
			
		||||
        if (result is null)
 | 
			
		||||
            throw new NullReferenceException(nameof(result));
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -12,7 +12,7 @@
 | 
			
		||||
    <link href="~/igniteui/css/themes/bootstrap3/default/infragistics.theme.css" rel="stylesheet"
 | 
			
		||||
        asp-append-version="true" />
 | 
			
		||||
    <link href="~/igniteui/css/structure/infragistics.css" rel="stylesheet" asp-append-version="true" />
 | 
			
		||||
    <link href="~/styles/site-server.css" rel="stylesheet" asp-append-version="true" />
 | 
			
		||||
    <link href="~/styles/site.css" rel="stylesheet" asp-append-version="true" />
 | 
			
		||||
 | 
			
		||||
    <script src="~/js/jquery-3.6.0.min.js" type="text/javascript" asp-append-version="true"></script>
 | 
			
		||||
    <script src="~/js/jquery-ui.min.js" type="text/javascript" asp-append-version="true"></script>
 | 
			
		||||
@ -23,7 +23,7 @@
 | 
			
		||||
    <script src="~/js/chart-4.3.0.min.js" type="module"></script>
 | 
			
		||||
 | 
			
		||||
    <script src="~/js/common.js" type="text/javascript" asp-append-version="true"></script>
 | 
			
		||||
    <script src="~/js/site-server.js" type="text/javascript" asp-append-version="true"></script>
 | 
			
		||||
    <script src="~/js/site.js" type="text/javascript" asp-append-version="true"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
        $(document).ready(function () {
 | 
			
		||||
            if (location.pathname == "/") {
 | 
			
		||||
 | 
			
		||||
@ -17,6 +17,7 @@ public interface IInfinityQSV4Repository
 | 
			
		||||
    string GetCommandText(List<string> eppReactorNumbers);
 | 
			
		||||
    List<string[]> GetEpiProTempVerificationRows(int[] night);
 | 
			
		||||
    Result<InfinityQSDescriptorV4[]> GetDescriptors(string subGroupId);
 | 
			
		||||
    Dictionary<string, List<string>> GetEngineeringSpcReview();
 | 
			
		||||
    string GetProductDataAverageSumOfDefectsProcessMeanProcessSigma(string process, string? recipe);
 | 
			
		||||
    string GetCommandText(string? subGroupId, string? process, string? job, string? part, string? lot, string? dateTime);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -12,5 +12,6 @@ public interface IWaferCounterController<T>
 | 
			
		||||
    static string GetRouteName() => nameof(IWaferCounterController<T>)[1..^10];
 | 
			
		||||
 | 
			
		||||
    T GetLastQuantityAndSlotMap(string area, string waferSize);
 | 
			
		||||
    T GetLastQuantityAndSlotMapWithText(string area, string waferSize, string text);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -5,5 +5,6 @@ public interface IWaferCounterRepository
 | 
			
		||||
 | 
			
		||||
    string? GetSlotMap(string line1, string line2);
 | 
			
		||||
    DataModels.WaferCounter GetLastQuantityAndSlotMap(string area, string waferSize);
 | 
			
		||||
    DataModels.WaferCounter? GetLastQuantityAndSlotMapWithText(string area, string waferSize, string text);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										2
									
								
								Tests/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								Tests/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							@ -89,7 +89,7 @@
 | 
			
		||||
        {
 | 
			
		||||
            "label": "File-Folder-Helper AOT s V Repositories",
 | 
			
		||||
            "type": "shell",
 | 
			
		||||
            "command": "L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net8.0/win-x64/publish/File-Folder-Helper.exe s V Repositories",
 | 
			
		||||
            "command": "& L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net7.0/win-x64/publish/File-Folder-Helper.exe s V Repositories",
 | 
			
		||||
            "problemMatcher": []
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
@ -295,4 +295,29 @@ public class UnitTestInfinityQSV4Controller
 | 
			
		||||
        NonThrowTryCatch();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [TestMethod]
 | 
			
		||||
    public void GetEngineeringSpcReview()
 | 
			
		||||
    {
 | 
			
		||||
        _Logger?.LogInformation("Starting Web Application");
 | 
			
		||||
        IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
 | 
			
		||||
        IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>();
 | 
			
		||||
        Dictionary<string, List<string>>? results = infinityQSV4Repository?.GetEngineeringSpcReview();
 | 
			
		||||
        Assert.IsNotNull(results);
 | 
			
		||||
        _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
 | 
			
		||||
        NonThrowTryCatch();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [TestMethod]
 | 
			
		||||
    public async Task GetEngineeringSpcReviewApi()
 | 
			
		||||
    {
 | 
			
		||||
        HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
 | 
			
		||||
        _Logger?.LogInformation("Starting Web Application");
 | 
			
		||||
        Assert.IsTrue(httpClient is not null);
 | 
			
		||||
        string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/engineering-spc-review");
 | 
			
		||||
        File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEngineeringSpcReview)}.json"), result);
 | 
			
		||||
        Assert.IsNotNull(result);
 | 
			
		||||
        _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
 | 
			
		||||
        NonThrowTryCatch();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -116,4 +116,31 @@ public class UnitTestWaferCounterController
 | 
			
		||||
        NonThrowTryCatch();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [Ignore]
 | 
			
		||||
    [TestMethod]
 | 
			
		||||
    public void GetLastQuantityAndSlotMapWithText()
 | 
			
		||||
    {
 | 
			
		||||
        _Logger?.LogInformation("Starting Web Application");
 | 
			
		||||
        IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
 | 
			
		||||
        IWaferCounterRepository? waferCounterRepository = serviceProvider?.GetRequiredService<IWaferCounterRepository>();
 | 
			
		||||
        WaferCounter? result = waferCounterRepository?.GetLastQuantityAndSlotMapWithText("EPP-East", "8INCH", "123456");
 | 
			
		||||
        Assert.IsNotNull(result);
 | 
			
		||||
        _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
 | 
			
		||||
        NonThrowTryCatch();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [Ignore]
 | 
			
		||||
    [TestMethod]
 | 
			
		||||
    public async Task GetLastQuantityAndSlotMapWithTextApi()
 | 
			
		||||
    {
 | 
			
		||||
        HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
 | 
			
		||||
        _Logger?.LogInformation("Starting Web Application");
 | 
			
		||||
        Assert.IsTrue(httpClient is not null);
 | 
			
		||||
        string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/8INCH/last-quantity-and-slot-map-with-text/?area=EPP-East&text=123456");
 | 
			
		||||
        File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetLastQuantityAndSlotMapWithText)}.json"), json);
 | 
			
		||||
        Assert.IsNotNull(json);
 | 
			
		||||
        _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
 | 
			
		||||
        NonThrowTryCatch();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user