From 6436465fa1f165041cd521978656a492a8e3af6e Mon Sep 17 00:00:00 2001 From: Daniel Wathen Date: Wed, 11 Jan 2023 10:00:39 -0700 Subject: [PATCH] Removed all references to FabTime --- .../Controllers/FabTimeController.cs | 52 --------- ReportingServices.API/Program.cs | 1 - .../HelperClasses/APIHelperFunctions.cs | 53 --------- .../HelperClasses/ApiCaller.cs | 13 +-- .../HelperClasses/DailyReportHelper.cs | 110 ++++-------------- .../ProductionReport/EquipmentStateByDay.cs | 12 -- .../ProductionReport/ToolStateCurrent.cs | 25 ---- .../FabTimeReportingRepository.cs | 106 ----------------- .../Interfaces/IFabTimeReportingRepository.cs | 13 --- .../ProductionReport/DailyReport.cs | 20 ---- .../ProductionReport/ToolStateByType.cs | 71 ----------- .../Controllers/ProductionReportController.cs | 2 +- ReportingServices.UI/Program.cs | 2 - .../wwwroot/Assets/SLLTools.json | 18 +-- 14 files changed, 30 insertions(+), 468 deletions(-) delete mode 100644 ReportingServices.API/Controllers/FabTimeController.cs delete mode 100644 ReportingServices.Shared/Models/ProductionReport/EquipmentStateByDay.cs delete mode 100644 ReportingServices.Shared/Models/ProductionReport/ToolStateCurrent.cs delete mode 100644 ReportingServices.Shared/Repositories/Implementations/FabTimeReportingRepository.cs delete mode 100644 ReportingServices.Shared/Repositories/Interfaces/IFabTimeReportingRepository.cs delete mode 100644 ReportingServices.Shared/ViewModels/ProductionReport/ToolStateByType.cs diff --git a/ReportingServices.API/Controllers/FabTimeController.cs b/ReportingServices.API/Controllers/FabTimeController.cs deleted file mode 100644 index a85d0c5..0000000 --- a/ReportingServices.API/Controllers/FabTimeController.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using ReportingServices.Shared.Models.ProductionReport; -using ReportingServices.Shared.Repositories; - -namespace ReportingServices.API.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class FabTimeController : ControllerBase - { - private readonly IFabTimeReportingRepository _fabTimeReportingRepository; - private readonly IScrapeDatabaseRepository _scrapeDBRepository; - - public FabTimeController(IFabTimeReportingRepository fabTimeReportingRepository, IScrapeDatabaseRepository scrapeDBRepository) - { - _fabTimeReportingRepository = fabTimeReportingRepository; - _scrapeDBRepository = scrapeDBRepository; - } - - [HttpGet("ReactorOuts")] - public async Task GetReactorOuts(string startDate, string endDate) - { - List outs = await _fabTimeReportingRepository.GetMovesTrendData(startDate, endDate); - YieldInformation yieldInformation = new() - { - Outs = outs, - Scrap = _scrapeDBRepository.GetScrapByDay(outs) - }; - - return yieldInformation; - } - - [HttpGet("ToolStateTrend")] - public async Task> GetToolStateTrendData(string toolType) - { - return await _fabTimeReportingRepository.GetToolStateTrendData(toolType); - } - - [HttpGet("ToolState")] - public async Task> GetToolStateData(string toolType) - { - return await _fabTimeReportingRepository.GetToolStateData(toolType); - } - - [HttpGet("Testing")] - public string Testing() - { - return "This Works!"; - } - } -} diff --git a/ReportingServices.API/Program.cs b/ReportingServices.API/Program.cs index 2bf3ec2..2d51169 100644 --- a/ReportingServices.API/Program.cs +++ b/ReportingServices.API/Program.cs @@ -14,7 +14,6 @@ builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); -builder.Services.AddScoped(); builder.Services.AddScoped(); var app = builder.Build(); diff --git a/ReportingServices.Shared/HelperClasses/APIHelperFunctions.cs b/ReportingServices.Shared/HelperClasses/APIHelperFunctions.cs index cb91831..6398639 100644 --- a/ReportingServices.Shared/HelperClasses/APIHelperFunctions.cs +++ b/ReportingServices.Shared/HelperClasses/APIHelperFunctions.cs @@ -4,8 +4,6 @@ namespace ReportingServices.Shared.HelperClasses { public static class APIHelperFunctions { - private readonly static string fabTimeServer = "http://messa004.infineon.com/fabtime717service/GetChartData.aspx?"; - public static string GetBeginningOfWeekAsAPIString() { DateTime date = DateTime.Now; @@ -43,57 +41,6 @@ namespace ReportingServices.Shared.HelperClasses return dateString; } - public static Dictionary SetParameters(string startDate = "", string endDate = "", string chart = "", string periodLen = "", - string areasLike = "", string toolsLike = "", string operationsLike = "", string capacityTypesLike = "") - { - Dictionary parameters = new(); - - startDate = startDate == "" ? HttpUtility.UrlEncode(GetBeginningOfWeekAsAPIString()) : startDate; - endDate = endDate == "" ? HttpUtility.UrlEncode(GetDateTimeAsAPIString(DateTime.Now.ToString(), true)) : endDate; - - parameters.Add("chart", chart); - parameters.Add("starttime", startDate); - parameters.Add("endtime", endDate); - parameters.Add("periodlen", periodLen); - parameters.Add("areaslike", areasLike); - parameters.Add("toolslike", toolsLike); - parameters.Add("operationslike", operationsLike); - parameters.Add("capacitytypeslike", capacityTypesLike); - parameters.Add("login", "administrator"); - parameters.Add("password", "admin"); - parameters.Add("fabtimeauthentication", "1"); - - return parameters; - } - - public static string GenerateURL(Dictionary parameters) - { - int count = 0; - string url = fabTimeServer; - - foreach (KeyValuePair pair in parameters) - { - if (pair.Value != "") - url = url + pair.Key + "=" + pair.Value; - - if (count != parameters.Count - 1 && !string.IsNullOrEmpty(pair.Value)) - url += "&"; - - count++; - } - - return url; - } - - public static string GenerateURLWithParameters(string startDate = "", string endDate = "", string chart = "", string periodLen = "", - string areasLike = "", string toolsLike = "", string operationsLike = "", string capacityTypesLike = "") - { - Dictionary parameters = SetParameters(startDate, endDate, chart, - periodLen, areasLike, toolsLike, operationsLike, capacityTypesLike); - - return GenerateURL(parameters); - } - public static List ReverseList(List inputList) { List temp = new(); diff --git a/ReportingServices.Shared/HelperClasses/ApiCaller.cs b/ReportingServices.Shared/HelperClasses/ApiCaller.cs index 25000ad..8cee208 100644 --- a/ReportingServices.Shared/HelperClasses/ApiCaller.cs +++ b/ReportingServices.Shared/HelperClasses/ApiCaller.cs @@ -10,17 +10,10 @@ namespace ReportingServices.Shared.HelperClasses { T deserializedJson = default(T); - try + using (HttpClient client = new()) { - using (HttpClient client = new()) - { - string apiResponse = await client.GetStringAsync(url); - deserializedJson = JsonSerializer.Deserialize(apiResponse); - } - } - catch (Exception ex) - { - + string apiResponse = await client.GetStringAsync(url); + deserializedJson = JsonSerializer.Deserialize(apiResponse); } return deserializedJson; diff --git a/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs b/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs index 991749b..b8bfec4 100644 --- a/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs +++ b/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs @@ -9,8 +9,23 @@ namespace ReportingServices.Shared.HelperClasses private static readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json"; private static readonly string _SLLFilePath = "wwwroot/Assets/SLLTools.json"; - public static DailyReport SetUpDailyReport(ILogger logger, string baseUrlFabtime, string baseUrlScrapeDb) + public static DailyReport SetUpDailyReport(ILogger logger, string baseUrlScrapeDb) { + DailyReport report = new(); + + try + { + report.SLLTools = JsonFileHandler.LoadJSONFile>(_SLLFilePath); + report.ManualReportEntries = JsonFileHandler.LoadJSONFile(_dailyRptFilePath); + + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load JsonFiles."); + logger.LogInformation("SLL File Path: {path}", _SLLFilePath); + logger.LogInformation("Manual Report Entries File Path: {path}", _dailyRptFilePath); + } + List cleanTools = new() { "AHPS", @@ -38,16 +53,17 @@ namespace ReportingServices.Shared.HelperClasses "SRP" }; - List>> tasksEQState = new(); - List>> tasksState = new(); - DailyReport report = new(); - List reactors = ApiCaller.GetApi>(baseUrlScrapeDb + "Reactors").Result; List>> toolEvents = new(); List> cleanEvents = new(); List> metrologyEvents = new(); + Task task1 = null; + Task task2 = null; + Task targets = null; + Task> rds = null; + try { foreach (Reactor reactor in reactors) @@ -65,80 +81,17 @@ namespace ReportingServices.Shared.HelperClasses { metrologyEvents.Add(ApiCaller.GetApi(baseUrlScrapeDb + "ToolEvents?toolID=" + tool)); } - } - catch (Exception ex) - { - } - - - try - { - report.SLLTools = JsonFileHandler.LoadJSONFile>(_SLLFilePath); - report.ManualReportEntries = JsonFileHandler.LoadJSONFile(_dailyRptFilePath); - - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load JsonFiles."); - logger.LogInformation("SLL File Path: {path}", _SLLFilePath); - logger.LogInformation("Manual Report Entries File Path: {path}", _dailyRptFilePath); - } - - Task task1 = null; - Task task2 = null; - - - try - { task1 = ApiCaller.GetApi(baseUrlScrapeDb + "ReactorOuts?startDate=" + report.StartDate.ToString() + "&endDate=" + DateTime.Now.ToString()); task2 = ApiCaller.GetApi(baseUrlScrapeDb + "ReactorOuts?startDate=" + report.StartDate.AddDays(-7).ToString() + "&endDate=" + report.StartDate.ToString()); - - tasksEQState.Add(ApiCaller.GetApi>(baseUrlFabtime + "ToolStateTrend?toolType=ASM")); - tasksEQState.Add(ApiCaller.GetApi>(baseUrlFabtime + "ToolStateTrend?toolType=EPP")); - tasksEQState.Add(ApiCaller.GetApi>(baseUrlFabtime + "ToolStateTrend?toolType=HTR")); - tasksState.Add(ApiCaller.GetApi>(baseUrlFabtime + "ToolState?toolType=ASM")); - tasksState.Add(ApiCaller.GetApi>(baseUrlFabtime + "ToolState?toolType=EPP")); - tasksState.Add(ApiCaller.GetApi>(baseUrlFabtime + "ToolState?toolType=HTR")); - tasksState.Add(ApiCaller.GetApi>(baseUrlFabtime + "ToolState?toolType=Metrology")); - tasksState.Add(ApiCaller.GetApi>(baseUrlFabtime + "ToolState?toolType=Cleans")); - } - catch (Exception ex) - { - logger.LogCritical(ex, "Failed to send get requests to fabtime endpoints."); - } - - Task targets = null; - Task> rds = null; - - try - { targets = ApiCaller.GetApi(baseUrlScrapeDb + "Targets"); rds = ApiCaller.GetApi>(baseUrlScrapeDb + "RDS?date=" + report.StartDate.ToString()); - } catch (Exception ex) { logger.LogCritical(ex, "Failed to send get requests to scrapedb endpoints."); } - try - { - report.AddToolAvailibilityByType("ASM", tasksEQState[0].Result); - report.AddToolAvailibilityByType("EPP", tasksEQState[1].Result); - report.AddToolAvailibilityByType("HTR", tasksEQState[2].Result); - - report.AddToolStateByType("ASM", tasksState[0].Result); - report.AddToolStateByType("EPP", tasksState[1].Result); - report.AddToolStateByType("HTR", tasksState[2].Result); - report.AddToolStateByType("Metrology", tasksState[3].Result); - report.AddToolStateByType("Cleans", tasksState[4].Result); - } - catch (Exception ex) - { - logger.LogCritical(ex, "Failed to retrieve data back from Tool State and Tool State Trend FabTime endpoints."); - } - try { report.QuarterlyTargets = targets.Result; @@ -165,20 +118,13 @@ namespace ReportingServices.Shared.HelperClasses report.CleanEvents = report.CleanEvents.Where(x => (x.TOOL_MODE != "PROD" || x.TOOL_MODE_DESC != "Production") && x.TOOL_MODE != "OUT").ToList(); report.MetrologyEvents = report.MetrologyEvents.Where(x => (x.TOOL_MODE != "PROD" || x.TOOL_MODE_DESC != "Production") && x.TOOL_MODE != "OUT").ToList(); - } - catch (Exception ex) - { - logger.LogCritical(ex, "Failed to retrieve data back from Scrape DB endpoints."); - } - try - { report.CurrentWeek.SetYieldInformation(task1.Result, report.QuarterlyTargets); report.PreviousWeek.SetYieldInformation(task2.Result, report.QuarterlyTargets); } catch (Exception ex) { - logger.LogCritical(ex, "Failed to retreive data back from ReactorOuts and Scrap endpoints."); + logger.LogCritical(ex, "Failed to retrieve data back from Scrape DB endpoints."); } report.ReverseLists(); @@ -203,17 +149,11 @@ namespace ReportingServices.Shared.HelperClasses { List reactors = new(); - foreach (KeyValuePair keyValuePairs in report.ToolStateByType) + foreach (ToolEventView tool in report.ToolEvents) { - if (keyValuePairs.Key != "Metrology" && keyValuePairs.Key != "Cleans") + if (!tool.IsInProduction) { - foreach (ToolStateCurrent tool in keyValuePairs.Value.ToolStateCurrents) - { - if (tool.BasicStateDescription != "Productive" && tool.ReactorStatus != "Out of Service") - { - reactors.Add(int.Parse(tool.Tool.Substring(1))); - } - } + reactors.Add(int.Parse(tool.Reactor)); } } diff --git a/ReportingServices.Shared/Models/ProductionReport/EquipmentStateByDay.cs b/ReportingServices.Shared/Models/ProductionReport/EquipmentStateByDay.cs deleted file mode 100644 index eb9ebc8..0000000 --- a/ReportingServices.Shared/Models/ProductionReport/EquipmentStateByDay.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Text.Json.Serialization; - -namespace ReportingServices.Shared.Models.ProductionReport -{ - public class EquipmentStateByDay - { - [JsonPropertyName("StartTime")] - public string StartTime { get; set; } - [JsonPropertyName("AvailablePct")] - public string AvailablePct { get; set; } - } -} diff --git a/ReportingServices.Shared/Models/ProductionReport/ToolStateCurrent.cs b/ReportingServices.Shared/Models/ProductionReport/ToolStateCurrent.cs deleted file mode 100644 index 4288123..0000000 --- a/ReportingServices.Shared/Models/ProductionReport/ToolStateCurrent.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Text.Json.Serialization; - -namespace ReportingServices.Shared.Models.ProductionReport -{ - public class ToolStateCurrent - { - [JsonPropertyName("Tool")] - public string Tool { get; set; } - [JsonPropertyName("TranTime")] - public string TranTime { get; set; } - [JsonPropertyName("GanttEndTime")] - public string GanttEndTime { get; set; } - [JsonPropertyName("GanttElapsedHours")] - public string GanttElapsedHours { get; set; } - [JsonPropertyName("BasicStateDescription")] - public string BasicStateDescription { get; set; } - [JsonPropertyName("SubState")] - public string SubState { get; set; } - [JsonPropertyName("ReactorStatus")] - public string ReactorStatus { get; set; } - [JsonPropertyName("Comment")] - public string Comment { get; set; } - - } -} diff --git a/ReportingServices.Shared/Repositories/Implementations/FabTimeReportingRepository.cs b/ReportingServices.Shared/Repositories/Implementations/FabTimeReportingRepository.cs deleted file mode 100644 index a0b9efb..0000000 --- a/ReportingServices.Shared/Repositories/Implementations/FabTimeReportingRepository.cs +++ /dev/null @@ -1,106 +0,0 @@ -using Microsoft.Extensions.Logging; -using ReportingServices.Shared.HelperClasses; -using ReportingServices.Shared.Models.ProductionReport; -using ReportingServices.Shared.ViewModels.ProductionReport; -using System.Text.Json; -using System.Web; - -namespace ReportingServices.Shared.Repositories -{ - public class FabTimeReportingRepository : IFabTimeReportingRepository - { - private readonly string _toolFilter = "~R76%2C%20~R78%2C%20~R25%2C%20~R67%2C%20~R69%2C%20~R71%2C%20~R47%2C%20~R51%2C%20~R28"; - private readonly ILogger _logger; - - public FabTimeReportingRepository(ILogger logger) - { - _logger = logger; - } - - public async Task> GetMovesTrendData(string startDate = "", string endDate = "") - { - string url = APIHelperFunctions.GenerateURLWithParameters(startDate: startDate, endDate: endDate, chart: "MOVESLOTLIST", areasLike: "CLEANROOM", operationsLike: "1UNLOAD"); - - _logger.LogInformation("FabTime URL: {url}", url); - - try - { - return await GetJsonData>(url); - } - catch (Exception ex) - { - _logger.LogCritical(ex, "Error in API call."); - } - - return null; - - } - - public async Task> GetToolStateTrendData(string toolType) - { - string url = APIHelperFunctions.GenerateURLWithParameters(chart: "TOOLSTATE", periodLen: "24", capacityTypesLike: toolType, toolsLike: _toolFilter); - - _logger.LogInformation("FabTime URL: {url}", url); - - try - { - return await GetJsonData>(url); - } - catch (Exception ex) - { - _logger.LogCritical(ex, "Error in API call."); - } - - return null; - } - - public async Task> GetToolStateData(string toolType) - { - string capacityFilter = toolType == "ASM" ? toolType + "%2CASM%2B" : toolType; - string startDate = HttpUtility.UrlEncode(APIHelperFunctions.GetDateWithOffsetAsAPIString(DateTime.Now.ToString(), -12.5f)); - - string url = APIHelperFunctions.GenerateURLWithParameters(chart: "ToolStateGantt", periodLen: "24", - capacityTypesLike: capacityFilter, toolsLike: _toolFilter, startDate: startDate); - - _logger.LogInformation("FabTime URL: {url}", url); - - try - { - return await GetJsonData>(url); - } - catch (Exception ex) - { - _logger.LogCritical(ex, "Error in API call."); - } - - return null; - } - - public async Task GetJsonData(string url) - { - T deserializedJson = default(T); - - using (var client = new HttpClient()) - { - using (HttpResponseMessage response = await client.GetAsync(url)) - { - string apiResponse = await response.Content.ReadAsStringAsync(); - - _logger.LogInformation("API Response: {response}" + apiResponse); - - try - { - deserializedJson = JsonSerializer.Deserialize(apiResponse); - } - catch (Exception ex) - { - _logger.LogCritical(ex, "Failed to deserialize Json object."); - } - - } - } - - return deserializedJson; - } - } -} diff --git a/ReportingServices.Shared/Repositories/Interfaces/IFabTimeReportingRepository.cs b/ReportingServices.Shared/Repositories/Interfaces/IFabTimeReportingRepository.cs deleted file mode 100644 index 900f712..0000000 --- a/ReportingServices.Shared/Repositories/Interfaces/IFabTimeReportingRepository.cs +++ /dev/null @@ -1,13 +0,0 @@ -using ReportingServices.Shared.Models.ProductionReport; -using ReportingServices.Shared.ViewModels.ProductionReport; - -namespace ReportingServices.Shared.Repositories -{ - public interface IFabTimeReportingRepository - { - public Task> GetMovesTrendData(string startDate = "", string endDate = ""); - public Task> GetToolStateTrendData(string toolType); - public Task> GetToolStateData(string toolType); - public Task GetJsonData(string url); - } -} diff --git a/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs b/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs index 6b0e842..49f8153 100644 --- a/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs +++ b/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs @@ -9,8 +9,6 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport public YieldStatistics CurrentWeek { get; set; } public YieldStatistics PreviousWeek { get; set; } public List ToolEvents { get; set; } - public Dictionary> ToolAvailibilityByType { get; set; } - public Dictionary ToolStateByType { get; set; } public List CleanEvents { get; set; } public List MetrologyEvents { get; set; } public Dictionary> ToolStatesByOwner { get; set; } @@ -26,8 +24,6 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport public DailyReport() { - ToolAvailibilityByType = new(); - ToolStateByType = new(); CleanEvents = new(); MetrologyEvents = new(); DualLayerReactors = new(); @@ -38,18 +34,6 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport PreviousWeek = new(StartDate.AddDays(-7), false); } - public void AddToolAvailibilityByType(string key, List states) - { - ToolAvailibilityByType.Add(key, states); - } - - public void AddToolStateByType(string key, List states) - { - ToolStateByType state = new(states); - - ToolStateByType.Add(key, state); - } - public void SetReactorInfo(List reactors, List unscheduledReactors) { SetToolsByPocketSize(reactors, unscheduledReactors); @@ -141,10 +125,6 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport { CurrentWeek.ScrapByDay = APIHelperFunctions.ReverseList(CurrentWeek.ScrapByDay); PreviousWeek.ScrapByDay = APIHelperFunctions.ReverseList(PreviousWeek.ScrapByDay); - - ToolAvailibilityByType["ASM"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["ASM"]); - ToolAvailibilityByType["EPP"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["EPP"]); - ToolAvailibilityByType["HTR"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["HTR"]); } } } diff --git a/ReportingServices.Shared/ViewModels/ProductionReport/ToolStateByType.cs b/ReportingServices.Shared/ViewModels/ProductionReport/ToolStateByType.cs deleted file mode 100644 index 3984850..0000000 --- a/ReportingServices.Shared/ViewModels/ProductionReport/ToolStateByType.cs +++ /dev/null @@ -1,71 +0,0 @@ -using ReportingServices.Shared.Models.ProductionReport; - -namespace ReportingServices.Shared.ViewModels.ProductionReport -{ - public class ToolStateByType - { - public int DownTools { get; set; } - public int UpTools { get; set; } - public List ToolStateCurrents { get; set; } - public List ToolsDownGreaterThan12Hours { get; set; } - - public ToolStateByType(List toolStateCurrents) - { - ToolStateCurrents = toolStateCurrents; - ToolsDownGreaterThan12Hours = new List(); - UpTools = 0; - DownTools = 0; - - GetToolsDownGreaterThan12Hours(); - GetMostRecentTransactions(); - DetermineUpAndDownTools(); - } - - public void GetMostRecentTransactions() - { - for (int i = ToolStateCurrents.Count - 2; i >= 0; i--) - { - if (ToolStateCurrents[i].Tool == ToolStateCurrents[i + 1].Tool) - ToolStateCurrents.RemoveAt(i); - } - } - - public void GetToolsDownGreaterThan12Hours() - { - float elapsedTime = 0f; - - if (ToolStateCurrents[^1].BasicStateDescription.ToUpper() is not "PRODUCTIVE" and not "OUT OF SERVICE") - float.Parse(ToolStateCurrents[^1].GanttElapsedHours); - - for (int i = ToolStateCurrents.Count - 2; i >= 0; i--) - { - if (ToolStateCurrents[i].Tool == ToolStateCurrents[i + 1].Tool) - { - if (ToolStateCurrents[i].BasicStateDescription.ToUpper() != "PRODUCTIVE" && ToolStateCurrents[^1].BasicStateDescription.ToUpper() != "OUT OF SERVICE") - elapsedTime += float.Parse(ToolStateCurrents[i].GanttElapsedHours); - } - else - { - if (elapsedTime >= 12) - ToolsDownGreaterThan12Hours.Add(ToolStateCurrents[i + 1].Tool); - - if (ToolStateCurrents[i].BasicStateDescription.ToUpper() != "PRODUCTIVE" && ToolStateCurrents[^1].BasicStateDescription.ToUpper() != "OUT OF SERVICE") - elapsedTime = float.Parse(ToolStateCurrents[i].GanttElapsedHours); - else - elapsedTime = 0; - } - } - } - - public void DetermineUpAndDownTools() - { - foreach (ToolStateCurrent tools in ToolStateCurrents) - { - if (tools.BasicStateDescription == "Productive") - UpTools++; - else if (tools.ReactorStatus != "Out of Service") - DownTools++; - } - } - } -} diff --git a/ReportingServices.UI/Controllers/ProductionReportController.cs b/ReportingServices.UI/Controllers/ProductionReportController.cs index 6f9362e..3815eef 100644 --- a/ReportingServices.UI/Controllers/ProductionReportController.cs +++ b/ReportingServices.UI/Controllers/ProductionReportController.cs @@ -36,7 +36,7 @@ namespace ReportingServices.UI.Controllers try { - DailyReport dailyReport = DailyReportHelper.SetUpDailyReport(_logger, baseFabTimeUrl, baseScrapeDbUrl); + DailyReport dailyReport = DailyReportHelper.SetUpDailyReport(_logger, baseScrapeDbUrl); Dictionary> toolStateOwners = JsonFileHandler.LoadJSONFile>>(_toolStateOwnerFilePath); dailyReport.ToolStatesByOwner = toolStateOwners; diff --git a/ReportingServices.UI/Program.cs b/ReportingServices.UI/Program.cs index 499e672..768e45e 100644 --- a/ReportingServices.UI/Program.cs +++ b/ReportingServices.UI/Program.cs @@ -13,8 +13,6 @@ Serilog.ILogger log = Log.ForContext(); // Add services to the container. builder.Services.AddControllersWithViews(); -builder.Services.AddScoped(); -builder.Services.AddScoped(); var app = builder.Build(); diff --git a/ReportingServices.UI/wwwroot/Assets/SLLTools.json b/ReportingServices.UI/wwwroot/Assets/SLLTools.json index 7af0e1a..e2d34ac 100644 --- a/ReportingServices.UI/wwwroot/Assets/SLLTools.json +++ b/ReportingServices.UI/wwwroot/Assets/SLLTools.json @@ -1,17 +1 @@ -[ - { - "Date": "2023-01-09T00:00:00-07:00", - "ASM": 8, - "HTR": 16 - }, - { - "Date": "2023-01-10T00:00:00-07:00", - "ASM": 8, - "HTR": 16 - }, - { - "Date": "2023-01-11T00:00:00-07:00", - "ASM": 8, - "HTR": 16 - } -] \ No newline at end of file +[{"Date":"2023-01-09T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-10T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-11T00:00:00-07:00","ASM":8,"HTR":16}] \ No newline at end of file