Updated daily report to show correct information when two work weeks split quarters.
Also current changes to project with Blazor implementation is implemented here as well.
This commit is contained in:
1
ReportingServices.Blazor/Components/Breadcrumbs.razor
Normal file
1
ReportingServices.Blazor/Components/Breadcrumbs.razor
Normal file
@ -0,0 +1 @@
|
||||
|
11
ReportingServices.Blazor/Components/Breadcrumbs.razor.cs
Normal file
11
ReportingServices.Blazor/Components/Breadcrumbs.razor.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace ReportingServices.Blazor.Components;
|
||||
|
||||
public partial class Breadcrumbs
|
||||
{
|
||||
public string MyClass { get; set; } = "";
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
|
@ -0,0 +1,5 @@
|
||||
namespace ReportingServices.Blazor.Components.DailyReport;
|
||||
|
||||
public partial class DailySnapshot
|
||||
{
|
||||
}
|
@ -0,0 +1 @@
|
||||
|
@ -0,0 +1,5 @@
|
||||
namespace ReportingServices.Blazor.Components.DailyReport;
|
||||
|
||||
public partial class DownedTools
|
||||
{
|
||||
}
|
@ -0,0 +1 @@
|
||||
|
@ -0,0 +1,5 @@
|
||||
namespace ReportingServices.Blazor.Components.DailyReport;
|
||||
|
||||
public partial class FabBreakdown
|
||||
{
|
||||
}
|
@ -0,0 +1,168 @@
|
||||
@if (Dates != null)
|
||||
{
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" rowspan="2" class="text-center align-middle">SI Operations</th>
|
||||
@foreach (DateTime date in Dates)
|
||||
{
|
||||
<th scope="col" class="text-center" >@date.ToShortDateString()</th>
|
||||
}
|
||||
|
||||
<th scope="col" rowspan="2" class="text-center align-middle">Weekly Total</th>
|
||||
<th scope="col" rowspan="2" class="text-center align-middle">QTD Total</th>
|
||||
<th scope="col" rowspan="2" class="text-center align-middle">Comment</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="col" class="text-center">Monday</th>
|
||||
<th scope="col" class="text-center">Tuesday</th>
|
||||
<th scope="col" class="text-center">Wednesday</th>
|
||||
<th scope="col" class="text-center">Thursday</th>
|
||||
<th scope="col" class="text-center">Friday</th>
|
||||
<th scope="col" class="text-center">Saturday</th>
|
||||
<th scope="col" class="text-center">Sunday</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td scope="row">Committed Target to meet Shipment Requirements</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", DailyPlanWafers)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", DailyPlanWafers)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", DailyPlanWafers)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", DailyPlanWafers)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", DailyPlanWafers)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", DailyPlanWafers)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", DailyPlanWafers)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", DailyPlanWafers * 7)</td>
|
||||
<td></td>
|
||||
<td>Number updated quarterly</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row">Actual Yielded Wafers Out</td>
|
||||
@foreach (DateTime date in Dates)
|
||||
{
|
||||
<td class="text-center">@string.Format("{0:##,###}", WeeklyYieldStatistics[date].Outs)</td>
|
||||
}
|
||||
<td class="text-center">@string.Format("{0:##,###}", TotalWafersOut)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", QTDOutsAndScrap.Outs)</td>
|
||||
<td>Before Scrap</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row">Actual Reactor Out</td>
|
||||
@foreach (DateTime date in Dates)
|
||||
{
|
||||
<td class="text-center">@string.Format("{0:##,###}", WeeklyYieldStatistics[date].YieldedOuts)</td>
|
||||
}
|
||||
<td class="text-center">@string.Format("{0:##,###}", TotalYieldedWafersOut)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", (QTDOutsAndScrap.Outs - QTDOutsAndScrap.CustomerScrap - QTDOutsAndScrap.ManufacturingScrap - QTDOutsAndScrap.ProductionScrap))</td>
|
||||
<td>After Scrap</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row" colspan="11" class="text-center">Yielded Wafers out Daily Average: @(string.Format("{0:##,###}", YieldedWafersPerDay))</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row">Customer Scrap</td>
|
||||
@foreach (DateTime date in Dates)
|
||||
{
|
||||
<td class="text-center">@string.Format("{0:##,###}", WeeklyYieldStatistics[date].CustomerScrap)</td>
|
||||
}
|
||||
<td class="text-center">@string.Format("{0:##,###}", TotalCustomerScrap)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", QTDOutsAndScrap.CustomerScrap)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row">Manufacturing Scrap</td>
|
||||
@foreach (DateTime date in Dates)
|
||||
{
|
||||
<td class="text-center">@string.Format("{0:##,###}", WeeklyYieldStatistics[date].ManufacturingScrap)</td>
|
||||
}
|
||||
<td class="text-center">@string.Format("{0:##,###}", TotalManufacturingScrap)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", QTDOutsAndScrap.ManufacturingScrap)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row">Production Scrap</td>
|
||||
@foreach (DateTime date in Dates)
|
||||
{
|
||||
<td class="text-center">@string.Format("{0:##,###}", WeeklyYieldStatistics[date].ProductionScrap)</td>
|
||||
}
|
||||
<td class="text-center">@string.Format("{0:##,###}", TotalProdScrap)</td>
|
||||
<td class="text-center">@string.Format("{0:##,###}", QTDOutsAndScrap.ProductionScrap)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row">Yield</td>
|
||||
@foreach (DateTime date in Dates)
|
||||
{
|
||||
string myClass = "";
|
||||
if (WeeklyYieldStatistics[date].YieldPercent != 0)
|
||||
{
|
||||
if (WeeklyYieldStatistics[date].YieldPercent < 98)
|
||||
myClass = "table-danger text-danger";
|
||||
|
||||
<td class="text-center @myClass">@string.Format("{0:P2}", WeeklyYieldStatistics[date].YieldPercent)</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td></td>
|
||||
}
|
||||
}
|
||||
<td class="text-center">@string.Format("{0:P2}", (double)(TotalWafersOut - TotalManufacturingScrap) / TotalWafersOut)</td>
|
||||
<td class="text-center">@string.Format("{0:P2}", (double)(QTDOutsAndScrap.Outs - QTDOutsAndScrap.ManufacturingScrap) / QTDOutsAndScrap.Outs)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row">Delta to Commit</td>
|
||||
@foreach (DateTime date in Dates)
|
||||
{
|
||||
string myClass = "";
|
||||
if (WeeklyYieldStatistics[date].YieldedOuts != 0)
|
||||
{
|
||||
if (WeeklyYieldStatistics[date].YieldedOuts - DailyWafersForQTR < 0)
|
||||
myClass = "table-danger text-danger";
|
||||
|
||||
<td class="text-center @myClass">@string.Format("{0:##,###}", WeeklyYieldStatistics[date].YieldedOuts - DailyWafersForQTR)</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td></td>
|
||||
}
|
||||
}
|
||||
<td class="text-center">@string.Format("{0:##,###}", (TotalYieldedWafersOut - DailyWafersForQTR * (NumberCompletedDaysInWeek + AddExtraDay)))</td>
|
||||
<td></td>
|
||||
<td>Difference to Commit</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row">Delta to the Plan</td>
|
||||
@foreach (DateTime date in Dates)
|
||||
{
|
||||
string myClass = "";
|
||||
if (WeeklyYieldStatistics[date].YieldedOuts != 0)
|
||||
{
|
||||
if (WeeklyYieldStatistics[date].YieldedOuts - DailyPlanWafers < 0)
|
||||
myClass = "table-danger text-danger";
|
||||
|
||||
<td class="text-center @myClass">@string.Format("{0:##,###}", WeeklyYieldStatistics[date].YieldedOuts - DailyPlanWafers)</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td></td>
|
||||
}
|
||||
}
|
||||
<td class="text-center">@string.Format("{0:##,###}", (TotalYieldedWafersOut - DailyPlanWafers * (NumberCompletedDaysInWeek + AddExtraDay)))</td>
|
||||
<td></td>
|
||||
<td>Difference to Target</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row">Wafers Needed to make QTR</td>
|
||||
@foreach (DateTime date in Dates)
|
||||
{
|
||||
<td class="text-center">@string.Format("{0:##,###}", DailyWafersForQTR)</td>
|
||||
}
|
||||
<td class="text-center">@string.Format("{0:##,###}", DailyWafersForQTR * 7)</td>
|
||||
<td></td>
|
||||
<td>Number Updated Weekly</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
@ -0,0 +1,157 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using ReportingServices.Blazor.Services;
|
||||
using ReportingServices.Shared.Blazor.Models.ProductionReport;
|
||||
|
||||
namespace ReportingServices.Blazor.Components.DailyReport;
|
||||
|
||||
public partial class TargetsSummary
|
||||
{
|
||||
[Inject]
|
||||
public AppData AppData { get; set; }
|
||||
|
||||
[Inject]
|
||||
public ScrapeDBService Db { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public DateTime StartDate { get; set; }
|
||||
[Parameter]
|
||||
public DateTime EndDate { get; set; }
|
||||
[Parameter]
|
||||
public DateTime QuarterStartDate { get; set; }
|
||||
[Parameter]
|
||||
public QuarterlyTargets Targets { get; set; }
|
||||
[Parameter]
|
||||
public OutsAndScrapTotal QTDOutsAndScrap { get; set; }
|
||||
|
||||
private List<ReactorOutsByDay> OutsByDay { get; set; }
|
||||
private List<ScrapByDay> ScrapByDay { get; set; }
|
||||
private int DailyPlanWafers { get; set; }
|
||||
private int DailyWafersForQTR { get; set; }
|
||||
|
||||
private YieldInformation YieldInformation { get; set; }
|
||||
private OutsAndScrapTotal OutsAndScrap { get; set; }
|
||||
private bool IsCurrentWeek { get; set; }
|
||||
private DateTime[] Dates { get; set; }
|
||||
private int AddExtraDay { get; set; }
|
||||
private Dictionary<DateTime, int> WeeklyOuts { get; set; }
|
||||
private Dictionary<DateTime, YieldStatistics> WeeklyYieldStatistics { get; set; }
|
||||
private int NumberCompletedDaysInWeek { get; set; }
|
||||
private int TotalWafersForPartialDay { get; set; }
|
||||
private int YieldedWafersPerDay { get; set; }
|
||||
|
||||
private int TotalWafersOut { get; set; }
|
||||
private int TotalCustomerScrap { get; set; }
|
||||
private int TotalManufacturingScrap { get; set; }
|
||||
private int TotalProdScrap { get; set; }
|
||||
private int TotalYieldedWafersOut { get; set; }
|
||||
private int DeltaToCommit { get; set; }
|
||||
private int DeltaToPlan { get; set; }
|
||||
private int TotalYield { get; set; }
|
||||
|
||||
protected async override Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
WeeklyYieldStatistics = new();
|
||||
|
||||
DailyPlanWafers = (int)Math.Floor((double)(Targets.Yield_Outs / Targets.PlanWorkingDays));
|
||||
|
||||
IsCurrentWeek = (EndDate - StartDate).Days != 7;
|
||||
AddExtraDay = IsCurrentWeek ? 1 : 0;
|
||||
|
||||
YieldInformation = await Db.GetReactorAndScrapOutsAsync(StartDate, EndDate);
|
||||
|
||||
OutsAndScrap = await Db.GetOutsAndScrapAsync(QuarterStartDate, StartDate);
|
||||
|
||||
Dates = new DateTime[] { StartDate, StartDate.AddDays(1), StartDate.AddDays(2),
|
||||
StartDate.AddDays(3), StartDate.AddDays(4), StartDate.AddDays(5), StartDate.AddDays(6) };
|
||||
}
|
||||
|
||||
protected override bool ShouldRender()
|
||||
{
|
||||
if (YieldInformation != null && OutsAndScrap != null)
|
||||
{
|
||||
GetReactorOutsByDay(YieldInformation.Outs);
|
||||
GetWeeklyTotals();
|
||||
GetYieldStatistics();
|
||||
|
||||
NumberCompletedDaysInWeek = IsCurrentWeek ? YieldInformation.Scrap.Count - 1 : 7;
|
||||
TotalWafersForPartialDay = NumberCompletedDaysInWeek == 7 ? 0 : WeeklyYieldStatistics[DateTime.Now.Date].YieldedOuts;
|
||||
|
||||
int daysRemainingInQtr = (int)(QuarterStartDate.AddDays(Targets.PlanWorkingDays) - StartDate).TotalDays;
|
||||
int yieldedOuts = OutsAndScrap.Outs - OutsAndScrap.CustomerScrap - OutsAndScrap.ManufacturingScrap - OutsAndScrap.ProductionScrap;
|
||||
|
||||
if (daysRemainingInQtr == Targets.PlanWorkingDays)
|
||||
DailyWafersForQTR = DailyPlanWafers;
|
||||
else
|
||||
DailyWafersForQTR = (int)Math.Round((double)((Targets.Yield_Outs - yieldedOuts) / daysRemainingInQtr));
|
||||
|
||||
YieldedWafersPerDay = (int)((double)(TotalYieldedWafersOut - TotalWafersForPartialDay) / NumberCompletedDaysInWeek);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void GetReactorOutsByDay(List<ReactorOutsByRDS> outs)
|
||||
{
|
||||
WeeklyOuts = outs.GroupBy(x => x.EndProcessTime, (key, values) =>
|
||||
new { Date = key, Outs = values.Sum(x => int.Parse(x.Units))}).ToDictionary(x => DateTime.Parse(x.Date), x => x.Outs);
|
||||
}
|
||||
|
||||
private void GetYieldStatistics()
|
||||
{
|
||||
Dictionary<DateTime, ScrapByDay> scrapInfo = new();
|
||||
|
||||
foreach (ScrapByDay scrap in YieldInformation.Scrap)
|
||||
scrapInfo.Add(DateTime.Parse(scrap.StartDate), scrap);
|
||||
|
||||
foreach (DateTime date in Dates)
|
||||
{
|
||||
int outs = 0, yieldedOuts = 0, customerScrap = 0, manufacturingScrap = 0, productionScrap = 0;
|
||||
double yieldPercentage = 0;
|
||||
|
||||
if (scrapInfo.ContainsKey(date))
|
||||
{
|
||||
outs = WeeklyOuts[date];
|
||||
customerScrap = scrapInfo[date].TOT_REJ_CUST;
|
||||
manufacturingScrap = scrapInfo[date].TOT_REJ_MANU;
|
||||
productionScrap = scrapInfo[date].TW_PROD;
|
||||
yieldedOuts = outs - customerScrap - manufacturingScrap - productionScrap;
|
||||
yieldPercentage = (double)(outs - manufacturingScrap) / outs;
|
||||
}
|
||||
|
||||
YieldStatistics yieldStatistics = new()
|
||||
{
|
||||
Outs = outs,
|
||||
CustomerScrap = customerScrap,
|
||||
ManufacturingScrap = manufacturingScrap,
|
||||
ProductionScrap = productionScrap,
|
||||
YieldedOuts = yieldedOuts,
|
||||
YieldPercent = yieldPercentage
|
||||
};
|
||||
|
||||
WeeklyYieldStatistics.Add(date, yieldStatistics);
|
||||
}
|
||||
}
|
||||
|
||||
private void GetWeeklyTotals()
|
||||
{
|
||||
TotalWafersOut = GetTotalOuts();
|
||||
TotalCustomerScrap = YieldInformation.Scrap.Sum(x => x.TOT_REJ_CUST);
|
||||
TotalManufacturingScrap = YieldInformation.Scrap.Sum(x => x.TOT_REJ_MANU);
|
||||
TotalProdScrap = YieldInformation.Scrap.Sum(x => x.TW_PROD);
|
||||
TotalYieldedWafersOut = TotalWafersOut - TotalManufacturingScrap - TotalProdScrap - TotalCustomerScrap;
|
||||
}
|
||||
|
||||
private int GetTotalOuts()
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
foreach (KeyValuePair<DateTime, int> pair in WeeklyOuts)
|
||||
result += pair.Value;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
|
@ -0,0 +1,5 @@
|
||||
namespace ReportingServices.Blazor.Components.DailyReport;
|
||||
|
||||
public partial class ToolInfo
|
||||
{
|
||||
}
|
10
ReportingServices.Blazor/Components/DatePickerModal.razor
Normal file
10
ReportingServices.Blazor/Components/DatePickerModal.razor
Normal file
@ -0,0 +1,10 @@
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudDatePicker Label="Start Date" @bind-Date="StartDate"></MudDatePicker>
|
||||
<MudDatePicker Label="End Date" @bind-Date="EndDate"></MudDatePicker>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Primary" OnClick="Submit">Ok</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
30
ReportingServices.Blazor/Components/DatePickerModal.razor.cs
Normal file
30
ReportingServices.Blazor/Components/DatePickerModal.razor.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
using ReportingServices.Blazor.Services;
|
||||
|
||||
namespace ReportingServices.Blazor.Components;
|
||||
|
||||
public partial class DatePickerModal
|
||||
{
|
||||
DateTime? StartDate { get; set; } = DateTime.Now.Date;
|
||||
DateTime? EndDate { get; set; } = DateTime.Now.Date;
|
||||
|
||||
[Inject]
|
||||
public AppData? ApplicationState { get; set; }
|
||||
|
||||
[Inject]
|
||||
public NavigationManager? NavigationManager { get; set; }
|
||||
|
||||
[CascadingParameter] MudDialogInstance? MudDialog { get; set; }
|
||||
|
||||
void Submit()
|
||||
{
|
||||
ApplicationState!.StartDate = (DateTime)StartDate!;
|
||||
ApplicationState.EndDate = (DateTime)EndDate!;
|
||||
|
||||
MudDialog!.Close(DialogResult.Ok(true));
|
||||
|
||||
NavigationManager!.NavigateTo("/PlanningReports/WeeklyPartChangesReport");
|
||||
}
|
||||
void Cancel() => MudDialog!.Cancel();
|
||||
}
|
8
ReportingServices.Blazor/Components/ReportHeader.razor
Normal file
8
ReportingServices.Blazor/Components/ReportHeader.razor
Normal file
@ -0,0 +1,8 @@
|
||||
<div class="text-center">
|
||||
<h2>@Title</h2>
|
||||
<br /><br />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="text-end fw-bold">Date Pulled: @Date</p>
|
||||
</div>
|
12
ReportingServices.Blazor/Components/ReportHeader.razor.cs
Normal file
12
ReportingServices.Blazor/Components/ReportHeader.razor.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace ReportingServices.Blazor.Components;
|
||||
|
||||
public partial class ReportHeader
|
||||
{
|
||||
[Parameter]
|
||||
public string Title { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public DateTime Date { get; set; }
|
||||
}
|
Reference in New Issue
Block a user