diff --git a/ReportingServices.API/appsettings.Development.json b/ReportingServices.API/appsettings.Development.json index 0c208ae..8e4564f 100644 --- a/ReportingServices.API/appsettings.Development.json +++ b/ReportingServices.API/appsettings.Development.json @@ -4,5 +4,8 @@ "Default": "Information", "Microsoft.AspNetCore": "Warning" } + }, + "ConnectionStrings": { + "DefaultConnection": "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true" } } diff --git a/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs b/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs index c8e3b3d..360a041 100644 --- a/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs +++ b/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs @@ -1,5 +1,4 @@ -using ReportingServices.Shared.Repositories; -using ReportingServices.Shared.Models.ProductionReport; +using ReportingServices.Shared.Models.ProductionReport; using ReportingServices.Shared.ViewModels.ProductionReport; namespace ReportingServices.Shared.HelperClasses @@ -8,10 +7,8 @@ namespace ReportingServices.Shared.HelperClasses { private static readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json"; private static readonly string _SLLFilePath = "wwwroot/Assets/SLLTools.json"; - private static readonly string _baseUrlFabtime = "https://localhost:7196/api/FabTime/"; - private static readonly string _baseUrlScrapeDb = "https://localhost:7196/api/ScrapeDB/"; - public static DailyReport SetUpDailyReport() + public static DailyReport SetUpDailyReport(string baseUrlFabtime, string baseUrlScrapeDb) { List>> tasksEQState = new(); List>> tasksState = new(); @@ -21,21 +18,21 @@ namespace ReportingServices.Shared.HelperClasses ManualReportEntries = JsonFileHandler.LoadJSONFile(_dailyRptFilePath) }; - Task task1 = ApiCaller.GetApi(_baseUrlFabtime + "ReactorOuts?startDate=" + report.StartDate.ToString() + "&endDate=" + DateTime.Now.ToString()); - Task task2 = ApiCaller.GetApi(_baseUrlFabtime + "ReactorOuts?startDate=" + report.StartDate.AddDays(-7).ToString() + "&endDate=" + report.StartDate.ToString()); + Task task1 = ApiCaller.GetApi(baseUrlFabtime + "ReactorOuts?startDate=" + report.StartDate.ToString() + "&endDate=" + DateTime.Now.ToString()); + Task task2 = ApiCaller.GetApi(baseUrlFabtime + "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")); + 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")); - Task targets = ApiCaller.GetApi(_baseUrlScrapeDb + "Targets"); - Task> rds = ApiCaller.GetApi>(_baseUrlScrapeDb + "RDS?date=" + report.StartDate.ToString()); - Task> reactors = ApiCaller.GetApi>(_baseUrlScrapeDb + "Reactors"); + Task targets = ApiCaller.GetApi(baseUrlScrapeDb + "Targets"); + Task> rds = ApiCaller.GetApi>(baseUrlScrapeDb + "RDS?date=" + report.StartDate.ToString()); + Task> reactors = ApiCaller.GetApi>(baseUrlScrapeDb + "Reactors"); report.AddToolAvailibilityByType("ASM", tasksEQState[0].Result); report.AddToolAvailibilityByType("EPP", tasksEQState[1].Result); diff --git a/ReportingServices.UI/Controllers/PlanningReportController.cs b/ReportingServices.UI/Controllers/PlanningReportController.cs index 5a31f17..8bb02cf 100644 --- a/ReportingServices.UI/Controllers/PlanningReportController.cs +++ b/ReportingServices.UI/Controllers/PlanningReportController.cs @@ -6,7 +6,14 @@ namespace ReportingServices.UI.Controllers { public class PlanningReportController : Controller { - private readonly string _baseUrl = "https://localhost:7196/api/ScrapeDB/"; + private readonly IConfiguration _configuration; + private readonly string _baseUrl; + + public PlanningReportController(IConfiguration configuration) + { + _configuration = configuration; + _baseUrl = _configuration.GetValue("BaseAPIAddress") + "ScrapeDB/"; + } public IActionResult Index() { diff --git a/ReportingServices.UI/Controllers/ProductionReportController.cs b/ReportingServices.UI/Controllers/ProductionReportController.cs index 1c23c7d..51addc4 100644 --- a/ReportingServices.UI/Controllers/ProductionReportController.cs +++ b/ReportingServices.UI/Controllers/ProductionReportController.cs @@ -8,12 +8,16 @@ namespace ReportingServices.UI.Controllers public class ProductionReportController : Controller { private readonly ILogger _logger; + private readonly IConfiguration _configuration; private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json"; private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json"; + private readonly string _baseUrl; - public ProductionReportController(ILogger logger) + public ProductionReportController(ILogger logger, IConfiguration configuration) { _logger = logger; + _configuration = configuration; + _baseUrl = _configuration.GetValue("BaseAPIAddress"); } @@ -24,9 +28,12 @@ namespace ReportingServices.UI.Controllers public IActionResult DailyReport() { + string baseFabTimeUrl = _baseUrl + "FabTime/"; + string baseScrapeDbUrl = _baseUrl + "ScrapeDB/"; + try { - DailyReport dailyReport = DailyReportHelper.SetUpDailyReport(); + DailyReport dailyReport = DailyReportHelper.SetUpDailyReport(baseFabTimeUrl, baseScrapeDbUrl); Dictionary> toolStateOwners = JsonFileHandler.LoadJSONFile>>(_toolStateOwnerFilePath); dailyReport.ToolStatesByOwner = toolStateOwners; diff --git a/ReportingServices.UI/Views/Shared/_DailyReportPartial.cshtml b/ReportingServices.UI/Views/Shared/_DailyReportPartial.cshtml index 9f86fa8..0a48acf 100644 --- a/ReportingServices.UI/Views/Shared/_DailyReportPartial.cshtml +++ b/ReportingServices.UI/Views/Shared/_DailyReportPartial.cshtml @@ -187,7 +187,7 @@ } } - @(string.Format("{0:P2}", totalYield / numberOfDaysInWeek)) + @(string.Format("{0:P2}", (float)(totalWafersOut - totalCustomerScrap - totalManufacturingScrap) / (float)totalWafersOut)) After Scrap @@ -242,14 +242,14 @@ Wafers Needed to make QTR - 3,640 - 3,640 - 3,640 - 3,640 - 3,640 - 3,640 - 3,640 - 25,480 + @string.Format("{0:#,###}", Model.DailyPlanWafers) + @string.Format("{0:#,###}", Model.DailyPlanWafers) + @string.Format("{0:#,###}", Model.DailyPlanWafers) + @string.Format("{0:#,###}", Model.DailyPlanWafers) + @string.Format("{0:#,###}", Model.DailyPlanWafers) + @string.Format("{0:#,###}", Model.DailyPlanWafers) + @string.Format("{0:#,###}", Model.DailyPlanWafers) + @string.Format("{0:##,###}", Model.DailyPlanWafers * 7) Number updated weekly diff --git a/ReportingServices.UI/appsettings.Development.json b/ReportingServices.UI/appsettings.Development.json index 0a35c7e..b44591a 100644 --- a/ReportingServices.UI/appsettings.Development.json +++ b/ReportingServices.UI/appsettings.Development.json @@ -9,6 +9,7 @@ "MinimumLevel": "Debug" }, "ConnectionStrings": { - "DefaultConnection": "Server=MESTSV01EC.ec.local\\TEST1,50572;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true" - } + "DefaultConnection": "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true" + }, + "BaseAPIAddress": "https://localhost:7196/api/" } diff --git a/ReportingServices.UI/appsettings.Release.json b/ReportingServices.UI/appsettings.Release.json index a2a590b..17ea30e 100644 --- a/ReportingServices.UI/appsettings.Release.json +++ b/ReportingServices.UI/appsettings.Release.json @@ -10,5 +10,6 @@ }, "ConnectionStrings": { "DefaultConnection": "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true" - } + }, + "BaseAPIAddress": "http://localhost:50201/api/" }