Compare commits

...

24 Commits

Author SHA1 Message Date
Samuele Locatelli 1cae70c244 Merge branch 'Release/UpdateModuloDoss' 2022-10-20 14:54:22 +02:00
Samuele Locatelli 18ee183b05 Pulizia codice DOSS x spostamento modulo update 2022-10-20 14:54:03 +02:00
Samuele Locatelli d88c4cc2bd Update comportamento edit dossier 2022-10-20 13:16:07 +02:00
zaccaria.majid 67922520b8 fix edit mode label 'PENDING CHANGES' 2022-10-20 11:42:10 +02:00
zaccaria.majid c5b5b54586 fix edit mode 2022-10-20 11:21:01 +02:00
zaccaria.majid ae3864a614 fix salva solo quando finito 2022-10-20 11:08:31 +02:00
zaccaria.majid f878f1c496 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-20 09:42:27 +02:00
zaccaria.majid d453c1d944 modifiche comportamento editing 2022-10-20 09:42:19 +02:00
Samuele Locatelli 921bf52659 Filtro eventi macchina spenta
- preso da semaforo (no idxStato)
2022-10-20 09:31:42 +02:00
Samuele Locatelli e948ae31af Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-19 20:07:36 +02:00
Samuele Locatelli b344180da2 Fix gestione HideSpenta da statistiche 2022-10-19 20:07:33 +02:00
zaccaria.majid 4b885d780c Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-19 17:47:48 +02:00
zaccaria.majid 01e181a4fc inizio modifiche editing 2022-10-19 17:47:07 +02:00
Samuele Locatelli 56f342a488 refresh test 2022-10-19 17:30:26 +02:00
Samuele Locatelli ed72bdfa24 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-19 17:14:20 +02:00
Samuele Locatelli 5e6924f0fe Inizio gestione nascondi spenta 2022-10-19 17:13:43 +02:00
zaccaria.majid cae7e50cbd cleanUp 2022-10-19 17:11:27 +02:00
zaccaria.majid e769227bb3 fix not update if "annulla" 2022-10-19 17:10:56 +02:00
zaccaria.majid 60f757965e CleanUp 2022-10-19 13:07:05 +02:00
zaccaria.majid 603ed3782f Cleanup 2022-10-19 13:02:59 +02:00
zaccaria.majid 71177e04c7 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-19 13:01:28 +02:00
zaccaria.majid 1a211ebca5 delete msgService da PARAMS 2022-10-19 13:01:21 +02:00
zaccaria.majid 591b66b52d delete msgService da dossier 2022-10-19 12:49:13 +02:00
Samuele Locatelli 96f4bb3b4c Merge tag 'UpdateLogCall' into develop
Fix log chaimate MP/IO
2022-10-19 11:02:23 +02:00
19 changed files with 521 additions and 235 deletions
+88 -10
View File
@@ -1,6 +1,9 @@
@using MP.SPEC.Components @using MP.SPEC.Components
@using MP.SPEC.Data @using MP.SPEC.Data
@if (ListRecords == null) @if (ListRecords == null)
{ {
<LoadingData></LoadingData> <LoadingData></LoadingData>
@@ -11,6 +14,70 @@ else if (totalCount == 0)
} }
else else
{ {
@if (currFluxLogDto != null)
{
<div class="row">
<div class="col-12">
<div class="card mb-5">
<div class="card-header bg-primary text-light d-flex justify-content-between">
<div>
Modifica Parametro
</div>
<div>
@if (isEditing)
{
<span class="text-light">PENDING CHANGES...</span>
}
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">MACCHINA</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.IdxMacchina">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">DATA</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.dtEvento">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">DATA TYPE</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.CodFlux">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">VALORE</span>
<input type="text" class="form-control" aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.ValoreEdit" @onclick="()=> enableEditing()">
</div>
</div>
</div>
<div class="row pt-4" style="visibility: @css()">
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => cancel()" class="btn btn-warning">Annulla <i class="bi bi-x-circle"></i></button>
</div>
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => update(currFluxLogDto)" class="btn btn-success">Save <i class="bi bi-save"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
}
<div class="row"> <div class="row">
<div class="d-flex justify justify-content-between"> <div class="d-flex justify justify-content-between">
<table class="table table-sm table-striped small"> <table class="table table-sm table-striped small">
@@ -24,7 +91,6 @@ else
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th> <th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
<th><i class="fa-regular fa-calendar-days"></i> Data Snap</th> <th><i class="fa-regular fa-calendar-days"></i> Data Snap</th>
<th><i class="fa-solid fa-sliders"></i> ODL</th> <th><i class="fa-solid fa-sliders"></i> ODL</th>
@*<th><i class="fa-solid fa-circle-info"></i> DATA TYPE</th>*@
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@@ -33,7 +99,15 @@ else
{ {
<tr class="@checkSelect(@record)"> <tr class="@checkSelect(@record)">
<td> <td>
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button> @if (isEditing == false)
{
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button>
}
else
{
<button class="btn btn-secondary btn-sm disabled"><i class="fa-solid fa-magnifying-glass"></i></button>
}
</td> </td>
<td> <td>
@record.OdlNav.CodArticolo @record.OdlNav.CodArticolo
@@ -52,11 +126,17 @@ else
<td> <td>
@record.IdxODL @record.IdxODL
</td> </td>
@*<td>
@record.DataType
</td>*@
<td> <td>
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button> @if (isEditing == false)
{
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button>
}
else
{
<button class="btn btn-secondary btn-sm disabled"><i class="bi bi-trash-fill"></i></button>
}
</td> </td>
</tr> </tr>
} }
@@ -81,10 +161,8 @@ else
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th> <th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
<th><i class="fa-regular fa-calendar-days"></i> Data</th> <th><i class="fa-regular fa-calendar-days"></i> Data</th>
<th><i class="fa-solid fa-sliders"></i> Data Type</th> <th><i class="fa-solid fa-sliders"></i> Data Type</th>
<th> <th style="text-align: right;">
<div class="d-flex justify-content-between col-12"> <span class="col-11"> Valore </span>
<span class="col-11" style="text-align: right;"> Valore </span>
</div>
</th> </th>
</tr> </tr>
</thead> </thead>
+87 -20
View File
@@ -4,6 +4,7 @@ using Microsoft.JSInterop;
using MP.Data.DatabaseModels; using MP.Data.DatabaseModels;
using MP.Data.DTO; using MP.Data.DTO;
using MP.SPEC.Data; using MP.SPEC.Data;
using Newtonsoft.Json;
namespace MP.SPEC.Components namespace MP.SPEC.Components
{ {
@@ -37,7 +38,7 @@ namespace MP.SPEC.Components
{ {
try try
{ {
answ = (currFluxLogDto.CodFlux == recordSel.CodFlux && currFluxLogDto.dtEvento== recordSel.dtEvento) ? "table-info" : ""; answ = (currFluxLogDto.CodFlux == recordSel.CodFlux && currFluxLogDto.dtEvento == recordSel.dtEvento) ? "table-info" : "";
} }
catch catch
{ } { }
@@ -53,6 +54,7 @@ namespace MP.SPEC.Components
try try
{ {
answ = (currRecord.IdxMacchina == recordSel.IdxMacchina && currRecord.DtRif == recordSel.DtRif) ? "table-info" : ""; answ = (currRecord.IdxMacchina == recordSel.IdxMacchina && currRecord.DtRif == recordSel.DtRif) ? "table-info" : "";
} }
catch catch
{ } { }
@@ -61,15 +63,20 @@ namespace MP.SPEC.Components
} }
public void Dispose() public void Dispose()
{ {
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated -= OnSeachUpdated;
currRecord = null; currRecord = null;
SearchRecords = null; SearchRecords = null;
ListRecords = null; ListRecords = null;
GC.Collect(); GC.Collect();
} }
private SelectDossierParams lastFilter { get; set; } = new SelectDossierParams() { CurrPage = -1 };
protected override async Task OnParametersSetAsync()
{
if (!lastFilter.Equals(SelFilter))
{
lastFilter = SelFilter.clone();
await reloadData(true);
}
}
#endregion Public Methods #endregion Public Methods
#region Protected Properties #region Protected Properties
@@ -79,10 +86,6 @@ namespace MP.SPEC.Components
[Inject] [Inject]
protected MpDataService MDService { get; set; } = null!; protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
#endregion Protected Properties #endregion Protected Properties
#region Protected Methods #region Protected Methods
@@ -111,10 +114,59 @@ namespace MP.SPEC.Components
await RecordSelFlux.InvokeAsync(selRec); await RecordSelFlux.InvokeAsync(selRec);
} }
private void enableEditing()
{
isEditing = true;
}
protected async Task cancel()
{
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler annullare TUTTE le modifiche? i dati saranno ricaricati.");
if (alert)
{
currFluxLogDto = null;
isEditing = false;
await Task.Delay(1);
listaFlux = MDService.getFluxLog(currRecord.Valore);
StateHasChanged();
}
}
protected async Task update(FluxLogDTO selRec)
{
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare TUTTE le modifiche? queste saranno parte del dossier inviato all'impianto");
if (alert)
{
await Task.Delay(1);
if (currRecord != null)
{
// serializzo valore x flux log...
DossierFluxLogDTO updatedResult = new DossierFluxLogDTO() { ODL = listaFlux };
string newVal = JsonConvert.SerializeObject(updatedResult);
currRecord.Valore = newVal;
// METODO PER UPDATE FLUX
await MDService.DossiersUpdateValore(currRecord);
currFluxLogDto = null;
isEditing = false;
await Task.Delay(1);
StateHasChanged();
}
return;
}
else
{
currFluxLogDto = null;
await Task.Delay(1);
await JSRuntime.InvokeAsync<bool>("location.reload");
}
}
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated += OnSeachUpdated;
ListStati = await MDService.AnagStatiComm(); ListStati = await MDService.AnagStatiComm();
await reloadData(true); await reloadData(true);
} }
@@ -141,6 +193,19 @@ namespace MP.SPEC.Components
currRecord = null; currRecord = null;
await reloadData(true); await reloadData(true);
} }
private string css()
{
string answ = "";
if (isEditing)
{
answ = "visible";
}
else
{
answ = "hidden";
}
return answ;
}
#endregion Protected Methods #endregion Protected Methods
@@ -162,8 +227,14 @@ namespace MP.SPEC.Components
private int currPage private int currPage
{ {
get => MessageService.currPage; get => SelFilter.CurrPage;
set => MessageService.currPage = value; set => SelFilter.CurrPage = value;
}
private bool isEditing
{
get => SelFilter.isEditing;
set => SelFilter.isEditing = value;
} }
private bool isLoading { get; set; } = false; private bool isLoading { get; set; } = false;
@@ -177,8 +248,8 @@ namespace MP.SPEC.Components
private int numRecord private int numRecord
{ {
get => MessageService.numRecord; get => SelFilter.NumRec;
set => MessageService.numRecord = value; set => SelFilter.NumRec = value;
} }
private string SelArticolo private string SelArticolo
@@ -219,11 +290,6 @@ namespace MP.SPEC.Components
#region Private Methods #region Private Methods
private async void MessageService_EA_PageUpdated()
{
await reloadData(true);
}
private async Task reloadData(bool setChanged) private async Task reloadData(bool setChanged)
{ {
isLoading = true; isLoading = true;
@@ -263,6 +329,7 @@ namespace MP.SPEC.Components
currFluxLogDto = null; currFluxLogDto = null;
currRecord = null; currRecord = null;
visualizzaFlux = true; visualizzaFlux = true;
isEditing = false;
await RecordSelFlux.InvokeAsync(currFluxLogDto); await RecordSelFlux.InvokeAsync(currFluxLogDto);
await Task.Delay(1); await Task.Delay(1);
} }
+16 -5
View File
@@ -198,6 +198,17 @@ else
</div> </div>
} }
</td> </td>
<td>
<div class="input-group input-group-sm">
<div class="input-group-text">
<span class="me-1 @leftStringCSS">Tutti gli Stati</span>
<span class="form-check form-check-sm form-switch py-1" title="Mostra/Nascondi macchina spenta">
<input class="form-check-input" type="checkbox" id="switchSpenta" @onchange="() => toggleSpenta()" value="@hideSpenta">
</span>
<span class="@rightStringCSS">Nascondi Spenta</span>
</div>
</div>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -205,10 +216,9 @@ else
<div> <div>
@if (statRecord != null) @if (statRecord != null)
{ {
@if (ListOdlStatsAct != null)
@if (ListOdlStats != null)
{ {
@foreach (var stat in ListOdlStats) @foreach (var stat in ListOdlStatsAct)
{ {
<div class="p-1"> <div class="p-1">
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
@@ -234,11 +244,12 @@ else
@if (statRecord != null && ListOdlStats != null) @if (statRecord != null && ListOdlStats != null)
{ {
<div class="dcBox"> <div class="dcBox">
<ODLPlot SelectedOdl="@statRecord.IdxOdl"></ODLPlot> <ODLPlot SelectedOdl="@statRecord.IdxOdl" hideSpenta="@hideSpenta"></ODLPlot>
</div> </div>
<div class="dcBox dcOverlay d-flex"> <div class="dcBox dcOverlay d-flex">
<div class="align-self-center text-center w-100"> <div class="align-self-center text-center w-100">
<b class="fs-3">@statRecord.DurataMinuti</b> <b class="fs-3">@durataFilt</b>
@*<b class="fs-3">@statRecord.DurataMinuti</b>*@
</div> </div>
</div> </div>
} }
+97 -28
View File
@@ -46,6 +46,7 @@ namespace MP.SPEC.Components
ListRecords = null; ListRecords = null;
ListStati = null; ListStati = null;
ListOdlStats = null; ListOdlStats = null;
ListOdlStatsNetto = null;
statRecord = null; statRecord = null;
GC.Collect(); GC.Collect();
} }
@@ -87,7 +88,7 @@ namespace MP.SPEC.Components
await MDService.ODLClose(currRecord.IdxOdl, currRecord.IdxMacchina, 0, true); await MDService.ODLClose(currRecord.IdxOdl, currRecord.IdxMacchina, 0, true);
Log.Info($"Effettuata chiusura ODL {currRecord.IdxOdl}"); Log.Info($"Effettuata chiusura ODL {currRecord.IdxOdl}");
// ricarica... // ricarica...
await selectRecord(null); await selRecord(null);
} }
await reloadData(); await reloadData();
} }
@@ -116,7 +117,7 @@ namespace MP.SPEC.Components
await callSyncDb(currRecord.IdxMacchina); await callSyncDb(currRecord.IdxMacchina);
Log.Info($"Richiesto forceSyncDb per idxMacc {currRecord.IdxMacchina}"); Log.Info($"Richiesto forceSyncDb per idxMacc {currRecord.IdxMacchina}");
// ricarica... // ricarica...
await selectRecord(null); await selRecord(null);
} }
await reloadData(); await reloadData();
} }
@@ -143,27 +144,10 @@ namespace MP.SPEC.Components
protected async Task resetSel() protected async Task resetSel()
{ {
await selectRecord(null); await selRecord(null);
await reloadData(); await reloadData();
} }
protected async Task selectRecord(ODLModel? currRec)
{
showStats = true;
await Task.Delay(1);
currRecord = currRec;
if (currRec != null)
{
showStats = true;
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
}
else
{
showStats = false;
ListOdlStats = null;
}
}
protected async Task selectStatRecord(ODLModel? currRec) protected async Task selectStatRecord(ODLModel? currRec)
{ {
showStats = true; showStats = true;
@@ -171,8 +155,7 @@ namespace MP.SPEC.Components
statRecord = currRec; statRecord = currRec;
if (currRec != null) if (currRec != null)
{ {
showStats = true; await reloadStatsData(currRec);
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
} }
else else
{ {
@@ -188,11 +171,22 @@ namespace MP.SPEC.Components
currRecord = currRec; currRecord = currRec;
showStats = false; showStats = false;
ListOdlStats = null; ListOdlStats = null;
ListOdlStatsNetto = null;
}
protected async Task toggleSpenta()
{
hideSpenta = !hideSpenta;
await Task.Delay(1);
if (statRecord != null)
{
await reloadStatsData(statRecord);
}
} }
protected async Task UpdateData() protected async Task UpdateData()
{ {
await selectRecord(null); await selRecord(null);
await reloadData(); await reloadData();
} }
@@ -201,10 +195,13 @@ namespace MP.SPEC.Components
#region Private Fields #region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger(); private static Logger Log = LogManager.GetCurrentClassLogger();
private ODLModel? currRecord = null; private ODLModel? currRecord = null;
private List<StatODLModel>? ListOdlStats; private List<StatODLModel>? ListOdlStats;
private List<StatODLModel>? ListOdlStatsNetto;
private List<ODLModel>? ListRecords; private List<ODLModel>? ListRecords;
private List<ListValues>? ListStati; private List<ListValues>? ListStati;
@@ -225,6 +222,39 @@ namespace MP.SPEC.Components
set => currFilter.CurrPage = value; set => currFilter.CurrPage = value;
} }
private string durataFilt
{
get
{
string answ = "ND";
if (statRecord != null)
{
if (hideSpenta)
{
if (ListOdlStatsNetto != null)
{
var tsDurata = TimeSpan.FromMinutes(ListOdlStatsNetto.Sum(x => x.TotDurata));
if (tsDurata.TotalDays < 1)
{
answ = $"{tsDurata.Hours:00}h {tsDurata.Minutes:00}'";
}
else
{
answ = $"{tsDurata.Days}gg {tsDurata.Hours:00}h";
}
}
}
else
{
answ = statRecord.DurataMinuti;
}
}
return answ;
}
}
private bool hideSpenta { get; set; } = false;
/// <summary> /// <summary>
/// Indica se si tratti di ODL correnti /// Indica se si tratti di ODL correnti
/// </summary> /// </summary>
@@ -235,12 +265,39 @@ namespace MP.SPEC.Components
private bool isLoading { get; set; } = false; private bool isLoading { get; set; } = false;
private string leftStringCSS
{
get => hideSpenta ? "text-secondary" : "text-dark fw-bold";
}
private List<StatODLModel>? ListOdlStatsAct
{
get
{
List<StatODLModel> answ = new List<StatODLModel>();
if (hideSpenta)
{
answ = ListOdlStatsNetto;
}
else
{
answ = ListOdlStats;
}
return answ;
}
}
private int numRecord private int numRecord
{ {
get => currFilter.NumRec; get => currFilter.NumRec;
set => currFilter.NumRec = value; set => currFilter.NumRec = value;
} }
private string rightStringCSS
{
get => hideSpenta ? "text-dark fw-bold" : "text-secondary";
}
private DateTime selDtFine { get; set; } = DateTime.Now; private DateTime selDtFine { get; set; } = DateTime.Now;
private bool showStats { get; set; } = false; private bool showStats { get; set; } = false;
@@ -286,12 +343,9 @@ namespace MP.SPEC.Components
double answ = 0; double answ = 0;
double tot = 0; double tot = 0;
if (ListOdlStats != null) if (ListOdlStatsAct != null)
{ {
foreach (var item in ListOdlStats) tot = ListOdlStatsAct.Sum(x => x.TotDurata);
{
tot += item.TotDurata;
}
double perc = (durata / tot) * 100; double perc = (durata / tot) * 100;
if (perc > 1) if (perc > 1)
@@ -349,6 +403,21 @@ namespace MP.SPEC.Components
isLoading = false; isLoading = false;
} }
private async Task reloadStatsData(ODLModel? currRec)
{
showStats = true;
if (currRec != null)
{
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
ListOdlStatsNetto = ListOdlStats.Where(x => x.Semaforo != "sGr").ToList();
}
else
{
ListOdlStats = null;
ListOdlStatsNetto = null;
}
}
private string tradFase(string codFase) private string tradFase(string codFase)
{ {
string answ = codFase; string answ = codFase;
+8 -20
View File
@@ -25,7 +25,7 @@ namespace MP.SPEC.Components
#endregion Public Properties #endregion Public Properties
#region Public Methods #region Public Methods
private SelectFluxParams lastFilter { get; set; } = new SelectFluxParams() { CurrPage = -1 };
public string checkSelect(FluxLog selRecord) public string checkSelect(FluxLog selRecord)
{ {
string answ = ""; string answ = "";
@@ -45,10 +45,10 @@ namespace MP.SPEC.Components
{ {
await Task.Delay(1); await Task.Delay(1);
// se sono cambiati --> rileggo... // se sono cambiati --> rileggo...
if (LastFilter==null || !SelFilter.Equals(LastFilter)) if (!lastFilter.Equals(SelFilter))
{ {
await reloadData(false); lastFilter = SelFilter.clone();
LastFilter = SelFilter; await reloadData(true);
} }
} }
@@ -58,8 +58,6 @@ namespace MP.SPEC.Components
public void Dispose() public void Dispose()
{ {
aTimer.Elapsed -= ElapsedTimer; aTimer.Elapsed -= ElapsedTimer;
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated -= OnSeachUpdated;
aTimer.Stop(); aTimer.Stop();
aTimer.Dispose(); aTimer.Dispose();
currRecord = null; currRecord = null;
@@ -128,9 +126,6 @@ namespace MP.SPEC.Components
[Inject] [Inject]
protected MpDataService MDService { get; set; } = null!; protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
protected int RefreshPeriod protected int RefreshPeriod
{ {
get => SelFilter.TempoAgg; get => SelFilter.TempoAgg;
@@ -142,8 +137,6 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated += OnSeachUpdated;
StartTimer(); StartTimer();
} }
@@ -197,8 +190,8 @@ namespace MP.SPEC.Components
private int currPage private int currPage
{ {
get => MessageService.currPage; get => SelFilter.CurrPage;
set => MessageService.currPage = value; set => SelFilter.CurrPage = value;
} }
private bool isLoading { get; set; } = false; private bool isLoading { get; set; } = false;
@@ -215,8 +208,8 @@ namespace MP.SPEC.Components
private int numRecord private int numRecord
{ {
get => MessageService.numRecord; get => SelFilter.NumRec;
set => MessageService.numRecord = value; set => SelFilter.NumRec = value;
} }
private string SelFlux private string SelFlux
@@ -250,11 +243,6 @@ namespace MP.SPEC.Components
#region Private Methods #region Private Methods
private async void MessageService_EA_PageUpdated()
{
await reloadData(true);
}
#endregion Private Methods #endregion Private Methods
} }
} }
+35 -17
View File
@@ -1,14 +1,25 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels; using MP.Data.DatabaseModels;
using MP.SPEC.Components;
using MP.SPEC.Data; using MP.SPEC.Data;
namespace MP.SPEC.Components namespace MP.SPEC.Components
{ {
public partial class ODLPlot public partial class ODLPlot
{ {
#region Public Properties #region Public Fields
public List<DoughnutStyling> colors = new List<DoughnutStyling>();
public List<double> Data = new List<double>();
public List<string> Labels = new List<string>();
#endregion Public Fields
#region Public Properties
[Parameter]
public bool hideSpenta { get; set; }
public int OdlId public int OdlId
{ {
@@ -29,34 +40,36 @@ namespace MP.SPEC.Components
//protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter(); //protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter();
protected int _selParam { get; set; } = -1; protected int _selParam { get; set; } = -1;
[Inject]
protected MpDataService MDService { get; set; } = null!;
#endregion Protected Properties #endregion Protected Properties
#region Protected Methods #region Protected Methods
private bool isLoading { get; set; } = false;
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
isLoading = true; isLoading = true;
await Task.Delay(1); await Task.Delay(1);
} }
private List<StatODLModel>? ListRecords = null;
protected override async Task OnParametersSetAsync() protected override async Task OnParametersSetAsync()
{ {
await ReloadData(); await ReloadData();
await Task.Delay(1); await Task.Delay(1);
} }
public List<double> Data = new List<double>();
public List<string> Labels = new List<string>();
public List<DoughnutStyling> colors = new List<DoughnutStyling>();
protected async Task ReloadData() protected async Task ReloadData()
{ {
Data.Clear(); Data.Clear();
Labels.Clear(); Labels.Clear();
colors.Clear(); colors.Clear();
ListRecords = await MDService.StatOdl(SelectedOdl); ListRecords = await MDService.StatOdl(SelectedOdl);
// se hideSpenta --> filtro stato 11 = spenta...
if (hideSpenta)
{
ListRecords = ListRecords.Where(x => x.Semaforo != "sGr").ToList();
}
foreach (var record in ListRecords) foreach (var record in ListRecords)
{ {
Data.Add(record.TotDurata); Data.Add(record.TotDurata);
@@ -73,18 +86,23 @@ namespace MP.SPEC.Components
{ {
colors.Add(new DoughnutStyling(record.Css, "ccc")); colors.Add(new DoughnutStyling(record.Css, "ccc"));
} }
} }
await Task.Delay(1); await Task.Delay(1);
isLoading = false; isLoading = false;
} }
[Inject]
protected MpDataService MDService { get; set; } = null!;
#endregion Protected Methods #endregion Protected Methods
#region Private Fields
private List<StatODLModel>? ListRecords = null;
#endregion Private Fields
#region Private Properties
private bool isLoading { get; set; } = false;
#endregion Private Properties
} }
} }
+9
View File
@@ -886,6 +886,15 @@ namespace MP.SPEC.Data
return answ; return answ;
} }
public async Task<bool> DossiersUpdateValore(Dossiers currDoss)
{
// aggiorno record sul DB
bool answ = await dbController.DossiersUpdateValore(currDoss);
return answ;
}
#endregion Public Methods #endregion Public Methods
#region Protected Fields #region Protected Fields
+74
View File
@@ -0,0 +1,74 @@
namespace MP.SPEC.Data
{
public class SelectArticoliParams
{
#region Public Constructors
public SelectArticoliParams()
{ }
#endregion Public Constructors
#region Public Properties
public int CurrPage { get; set; } = 1;
public string IdxMacchina { get; set; } = "*";
public string Azienda { get; set; } = "*";
public int MaxRecord { get; set; } = 100;
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
#endregion Public Properties
#region Public Methods
public SelectArticoliParams clone()
{
SelectArticoliParams clonedData = new SelectArticoliParams()
{
CurrPage = this.CurrPage,
IdxMacchina = this.IdxMacchina,
Azienda = this.Azienda,
MaxRecord = this.MaxRecord,
NumRec = this.NumRec,
TotCount = this.TotCount
};
return clonedData;
}
public override bool Equals(object obj)
{
if (!(obj is SelectArticoliParams item))
return false;
if (MaxRecord != item.MaxRecord)
return false;
if (NumRec != item.NumRec)
return false;
if (TotCount != item.TotCount)
return false;
if (CurrPage != item.CurrPage)
return false;
if (IdxMacchina != item.IdxMacchina)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
+27 -15
View File
@@ -1,4 +1,6 @@
namespace MP.SPEC.Data using MP.Data;
namespace MP.SPEC.Data
{ {
public class SelectDossierParams public class SelectDossierParams
{ {
@@ -13,31 +15,35 @@
public int CurrPage { get; set; } = 1; public int CurrPage { get; set; } = 1;
public DateTime DtEnd { get; set; } = InitDatetime(5); public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
public DateTime DtStart { get; set; } = InitDatetime(5).AddDays(-730); public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-730);
public string IdxMacchina { get; set; } = "*"; public string IdxMacchina { get; set; } = "*";
public string CodArticolo { get; set; } = "*"; public string CodArticolo { get; set; } = "*";
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
public int MaxRecord { get; set; } = 100; public int MaxRecord { get; set; } = 100;
public bool isEditing { get; set; } = false;
#endregion Public Properties #endregion Public Properties
#region Public Methods #region Public Methods
public SelectDossierParams clone()
/// <summary>
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <returns></returns>
public static DateTime InitDatetime(int minRound)
{ {
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today); SelectDossierParams clonedData = new SelectDossierParams()
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound; {
DateTime endRounded = DateTime.Today.AddMinutes(minDay); DtEnd = this.DtEnd,
return endRounded; DtStart = this.DtStart,
CurrPage = this.CurrPage,
IdxMacchina = this.IdxMacchina,
CodArticolo = this.CodArticolo,
MaxRecord = this.MaxRecord,
NumRec = this.NumRec,
TotCount = this.TotCount
};
return clonedData;
} }
public override bool Equals(object obj) public override bool Equals(object obj)
@@ -54,6 +60,12 @@
if (MaxRecord != item.MaxRecord) if (MaxRecord != item.MaxRecord)
return false; return false;
if (TotCount != item.TotCount)
return false;
if (NumRec != item.NumRec)
return false;
if (DtEnd != item.DtEnd) if (DtEnd != item.DtEnd)
return false; return false;
+27 -2
View File
@@ -19,14 +19,33 @@
public string IdxMacchina { get; set; } = "*"; public string IdxMacchina { get; set; } = "*";
public string lastUpdate { get; set; } = "-"; public string lastUpdate { get; set; } = "-";
public bool LiveUpdate { get; set; } = true; public bool LiveUpdate { get; set; } = true;
public int NumRec { get; set; } = 10;
public int MaxRecord { get; set; } = 100; public int MaxRecord { get; set; } = 100;
public int TempoAgg { get; set; } = 10000; public int TempoAgg { get; set; } = 10000;
public int TotCount { get; set; } = 0;
#endregion Public Properties #endregion Public Properties
#region Public Methods #region Public Methods
public SelectFluxParams clone()
{
SelectFluxParams clonedData = new SelectFluxParams()
{
CodFlux = this.CodFlux,
CurrPage = this.CurrPage,
dtRif = this.dtRif,
dtMax = this.dtMax,
dtMin = this.dtMin,
IdxMacchina = this.IdxMacchina,
lastUpdate = this.lastUpdate,
LiveUpdate = this.LiveUpdate,
NumRec = this.NumRec,
MaxRecord = this.MaxRecord,
TotCount = this.TotCount,
TempoAgg = this.TempoAgg
};
return clonedData;
}
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
if (!(obj is SelectFluxParams item)) if (!(obj is SelectFluxParams item))
@@ -46,6 +65,12 @@
if (TempoAgg != item.TempoAgg) if (TempoAgg != item.TempoAgg)
return false; return false;
if (NumRec!= item.NumRec)
return false;
if (TotCount!= item.TotCount)
return false;
if (CurrPage != item.CurrPage) if (CurrPage != item.CurrPage)
return false; return false;
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace> <RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2210.1910</Version> <Version>6.16.2210.2014</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
+7 -11
View File
@@ -24,9 +24,11 @@ namespace MP.SPEC.Pages
return answ; return answ;
} }
private SelectArticoliParams currFilter = new SelectArticoliParams();
public void Dispose() public void Dispose()
{ {
MessageService.EA_SearchUpdated -= OnSeachUpdated; //MessageService.EA_SearchUpdated -= OnSeachUpdated;
currRecord = null; currRecord = null;
ListTipoArt = null; ListTipoArt = null;
ListAziende = null; ListAziende = null;
@@ -55,9 +57,6 @@ namespace MP.SPEC.Pages
[Inject] [Inject]
protected MpDataService MDService { get; set; } = null!; protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
[Inject] [Inject]
protected NavigationManager NavManager { get; set; } protected NavigationManager NavManager { get; set; }
@@ -131,9 +130,6 @@ namespace MP.SPEC.Pages
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
numRecord = 10; numRecord = 10;
// mostro ricerca
MessageService.ShowSearch = true;
MessageService.EA_SearchUpdated += OnSeachUpdated;
configData = await MDService.ConfigGetAll(); configData = await MDService.ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA"); var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
if (currRec != null) if (currRec != null)
@@ -172,14 +168,14 @@ namespace MP.SPEC.Pages
{ {
Azienda = selRec.Azienda, Azienda = selRec.Azienda,
CodArticolo = selRec.CodArticolo, CodArticolo = selRec.CodArticolo,
DescArticolo = $"CLONE - { selRec.DescArticolo }", DescArticolo = $"CLONE - {selRec.DescArticolo}",
Disegno = selRec.Disegno, Disegno = selRec.Disegno,
Tipo=selRec.Tipo Tipo = selRec.Tipo
}; };
currRecord = newRec; currRecord = newRec;
await Task.Delay(1); await Task.Delay(1);
} }
protected async Task update(AnagArticoli selRec) protected async Task update(AnagArticoli selRec)
{ {
@@ -294,7 +290,7 @@ namespace MP.SPEC.Pages
private async Task reloadData() private async Task reloadData()
{ {
isLoading = true; isLoading = true;
SearchRecords = await MDService.ArticoliGetSearch(100000, selAzienda, MessageService.SearchVal); SearchRecords = await MDService.ArticoliGetSearch(100000, selAzienda, "*");
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
isLoading = false; isLoading = false;
} }
+1 -55
View File
@@ -21,67 +21,13 @@
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
@if (currDetFluxLogRecord != null)
{
<div class="row">
<div class="col-12">
<div class="card mb-5">
<div class="card-header bg-primary text-light">Modifica Parametro</div>
<div class="card-body">
<div class="row">
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">MACCHINA</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.IdxMacchina">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">DATA</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.dtEvento">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">DATA TYPE</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.CodFlux">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">VALORE</span>
<input type="text" class="form-control" aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.ValoreEdit">
</div>
</div>
</div>
<div class="row pt-4">
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => cancel()" class="btn btn-warning">Annulla <i class="bi bi-x-circle"></i></button>
</div>
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => update(currDetFluxLogRecord)" class="btn btn-success">Save <i class="bi bi-save"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
}
@if (isLoading) @if (isLoading)
{ {
<LoadingData></LoadingData> <LoadingData></LoadingData>
} }
else else
{ {
<ListDossiers SelFilter="@currFilter" RecordSel="@selRecordDoss" RecordSelFlux="@selRecordFlux" TotRecordChanged="updateTotal"></ListDossiers> <ListDossiers SelFilter="@currFilter" RecordSel="@selRecordDoss" TotRecordChanged="updateTotal"></ListDossiers>
} }
</div> </div>
<div class="card-footer py-1"> <div class="card-footer py-1">
+32 -37
View File
@@ -23,19 +23,11 @@ namespace MP.SPEC.Pages
[Inject] [Inject]
protected MpDataService MDService { get; set; } = null!; protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MsgService { get; set; } = null!;
#endregion Protected Properties #endregion Protected Properties
#region Protected Methods #region Protected Methods
protected async Task cancel()
{
currDetFluxLogRecord = null;
await Task.Delay(1);
}
protected void ForceReload(int newNum) protected void ForceReload(int newNum)
{ {
numRecord = newNum; numRecord = newNum;
@@ -51,9 +43,6 @@ namespace MP.SPEC.Pages
{ {
isLoading = true; isLoading = true;
isFiltering = true; isFiltering = true;
// disabilito ricerca...
MsgService.SearchVal = "";
MsgService.ShowSearch = false;
// fix pagina // fix pagina
await Task.Delay(1); await Task.Delay(1);
var modFilter = currFilter; var modFilter = currFilter;
@@ -69,25 +58,23 @@ namespace MP.SPEC.Pages
await Task.Delay(1); await Task.Delay(1);
} }
protected async Task selRecordFlux(FluxLogDTO selRec) private string css()
{ {
currDetFluxLogRecord = selRec; string answ = "";
await Task.Delay(1); if (isEditing == false)
{
answ = "hidden";
}
else
{
answ = "visible";
}
return answ;
} }
protected async Task update(FluxLogDTO selRec) private void enableEditing()
{ {
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare le modifiche? queste saranno parte del dossier inviato all'impianto")) isEditing = true;
return;
await Task.Delay(1);
if (currRecordDoss != null)
{
// METODO PER UPDATE FLUX
await MDService.updateDossierValue(currRecordDoss, selRec);
}
currDetFluxLogRecord = null;
await Task.Delay(1);
} }
protected void updateTotal(int newTotCount) protected void updateTotal(int newTotCount)
@@ -105,18 +92,14 @@ namespace MP.SPEC.Pages
#region Private Properties #region Private Properties
private FluxLogDTO? currDetFluxLogRecord
{
get => _currDetFluxLogRecord;
set { _currDetFluxLogRecord = value; }
}
private SelectDossierParams currFilter { get; set; } = new SelectDossierParams(); private SelectDossierParams currFilter { get; set; } = new SelectDossierParams();
private int currPage private int currPage
{ {
get => MsgService.currPage; get => currFilter.CurrPage;
set => MsgService.currPage = value; set => currFilter.CurrPage = value;
} }
private Dossiers? currRecordDoss { get; set; } = null; private Dossiers? currRecordDoss { get; set; } = null;
@@ -125,11 +108,19 @@ namespace MP.SPEC.Pages
private int numRecord private int numRecord
{ {
get => MsgService.numRecord; get => currFilter.NumRec;
set => MsgService.numRecord = value; set => currFilter.NumRec = value;
}
private bool isEditing
{
get => currFilter.isEditing;
set => currFilter.isEditing = value;
}
private int totalCount
{
get => currFilter.TotCount;
set => currFilter.TotCount = value;
} }
private int totalCount { get; set; } = 0;
#endregion Private Properties #endregion Private Properties
@@ -146,6 +137,10 @@ namespace MP.SPEC.Pages
currFilter = newParams; currFilter = newParams;
isLoading = false; isLoading = false;
} }
protected void UpdateTotCount(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Private Methods #endregion Private Methods
} }
+1 -1
View File
@@ -25,7 +25,7 @@
} }
else else
{ {
<ListPARAMS SelFilter="@currFilter" TotRecordChanged="@updateTotal" RecordSel="@detailSel"></ListPARAMS> <ListPARAMS SelFilter="@currFilter" TotRecordChanged="@UpdateTotCount" RecordSel="@detailSel"></ListPARAMS>
} }
</div> </div>
<div class="card-footer py-1"> <div class="card-footer py-1">
+8 -10
View File
@@ -15,8 +15,6 @@ namespace MP.SPEC.Pages
#region Protected Properties #region Protected Properties
[Inject]
protected MessageService MsgService { get; set; } = null!;
#endregion Protected Properties #endregion Protected Properties
@@ -43,9 +41,6 @@ namespace MP.SPEC.Pages
{ {
isLoading = true; isLoading = true;
isFiltering = true; isFiltering = true;
// disabilito ricerca...
MsgService.SearchVal = "";
MsgService.ShowSearch = false;
// fix pagina // fix pagina
await Task.Delay(1); await Task.Delay(1);
var modFilter = currFilter; var modFilter = currFilter;
@@ -100,8 +95,8 @@ namespace MP.SPEC.Pages
private int currPage private int currPage
{ {
get => MsgService.currPage; get => currFilter.CurrPage;
set => MsgService.currPage = value; set => currFilter.CurrPage = value;
} }
private bool isFiltering { get; set; } = false; private bool isFiltering { get; set; } = false;
@@ -109,8 +104,8 @@ namespace MP.SPEC.Pages
private int numRecord private int numRecord
{ {
get => MsgService.numRecord; get => currFilter.NumRec;
set => MsgService.numRecord = value; set => currFilter.NumRec = value;
} }
private int totalCount { get; set; } = 0; private int totalCount { get; set; } = 0;
@@ -139,7 +134,10 @@ namespace MP.SPEC.Pages
currFilter = newParams; currFilter = newParams;
isLoading = false; isLoading = false;
} }
protected void UpdateTotCount(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Private Methods #endregion Private Methods
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
<body> <body>
<i>Modulo MAPOSPEC </i> <i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2210.1910</h4> <h4>Versione: 6.16.2210.2014</h4>
<br /> Note di rilascio: <br /> Note di rilascio:
<ul> <ul>
<li> <li>
+1 -1
View File
@@ -1 +1 @@
6.16.2210.1910 6.16.2210.2014
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<item> <item>
<version>6.16.2210.1910</version> <version>6.16.2210.2014</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url> <url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog> <changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory> <mandatory>false</mandatory>