Compare commits

...

29 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
Samuele Locatelli f1c295993c Merge branch 'Release/UpdateLogCall' 2022-10-19 11:02:16 +02:00
Samuele Locatelli a293ce825e Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-19 11:01:34 +02:00
Samuele Locatelli e3b67ee6c0 Fix log vari x chiamate MP/IO 2022-10-19 11:01:29 +02:00
zaccaria.majid 0c5e41826e fix recordsel = null in dossier post chiusura 2022-10-19 10:43:45 +02:00
Samuele Locatelli 0d4e1aed88 Merge tag 'FixPAramsDetailAndReload' into develop
Sistemazione reload e params detail
2022-10-18 20:02:34 +02:00
24 changed files with 593 additions and 259 deletions
+88 -10
View File
@@ -1,6 +1,9 @@
@using MP.SPEC.Components
@using MP.SPEC.Data
@if (ListRecords == null)
{
<LoadingData></LoadingData>
@@ -11,6 +14,70 @@ else if (totalCount == 0)
}
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="d-flex justify justify-content-between">
<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-regular fa-calendar-days"></i> Data Snap</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>
</tr>
</thead>
@@ -33,7 +99,15 @@ else
{
<tr class="@checkSelect(@record)">
<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>
@record.OdlNav.CodArticolo
@@ -52,11 +126,17 @@ else
<td>
@record.IdxODL
</td>
@*<td>
@record.DataType
</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>
</tr>
}
@@ -81,10 +161,8 @@ else
<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-solid fa-sliders"></i> Data Type</th>
<th>
<div class="d-flex justify-content-between col-12">
<span class="col-11" style="text-align: right;"> Valore </span>
</div>
<th style="text-align: right;">
<span class="col-11"> Valore </span>
</th>
</tr>
</thead>
+89 -20
View File
@@ -1,8 +1,10 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using MP.SPEC.Data;
using Newtonsoft.Json;
namespace MP.SPEC.Components
{
@@ -36,7 +38,7 @@ namespace MP.SPEC.Components
{
try
{
answ = (currFluxLogDto.CodFlux == recordSel.CodFlux && currFluxLogDto.dtEvento== recordSel.dtEvento) ? "table-info" : "";
answ = (currFluxLogDto.CodFlux == recordSel.CodFlux && currFluxLogDto.dtEvento == recordSel.dtEvento) ? "table-info" : "";
}
catch
{ }
@@ -52,6 +54,7 @@ namespace MP.SPEC.Components
try
{
answ = (currRecord.IdxMacchina == recordSel.IdxMacchina && currRecord.DtRif == recordSel.DtRif) ? "table-info" : "";
}
catch
{ }
@@ -60,15 +63,20 @@ namespace MP.SPEC.Components
}
public void Dispose()
{
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated -= OnSeachUpdated;
currRecord = null;
SearchRecords = null;
ListRecords = null;
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
#region Protected Properties
@@ -78,10 +86,6 @@ namespace MP.SPEC.Components
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
@@ -110,10 +114,59 @@ namespace MP.SPEC.Components
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()
{
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated += OnSeachUpdated;
ListStati = await MDService.AnagStatiComm();
await reloadData(true);
}
@@ -140,6 +193,19 @@ namespace MP.SPEC.Components
currRecord = null;
await reloadData(true);
}
private string css()
{
string answ = "";
if (isEditing)
{
answ = "visible";
}
else
{
answ = "hidden";
}
return answ;
}
#endregion Protected Methods
@@ -161,8 +227,14 @@ namespace MP.SPEC.Components
private int currPage
{
get => MessageService.currPage;
set => MessageService.currPage = value;
get => SelFilter.CurrPage;
set => SelFilter.CurrPage = value;
}
private bool isEditing
{
get => SelFilter.isEditing;
set => SelFilter.isEditing = value;
}
private bool isLoading { get; set; } = false;
@@ -176,8 +248,8 @@ namespace MP.SPEC.Components
private int numRecord
{
get => MessageService.numRecord;
set => MessageService.numRecord = value;
get => SelFilter.NumRec;
set => SelFilter.NumRec = value;
}
private string SelArticolo
@@ -218,11 +290,6 @@ namespace MP.SPEC.Components
#region Private Methods
private async void MessageService_EA_PageUpdated()
{
await reloadData(true);
}
private async Task reloadData(bool setChanged)
{
isLoading = true;
@@ -262,6 +329,8 @@ namespace MP.SPEC.Components
currFluxLogDto = null;
currRecord = null;
visualizzaFlux = true;
isEditing = false;
await RecordSelFlux.InvokeAsync(currFluxLogDto);
await Task.Delay(1);
}
+16 -5
View File
@@ -198,6 +198,17 @@ else
</div>
}
</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>
</tbody>
</table>
@@ -205,10 +216,9 @@ else
<div>
@if (statRecord != null)
{
@if (ListOdlStats != null)
@if (ListOdlStatsAct != null)
{
@foreach (var stat in ListOdlStats)
@foreach (var stat in ListOdlStatsAct)
{
<div class="p-1">
<div class="d-flex justify-content-between">
@@ -234,11 +244,12 @@ else
@if (statRecord != null && ListOdlStats != null)
{
<div class="dcBox">
<ODLPlot SelectedOdl="@statRecord.IdxOdl"></ODLPlot>
<ODLPlot SelectedOdl="@statRecord.IdxOdl" hideSpenta="@hideSpenta"></ODLPlot>
</div>
<div class="dcBox dcOverlay d-flex">
<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>
}
+102 -28
View File
@@ -3,6 +3,7 @@ using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using MP.SPEC.Services;
using NLog;
namespace MP.SPEC.Components
{
@@ -45,6 +46,7 @@ namespace MP.SPEC.Components
ListRecords = null;
ListStati = null;
ListOdlStats = null;
ListOdlStatsNetto = null;
statRecord = null;
GC.Collect();
}
@@ -84,8 +86,9 @@ namespace MP.SPEC.Components
{
// effettua chiusura sul DB
await MDService.ODLClose(currRecord.IdxOdl, currRecord.IdxMacchina, 0, true);
Log.Info($"Effettuata chiusura ODL {currRecord.IdxOdl}");
// ricarica...
await selectRecord(null);
await selRecord(null);
}
await reloadData();
}
@@ -112,8 +115,9 @@ namespace MP.SPEC.Components
if (currRecord != null)
{
await callSyncDb(currRecord.IdxMacchina);
Log.Info($"Richiesto forceSyncDb per idxMacc {currRecord.IdxMacchina}");
// ricarica...
await selectRecord(null);
await selRecord(null);
}
await reloadData();
}
@@ -140,27 +144,10 @@ namespace MP.SPEC.Components
protected async Task resetSel()
{
await selectRecord(null);
await selRecord(null);
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)
{
showStats = true;
@@ -168,8 +155,7 @@ namespace MP.SPEC.Components
statRecord = currRec;
if (currRec != null)
{
showStats = true;
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
await reloadStatsData(currRec);
}
else
{
@@ -185,11 +171,22 @@ namespace MP.SPEC.Components
currRecord = currRec;
showStats = false;
ListOdlStats = null;
ListOdlStatsNetto = null;
}
protected async Task toggleSpenta()
{
hideSpenta = !hideSpenta;
await Task.Delay(1);
if (statRecord != null)
{
await reloadStatsData(statRecord);
}
}
protected async Task UpdateData()
{
await selectRecord(null);
await selRecord(null);
await reloadData();
}
@@ -197,10 +194,14 @@ namespace MP.SPEC.Components
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private ODLModel? currRecord = null;
private List<StatODLModel>? ListOdlStats;
private List<StatODLModel>? ListOdlStatsNetto;
private List<ODLModel>? ListRecords;
private List<ListValues>? ListStati;
@@ -221,6 +222,39 @@ namespace MP.SPEC.Components
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>
/// Indica se si tratti di ODL correnti
/// </summary>
@@ -231,12 +265,39 @@ namespace MP.SPEC.Components
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
{
get => currFilter.NumRec;
set => currFilter.NumRec = value;
}
private string rightStringCSS
{
get => hideSpenta ? "text-dark fw-bold" : "text-secondary";
}
private DateTime selDtFine { get; set; } = DateTime.Now;
private bool showStats { get; set; } = false;
@@ -273,6 +334,7 @@ namespace MP.SPEC.Components
}
catch (Exception exc)
{
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
}
}
@@ -281,12 +343,9 @@ namespace MP.SPEC.Components
double answ = 0;
double tot = 0;
if (ListOdlStats != null)
if (ListOdlStatsAct != null)
{
foreach (var item in ListOdlStats)
{
tot += item.TotDurata;
}
tot = ListOdlStatsAct.Sum(x => x.TotDurata);
double perc = (durata / tot) * 100;
if (perc > 1)
@@ -344,6 +403,21 @@ namespace MP.SPEC.Components
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)
{
string answ = codFase;
+8 -20
View File
@@ -25,7 +25,7 @@ namespace MP.SPEC.Components
#endregion Public Properties
#region Public Methods
private SelectFluxParams lastFilter { get; set; } = new SelectFluxParams() { CurrPage = -1 };
public string checkSelect(FluxLog selRecord)
{
string answ = "";
@@ -45,10 +45,10 @@ namespace MP.SPEC.Components
{
await Task.Delay(1);
// se sono cambiati --> rileggo...
if (LastFilter==null || !SelFilter.Equals(LastFilter))
if (!lastFilter.Equals(SelFilter))
{
await reloadData(false);
LastFilter = SelFilter;
lastFilter = SelFilter.clone();
await reloadData(true);
}
}
@@ -58,8 +58,6 @@ namespace MP.SPEC.Components
public void Dispose()
{
aTimer.Elapsed -= ElapsedTimer;
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated -= OnSeachUpdated;
aTimer.Stop();
aTimer.Dispose();
currRecord = null;
@@ -128,9 +126,6 @@ namespace MP.SPEC.Components
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
protected int RefreshPeriod
{
get => SelFilter.TempoAgg;
@@ -142,8 +137,6 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync()
{
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated += OnSeachUpdated;
StartTimer();
}
@@ -197,8 +190,8 @@ namespace MP.SPEC.Components
private int currPage
{
get => MessageService.currPage;
set => MessageService.currPage = value;
get => SelFilter.CurrPage;
set => SelFilter.CurrPage = value;
}
private bool isLoading { get; set; } = false;
@@ -215,8 +208,8 @@ namespace MP.SPEC.Components
private int numRecord
{
get => MessageService.numRecord;
set => MessageService.numRecord = value;
get => SelFilter.NumRec;
set => SelFilter.NumRec = value;
}
private string SelFlux
@@ -250,11 +243,6 @@ namespace MP.SPEC.Components
#region Private Methods
private async void MessageService_EA_PageUpdated()
{
await reloadData(true);
}
#endregion Private Methods
}
}
+14 -10
View File
@@ -3,6 +3,7 @@ using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using MP.SPEC.Services;
using NLog;
namespace MP.SPEC.Components
{
@@ -209,9 +210,21 @@ namespace MP.SPEC.Components
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private PODLModel? currRecord = null;
private List<PODLModel>? ListRecords;
private List<ListValues>? ListStati;
/// <summary>
/// scadenza validità lista ODL correnti
/// </summary>
private DateTime odlCurrExp = DateTime.Now.AddMinutes(-1);
/// <summary>
/// Elenco ODL correnti...
/// </summary>
private List<string> odlCurrList = new List<string>();
private List<PODLModel>? SearchRecords;
#endregion Private Fields
@@ -278,6 +291,7 @@ namespace MP.SPEC.Components
}
catch (Exception exc)
{
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
}
}
@@ -379,16 +393,6 @@ namespace MP.SPEC.Components
isLoading = false;
}
/// <summary>
/// scadenza validità lista ODL correnti
/// </summary>
private DateTime odlCurrExp = DateTime.Now.AddMinutes(-1);
/// <summary>
/// Elenco ODL correnti...
/// </summary>
private List<string> odlCurrList = new List<string>();
private string tradFase(string codFase)
{
string answ = codFase;
+35 -17
View File
@@ -1,14 +1,25 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Components;
using MP.SPEC.Data;
namespace MP.SPEC.Components
{
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
{
@@ -29,34 +40,36 @@ namespace MP.SPEC.Components
//protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter();
protected int _selParam { get; set; } = -1;
[Inject]
protected MpDataService MDService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
private bool isLoading { get; set; } = false;
protected override async Task OnInitializedAsync()
{
isLoading = true;
await Task.Delay(1);
}
private List<StatODLModel>? ListRecords = null;
protected override async Task OnParametersSetAsync()
{
await ReloadData();
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()
{
Data.Clear();
Labels.Clear();
colors.Clear();
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)
{
Data.Add(record.TotDurata);
@@ -73,18 +86,23 @@ namespace MP.SPEC.Components
{
colors.Add(new DoughnutStyling(record.Css, "ccc"));
}
}
await Task.Delay(1);
isLoading = false;
}
[Inject]
protected MpDataService MDService { get; set; } = null!;
#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;
}
public async Task<bool> DossiersUpdateValore(Dossiers currDoss)
{
// aggiorno record sul DB
bool answ = await dbController.DossiersUpdateValore(currDoss);
return answ;
}
#endregion Public Methods
#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
{
@@ -13,31 +15,35 @@
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 CodArticolo { get; set; } = "*";
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
public int MaxRecord { get; set; } = 100;
public bool isEditing { get; set; } = false;
#endregion Public Properties
#region Public Methods
/// <summary>
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <returns></returns>
public static DateTime InitDatetime(int minRound)
public SelectDossierParams clone()
{
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
return endRounded;
SelectDossierParams clonedData = new SelectDossierParams()
{
DtEnd = this.DtEnd,
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)
@@ -54,6 +60,12 @@
if (MaxRecord != item.MaxRecord)
return false;
if (TotCount != item.TotCount)
return false;
if (NumRec != item.NumRec)
return false;
if (DtEnd != item.DtEnd)
return false;
+27 -2
View File
@@ -19,14 +19,33 @@
public string IdxMacchina { get; set; } = "*";
public string lastUpdate { get; set; } = "-";
public bool LiveUpdate { get; set; } = true;
public int NumRec { get; set; } = 10;
public int MaxRecord { get; set; } = 100;
public int TempoAgg { get; set; } = 10000;
public int TotCount { get; set; } = 0;
#endregion Public Properties
#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)
{
if (!(obj is SelectFluxParams item))
@@ -46,6 +65,12 @@
if (TempoAgg != item.TempoAgg)
return false;
if (NumRec!= item.NumRec)
return false;
if (TotCount!= item.TotCount)
return false;
if (CurrPage != item.CurrPage)
return false;
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2210.1820</Version>
<Version>6.16.2210.2014</Version>
</PropertyGroup>
<ItemGroup>
+7 -11
View File
@@ -24,9 +24,11 @@ namespace MP.SPEC.Pages
return answ;
}
private SelectArticoliParams currFilter = new SelectArticoliParams();
public void Dispose()
{
MessageService.EA_SearchUpdated -= OnSeachUpdated;
//MessageService.EA_SearchUpdated -= OnSeachUpdated;
currRecord = null;
ListTipoArt = null;
ListAziende = null;
@@ -55,9 +57,6 @@ namespace MP.SPEC.Pages
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
[Inject]
protected NavigationManager NavManager { get; set; }
@@ -131,9 +130,6 @@ namespace MP.SPEC.Pages
protected override async Task OnInitializedAsync()
{
numRecord = 10;
// mostro ricerca
MessageService.ShowSearch = true;
MessageService.EA_SearchUpdated += OnSeachUpdated;
configData = await MDService.ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
if (currRec != null)
@@ -172,14 +168,14 @@ namespace MP.SPEC.Pages
{
Azienda = selRec.Azienda,
CodArticolo = selRec.CodArticolo,
DescArticolo = $"CLONE - { selRec.DescArticolo }",
DescArticolo = $"CLONE - {selRec.DescArticolo}",
Disegno = selRec.Disegno,
Tipo=selRec.Tipo
Tipo = selRec.Tipo
};
currRecord = newRec;
await Task.Delay(1);
}
protected async Task update(AnagArticoli selRec)
{
@@ -294,7 +290,7 @@ namespace MP.SPEC.Pages
private async Task reloadData()
{
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();
isLoading = false;
}
+1 -55
View File
@@ -21,67 +21,13 @@
</div>
</div>
<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)
{
<LoadingData></LoadingData>
}
else
{
<ListDossiers SelFilter="@currFilter" RecordSel="@selRecordDoss" RecordSelFlux="@selRecordFlux" TotRecordChanged="updateTotal"></ListDossiers>
<ListDossiers SelFilter="@currFilter" RecordSel="@selRecordDoss" TotRecordChanged="updateTotal"></ListDossiers>
}
</div>
<div class="card-footer py-1">
+32 -37
View File
@@ -23,19 +23,11 @@ namespace MP.SPEC.Pages
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MsgService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async Task cancel()
{
currDetFluxLogRecord = null;
await Task.Delay(1);
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
@@ -51,9 +43,6 @@ namespace MP.SPEC.Pages
{
isLoading = true;
isFiltering = true;
// disabilito ricerca...
MsgService.SearchVal = "";
MsgService.ShowSearch = false;
// fix pagina
await Task.Delay(1);
var modFilter = currFilter;
@@ -69,25 +58,23 @@ namespace MP.SPEC.Pages
await Task.Delay(1);
}
protected async Task selRecordFlux(FluxLogDTO selRec)
private string css()
{
currDetFluxLogRecord = selRec;
await Task.Delay(1);
string answ = "";
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"))
return;
await Task.Delay(1);
if (currRecordDoss != null)
{
// METODO PER UPDATE FLUX
await MDService.updateDossierValue(currRecordDoss, selRec);
}
currDetFluxLogRecord = null;
await Task.Delay(1);
isEditing = true;
}
protected void updateTotal(int newTotCount)
@@ -105,18 +92,14 @@ namespace MP.SPEC.Pages
#region Private Properties
private FluxLogDTO? currDetFluxLogRecord
{
get => _currDetFluxLogRecord;
set { _currDetFluxLogRecord = value; }
}
private SelectDossierParams currFilter { get; set; } = new SelectDossierParams();
private int currPage
{
get => MsgService.currPage;
set => MsgService.currPage = value;
get => currFilter.CurrPage;
set => currFilter.CurrPage = value;
}
private Dossiers? currRecordDoss { get; set; } = null;
@@ -125,11 +108,19 @@ namespace MP.SPEC.Pages
private int numRecord
{
get => MsgService.numRecord;
set => MsgService.numRecord = value;
get => currFilter.NumRec;
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
@@ -146,6 +137,10 @@ namespace MP.SPEC.Pages
currFilter = newParams;
isLoading = false;
}
protected void UpdateTotCount(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Private Methods
}
+1 -1
View File
@@ -25,7 +25,7 @@
}
else
{
<ListPARAMS SelFilter="@currFilter" TotRecordChanged="@updateTotal" RecordSel="@detailSel"></ListPARAMS>
<ListPARAMS SelFilter="@currFilter" TotRecordChanged="@UpdateTotCount" RecordSel="@detailSel"></ListPARAMS>
}
</div>
<div class="card-footer py-1">
+8 -10
View File
@@ -15,8 +15,6 @@ namespace MP.SPEC.Pages
#region Protected Properties
[Inject]
protected MessageService MsgService { get; set; } = null!;
#endregion Protected Properties
@@ -43,9 +41,6 @@ namespace MP.SPEC.Pages
{
isLoading = true;
isFiltering = true;
// disabilito ricerca...
MsgService.SearchVal = "";
MsgService.ShowSearch = false;
// fix pagina
await Task.Delay(1);
var modFilter = currFilter;
@@ -100,8 +95,8 @@ namespace MP.SPEC.Pages
private int currPage
{
get => MsgService.currPage;
set => MsgService.currPage = value;
get => currFilter.CurrPage;
set => currFilter.CurrPage = value;
}
private bool isFiltering { get; set; } = false;
@@ -109,8 +104,8 @@ namespace MP.SPEC.Pages
private int numRecord
{
get => MsgService.numRecord;
set => MsgService.numRecord = value;
get => currFilter.NumRec;
set => currFilter.NumRec = value;
}
private int totalCount { get; set; } = 0;
@@ -139,7 +134,10 @@ namespace MP.SPEC.Pages
currFilter = newParams;
isLoading = false;
}
protected void UpdateTotCount(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Private Methods
}
}
+23 -14
View File
@@ -4,6 +4,7 @@ using MP.Data.DatabaseModels;
using MP.SPEC.Components;
using MP.SPEC.Data;
using MP.SPEC.Services;
using NLog;
namespace MP.SPEC.Pages
{
@@ -165,6 +166,7 @@ namespace MP.SPEC.Pages
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private PODLModel? _currRecord = null;
private List<AnagArticoli>? ListArticoli;
private List<AnagGruppi>? ListAziende;
@@ -226,6 +228,19 @@ namespace MP.SPEC.Pages
}
}
private string currFase
{
get => currFilter.CodFase;
set
{
if (!currFilter.CodFase.Equals(value))
{
currFilter.CodFase = value;
currPage = 1;
}
}
}
private SelectPOdlParams currFilter { get; set; } = new SelectPOdlParams();
private int currPage
@@ -252,19 +267,6 @@ namespace MP.SPEC.Pages
set => currFilter.NumRec = value;
}
private string currFase
{
get => currFilter.CodFase;
set
{
if (!currFilter.CodFase.Equals(value))
{
currFilter.CodFase = value;
currPage = 1;
}
}
}
private int totalCount
{
get => currFilter.TotCount;
@@ -285,7 +287,14 @@ namespace MP.SPEC.Pages
// chiamo aggiunta task SyncDb...
string idxMacc = selRec.IdxMacchina;
string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName=syncDbData&taskVal=";
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
try
{
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
}
catch (Exception exc)
{
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
}
}
private async Task reloadData()
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2210.1820</h4>
<h4>Versione: 6.16.2210.2014</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2210.1820
6.16.2210.2014
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2210.1820</version>
<version>6.16.2210.2014</version>
<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>
<mandatory>false</mandatory>
+7
View File
@@ -1,5 +1,6 @@
using Microsoft.Extensions.Configuration;
using MP.SPEC.Data;
using NLog;
using System.Text.Json;
namespace MP.SPEC.Services
@@ -18,6 +19,9 @@ namespace MP.SPEC.Services
private static IConfiguration _configuration = null!;
private static Logger Log = LogManager.GetCurrentClassLogger();
private static string MpIoBaseUrl = "";
public IOApiService(IHttpClientFactory clientFactory, IConfiguration configuration, ILogger<MpDataService> logger)
@@ -40,15 +44,18 @@ namespace MP.SPEC.Services
var request = new HttpRequestMessage(HttpMethod.Get, $"{MpIoBaseUrl}{relUrl}");
request.Headers.Add("Accept", "application/vnd.github.v3+json");
var client = _clientFactory.CreateClient();
Log.Info($"Richiesta call per {MpIoBaseUrl}{relUrl}");
var response = await client.SendAsync(request);
if (response.IsSuccessStatusCode)
{
var stringResponse = await response.Content.ReadAsStringAsync();
result = stringResponse;
Log.Info($"Richiesta call per {MpIoBaseUrl}{relUrl}");
}
else
{
result = "NO";
Log.Error($"Errore in chaimata | code {response.StatusCode} | {response.Content}");
}
return result;
}
+6
View File
@@ -5,5 +5,11 @@
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ServerConf": {
"maxAge": "2000",
"cacheCheckArtUsato": 2,
"redisLongTimeCache": 15,
"MpIoBaseUrl": "https://iis01.egalware.com/MP/IO/"
}
}
+15
View File
@@ -0,0 +1,15 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ServerConf": {
"maxAge": "2000",
"cacheCheckArtUsato": 2,
"redisLongTimeCache": 15,
"MpIoBaseUrl": "http://localhost/MP/IO/"
}
}