Client only

This commit is contained in:
2023-01-13 15:33:58 -07:00
parent a2512b41e1
commit b9e95e3c55
140 changed files with 95748 additions and 0 deletions

View File

@ -0,0 +1,7 @@
@page "/counter"
<PageTitle>Counter</PageTitle>
<MudText Typo="Typo.h3" GutterBottom="true">Counter</MudText>
<MudText Class="mb-4">Current count: @_CurrentCount</MudText>
<MudButton Color="Color.Primary" Variant="Variant.Filled" @onclick="IncrementCount">Click me</MudButton>

View File

@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Components;
namespace ReportingServices.Client.Pages;
public partial class Counter
{
[Inject] protected ILogger<Counter>? Logger { get; set; }
private int _CurrentCount = 0;
private void IncrementCount()
{
if (Logger is null)
throw new NullReferenceException(nameof(Logger));
Logger.LogWarning("Someone has clicked me!");
_CurrentCount++;
}
}

View File

@ -0,0 +1,467 @@
@page "/DailyReport"
@using ReportingServices.Shared.Models.ProductionReport;
@using ReportingServices.Shared.ViewModels.ProductionReport;
<PageTitle>Daily Passdown | Mesa Reporting Services</PageTitle>
<div aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="">Home</a>
</li>
<li class="breadcrumb-item">
<a href="ProductionReport">Production Reports</a>
</li>
<li class="breadcrumb-item active" aria-current="page">Production Passdown Report</li>
</ol>
</div>
<br />
<div class="text-center">
<h2>Daily Report - ScrapeDB</h2>
<br /><br />
</div>
@if (_dailyReport is null || _rpt is null)
{
<MudProgressCircular Color="Color.Default" Indeterminate="true" />
}
else
{
<button class="btn btn-outline-dark float-start dailyReportTable" onclick="toggleWeek()">View Previous Week</button>
<button class="btn btn-outline-dark float-end dailyReportTable hidden" onclick="toggleWeek()">View Current Week</button>
<br /><br />
<div class="table-responsive dailyReportTable">
<ReportingServices.Client.Shared.DailyReport YieldStatistics=_dailyReport.CurrentWeek YieldOutDays=@(_dailyReport.CurrentWeek.OutsByDay.Count - 1) NumberOfDaysInWeek=_dailyReport.CurrentWeek.OutsByDay.Count></ReportingServices.Client.Shared.DailyReport>
</div>
<div class="table-responsive dailyReportTable hidden">
<ReportingServices.Client.Shared.DailyReport YieldStatistics=_dailyReport.PreviousWeek YieldOutDays=_dailyReport.PreviousWeek.OutsByDay.Count NumberOfDaysInWeek=_dailyReport.PreviousWeek.OutsByDay.Count></ReportingServices.Client.Shared.DailyReport>
</div>
<br />
<h5>Daily Target Summary</h5>
<ul>
<li>Operator HC: (Days/Nights) @_rpt.OperatorHeadcountDays/@_rpt.OperatorHeadcountNights</li>
<li>Total Call Outs: (Days/Nights) @_rpt.OperatorCallOutsDays/@_rpt.OperatorCallOutsNights</li>
<li>Engineering HC: @_rpt.EngineeringHeadcountDays/@_rpt.EngineeringHeadcountNights</li>
<li>Total Call Outs: (Days/Nights) @_rpt.EngineeringCallOutsDays/@_rpt.EngineeringCallOutsNights</li>
<li>Maintenance HC: @_rpt.MaintenanceHeadcountDays/@_rpt.MaintenanceHeadcountNights</li>
<li>Total Call Outs: (Days/Nights) @_rpt.MaintenanceCallOutsDays/@_rpt.MaintenanceCallOutsNights</li>
</ul>
<br />
<ul>
@{
int bottleChanges = 0;
int dailyPartChanges = 0;
int weeklyPartChanges = 0;
string bottle = "";
string daily = "";
string weekly = "";
if (!string.IsNullOrEmpty(_rpt.BottleChanges))
{
bottle = string.Join(", ", _rpt.BottleChanges.Split(','));
bottleChanges = _rpt.BottleChanges.Split(',').Length;
}
if (!string.IsNullOrEmpty(_rpt.DailyPartChanges))
{
daily = string.Join(", ", _rpt.DailyPartChanges.Split(','));
dailyPartChanges = _rpt.DailyPartChanges.Split(',').Length;
}
if (!string.IsNullOrEmpty(_rpt.WeeklyPartChanges))
{
weekly = string.Join(", ", _rpt.WeeklyPartChanges.Split(','));
weeklyPartChanges = _rpt.WeeklyPartChanges.Split(',').Length;
}
}
<li>Bottle Change (@bottleChanges): @bottle</li>
<li>Daily Part Changes (@dailyPartChanges): @daily</li>
<li>Weekly Part Changes (@weeklyPartChanges): @weekly</li>
</ul>
<br />
<a class="btn btn-light" href="EditDailyReport">Edit</a>
<br /><br />
<h5>Current Reactors Down(@_dailyReport.ToolEvents.Where(x => x.IsInProduction == false).Count()):</h5>
<div class="row">
<div class="col-lg-6">
@{
List<ToolEventView> asmTools = _dailyReport.ToolEvents.Where(x => x.IsInProduction == false && x.Type.Contains("ASM")).ToList();
}
ASM(@asmTools.Count())
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Reactor</th>
<th scope="col">Owner</th>
<th scope="col">Issue</th>
<th scope="col">Downtime</th>
</tr>
</thead>
<tbody>
@foreach (ToolEventView tool in asmTools)
{
string owner = "";
if (_dailyReport.ToolStatesByOwner["Maintenance"].Contains(tool.MostRecentEvent.REACT_MODE))
owner = "Maint";
else if (_dailyReport.ToolStatesByOwner["Engineering"].Contains(tool.MostRecentEvent.REACT_MODE))
owner = "Eng";
else
owner = "Prod";
if (tool.Downtime > 12)
_myClass = "tableDowntime";
else
_myClass = "";
<tr class="@_myClass">
<td>@tool.Reactor</td>
<td>@owner</td>
<td>@tool.MostRecentEvent.COMMENT</td>
<td>@string.Format("{0:##,###.##}", tool.Downtime)</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-lg-6">
@{
List<ToolEventView> eppTools = _dailyReport.ToolEvents.Where(x => x.IsInProduction == false && x.Type.Contains("EPP")).ToList();
}
EPP(@eppTools.Count())
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Reactor</th>
<th scope="col">Owner</th>
<th scope="col">Issue</th>
<th scope="col">Downtime</th>
</tr>
</thead>
<tbody>
@foreach (ToolEventView tool in eppTools)
{
string owner = "";
if (_dailyReport.ToolStatesByOwner["Maintenance"].Contains(tool.MostRecentEvent.REACT_MODE))
owner = "Maint";
else if (_dailyReport.ToolStatesByOwner["Engineering"].Contains(tool.MostRecentEvent.REACT_MODE))
owner = "Eng";
else
owner = "Prod";
if (tool.Downtime > 12)
_myClass = "tableDowntime";
else
_myClass = "";
<tr class="@_myClass">
<td>@tool.Reactor</td>
<td>@owner</td>
<td>@tool.MostRecentEvent.COMMENT</td>
<td>@string.Format("{0:##,###.##}", tool.Downtime)</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-lg-6">
@{
List<ToolEventView> htrTools = _dailyReport.ToolEvents.Where(x => x.IsInProduction == false && x.Type.Contains("HTR")).ToList();
}
HTR(@htrTools.Count())
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Reactor</th>
<th scope="col">Owner</th>
<th scope="col">Issue</th>
<th scope="col">Downtime</th>
</tr>
</thead>
<tbody>
@foreach (ToolEventView tool in htrTools)
{
string owner = "";
if (_dailyReport.ToolStatesByOwner["Maintenance"].Contains(tool.MostRecentEvent.REACT_MODE))
owner = "Maint";
else if (_dailyReport.ToolStatesByOwner["Engineering"].Contains(tool.MostRecentEvent.REACT_MODE))
owner = "Eng";
else
owner = "Prod";
if (tool.Downtime > 12)
_myClass = "tableDowntime";
else
_myClass = "";
<tr class="@_myClass">
<td>@tool.Reactor</td>
<td>@owner</td>
<td>@tool.MostRecentEvent.COMMENT</td>
<td>@string.Format("{0:##,###.##}", tool.Downtime)</td>
</tr>
}
</tbody>
</table>
<p> *Rows highlighted in orange have been down for more than 12 hours</p>
</div>
</div>
<ul>
<li>Application ENG (0):</li>
<li>Reactors (Capacity @(_dailyReport.NumberOfToolsWaferSize6IN + _dailyReport.NumberOfToolsWaferSize8IN))
<ul>
<li>150mm - @_dailyReport.NumberOfToolsWaferSize6IN</li>
<li>200mm - @_dailyReport.NumberOfToolsWaferSize8IN</li>
</ul>
</li>
<li>Scheduled Reactors (@(_dailyReport.NumberOfToolsWaferSize6INScheduled + _dailyReport.NumberOfToolsWaferSize8INScheduled)):
<ul>
<li>150mm - @_dailyReport.NumberOfToolsWaferSize6INScheduled</li>
<li>200mm - @_dailyReport.NumberOfToolsWaferSize8INScheduled</li>
</ul>
</li>
<li>Dual Layer Reactors
<ul>
<li>ASM - @(string.Join(',', _dailyReport.DualLayerReactors["ASM"]))</li>
<li>HTR - @(string.Join(',', _dailyReport.DualLayerReactors["HTR"]))</li>
<li>EpiPro - @(string.Join(',', _dailyReport.DualLayerReactors["EPP"]))</li>
</ul>
</li>
<li>Metrology Down (@_dailyReport.MetrologyEvents.Count()):
@if (@_dailyReport.MetrologyEvents.Count() > 0)
{
<ul>
@foreach (ToolEvent tool in @_dailyReport.MetrologyEvents)
{
<li>@tool.TOOL_ID</li>
}
</ul>
}
</li>
<li>Cleans (@_dailyReport.CleanEvents.Count()):
@if (@_dailyReport.CleanEvents.Count() > 0)
{
<ul>
@foreach (ToolEvent tool in @_dailyReport.CleanEvents)
{
<li>@tool.TOOL_ID</li>
}
</ul>
}
</li>
</ul>
<br /><br />
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Monday</th>
<th scope="col">Tuesday</th>
<th scope="col">Wednesday</th>
<th scope="col">Thursday</th>
<th scope="col">Friday</th>
<th scope="col">Saturday</th>
<th scope="col">Sunday</th>
<th scope="col">WTD</th>
<th scope="col">Daily / Weekly</th>
</tr>
<tr>
<th scope="col"></th>
@for (int i = 0; i < 7; i++)
{
<th scope="col">@_dailyReport.StartDate.AddDays(i).ToString("MM/dd/yyyy")</th>
}
<th scope="col">Actual</th>
<th scope="col">Target</th>
</tr>
</thead>
<tbody>
<tr>
<td scope="row">ASMs Uptime</td>
@for (int i = 0; i < 7; i++)
{
asmTools = _dailyReport.ToolEvents.Where(x => x.Type.Contains("ASM")).ToList();
double availablePct = 0;
if (i < asmTools[0].Uptime.Count)
{
for (int j = 0; j < asmTools.Count; j++)
{
availablePct += asmTools[j].Uptime[i].UptimePercentage;
}
if (availablePct / asmTools.Count < .82)
_myClass = "table-danger text-danger";
else
_myClass = "";
<td class="@_myClass">@string.Format("{0:P2}", availablePct / asmTools.Count)</td>
_ASMAvailablePct += availablePct / asmTools.Count;
}
else
{
<td></td>
}
}
<td>@string.Format("{0:P2}", _ASMAvailablePct / _numberOfDaysInWeek)</td>
<td>82%</td>
</tr>
<tr>
<td scope="row">EPPs Uptime</td>
@for (int i = 0; i < 7; i++)
{
eppTools = _dailyReport.ToolEvents.Where(x => x.Type.Contains("EPP")).ToList();
double availablePct = 0;
if (i < eppTools[0].Uptime.Count)
{
for (int j = 0; j < eppTools.Count; j++)
{
availablePct += eppTools[j].Uptime[i].UptimePercentage;
}
if (availablePct / eppTools.Count < .60)
_myClass = "table-danger text-danger";
else
_myClass = "";
<td class="@_myClass">@string.Format("{0:P2}", availablePct / eppTools.Count)</td>
_EPPAvailablePct += availablePct / eppTools.Count;
}
else
{
<td></td>
}
}
<td>@string.Format("{0:P2}", _EPPAvailablePct / _numberOfDaysInWeek)</td>
<td>60%</td>
</tr>
<tr>
<td scope="row">HTRs Uptime</td>
@for (int i = 0; i < 7; i++)
{
htrTools = _dailyReport.ToolEvents.Where(x => x.Type.Contains("HTR")).ToList();
double availablePct = 0;
if (i < htrTools[0].Uptime.Count)
{
for (int j = 0; j < htrTools.Count; j++)
{
availablePct += htrTools[j].Uptime[i].UptimePercentage;
}
if (availablePct / htrTools.Count < .78)
_myClass = "table-danger text-danger";
else
_myClass = "";
<td class="@_myClass">@string.Format("{0:P2}", availablePct / htrTools.Count)</td>
_HTRAvailablePct += availablePct / htrTools.Count;
}
else
{
<td></td>
}
}
<td>@string.Format("{0:P2}", _HTRAvailablePct / _numberOfDaysInWeek)</td>
<td>78%</td>
</tr>
<tr>
<td scope="row">ASMs SLL Tool Count</td>
@for (int i = 0; i < 7; i++)
{
if (i < _dailyReport.SLLTools.Count())
{
<td>@_dailyReport.SLLTools[i].ASM</td>
_ASMSLL += @_dailyReport.SLLTools[i].ASM;
}
else
{
<td></td>
}
}
<td>@(_ASMSLL / _numberOfDaysInWeek)</td>
<td>0</td>
</tr>
<tr>
<td scope="row">HTRs SLL Tool Count</td>
@for (int i = 0; i < 7; i++)
{
int index = i == 6 ? 0 : i + 1;
if (i < _dailyReport.SLLTools.Count())
{
<td>@_dailyReport.SLLTools[i].HTR</td>
_HTRSLL += @_dailyReport.SLLTools[i].HTR;
}
else
{
<td></td>
}
}
<td>@(_HTRSLL / _numberOfDaysInWeek)</td>
<td>0</td>
</tr>
<tr>
<td scope="row">ASMs &lt;700C (Unload Temps)</td>
@for (int i = 0; i < 7; i++)
{
if (i < _dailyReport.UnloadTempsByDay.Count())
{
<td>@_dailyReport.UnloadTempsByDay[i].ASMUnloadsBelow700</td>
_ASMUnloadTemps += @_dailyReport.UnloadTempsByDay[i].ASMUnloadsBelow700;
}
else
{
<td></td>
}
}
<td>@(_ASMUnloadTemps / _numberOfDaysInWeek)</td>
<td>0</td>
</tr>
<tr>
<td scope="row">HTRs &lt;700C (Unload Temps)</td>
@for (int i = 0; i < 7; i++)
{
if (i < _dailyReport.UnloadTempsByDay.Count())
{
<td>@_dailyReport.UnloadTempsByDay[i].HTRUnloadsBelow700</td>
_HTRUnloadTemps += @_dailyReport.UnloadTempsByDay[i].HTRUnloadsBelow700;
}
else
{
<td></td>
}
}
<td>@(_HTRUnloadTemps / _numberOfDaysInWeek)</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
}

View File

@ -0,0 +1,71 @@
using System.Net.Http.Json;
using Microsoft.AspNetCore.Components;
using ReportingServices.Shared.HelperClasses;
using ReportingServices.Shared.Models.ProductionReport;
using ReportingServices.Shared.ViewModels.ProductionReport;
namespace ReportingServices.Client.Pages;
public partial class DailyReport
{
[Inject] protected HttpClient? HttpClient { get; set; }
[Inject] protected ILogger<DailyReport>? Logger { get; set; }
protected ReportingServices.Shared.ViewModels.ProductionReport.DailyReport? _dailyReport;
protected double _ASMAvailablePct = 0;
protected double _EPPAvailablePct = 0;
protected double _HTRAvailablePct = 0;
protected int _ASMSLL = 0;
protected int _HTRSLL = 0;
protected int _ASMUnloadTemps = 0;
protected int _HTRUnloadTemps = 0;
protected int _reportIndex = (int)DateTime.Now.DayOfWeek;
protected int _numberOfDaysInWeek; // = Model.CurrentWeek.OutsByDay.Count;
protected ManualReportEntries? _rpt; // = Model.ManualReportEntries;
protected string? _myClass;
protected override async Task OnInitializedAsync()
{
if (Logger is null)
throw new NullReferenceException(nameof(Logger));
if (HttpClient is null)
throw new NullReferenceException(nameof(HttpClient));
string baseScrapeDbUrl = "https://localhost:7196/api/" + "ScrapeDB/";
List<SLLTool>? sllTools = null;
ManualReportEntries? manualReportEntries = null;
Dictionary<string, List<string>>? toolStateOwners = null;
try
{
sllTools = await HttpClient.GetFromJsonAsync<List<SLLTool>>("http://localhost:5054/SLLTools.json");
manualReportEntries = await HttpClient.GetFromJsonAsync<ManualReportEntries>("http://localhost:5054/DailyReportInfo.json");
toolStateOwners = await HttpClient.GetFromJsonAsync<Dictionary<string, List<string>>>("http://localhost:5054/ToolStates.json");
}
catch (Exception ex)
{
Logger.LogError(ex, "Failed to load JsonFiles.");
}
try
{
_dailyReport = DailyReportHelper.SetUpDailyReport(Logger, baseScrapeDbUrl, sllTools, manualReportEntries);
_dailyReport.ToolStatesByOwner = toolStateOwners;
_numberOfDaysInWeek = _dailyReport.CurrentWeek.OutsByDay.Count;
_rpt = _dailyReport.ManualReportEntries;
}
catch (Exception ex)
{
Logger.LogCritical(ex, "Failed to load report");
}
}
}

View File

@ -0,0 +1,263 @@
@page "/EditDailyReport/{Rpt?}"
@using ReportingServices.Shared.Models.ProductionReport;
<PageTitle>Edit Daily Passdown | Mesa Reporting Services</PageTitle>
<div aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="">Home</a>
</li>
<li class="breadcrumb-item">
<a href="ProductionReport">Production Reports</a>
</li>
<li class="breadcrumb-item active" aria-current="page">Edit Passdown</li>
</ol>
</div>
<br />
@if (Rpt is null)
{
<MudProgressCircular Color="Color.Default" Indeterminate="true" />
}
else
{
<div class="container">
<h1 class="text-center">Edit Daily Targets</h1>
<form method="post" action="EditDailyReport">
<div class="row" style="padding-top: 5px; padding-bottom: 5px;">
<div class="col-lg-3 col-6">
<h6 style="padding-top: 10px;">Operator Headcount:</h6>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="OperatorHeadcountDays" name="OperatorHeadcountDays">
@for (int i = 0; i <= 15; i++)
{
<option selected="@(i == Rpt.OperatorHeadcountDays)">@i</option>
}
</select>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="OperatorHeadcountNights" name="OperatorHeadcountNights">
@for (int i = 0; i <= 15; i++)
{
<option selected="@(i == Rpt.OperatorHeadcountNights)">@i</option>
}
</select>
</div>
</div>
<div class="row" style="padding-top: 5px; padding-bottom: 5px;">
<div class="col-lg-3 col-6">
<h6 style="padding-top: 10px;">Total Call Outs (Operators):</h6>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="OperatorCallOutsDays" name="OperatorCallOutsDays">
@for (int i = 0; i <= 5; i++)
{
<option selected="@(i == Rpt.OperatorCallOutsDays)">@i</option>
}
</select>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="OperatorCallOutsNights" name="OperatorCallOutsNights">
@for (int i = 0; i <= 5; i++)
{
<option selected="@(i == Rpt.OperatorCallOutsNights)">@i</option>
}
</select>
</div>
</div>
<div class="row" style="padding-top: 5px; padding-bottom: 5px;">
<div class="col-lg-3 col-6">
<h6 style="padding-top: 10px;">Engineering Headcount:</h6>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="EngineeringHeadcountDays" name="EngineeringHeadcountDays">
@for (int i = 0; i <= 5; i++)
{
<option selected="@(i == Rpt.EngineeringHeadcountDays)">@i</option>
}
</select>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="EngineeringHeadcountNights" name="EngineeringHeadcountNights">
@for (int i = 0; i <= 5; i++)
{
<option selected="@(i == Rpt.EngineeringHeadcountNights)">@i</option>
}
</select>
</div>
</div>
<div class="row" style="padding-top: 5px; padding-bottom: 5px;">
<div class="col-lg-3 col-6">
<h6 style="padding-top: 10px;">Total Call Outs (Engineers):</h6>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="EngineerCallOutsDays" name="EngineeringCallOutsDays">
@for (int i = 0; i <= 5; i++)
{
<option selected="@(i == Rpt.EngineeringCallOutsDays)">@i</option>
}
</select>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="EngineerCallOutsNights" name="EngineeringCallOutsNights">
@for (int i = 0; i <= 5; i++)
{
<option selected="@(i == Rpt.EngineeringCallOutsNights)">@i</option>
}
</select>
</div>
</div>
<div class="row" style="padding-top: 5px; padding-bottom: 5px;">
<div class="col-lg-3 col-6">
<h6 style="padding-top: 10px;">Maintenance Headcount:</h6>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="MaintenanceHeadcountDays" name="MaintenanceHeadcountDays">
@for (int i = 0; i <= 5; i++)
{
<option selected="@(i == Rpt.MaintenanceHeadcountDays)">@i</option>
}
</select>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="MaintenanceHeadcountNights" name="MaintenanceHeadcountNights">
@for (int i = 0; i <= 5; i++)
{
<option selected="@(i == Rpt.MaintenanceHeadcountNights)">@i</option>
}
</select>
</div>
</div>
<div class="row" style="padding-top: 5px; padding-bottom: 5px;">
<div class="col-lg-3 col-6">
<h6 style="padding-top: 10px;">Total Call Outs (Maintenance):</h6>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="MaintenanceCallOutsDays" name="MaintenanceCallOutsDays">
@for (int i = 0; i <= 5; i++)
{
<option selected="@(i == Rpt.MaintenanceCallOutsDays)">@i</option>
}
</select>
</div>
<div class="col-lg-2 col-3">
<select class="form-control" id="MaintenanceCallOutsNights" name="MaintenanceCallOutsNights">
@for (int i = 0; i <= 5; i++)
{
<option selected="@(i == Rpt.MaintenanceCallOutsNights)">@i</option>
}
</select>
</div>
</div>
<br /><br />
<div id="bottleChanges" class="row myMultiselect" style="padding-top: 5px; padding-bottom: 5px;">
<div class="col-lg-3 col-md-4">
<h6>Bottle Changes:</h6>
</div>
<div class="form-group col-lg-4 col-md-5">
<div class="mySelectLabel selectBox" onclick="toggleCheckboxArea()">
<select class="form-select" name="BottleChanges">
<option>somevalue</option>
</select>
<div class="overSelect"></div>
</div>
<div class="mySelectOptions">
@for (int i = 20; i < 80; i++)
{
string isMatching = "";
string[] bottleChanges = !string.IsNullOrEmpty(Rpt.BottleChanges) ? Rpt.BottleChanges.Split(',') : new string[0];
for (int j = 0; j < bottleChanges.Length; j++)
{
if (bottleChanges[j] == "R" + i)
isMatching = "checked";
}
if(isMatching is null)
{
}
<label><input type="checkbox" onchange="checkboxStatusChange()" value="@("R" + i)" @isMatching />@(" R" + i)</label>
}
</div>
</div>
<div class="col-lg-2 col-md-3">
<button class="btn btn-info" type="button" onclick="clearList()">Clear List</button>
</div>
</div>
<div id="dailyPartChanges" class="row myMultiselect" style="padding-top: 5px; padding-bottom: 5px;">
<div class="col-lg-3 col-md-4">
<h6>Daily Part Changes:</h6>
</div>
<div class="form-group col-lg-4 col-md-5">
<div class="mySelectLabel selectBox" onclick="toggleCheckboxArea()">
<select class="form-select" name="DailyPartChanges">
<option>somevalue</option>
</select>
<div class="overSelect"></div>
</div>
<div class="mySelectOptions">
@for (int i = 20; i < 80; i++)
{
string isMatching = "";
string[] dailyPartChanges = !string.IsNullOrEmpty(Rpt.DailyPartChanges) ? Rpt.DailyPartChanges.Split(',') : new string[0];
for (int j = 0; j < dailyPartChanges.Length; j++)
{
if (dailyPartChanges[j] == "R" + i)
isMatching = "checked";
}
if(isMatching is null)
{
}
<label><input type="checkbox" onchange="checkboxStatusChange()" value="@("R" + i)" @isMatching />@(" R" + i)</label>
}
</div>
</div>
<div class="col-lg-2 col-md-3">
<button class="btn btn-info" type="button" onclick="clearList()">Clear List</button>
</div>
</div>
<div id="weeklyPartChanges" class="row myMultiselect" style="padding-top: 5px; padding-bottom: 5px;">
<div class="col-lg-3 col-md-4">
<h6>Weekly Part Changes:</h6>
</div>
<div class="form-group col-lg-4 col-md-5">
<div class="mySelectLabel selectBox" onclick="toggleCheckboxArea()">
<select class="form-select" name="WeeklyPartChanges">
<option>somevalue</option>
</select>
<div class="overSelect"></div>
</div>
<div class="mySelectOptions">
@for (int i = 20; i < 80; i++)
{
string isMatching = "";
string[] weeklyPartChanges = !string.IsNullOrEmpty(Rpt.WeeklyPartChanges) ? Rpt.WeeklyPartChanges.Split(',') : new string[0];
for (int j = 0; j < weeklyPartChanges.Length; j++)
{
if (weeklyPartChanges[j] == "R" + i)
isMatching = "checked";
}
if(isMatching is null)
{
}
<label><input type="checkbox" onchange="checkboxStatusChange()" value="@("R" + i)" @isMatching />@(" R" + i)</label>
}
</div>
</div>
<div class="col-lg-2 col-md-3">
<button class="btn btn-info" type="button" onclick="clearList()">Clear List</button>
</div>
</div>
<button type="submit" value="Submit" class="btn btn-light" style="margin-top: 5px;">Submit</button>
</form>
</div>
}

View File

@ -0,0 +1,25 @@
using System.Net.Http.Json;
using Microsoft.AspNetCore.Components;
using ReportingServices.Shared.HelperClasses;
using ReportingServices.Shared.Models.ProductionReport;
namespace ReportingServices.Client.Pages;
public partial class EditDailyReport
{
[Inject] protected HttpClient? HttpClient { get; set; }
[Inject] protected ILogger<EditDailyReport>? Logger { get; set; }
[Parameter] public ManualReportEntries? Rpt { get; set; }
protected override async Task OnInitializedAsync()
{
if (Logger is null)
throw new NullReferenceException(nameof(Logger));
if (HttpClient is null)
throw new NullReferenceException(nameof(HttpClient));
Rpt = await HttpClient.GetFromJsonAsync<ManualReportEntries>("http://localhost:5054/DailyReportInfo.json");
}
}

View File

@ -0,0 +1,19 @@
@page "/"
<PageTitle>Home Page | Mesa Reporting Services</PageTitle>
<div aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page">Home</li>
</ol>
</div>
<br />
<div class="row">
<div class="col-3 d-grid">
<a class="btn btn-outline-secondary" href="ProductionReport"><span class="float-start"><i class="fa-regular fa-folder-open fa-4x buttonImage align-middle"></i> Production</span></a>
</div>
<div class="col-3 d-grid">
<a class="btn btn-outline-secondary" href="PlanningReport"><span class="float-start"><i class="fa-regular fa-folder-open fa-4x buttonImage align-middle"></i> Planning</span></a>
</div>
</div>

View File

@ -0,0 +1,4 @@
namespace ReportingServices.Client.Pages;
public partial class Index
{ }

View File

@ -0,0 +1,49 @@
@page "/PlanningReport"
<PageTitle>Planning Reports | Mesa Reporting Services</PageTitle>
<div aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="">Home</a>
</li>
<li class="breadcrumb-item active" aria-current="page">Planning Reports</li>
</ol>
</div>
<br />
<div class="row">
<div class="col-3 d-grid">
<button class="btn btn-outline-secondary text-start" data-bs-toggle="modal" data-bs-target="#chooseDateRange"><span class="float-start"><i class="fa-regular fa-file-alt fa-4x buttonImage align-middle"></i> Weekly Part Changes Report</span></button>
</div>
</div>
<div class="modal fade" id="chooseDateRange" tabindex="-1" aria-labelledby="chooseDateRangeLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Choose Date Range</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form method="post" action="PlanningReport/WeeklyPartChangesReport" autocomplete="off">
<div class="modal-body" style="padding-top: 15px; padding-bottom: 10px">
<div class="row">
<div class="col-6">Start Date:</div>
<div class="col-6"><input type="text" name="startDate" id="StartDate" /></div>
</div>
<div class="row" style="padding-top: 10px; padding-bottom: 10px">
<div class="col-6">End Date:</div>
<div class="col-6"><input type="text" name="endDate" id="EndDate" /></div>
</div>
<div class="row" style="padding-top: 10px; padding-bottom: 10px">
<div class="col text-center">
<button class="btn btn-outline-secondary" onclick="displayBusyIndicator()" data-bs-dismiss="modal" type="submit">Go To Report</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<Loading></Loading>

View File

@ -0,0 +1,4 @@
namespace ReportingServices.Client.Pages;
public partial class PlanningReport
{ }

View File

@ -0,0 +1,24 @@
@page "/ProductionReport"
<PageTitle>Production Reports | Mesa Reporting Services</PageTitle>
<div aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="">Home</a>
</li>
<li class="breadcrumb-item active" aria-current="page">Production Reports</li>
</ol>
</div>
<br />
<div class="row">
<div class="col-3 d-grid">
<a class="btn btn-outline-secondary text-start" href="DailyReport" onclick="displayBusyIndicator()"><span class="float-start"><i class="fa-regular fa-file-alt fa-4x buttonImage align-middle"></i> Production Passdown Report</span></a>
</div>
<div class="col-3 d-grid">
<a class="btn btn-outline-secondary text-start" href="http://goto.infineon.com/mesassrreport" onclick="displayBusyIndicator()"><span class="float-start"><i class="fa-regular fa-file-alt fa-4x buttonImage align-middle"></i> Mesa SSR Report</span></a>
</div>
</div>
<Loading></Loading>

View File

@ -0,0 +1,4 @@
namespace ReportingServices.Client.Pages;
public partial class ProductionReport
{ }

View File

@ -0,0 +1,91 @@
@page "/WeeklyPartChangesReport/{StartDate?}/{EndDate?}"
<PageTitle>Weekly Part Changes | Mesa Reporting Services</PageTitle>
<div aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="">Home</a>
</li>
<li class="breadcrumb-item">
<a href="PlanningReport">Planning Reports</a>
</li>
<li class="breadcrumb-item active" aria-current="page">Weekly Part Changes Report</li>
</ol>
</div>
<br />
<h1 class="text-center">Weekly Part Changes</h1>
@if (_weeklyPartChanges is null)
{
<MudProgressCircular Color="Color.Default" Indeterminate="true" />
}
else
{
<div>
<div class="row">
<div class="col-6">
<p>Number of Part Changes: @_weeklyPartChanges.TotalPartChanges</p>
</div>
<div class="col-6">
<p class="text-end">@_weeklyPartChanges.StartDate - @_weeklyPartChanges.EndDate</p>
</div>
</div>
<div>
<table class="table">
<thead>
<tr>
<th scope="col">Reactor</th>
<th scope="col">PSN</th>
<th scope="col">WO_COUNT</th>
</tr>
</thead>
<tbody>
@for (int i = 0; i < _weeklyPartChanges.ReactorPSNWORuns.Count; i++)
{
int count = 1;
bool doesMatch = false;
if (i + count < _weeklyPartChanges.ReactorPSNWORuns.Count)
doesMatch = _weeklyPartChanges.ReactorPSNWORuns[i].REACTOR == _weeklyPartChanges.ReactorPSNWORuns[i +
count].REACTOR;
while (doesMatch)
{
count++;
if (i + count < _weeklyPartChanges.ReactorPSNWORuns.Count)
doesMatch = _weeklyPartChanges.ReactorPSNWORuns[i].REACTOR == _weeklyPartChanges.ReactorPSNWORuns[i +
count].REACTOR;
else
doesMatch = false;
}
for (int j = 0; j < count; j++)
{
string tableColor = "";
if (count > 1)
tableColor = "table-info";
<tr class="align-middle @tableColor">
@if (j == 0)
{
<td rowspan="@(count)">@_weeklyPartChanges.ReactorPSNWORuns[i].REACTOR</td>
<td>@_weeklyPartChanges.ReactorPSNWORuns[i].PSN</td>
<td>@_weeklyPartChanges.ReactorPSNWORuns[i].WO_COUNT</td>
}
else
{
<td>@_weeklyPartChanges.ReactorPSNWORuns[i + j].PSN</td>
<td>@_weeklyPartChanges.ReactorPSNWORuns[i + j].WO_COUNT</td>
}
</tr>
}
i = i + (count - 1);
}
</tbody>
</table>
</div>
</div>
}

View File

@ -0,0 +1,57 @@
using System.Globalization;
using Microsoft.AspNetCore.Components;
using ReportingServices.Shared.HelperClasses;
using ReportingServices.Shared.Models.PlanningReport;
namespace ReportingServices.Client.Pages;
public partial class WeeklyPartChangesReport
{
[Parameter] public string? EndDate { get; set; }
[Parameter] public string? StartDate { get; set; }
[Inject] protected HttpClient? HttpClient { get; set; }
[Inject] protected NavigationManager? NavigationManager { get; set; }
[Inject] protected ILogger<WeeklyPartChangesReport>? Logger { get; set; }
protected WeeklyPartChanges? _weeklyPartChanges;
protected override async Task OnInitializedAsync()
{
if (Logger is null)
throw new NullReferenceException(nameof(Logger));
if (HttpClient is null)
throw new NullReferenceException(nameof(HttpClient));
if (NavigationManager is null)
throw new NullReferenceException(nameof(NavigationManager));
string datetimeFormat = "yyyy-MM-dd HH:mm:ss";
DateTime endDate = EndDate is null ? DateTime.Now : DateTime.ParseExact(EndDate, datetimeFormat, CultureInfo.InvariantCulture);
DateTime startDate = StartDate is null ? endDate.AddDays(-3) : DateTime.ParseExact(StartDate, datetimeFormat, CultureInfo.InvariantCulture);
string partChangeUrl = "https://localhost:7196/api/" + "ScrapeDB/" + "PartChanges?startDate=" + startDate.ToString() + "&endDate=" + endDate.ToString();
string psnwoRunsUrl = "https://localhost:7196/api/" + "ScrapeDB/" + "PSNWO?startDate=" + startDate.ToString() + "&endDate=" + endDate.ToString();
Logger.LogInformation("Part Change URL: {url}", partChangeUrl);
Logger.LogInformation("PSN WO Runs URL: {url}", psnwoRunsUrl);
_weeklyPartChanges = new();
try
{
int numberOfPartChanges = await ApiCaller.GetApi<int>(partChangeUrl);
List<ReactorPSNWORuns> reactorPSNWORuns = await ApiCaller.GetApi<List<ReactorPSNWORuns>>(psnwoRunsUrl);
_weeklyPartChanges.TotalPartChanges = numberOfPartChanges;
_weeklyPartChanges.StartDate = startDate.ToShortDateString();
_weeklyPartChanges.EndDate = endDate.ToShortDateString();
_weeklyPartChanges.ReactorPSNWORuns = reactorPSNWORuns;
}
catch (Exception ex)
{
Logger.LogCritical(ex, "Failed to get a response from API calls.");
NavigationManager.NavigateTo("Error");
}
}
}