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

@ -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<string>("BaseAPIAddress") + "ScrapeDB/";
}
public IActionResult Index()
{

View File

@ -8,12 +8,16 @@ namespace ReportingServices.UI.Controllers
public class ProductionReportController : Controller
{
private readonly ILogger<ProductionReportController> _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<ProductionReportController> logger)
public ProductionReportController(ILogger<ProductionReportController> logger, IConfiguration configuration)
{
_logger = logger;
_configuration = configuration;
_baseUrl = _configuration.GetValue<string>("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<string, List<string>> toolStateOwners = JsonFileHandler.LoadJSONFile<Dictionary<string, List<string>>>(_toolStateOwnerFilePath);
dailyReport.ToolStatesByOwner = toolStateOwners;

View File

@ -187,7 +187,7 @@
<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>
</tr>
<tr>
@ -242,14 +242,14 @@
</tr>
<tr>
<td scope="row">Wafers Needed to make QTR</td>
<td class="text-center">3,640</td>
<td class="text-center">3,640</td>
<td class="text-center">3,640</td>
<td class="text-center">3,640</td>
<td class="text-center">3,640</td>
<td class="text-center">3,640</td>
<td class="text-center">3,640</td>
<td class="text-center">25,480</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td>
<td class="text-center">@string.Format("{0:##,###}", Model.DailyPlanWafers * 7)</td>
<td>Number updated weekly</td>
</tr>
</tbody>

View File

@ -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/"
}

View File

@ -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/"
}