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:
@ -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;
|
||||
|
Reference in New Issue
Block a user