HeReport - date input, from - to

Test protocol - legend, test state
This commit is contained in:
Stoyan Zlatev
2023-04-11 13:15:00 +02:00
parent c4b9933eb0
commit a5d86fd707
16 changed files with 287 additions and 89 deletions
@@ -1,12 +1,12 @@
namespace LaaProductionWeb.Controllers
{
using LaaProductionWeb.App_Infrastructure;
using LaaProductionWeb.Services.Interfaces;
using LaaProductionWeb.Services.Models;
using System.Web.Mvc;
[AllowedRoles("Protocol")]
[Authorize]
// [AllowedRoles("Protocol")]
public class ProtocolController : Controller
{
public const string FilePDF = nameof(FilePDF);
@@ -4,7 +4,9 @@
using LaaProductionWeb.Services.Models;
using System.Web.Mvc;
[Authorize]
// [AllowedRoles("HeReport")]
public class ReportController : Controller
{
private readonly IReportService reportService;
@@ -1,6 +1,5 @@
namespace LaaProductionWeb.Controllers
{
using LaaProductionWeb.App_Infrastructure;
using LaaProductionWeb.Services.Interfaces;
using LaaProductionWeb.Services.Models;
@@ -13,7 +12,8 @@
using SystemFile = System.IO.File;
[AllowedRoles("Shipment")]
[Authorize]
// [AllowedRoles("Shipment")]
public class ShipmentsController : Controller
{
private readonly IShipmentsService shipmentsService;
@@ -180,6 +180,7 @@
<Content Include="Views\Report\Index.cshtml" />
<Content Include="Views\Report\Filter.cshtml" />
<Content Include="Views\Report\Results.cshtml" />
<Content Include="Views\Report\DateFilter.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Content\font\fonts\bootstrap-icons.woff" />
@@ -1,74 +1,144 @@
@model IEnumerable<LaaProductionWeb.Services.Models.TestStatus>
@{
Func<bool?, string> testPassed = testStatus =>
Func<bool?, bool, MvcHtmlString> testPassed = (testStatus, nullable) =>
{
if (testStatus is null)
if (testStatus is null && nullable)
{
return "bi bi-check2 text-secondary opacity-25 fs-3";
return new MvcHtmlString("<td class=\"text-center text-success\">OK*</td>");
}
else if (testStatus is null)
{
return new MvcHtmlString("<td class=\"text-center text-secondary small\">NULL</td>");
}
else if (testStatus == false)
{
return "bi bi-x text-danger fs-3";
return new MvcHtmlString("<td class=\"text-center text-danger\">X</td>");
}
else
{
return "bi bi-check2 text-teal fs-3";
return new MvcHtmlString("<td class=\"text-center text-success\">OK</td>");
}
};
}
<tbody>
@{
}
<tr>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th class="white-space-nowrap">Pos. No.</th>
<th class="white-space-nowrap">Pos.</th>
<th class="white-space-nowrap">Serial No.</th>
<th>Tightness Test</th>
<th>Pressure and burst test composit transducer</th>
<th>Metrological testing</th>
<th>Config comparison and radio test</th>
</tr>
<tr>
<th colspan="2">Acceptance Norms</th>
<td>Rejected in case of leakage</td>
<td>Rejected in case of leakage or breakage</td>
<td>
Maximum Permissible Error at
<br>Q1 < ± 5%
<br>Q2 < ± 2%
<br>Q3 < ± 2%
</td>
<td>
Main functions,
<br>LCD display,
<br>LED,
<br>Radio functions according to specs
<br>
<br>Parameter readable and according to customer specification
</td>
<th class="text-center">T1</th>
<th class="text-center">T2</th>
<th class="text-center">T3</th>
<th class="text-center">T4</th>
<th class="text-center">T5</th>
<th class="text-center">T6</th>
<th class="text-center">T7</th>
</tr>
@foreach (var item in this.Model)
{
<tr>
<td class="va-middle">@item.PosNr</td>
<td class="va-middle white-space-nowrap">@item.SerialNr</td>
<td class="text-center">
<bi class="@testPassed(item.HeliumTest)"></bi>
</td>
<td class="text-center">
<bi class="@testPassed(item.PressureTest)"></bi>
</td>
<td class="text-center">
<bi class="@testPassed(item.MetroTest)"></bi>
</td>
<td class="text-center">
<bi class="@testPassed(item.RadioTest)"></bi>
</td>
@testPassed(null, true)
@testPassed(item.PressureTest, false)
@testPassed(item.HeliumTest, false)
@testPassed(null, true)
@testPassed(item.MetroTest, false)
@testPassed(item.RadioTest, false)
@testPassed(null, true)
</tr>
}
</table>
</td>
</tr>
<tr>
<td colspan="2" class="pt-5 px-0 small">
<table class="table table-sm table-bordered border-top text-secondary">
<tr>
<th>Legend:</th>
<th>Component & Operation</th>
<th>Quantum of Check</th>
<th>Acceptance Norms</th>
</tr>
<tr>
<th class="va-middle py-0">T1</th>
<th class="va-middle py-0">Powder coating</th>
<td class="py-0">
1 piece per quarter<br />
1 piece per h
</td>
<td class="va-middle py-0">
Adhesion according to DIN 53151,coating faultless & corrosion free<br />
According drawing
</td>
</tr>
<tr>
<th class="va-middle py-0">T2</th>
<th class="va-middle py-0">Pressure and burst test composit transducer</th>
<td class="py-0">
First part / batch<br />
500 th part / batch<br />
Last part / batch
</td>
<td class="va-middle">Rejected in case of leakage or breakage</td>
</tr>
<tr>
<th class="va-middle py-0">T3</th>
<th class="va-middle py-0">Tightness Test</th>
<td class="py-0">100%</td>
<td class="va-middle">Rejected in case of leakage</td>
</tr>
<tr>
<th class="va-middle py-0">T4</th>
<th class="va-middle py-0">Pressure and tightness test</th>
<td class="py-0">100% at start of production</td>
<td class="va-middle py-0">Rejected in case of leakage or breakage</td>
</tr>
<tr>
<th class="va-middle py-0">T5</th>
<th class="va-middle py-0">Metrological testing</th>
<td class="py-0">100%</td>
<td class="va-middle py-0">
Maximum Permissible Error at<br />
Q1 < ± 5%<br />
Q2 < ± 2%<br />
Q3 < ± 2%
</td>
</tr>
<tr>
<th class="va-middle py-0">T6</th>
<th class="va-middle py-0">Config comparison and radio test</th>
<td class="py-0">100%</td>
<td class="va-middle py-0">
Main functions, LCD display, LED, Radio functions according to specs<br />
Parameter readable and according to customer specification
</td>
</tr>
<tr>
<th class="va-middle py-0">T7</th>
<th class="py-0">100%</th>
<td class="va-middle py-0">Packaging of meter</td>
<td class="va-middle py-0">SENSUS-1-924</td>
</tr>
<tr>
<th class="va-middle py-0">Ok</th>
<td class="va-middle py-0" colspan="3">Test passed</td>
</tr>
<tr>
<th class="va-middle py-0">Ok*</th>
<td class="va-middle py-0" colspan="3">Test passed according to the Quantum of Check</td>
</tr>
<tr>
<th class="va-middle py-0">X</th>
<td class="va-middle py-0" colspan="3">Test not passed</td>
</tr>
</table>
</td>
</tr>
</tbody>
@@ -55,8 +55,12 @@
@this.Html.HiddenFor(x => x.Positions)
<input name="FilePDF" id="FilePDF" type="file" class="d-none" accept="application/pdf" onchange="javascript: this.form.submit();" />
<div class="input-group flex-nowrap mt-3">
<a class="btn btn-light white-space-nowrap w-100" href="/Protocol/Print?orderId=@this.Model.OrderId" target="_blank"><i class="bi bi-printer me-2"></i> Vorschau</a>
<label for="FilePDF" class="btn btn-outline-light border text-dark white-space-nowrap w-100"><i class="bi bi-filetype-pdf"></i> Auswählen</label>
<a class="btn btn-light border white-space-nowrap w-100" href="/Protocol/Print?orderId=@this.Model.OrderId" target="_blank">
<i class="bi bi-printer me-2"></i> Vorschau
</a>
<label for="FilePDF" class="btn btn-outline-light border text-dark white-space-nowrap w-100">
<i class="bi bi-filetype-pdf"></i> Auswählen
</label>
</div>
@if (this.TempData.TryGetValue(ProtocolController.FilePDF, out object errorMessage))
{
@@ -71,4 +71,24 @@
{
this.Html.RenderAction(nameof(ProtocolController.Body), new { orderId = this.Model.OrderId });
}
</table>
</table>
<div class="container-fluid">
<div class="row pt-5">
<div class="col-4 d-flex flex-column justify-content-end">
<label class="small">Datum: @($"{DateTime.Now:dd.MM.yyyy}")</label>
<hr class="mt-0" />
</div>
<div class="col-4 d-flex flex-column justify-content-end">
<div class="input-group align-items-end">
<label class="small">Name: </label>
<input class="form-control border-0 rounded-0" />
</div>
<hr class="mt-0" />
</div>
<div class="col-4 d-flex flex-column justify-content-end">
<label class="small">Unterschrift: </label>
<hr class="mt-0" />
</div>
</div>
</div>
@@ -0,0 +1,31 @@
@model LaaProductionWeb.Services.Models.HeliumReportFilterProperty
@{
Func<bool, string> isChecked = x => x ? "checked" : string.Empty;
Func<bool, string> bgColor = x => !x ? "bg-light" : string.Empty;
}
<input type="hidden" name="@this.Model.IndexName" value="@this.Model.Index" />
<input type="hidden" name="@this.Model.ColumnName" value="@this.Model.Column" />
<input type="hidden" name="@this.Model.PropertyName" value="@this.Model.Property" />
<input type="hidden" name="@this.Model.TypeName" value="@this.Model.Type" />
<div class="input-group flex-nowrap justify-content-center">
<input name="@this.Model.VonName" type="date" class="form-control form-control-sm mb-1" value="@($"{this.Model.Von:MM/dd/yyyy}")" />
<input name="@this.Model.BisName" type="date" class="form-control form-control-sm mb-1" value="@($"{this.Model.Bis:MM/dd/yyyy}")" />
</div>
<div class="input-group flex-nowrap justify-content-center">
<input id="@(this.Model.OrderById)_1" name="@this.Model.OrderByName" type="radio" value="1" @isChecked(this.Model.OrderBy == 1) class="d-none" />
<label for="@(this.Model.OrderById)_1" class="form-control form-control-sm text-center text-secondary border-light @bgColor(this.Model.OrderBy == 1) cursor-pointer">
<i class="bi bi-chevron-up"></i>
</label>
<input id="@(this.Model.OrderById)_0" name="@this.Model.OrderByName" type="radio" value="0" @isChecked(this.Model.OrderBy == 0) class="d-none" />
<label for="@(this.Model.OrderById)_0" class="form-control form-control-sm text-center text-secondary border-light @bgColor(this.Model.OrderBy == 0) cursor-pointer">
<i class="bi bi-dash"></i>
</label>
<input id="@(this.Model.OrderById)__1" name="@this.Model.OrderByName" type="radio" value="-1" @isChecked(this.Model.OrderBy == -1) class="d-none" />
<label for="@(this.Model.OrderById)__1" class="form-control form-control-sm text-center text-secondary border-light @bgColor(this.Model.OrderBy == -1) cursor-pointer">
<i class="bi bi-chevron-down"></i>
</label>
</div>
@@ -1,6 +1,6 @@
@model LaaProductionWeb.Services.Models.HeliumReportFilterProperty
@{
@{
Func<bool, string> isChecked = x => x ? "checked" : string.Empty;
Func<bool, string> bgColor = x => !x ? "bg-light" : string.Empty;
}
@@ -8,6 +8,7 @@
<input type="hidden" name="@this.Model.IndexName" value="@this.Model.Index" />
<input type="hidden" name="@this.Model.ColumnName" value="@this.Model.Column" />
<input type="hidden" name="@this.Model.PropertyName" value="@this.Model.Property" />
<input type="hidden" name="@this.Model.TypeName" value="@this.Model.Type" />
<input name="@this.Model.LikeName" class="form-control form-control-sm mb-1" autocomplete="off" value="@this.Model.Like" />
<div class="input-group flex-nowrap justify-content-center">
<input id="@(this.Model.OrderById)_1" name="@this.Model.OrderByName" type="radio" value="1" @isChecked(this.Model.OrderBy == 1) class="d-none" />
@@ -5,8 +5,8 @@
<table class="table table-sm table-bordered mb-0">
<thead class="bg-light">
<tr>
<th class="text-nowrap p-2">@this.Model.Display(x => x.AuftragNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.FertigungNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.AuftragNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.PositionNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.SerialNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.IdentNr)</th>
@@ -23,12 +23,19 @@
<th class="text-nowrap p-2">@this.Model.Display(x => x.IsValid)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.TestDate)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Tester)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Text)</th>
<th class="p-2">@this.Model.Display(x => x.Text)</th>
</tr>
<tr>
@foreach (var filter in this.Model.Filter)
{
<td>@this.Html.Partial("Filter", filter)</td>
if (filter.Type == "date")
{
<td>@this.Html.Partial("DateFilter", filter)</td>
}
else
{
<td>@this.Html.Partial("Filter", filter)</td>
}
}
</tr>
</thead>
@@ -36,8 +43,8 @@
@foreach (var item in this.Model.Items)
{
<tr>
<td class="text-nowrap p-2">@item.AuftragNr</td>
<td class="text-nowrap p-2">@item.FertigungNr</td>
<td class="text-nowrap p-2">@item.AuftragNr</td>
<td class="text-nowrap p-2">@item.PositionNr</td>
<td class="text-nowrap p-2">@item.SerialNr</td>
<td class="text-nowrap p-2">@item.IdentNr</td>
@@ -55,10 +62,10 @@
<td class="text-nowrap p-2">@item.Temperatur</td>
<td class="text-nowrap p-2">@item.HeLakeRate</td>
<td class="text-nowrap p-2">@item.HeTestPressure</td>
<td class="text-nowrap p-2"><i class="bi bi-bold @(@item.IsValid ? "bi-check text-success" : "bi-x text-danger")"></i></td>
<td class="text-nowrap p-2"><i class="bi bi-bold @(item.IsValid ? "bi-check text-success" : "bi-x text-danger")"></i></td>
<td class="text-nowrap p-2">@($"{item.TestDate:dd.MM.yyyy}")</td>
<td class="text-nowrap p-2">@item.Tester</td>
<td class="text-nowrap p-2">@item.Text</td>
<td class="p-2">@item.Text</td>
</tr>
}
</tbody>