Updated appsettings.json file to change base api url based on environment. Also fixed bug in calculation of yield percentage.

This commit is contained in:
Daniel Wathen 2023-01-05 15:10:40 -07:00
parent 3922d28a8b
commit 6de41bc8da
7 changed files with 49 additions and 33 deletions

View File

@ -4,5 +4,8 @@
"Default": "Information", "Default": "Information",
"Microsoft.AspNetCore": "Warning" "Microsoft.AspNetCore": "Warning"
} }
},
"ConnectionStrings": {
"DefaultConnection": "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true"
} }
} }

View File

@ -1,5 +1,4 @@
using ReportingServices.Shared.Repositories; using ReportingServices.Shared.Models.ProductionReport;
using ReportingServices.Shared.Models.ProductionReport;
using ReportingServices.Shared.ViewModels.ProductionReport; using ReportingServices.Shared.ViewModels.ProductionReport;
namespace ReportingServices.Shared.HelperClasses 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 _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
private static readonly string _SLLFilePath = "wwwroot/Assets/SLLTools.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<Task<List<EquipmentStateByDay>>> tasksEQState = new(); List<Task<List<EquipmentStateByDay>>> tasksEQState = new();
List<Task<List<ToolStateCurrent>>> tasksState = new(); List<Task<List<ToolStateCurrent>>> tasksState = new();
@ -21,21 +18,21 @@ namespace ReportingServices.Shared.HelperClasses
ManualReportEntries = JsonFileHandler.LoadJSONFile<ManualReportEntries>(_dailyRptFilePath) ManualReportEntries = JsonFileHandler.LoadJSONFile<ManualReportEntries>(_dailyRptFilePath)
}; };
Task<YieldInformation> task1 = ApiCaller.GetApi<YieldInformation>(_baseUrlFabtime + "ReactorOuts?startDate=" + report.StartDate.ToString() + "&endDate=" + DateTime.Now.ToString()); Task<YieldInformation> task1 = ApiCaller.GetApi<YieldInformation>(baseUrlFabtime + "ReactorOuts?startDate=" + report.StartDate.ToString() + "&endDate=" + DateTime.Now.ToString());
Task<YieldInformation> task2 = ApiCaller.GetApi<YieldInformation>(_baseUrlFabtime + "ReactorOuts?startDate=" + report.StartDate.AddDays(-7).ToString() + "&endDate=" + report.StartDate.ToString()); Task<YieldInformation> task2 = ApiCaller.GetApi<YieldInformation>(baseUrlFabtime + "ReactorOuts?startDate=" + report.StartDate.AddDays(-7).ToString() + "&endDate=" + report.StartDate.ToString());
tasksEQState.Add(ApiCaller.GetApi<List<EquipmentStateByDay>>(_baseUrlFabtime + "ToolStateTrend?toolType=ASM")); tasksEQState.Add(ApiCaller.GetApi<List<EquipmentStateByDay>>(baseUrlFabtime + "ToolStateTrend?toolType=ASM"));
tasksEQState.Add(ApiCaller.GetApi<List<EquipmentStateByDay>>(_baseUrlFabtime + "ToolStateTrend?toolType=EPP")); tasksEQState.Add(ApiCaller.GetApi<List<EquipmentStateByDay>>(baseUrlFabtime + "ToolStateTrend?toolType=EPP"));
tasksEQState.Add(ApiCaller.GetApi<List<EquipmentStateByDay>>(_baseUrlFabtime + "ToolStateTrend?toolType=HTR")); tasksEQState.Add(ApiCaller.GetApi<List<EquipmentStateByDay>>(baseUrlFabtime + "ToolStateTrend?toolType=HTR"));
tasksState.Add(ApiCaller.GetApi<List<ToolStateCurrent>>(_baseUrlFabtime + "ToolState?toolType=ASM")); tasksState.Add(ApiCaller.GetApi<List<ToolStateCurrent>>(baseUrlFabtime + "ToolState?toolType=ASM"));
tasksState.Add(ApiCaller.GetApi<List<ToolStateCurrent>>(_baseUrlFabtime + "ToolState?toolType=EPP")); tasksState.Add(ApiCaller.GetApi<List<ToolStateCurrent>>(baseUrlFabtime + "ToolState?toolType=EPP"));
tasksState.Add(ApiCaller.GetApi<List<ToolStateCurrent>>(_baseUrlFabtime + "ToolState?toolType=HTR")); tasksState.Add(ApiCaller.GetApi<List<ToolStateCurrent>>(baseUrlFabtime + "ToolState?toolType=HTR"));
tasksState.Add(ApiCaller.GetApi<List<ToolStateCurrent>>(_baseUrlFabtime + "ToolState?toolType=Metrology")); tasksState.Add(ApiCaller.GetApi<List<ToolStateCurrent>>(baseUrlFabtime + "ToolState?toolType=Metrology"));
tasksState.Add(ApiCaller.GetApi<List<ToolStateCurrent>>(_baseUrlFabtime + "ToolState?toolType=Cleans")); tasksState.Add(ApiCaller.GetApi<List<ToolStateCurrent>>(baseUrlFabtime + "ToolState?toolType=Cleans"));
Task<QuarterlyTargets> targets = ApiCaller.GetApi<QuarterlyTargets>(_baseUrlScrapeDb + "Targets"); Task<QuarterlyTargets> targets = ApiCaller.GetApi<QuarterlyTargets>(baseUrlScrapeDb + "Targets");
Task<List<RDS>> rds = ApiCaller.GetApi<List<RDS>>(_baseUrlScrapeDb + "RDS?date=" + report.StartDate.ToString()); Task<List<RDS>> rds = ApiCaller.GetApi<List<RDS>>(baseUrlScrapeDb + "RDS?date=" + report.StartDate.ToString());
Task<List<Reactor>> reactors = ApiCaller.GetApi<List<Reactor>>(_baseUrlScrapeDb + "Reactors"); Task<List<Reactor>> reactors = ApiCaller.GetApi<List<Reactor>>(baseUrlScrapeDb + "Reactors");
report.AddToolAvailibilityByType("ASM", tasksEQState[0].Result); report.AddToolAvailibilityByType("ASM", tasksEQState[0].Result);
report.AddToolAvailibilityByType("EPP", tasksEQState[1].Result); report.AddToolAvailibilityByType("EPP", tasksEQState[1].Result);

View File

@ -6,7 +6,14 @@ namespace ReportingServices.UI.Controllers
{ {
public class PlanningReportController : Controller 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<string>("BaseAPIAddress") + "ScrapeDB/";
}
public IActionResult Index() public IActionResult Index()
{ {

View File

@ -8,12 +8,16 @@ namespace ReportingServices.UI.Controllers
public class ProductionReportController : Controller public class ProductionReportController : Controller
{ {
private readonly ILogger<ProductionReportController> _logger; private readonly ILogger<ProductionReportController> _logger;
private readonly IConfiguration _configuration;
private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json"; private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json"; private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json";
private readonly string _baseUrl;
public ProductionReportController(ILogger<ProductionReportController> logger) public ProductionReportController(ILogger<ProductionReportController> logger, IConfiguration configuration)
{ {
_logger = logger; _logger = logger;
_configuration = configuration;
_baseUrl = _configuration.GetValue<string>("BaseAPIAddress");
} }
@ -24,9 +28,12 @@ namespace ReportingServices.UI.Controllers
public IActionResult DailyReport() public IActionResult DailyReport()
{ {
string baseFabTimeUrl = _baseUrl + "FabTime/";
string baseScrapeDbUrl = _baseUrl + "ScrapeDB/";
try try
{ {
DailyReport dailyReport = DailyReportHelper.SetUpDailyReport(); DailyReport dailyReport = DailyReportHelper.SetUpDailyReport(baseFabTimeUrl, baseScrapeDbUrl);
Dictionary<string, List<string>> toolStateOwners = JsonFileHandler.LoadJSONFile<Dictionary<string, List<string>>>(_toolStateOwnerFilePath); Dictionary<string, List<string>> toolStateOwners = JsonFileHandler.LoadJSONFile<Dictionary<string, List<string>>>(_toolStateOwnerFilePath);
dailyReport.ToolStatesByOwner = toolStateOwners; dailyReport.ToolStatesByOwner = toolStateOwners;

View File

@ -187,7 +187,7 @@
<td></td> <td></td>
} }
} }
<td class="text-center">@(string.Format("{0:P2}", totalYield / numberOfDaysInWeek))</td> <td class="text-center">@(string.Format("{0:P2}", (float)(totalWafersOut - totalCustomerScrap - totalManufacturingScrap) / (float)totalWafersOut))</td>
<td>After Scrap</td> <td>After Scrap</td>
</tr> </tr>
<tr> <tr>
@ -242,14 +242,14 @@
</tr> </tr>
<tr> <tr>
<td scope="row">Wafers Needed to make QTR</td> <td scope="row">Wafers Needed to make QTR</td>
<td class="text-center">3,640</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">3,640</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">3,640</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">3,640</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">3,640</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">3,640</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">3,640</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">25,480</td> <td class="text-center">@string.Format("{0:##,###}", Model.DailyPlanWafers * 7)</td>
<td>Number updated weekly</td> <td>Number updated weekly</td>
</tr> </tr>
</tbody> </tbody>

View File

@ -9,6 +9,7 @@
"MinimumLevel": "Debug" "MinimumLevel": "Debug"
}, },
"ConnectionStrings": { "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/"
} }

View File

@ -10,5 +10,6 @@
}, },
"ConnectionStrings": { "ConnectionStrings": {
"DefaultConnection": "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;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": "http://localhost:50201/api/"
} }