Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f1c295993c | |||
| a293ce825e | |||
| e3b67ee6c0 | |||
| 0c5e41826e | |||
| 0d4e1aed88 | |||
| 93f4f09b85 | |||
| aebae6b406 | |||
| a2bf5f4a8b | |||
| 759373b5a4 | |||
| 0ea3ee6341 | |||
| a0ffe1bc6c | |||
| 6e75f590bb | |||
| 12473b5088 | |||
| f6406f833f | |||
| a21cd16362 | |||
| d659afacc2 | |||
| 56c3ba4064 | |||
| 8d0292d789 | |||
| 419863a684 | |||
| f56a7e5164 | |||
| 0cf6ecd38f | |||
| 094ce0d181 | |||
| b4de1c9880 |
@@ -333,10 +333,10 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
||||
/// <param name="CodArticolo">* = tutti, altrimenti solo x un dato articolo</param>
|
||||
/// <param name="DtRef">Data di riferimento (Massima) per estrazioen records</param>
|
||||
/// <param name="MaxRec">numero massimo record da restituire</param>
|
||||
/// <param name="DtStart">Data minima per estrazione records</param>
|
||||
/// <param name="DtEnd">Data Massima per estrazione records</param>
|
||||
/// <returns></returns>
|
||||
public List<Dossiers> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtRef, int MaxRec)
|
||||
public List<Dossiers> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd)
|
||||
{
|
||||
List<Dossiers> dbResult = new List<Dossiers>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
@@ -344,12 +344,11 @@ namespace MP.Data.Controllers
|
||||
dbResult = dbCtx
|
||||
.DbSetDossiers
|
||||
.AsNoTracking()
|
||||
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodArticolo == "*" || x.OdlNav.CodArticolo == CodArticolo) && x.DtRif <= DtRef)
|
||||
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodArticolo == "*" || x.OdlNav.CodArticolo == CodArticolo) && (x.DtRif >= DtStart && x.DtRif <= DtEnd))
|
||||
.Include(m => m.MachineNav)
|
||||
.Include(o => o.OdlNav)
|
||||
.Include(a => a.OdlNav.ArticoloNav)
|
||||
.OrderByDescending(x => x.DtRif)
|
||||
.Take(MaxRec)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
@@ -602,10 +601,12 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco id Macchine che abbiano dati FLuxLog
|
||||
/// Elenco id Macchine che abbiano dati FLuxLog, nel periodo indicato
|
||||
/// </summary>
|
||||
/// <param name="dtStart"></param>
|
||||
/// <param name="dtEnd"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<string>> MacchineWithFlux()
|
||||
public async Task<List<string>> MacchineWithFlux(DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
List<string> dbResult = new List<string>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
@@ -613,6 +614,7 @@ namespace MP.Data.Controllers
|
||||
dbResult = await dbCtx
|
||||
.DbSetFluxLog
|
||||
.AsNoTracking()
|
||||
.Where(x => x.dtEvento >= dtStart && x.dtEvento <= dtEnd)
|
||||
.Select(i => i.IdxMacchina)
|
||||
.Distinct()
|
||||
.ToListAsync();
|
||||
@@ -742,19 +744,18 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero Odl CORRENTE x macchina (SE c'è)
|
||||
/// Recupero Odl CORRENTI
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public ODLModel OdlGetCurrentByMacc(string idxMacchina)
|
||||
public List<ODLModel> OdlGetCurrent()
|
||||
{
|
||||
ODLModel dbResult = new ODLModel();
|
||||
|
||||
List<ODLModel> dbResult = new List<ODLModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetODL
|
||||
.FirstOrDefault(x => x.IdxMacchina == idxMacchina && x.DataInizio != null && x.DataFine == null);
|
||||
.Where(x => x.DataInizio != null && x.DataFine == null)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
@@ -796,8 +797,10 @@ namespace MP.Data.Controllers
|
||||
.DbSetFluxLog
|
||||
.AsNoTracking()
|
||||
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina))
|
||||
.Take(1000)
|
||||
.Select(i => i.CodFlux)
|
||||
.Distinct()
|
||||
.OrderBy(x => x)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
@@ -932,6 +935,7 @@ namespace MP.Data.Controllers
|
||||
currRec.KeyRichiesta = editRec.KeyRichiesta;
|
||||
currRec.NumPezzi = editRec.NumPezzi;
|
||||
currRec.Tcassegnato = editRec.Tcassegnato;
|
||||
currRec.Attivabile = editRec.Attivabile;
|
||||
currRec.Note = editRec.Note;
|
||||
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data;
|
||||
using MP.SPEC.Data;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace MP.SPEC.Components.Chart
|
||||
@@ -28,7 +29,7 @@ namespace MP.SPEC.Components.Chart
|
||||
public double[] Data { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string[] BackgroundColor { get; set; }
|
||||
public List<DoughnutStyling> BackgroundColor { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string[] Labels { get; set; }
|
||||
@@ -46,7 +47,7 @@ namespace MP.SPEC.Components.Chart
|
||||
{
|
||||
Datasets = new[]
|
||||
{
|
||||
new { Data = Data, BackgroundColor = BackgroundColor
|
||||
new { Data = Data, BackgroundColor = BackgroundColor.Select(x=>x.color), borderColor = BackgroundColor.Select(x=>x.border), borderWidth= 0, offset= 1, borderRadius = 0
|
||||
}
|
||||
},
|
||||
Labels = Labels
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace MP.SPEC.Components
|
||||
|
||||
protected int _numRecord { get; set; } = 10;
|
||||
|
||||
protected int percLoading { get; set; } = 0;
|
||||
protected int percLoading { get; set; } = 0;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
|
||||
@@ -37,7 +37,22 @@
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group p-2">
|
||||
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Inizio Periodo</label>
|
||||
</div>
|
||||
<div class="px-2 input-group">
|
||||
<label class="input-group-text" for="dtMin" title="Selezionare inizio periodo"><i class="fa-regular fa-calendar-minus"></i></label>
|
||||
<input class="form-control" @bind="@selDtMin" id="dtMin" type="datetime-local" title="Data minima eventi da visualizzare">
|
||||
</div>
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="dtMax" title="Selezionare fine periodo">Fine Periodo</label>
|
||||
</div>
|
||||
<div class="px-2 input-group">
|
||||
<label class="input-group-text" for="dtMax" title="Selezionare fine periodo"><i class="fa-regular fa-calendar-plus"></i></label>
|
||||
<input class="form-control" @bind="@selDtMax" id="dtMax" type="datetime-local" title="Selezionare fine periodo">
|
||||
</div>
|
||||
@*<div class="input-group p-2">
|
||||
<label class="input-group-text" for="DtMin" title="Selezionare la data da visualizzare"><i class="fa-solid fa-calendar-check"></i></label>
|
||||
<input @bind="@selDtRef" id="DtMin" class="form-control" type="datetime-local" title="Selezionare la data minima da visualizzare" />
|
||||
</div>
|
||||
@@ -49,7 +64,7 @@
|
||||
<option value="250">250</option>
|
||||
<option value="500">500</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>*@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -39,18 +39,35 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
}
|
||||
|
||||
protected DateTime selDtRef
|
||||
protected DateTime selDtMax
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilterDossier.DtRef;
|
||||
return SelFilterDossier.DtEnd;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (!SelFilterDossier.DtRef.Equals(value))
|
||||
if (!SelFilterDossier.DtEnd.Equals(value))
|
||||
{
|
||||
SelFilterDossier.DtRef = value;
|
||||
SelFilterDossier.DtEnd = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected DateTime selDtMin
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilterDossier.DtStart;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (!SelFilterDossier.DtStart.Equals(value))
|
||||
{
|
||||
SelFilterDossier.DtStart = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
@@ -101,7 +118,9 @@ namespace MP.SPEC.Components
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
SelFilterDossier = new SelectDossierParams();
|
||||
ListMacchine = await MDService.MacchineWithFlux();
|
||||
DateTime dtEnd = SelFilterDossier.DtEnd;
|
||||
DateTime dtStart = dtEnd.Subtract(SelFilterDossier.DtStart).TotalDays < 15 ? SelFilterDossier.DtStart : dtEnd.AddDays(-14);
|
||||
ListMacchine = await MDService.MacchineWithFlux(dtStart, dtEnd);
|
||||
ListArticoli = await MDService.ArticleWithDossier();
|
||||
await FilterChanged.InvokeAsync(SelFilterDossier);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ else
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button @onclick="() => unToggleTableFlux()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||
<button @onclick="() => closeTableFlux()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||
</th>
|
||||
<th><i class="fa-solid fa-file"></i> Articolo</th>
|
||||
<th><i class="fa-solid fa-screwdriver-wrench"></i> Fase</th>
|
||||
@@ -75,15 +75,15 @@ else
|
||||
<table class="table table-light table-sm table-striped small mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>
|
||||
<button class="btn btn-info" @onclick="() => closeTableFlux()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</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-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>
|
||||
<button class="btn btn-primary btn-sm py-0" @onclick="() => unToggleTableFlux()"><i class="fa-solid fa-xmark"></i></button>
|
||||
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
@@ -91,7 +91,7 @@ else
|
||||
<tbody>
|
||||
@foreach (var record in listaFlux)
|
||||
{
|
||||
<tr>
|
||||
<tr class="@checkSelPar(@record)">
|
||||
<td>
|
||||
<button @onclick="() => editRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
|
||||
</td>
|
||||
@@ -105,8 +105,15 @@ else
|
||||
@record.CodFlux
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<div><span class="small text-dark">Modificato: </span><b>@record.ValoreEdit</b></div>
|
||||
<div class="small text-secondary"><span class="small text-dark">Originale: </span><i>@record.Valore</i></div>
|
||||
@if (record.ValoreEdit != record.Valore)
|
||||
{
|
||||
<div title="Valore Modificato"><span class="small text-dark"></span><b>@record.ValoreEdit</b></div>
|
||||
<div class="small text-secondary" title="Valore Registrato">(<i>@record.Valore</i>)</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div><span class="small text-dark"></span>@record.ValoreEdit</div>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
@@ -6,7 +7,7 @@ using MP.SPEC.Data;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ListDossiers
|
||||
public partial class ListDossiers : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
@@ -26,6 +27,24 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Public Methods
|
||||
|
||||
private FluxLogDTO? currFluxLogDto = null;
|
||||
|
||||
|
||||
public string checkSelPar(FluxLogDTO recordSel)
|
||||
{
|
||||
string answ = "";
|
||||
if (currFluxLogDto != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = (currFluxLogDto.CodFlux == recordSel.CodFlux && currFluxLogDto.dtEvento== recordSel.dtEvento) ? "table-info" : "";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public string checkSelect(Dossiers recordSel)
|
||||
{
|
||||
string answ = "";
|
||||
@@ -40,6 +59,16 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
|
||||
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
@@ -77,22 +106,11 @@ namespace MP.SPEC.Components
|
||||
|
||||
protected async Task editRecord(FluxLogDTO selRec)
|
||||
{
|
||||
currFluxLogDto = selRec;
|
||||
// indico record selezionato
|
||||
await RecordSelFlux.InvokeAsync(selRec);
|
||||
}
|
||||
|
||||
protected string findRec(FluxLog record)
|
||||
{
|
||||
string answ = "";
|
||||
#if false
|
||||
if (ListRecordsMod != null)
|
||||
{
|
||||
answ = ListRecordsMod.Where(l => l.IdxMacchina == record.IdxMacchina && l.CodFlux == record.CodFlux).Select(x => x.Valore).SingleOrDefault();
|
||||
}
|
||||
#endif
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
|
||||
@@ -168,9 +186,13 @@ namespace MP.SPEC.Components
|
||||
get => SelFilter.CodArticolo;
|
||||
}
|
||||
|
||||
private DateTime SelDtRef
|
||||
private DateTime SelDtEnd
|
||||
{
|
||||
get => SelFilter.DtRef;
|
||||
get => SelFilter.DtEnd;
|
||||
}
|
||||
private DateTime SelDtStart
|
||||
{
|
||||
get => SelFilter.DtStart;
|
||||
}
|
||||
|
||||
private string SelMacchina
|
||||
@@ -205,7 +227,7 @@ namespace MP.SPEC.Components
|
||||
private async Task reloadData(bool setChanged)
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelArticolo, SelDtRef, MaxRecord);
|
||||
SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelArticolo, SelDtStart, SelDtEnd);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
@@ -236,10 +258,12 @@ namespace MP.SPEC.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
private async Task unToggleTableFlux()
|
||||
private async Task closeTableFlux()
|
||||
{
|
||||
currFluxLogDto = null;
|
||||
currRecord = null;
|
||||
visualizzaFlux = true;
|
||||
await RecordSelFlux.InvokeAsync(currFluxLogDto);
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,14 @@ else
|
||||
@if (currRecord != null && !showStats && isCurrOdl)
|
||||
{
|
||||
<div class="col-6 col-lg-8">
|
||||
<button @onclick="() => forceSyncDb()" class="btn btn-success btn-sm btn-">Forza sync dati ODL <i class="bi bi-fast-forward-circle"></i></button>
|
||||
</div>
|
||||
<div class="col-6 col-lg-4 text-end">
|
||||
@*<div class="px-2 input-group" title="Selezionare Data-Ora chiusura ODL">
|
||||
<label class="input-group-text" for="dtMax"><i class="fa-regular fa-calendar-minus"></i></label>
|
||||
<input class="form-control" @bind="@selDtFine" id="dtMax" type="datetime-local">
|
||||
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm btn-">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
|
||||
</div>*@
|
||||
<label class="input-group-text" for="dtMax"><i class="fa-regular fa-calendar-minus"></i></label>
|
||||
<input class="form-control" @bind="@selDtFine" id="dtMax" type="datetime-local">
|
||||
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm btn-">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
|
||||
</div>*@
|
||||
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm btn-">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
|
||||
</div>
|
||||
}
|
||||
@@ -178,10 +179,6 @@ else
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<!-- Modal -->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -224,7 +221,7 @@ else
|
||||
|
||||
</div>
|
||||
<div class="progress">
|
||||
<div class="progress-bar @colorChanger(@stat.Css)" role="progressbar" aria-valuenow="0" aria-valuemin="0" style="width: @Math.Round(calcolaPerc(stat.TotDurata),0)%; background-color:@stat.Css;" aria-valuemax="100">@($"{calcolaPerc(stat.TotDurata):N1}%")</div>
|
||||
<div class="progress-bar @colorChanger(@stat.Css)" role="progressbar" aria-valuenow="0" aria-valuemin="0" style="width: @Math.Round(calcolaPerc(stat.TotDurata),0)%; background-color:@pbStyle(@stat.Css);" aria-valuemax="100">@($"{calcolaPerc(stat.TotDurata):N1}%")</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.SPEC.Data;
|
||||
using MP.SPEC.Pages;
|
||||
using System.Xml.Linq;
|
||||
using MP.SPEC.Services;
|
||||
using NLog;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ListODL
|
||||
public partial class ListODL : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
@@ -40,39 +39,26 @@ namespace MP.SPEC.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
ListStati = null;
|
||||
ListOdlStats = null;
|
||||
statRecord = null;
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
public string formDurata(double durataMin)
|
||||
{
|
||||
return MP.Data.Utils.FormDurata(durataMin);
|
||||
}
|
||||
|
||||
//oggetto contenente le funzioni del code behind che sono jsInvokable
|
||||
private DotNetObjectReference<ListODL>? objRef;
|
||||
|
||||
#if false //FUNZIONA SE IL METODO TriggerDotNetInstanceMethod() E' IN ONCLICK BOTTONE
|
||||
|
||||
[JSInvokable]
|
||||
public void setHelper()
|
||||
{
|
||||
objRef = DotNetObjectReference.Create(this);
|
||||
}
|
||||
[JSInvokable]
|
||||
public void svuotaRecord()
|
||||
{
|
||||
currRecord = null;
|
||||
|
||||
}
|
||||
public async Task TriggerDotNetInstanceMethod()
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("recordDeselect", objRef);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
|
||||
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
@@ -80,7 +66,7 @@ namespace MP.SPEC.Components
|
||||
protected MpDataService MDService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected MessageService MessageService { get; set; } = null!;
|
||||
protected IOApiService MpIoApiCall { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
@@ -99,24 +85,13 @@ 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 reloadData();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
objRef = DotNetObjectReference.Create(this);
|
||||
//await JSRuntime.InvokeVoidAsync("setHelper", objRef);
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected string colorChanger(string colorCSS)
|
||||
{
|
||||
string answ = "";
|
||||
@@ -127,13 +102,34 @@ namespace MP.SPEC.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
//protected double durataMin(DateTime? DataInizio, DateTime? DataFine)
|
||||
//{
|
||||
// DateTime end = DataInizio != null ? (DateTime)DataFine : DateTime.Now;
|
||||
// var tsDurata = (end).Subtract((DateTime)DataInizio);
|
||||
/// <summary>
|
||||
/// Richiesta invio sync all'IOB-WIN
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task forceSyncDb()
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sei sicuro di voler reinviare i dati (Articoli, PODL) all'impianto?"))
|
||||
return;
|
||||
|
||||
// return tsDurata.TotalMinutes;
|
||||
//}
|
||||
if (currRecord != null)
|
||||
{
|
||||
await callSyncDb(currRecord.IdxMacchina);
|
||||
Log.Info($"Richiesto forceSyncDb per idxMacc {currRecord.IdxMacchina}");
|
||||
// ricarica...
|
||||
await selectRecord(null);
|
||||
}
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async void OnSeachUpdated()
|
||||
{
|
||||
@@ -167,6 +163,7 @@ namespace MP.SPEC.Components
|
||||
ListOdlStats = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task selectStatRecord(ODLModel? currRec)
|
||||
{
|
||||
showStats = true;
|
||||
@@ -203,10 +200,9 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private ODLModel? currRecord = null;
|
||||
|
||||
private ODLModel? statRecord = null;
|
||||
|
||||
private List<StatODLModel>? ListOdlStats;
|
||||
|
||||
private List<ODLModel>? ListRecords;
|
||||
@@ -215,14 +211,18 @@ namespace MP.SPEC.Components
|
||||
|
||||
private List<ODLModel>? SearchRecords;
|
||||
|
||||
private ODLModel? statRecord = null;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int _totalCount { get; set; } = 0;
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => MessageService.currPage;
|
||||
set => MessageService.currPage = value;
|
||||
get => currFilter.CurrPage;
|
||||
set => currFilter.CurrPage = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -237,22 +237,50 @@ namespace MP.SPEC.Components
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
get => MessageService.numRecord;
|
||||
set => MessageService.numRecord = value;
|
||||
get => currFilter.NumRec;
|
||||
set => currFilter.NumRec = value;
|
||||
}
|
||||
|
||||
private DateTime selDtFine { get; set; } = DateTime.Now;
|
||||
|
||||
private bool showStats { get; set; } = false;
|
||||
#if false
|
||||
private List<double>? ListOdlStatsData = new List<double>();
|
||||
private List<string>? ListOdlStatsLabels = new List<string>();
|
||||
#endif
|
||||
private int totalCount { get; set; } = 0;
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
if (_totalCount != value)
|
||||
{
|
||||
_totalCount = value;
|
||||
updateRecordCount.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Chiama metodo x chiedere sync DB
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task addTask2Exe(string idxMacc, string taskName, string taskVal)
|
||||
{
|
||||
// compongo URL e chiamo
|
||||
string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName={taskName}&taskVal={taskVal}";
|
||||
try
|
||||
{
|
||||
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
|
||||
private double calcolaPerc(double durata)
|
||||
{
|
||||
double answ = 0;
|
||||
@@ -278,9 +306,36 @@ namespace MP.SPEC.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
private async void MessageService_EA_PageUpdated()
|
||||
/// <summary>
|
||||
/// Chiama metodo x chiedere sync DB
|
||||
/// </summary>
|
||||
/// <param name="IdxMacc"></param>
|
||||
/// <returns></returns>
|
||||
private async Task callSyncDb(string IdxMacc)
|
||||
{
|
||||
await reloadData();
|
||||
// chiamo aggiunta task SyncDb...
|
||||
await addTask2Exe(IdxMacc, "syncDbData", "");
|
||||
}
|
||||
|
||||
private string pbStyle(string css)
|
||||
{
|
||||
string answ = "";
|
||||
if (ListOdlStats != null)
|
||||
{
|
||||
if (css == "yellow")
|
||||
{
|
||||
answ = "orange";
|
||||
}
|
||||
else if (css == "blue")
|
||||
{
|
||||
answ = "#2874A6";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = css;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private async Task reloadData()
|
||||
@@ -291,7 +346,6 @@ namespace MP.SPEC.Components
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
await updateRecordCount.InvokeAsync(totalCount);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,10 @@ namespace MP.SPEC.Components
|
||||
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@using MP.SPEC.Components
|
||||
@using MP.SPEC.Data
|
||||
|
||||
@if (ListRecords == null)
|
||||
@if (ListRecords == null || isLoading)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
|
||||
@@ -3,13 +3,17 @@ using Microsoft.JSInterop;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.SPEC.Data;
|
||||
using MP.SPEC.Services;
|
||||
using NLog;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ListPODL
|
||||
public partial class ListPODL : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams();
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> PagerResetReq { get; set; }
|
||||
|
||||
@@ -38,6 +42,15 @@ namespace MP.SPEC.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
ListStati = null;
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
@@ -51,9 +64,6 @@ namespace MP.SPEC.Components
|
||||
[Inject]
|
||||
protected IOApiService MpIoApiCall { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -103,15 +113,17 @@ namespace MP.SPEC.Components
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
MsgService.EA_PageUpdated += MessageService_EA_PageUpdated;
|
||||
MsgService.EA_SearchUpdated += OnSeachUpdated;
|
||||
MsgService.EA_StatoSearch += MsgService_EA_StatoSearch;
|
||||
//await FilterChanged.InvokeAsync(actFilter);
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await reloadData();
|
||||
if (!lastFilter.Equals(actFilter))
|
||||
{
|
||||
lastFilter = actFilter.clone();
|
||||
await reloadData();
|
||||
}
|
||||
}
|
||||
|
||||
protected async void OnSeachUpdated()
|
||||
@@ -198,44 +210,67 @@ 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
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int _totalCount { get; set; } = 0;
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => MsgService.currPage;
|
||||
set => MsgService.currPage = value;
|
||||
get => actFilter.CurrPage;
|
||||
set => actFilter.CurrPage = value;
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 };
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
get => MsgService.numRecord;
|
||||
set => MsgService.numRecord = value;
|
||||
get => actFilter.NumRec;
|
||||
set => actFilter.NumRec = value;
|
||||
}
|
||||
|
||||
private string SearchVal
|
||||
{
|
||||
get => string.IsNullOrEmpty(MsgService.SearchVal) ? "*" : MsgService.SearchVal;
|
||||
get => string.IsNullOrEmpty(actFilter.SearchVal) ? "*" : actFilter.SearchVal;
|
||||
}
|
||||
|
||||
private string StatoSel
|
||||
{
|
||||
get => MsgService.StateSel;
|
||||
set => MsgService.StateSel = value;
|
||||
get => actFilter.CodFase;
|
||||
set => actFilter.CodFase = value;
|
||||
}
|
||||
|
||||
private int totalCount { get; set; } = 0;
|
||||
private int totalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
if (_totalCount != value)
|
||||
{
|
||||
_totalCount = value;
|
||||
updateRecordCount.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
@@ -254,8 +289,9 @@ namespace MP.SPEC.Components
|
||||
{
|
||||
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
|
||||
}
|
||||
catch(Exception exc)
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,11 +326,6 @@ namespace MP.SPEC.Components
|
||||
{
|
||||
// chiamo aggiunta task SyncDb...
|
||||
await addTask2Exe(IdxMacc, "syncDbData", "");
|
||||
#if false
|
||||
string idxMacc = selRec.IdxMacchina;
|
||||
string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName=syncDbData&taskVal=";
|
||||
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -304,25 +335,16 @@ namespace MP.SPEC.Components
|
||||
/// <returns></returns>
|
||||
private bool canStartOdl(string idxMacchina)
|
||||
{
|
||||
var currOdl = MDService.OdlGetCurrentByMacc(idxMacchina);
|
||||
bool answ = currOdl == null;
|
||||
return answ;
|
||||
}
|
||||
|
||||
private async void MessageService_EA_PageUpdated()
|
||||
{
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
private async void MsgService_EA_StatoSearch()
|
||||
{
|
||||
await InvokeAsync(() =>
|
||||
// controllo se lista scaduta...
|
||||
bool answ = false;
|
||||
DateTime adesso = DateTime.Now;
|
||||
if (adesso > odlCurrExp || odlCurrList == null || odlCurrList.Count == 0)
|
||||
{
|
||||
PagerResetReq.InvokeAsync(true);
|
||||
//currPage = 1;
|
||||
Task task = UpdateData();
|
||||
StateHasChanged();
|
||||
});
|
||||
odlCurrList = MDService.OdlGetCurrent();
|
||||
odlCurrExp = adesso.AddSeconds(2);
|
||||
}
|
||||
answ = !odlCurrList.Contains(idxMacchina);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -367,7 +389,7 @@ namespace MP.SPEC.Components
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
await updateRecordCount.InvokeAsync(totalCount);
|
||||
//await updateRecordCount.InvokeAsync(totalCount);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<MP.SPEC.Components.Chart.Doughnut Type="@Chart.Doughnut.ChartType.Doughnut" Data="@Data.ToArray()" BackgroundColor="@colors.ToArray()"></MP.SPEC.Components.Chart.Doughnut>
|
||||
<MP.SPEC.Components.Chart.Doughnut Type="@Chart.Doughnut.ChartType.Doughnut" Data="@Data.ToArray()" BackgroundColor="@colors"></MP.SPEC.Components.Chart.Doughnut>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@@ -49,7 +49,7 @@ namespace MP.SPEC.Components
|
||||
|
||||
public List<double> Data = new List<double>();
|
||||
public List<string> Labels = new List<string>();
|
||||
public List<string> colors = new List<string>();
|
||||
public List<DoughnutStyling> colors = new List<DoughnutStyling>();
|
||||
|
||||
protected async Task ReloadData()
|
||||
{
|
||||
@@ -61,7 +61,20 @@ namespace MP.SPEC.Components
|
||||
{
|
||||
Data.Add(record.TotDurata);
|
||||
Labels.Add($"{record.Descrizione} - {record.TotDurata:N1}min");
|
||||
colors.Add($"{record.Css}");
|
||||
if (record.Css == "yellow")
|
||||
{
|
||||
colors.Add(new DoughnutStyling("orange", "ccc"));
|
||||
}
|
||||
else if (record.Css == "blue")
|
||||
{
|
||||
colors.Add(new DoughnutStyling("#2874A6", "ccc"));
|
||||
}
|
||||
else
|
||||
{
|
||||
colors.Add(new DoughnutStyling(record.Css, "ccc"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex justify-content-between pt-1 mb-1">
|
||||
<div class="px-2">
|
||||
|
||||
@if (!liveUpdate)
|
||||
{
|
||||
<button class="btn btn-secondary" type="button" @onclick="() => toggleUpdate()" title="Click per tornare a Valori Live">
|
||||
|
||||
@@ -168,7 +168,10 @@ namespace MP.SPEC.Components
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
SelFilter = new SelectFluxParams();
|
||||
ListMacchine = await MDService.MacchineWithFlux();
|
||||
setDtMax();
|
||||
DateTime dtStart = SelFilter.dtMin != null ? (DateTime)SelFilter.dtMin : DateTime.Now.AddDays(-7);
|
||||
DateTime dtEnd = SelFilter.dtMax != null ? (DateTime)SelFilter.dtMax : DateTime.Now;
|
||||
ListMacchine = await MDService.MacchineWithFlux(dtStart, dtEnd);
|
||||
ListFlux = await MDService.ParametriGetFilt(selMacchina);
|
||||
|
||||
var configData = await MDService.ConfigGetAll();
|
||||
@@ -186,7 +189,7 @@ namespace MP.SPEC.Components
|
||||
// copio il filtro
|
||||
var currFilt = SelFilter;
|
||||
// fermo update
|
||||
//currFilt.LiveUpdate = false;
|
||||
currFilt.LiveUpdate = true;
|
||||
currFilt.CurrPage = 0;
|
||||
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
currFilt.dtMax = RoundDatetime(5);
|
||||
@@ -210,9 +213,8 @@ namespace MP.SPEC.Components
|
||||
// se non ho data rif uso adesso...
|
||||
DateTime dtMax = selDtMax == null ? RoundDatetime(5) : (DateTime)selDtMax;
|
||||
DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddHours(-numOreAnticipoSnapshot) : (DateTime)selDtMin;
|
||||
// aggiungo 2 sec
|
||||
// aggiungo 15 sec
|
||||
dtMax = dtMax.AddSeconds(15);
|
||||
//dtMin = dtMin.AddMinutes(-30);
|
||||
await MDService.DossiersTakeParamsSnapshotLast(selMacchina, dtMin, dtMax);
|
||||
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
// indico snapshot fatto
|
||||
@@ -267,7 +269,7 @@ namespace MP.SPEC.Components
|
||||
// copio il filtro
|
||||
var currFilt = SelFilter;
|
||||
// fermo update
|
||||
currFilt.LiveUpdate = false;
|
||||
currFilt.LiveUpdate = (value == null);
|
||||
currFilt.CurrPage = 0;
|
||||
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
currFilt.dtMax = value;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace MP.SPEC.Data
|
||||
{
|
||||
public class DoughnutStyling
|
||||
{
|
||||
public string color { get; set; }
|
||||
public string border { get; set; }
|
||||
|
||||
public DoughnutStyling(string color, string border)
|
||||
{
|
||||
this.color = color;
|
||||
this.border = border;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ namespace MP.SPEC.Data
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.AnagStatiComm());
|
||||
// serializzp e salvo...
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(redisStatoCom, rawData, getRandTOut(redisLongTimeCache));
|
||||
stopWatch.Stop();
|
||||
@@ -113,7 +113,7 @@ namespace MP.SPEC.Data
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.AnagTipoArtLV());
|
||||
// serializzp e salvo...
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(redisTipoArt, rawData, getRandTOut(redisLongTimeCache));
|
||||
stopWatch.Stop();
|
||||
@@ -148,7 +148,7 @@ namespace MP.SPEC.Data
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.ArticleWithDossier());
|
||||
// serializzp e salvo...
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
}
|
||||
@@ -277,7 +277,7 @@ namespace MP.SPEC.Data
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.ConfigGetAll());
|
||||
// serializzp e salvo...
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(redisConfKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
stopWatch.Stop();
|
||||
@@ -341,16 +341,16 @@ namespace MP.SPEC.Data
|
||||
/// macchina (ordinato x data registrazione)
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
||||
/// <param name="DtRef">Data di riferimento (Massima) per estrazione records</param>
|
||||
/// <param name="MaxRec">numero massimo record da restituire</param>
|
||||
/// <param name="DtStart">Data minima per estrazione records</param>
|
||||
/// <param name="DtEnd">Data Massima per estrazione records</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<Dossiers>> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtRef, int MaxRec)
|
||||
public async Task<List<Dossiers>> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd)
|
||||
{
|
||||
List<Dossiers>? result = new List<Dossiers>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{redisDossByMac}:{IdxMacchina}:{CodArticolo}:{DtRef}:{MaxRec}";
|
||||
string currKey = $"{redisDossByMac}:{IdxMacchina}:{CodArticolo}:{DtStart:yyyyMMddHHmm}:{DtEnd:yyyyMMddHHmm}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
@@ -360,8 +360,8 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, CodArticolo, DtRef, MaxRec));
|
||||
// serializzp e salvo...
|
||||
result = await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, CodArticolo, DtStart, DtEnd));
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache / 5));
|
||||
}
|
||||
@@ -468,13 +468,33 @@ namespace MP.SPEC.Data
|
||||
/// <returns></returns>
|
||||
public async Task<List<FluxLog>> FluxLogGetLastFilt(DateTime DtMax, string IdxMacchina, string CodFlux, int MaxRec)
|
||||
{
|
||||
List<FluxLog>? result = new List<FluxLog>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
var results = await Task.FromResult(dbController.FluxLogGetLastFilt(DtMax, IdxMacchina, CodFlux, MaxRec));
|
||||
string readType = "DB";
|
||||
string currKey = $"{redisFluxLogFilt}:{IdxMacchina}:{CodFlux}:{MaxRec}:{DtMax:yyyyMMdd}:{DtMax:HHmm}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<FluxLog>>($"{rawData}");
|
||||
readType = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.FluxLogGetLastFilt(DtMax, IdxMacchina, CodFlux, MaxRec));
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(10));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<FluxLog>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"FluxLogGetLastFilt | Read from DB: {ts.TotalMilliseconds}ms");
|
||||
return results;
|
||||
Log.Debug($"FluxLogGetLastFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -546,7 +566,35 @@ namespace MP.SPEC.Data
|
||||
/// <returns></returns>
|
||||
public async Task<List<PODLModel>> ListPODLFilt(string codArt, string keyRichPart)
|
||||
{
|
||||
return await Task.FromResult(dbController.ListPODLFilt(codArt, keyRichPart));
|
||||
List<PODLModel>? result = new List<PODLModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{redisPOdlList}:{codArt}:{keyRichPart}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<PODLModel>>($"{rawData}");
|
||||
readType = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.ListPODLFilt(codArt, keyRichPart));
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<PODLModel>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ListPODLFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -570,7 +618,7 @@ namespace MP.SPEC.Data
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.MacchineGetAll());
|
||||
// serializzp e salvo...
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
}
|
||||
@@ -585,16 +633,18 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ID macchine con dati FluxLog gestite
|
||||
/// Elenco id Macchine che abbiano dati FLuxLog, nel periodo indicato
|
||||
/// </summary>
|
||||
/// <param name="dtStart"></param>
|
||||
/// <param name="dtEnd"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<string>> MacchineWithFlux()
|
||||
public async Task<List<string>> MacchineWithFlux(DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
List<string>? result = new List<string>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = redisMacByFlux;
|
||||
string currKey = $"{redisMacByFlux}:{dtStart:yyyyMMddHHmm}:{dtEnd:yyyyMMddHHmm}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
@@ -604,8 +654,8 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await dbController.MacchineWithFlux();
|
||||
// serializzp e salvo...
|
||||
result = await dbController.MacchineWithFlux(dtStart, dtEnd);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
}
|
||||
@@ -665,38 +715,42 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ODL corrente x macchina
|
||||
/// ODL correnti (tutti)
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public ODLModel OdlGetCurrentByMacc(string idxMacchina)
|
||||
public List<string> OdlGetCurrent()
|
||||
{
|
||||
ODLModel dbResult = new ODLModel();
|
||||
List<string> dbResult = new List<string>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{redisOdlCurrByMac}:{idxMacchina}";
|
||||
string currKey = $"{redisOdlCurrByMac}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
dbResult = JsonConvert.DeserializeObject<ODLModel>($"{rawData}");
|
||||
try
|
||||
{
|
||||
dbResult = JsonConvert.DeserializeObject<List<string>>($"{rawData}");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
readType = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbController.OdlGetCurrentByMacc(idxMacchina);
|
||||
// serializzp e salvo...
|
||||
dbResult = dbController.OdlGetCurrent().Select(x => x.IdxMacchina).Distinct().ToList();
|
||||
rawData = JsonConvert.SerializeObject(dbResult);
|
||||
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3));
|
||||
}
|
||||
if (dbResult == null)
|
||||
{
|
||||
dbResult = new ODLModel();
|
||||
dbResult = new List<string>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"OdlGetCurrentByMacc | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
Log.Debug($"OdlGetCurrent | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
|
||||
|
||||
return dbResult;
|
||||
@@ -724,7 +778,7 @@ namespace MP.SPEC.Data
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.ParametriGetFilt(IdxMacchina));
|
||||
// serializzp e salvo...
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
}
|
||||
@@ -775,7 +829,12 @@ namespace MP.SPEC.Data
|
||||
/// <returns></returns>
|
||||
public async Task<bool> POdlUpdateRecord(PODLModel currRec)
|
||||
{
|
||||
return await dbController.PODLUpdateRecord(currRec);
|
||||
var dbResult = await dbController.PODLUpdateRecord(currRec);
|
||||
// elimino cache redis...
|
||||
RedisValue pattern = new RedisValue($"{redisPOdlList}:*");
|
||||
bool answ = await ExecFlushRedisPattern(pattern);
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -864,6 +923,8 @@ namespace MP.SPEC.Data
|
||||
|
||||
private const string redisMacByFlux = redisBaseAddr + "SPEC:Cache:MacByFlux";
|
||||
private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList";
|
||||
private const string redisPOdlList = redisBaseAddr + "SPEC:Cache:POdlList";
|
||||
private const string redisFluxLogFilt = redisBaseAddr + "SPEC:Cache:FluxLogFilt";
|
||||
|
||||
private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom";
|
||||
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
|
||||
public int CurrPage { get; set; } = 1;
|
||||
|
||||
public DateTime DtRef { get; set; } = InitDatetime(5);
|
||||
public DateTime DtEnd { get; set; } = InitDatetime(5);
|
||||
|
||||
public DateTime DtStart { get; set; } = InitDatetime(5).AddDays(-730);
|
||||
|
||||
public string IdxMacchina { get; set; } = "*";
|
||||
|
||||
@@ -52,14 +54,12 @@
|
||||
if (MaxRecord != item.MaxRecord)
|
||||
return false;
|
||||
|
||||
if (DtRef != item.DtRef)
|
||||
if (DtEnd != item.DtEnd)
|
||||
return false;
|
||||
|
||||
if (CurrPage != item.CurrPage)
|
||||
return false;
|
||||
|
||||
//if (lastUpdate != item.lastUpdate)
|
||||
// return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace MP.SPEC.Data
|
||||
public string IdxMacchina { get; set; } = "*";
|
||||
public int CurrPage { get; set; } = 1;
|
||||
public int NumRec { get; set; } = 10;
|
||||
public int TotCount { get; set; } = 0;
|
||||
public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
|
||||
public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-7);
|
||||
public int MaxRecord { get; set; } = 100;
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
namespace MP.SPEC.Data
|
||||
{
|
||||
public class SelectPOdlParams
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public SelectPOdlParams()
|
||||
{ }
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public string CodFase { get; set; } = "*";
|
||||
|
||||
public int CurrPage { get; set; } = 1;
|
||||
|
||||
public string IdxMacchina { get; set; } = "*";
|
||||
|
||||
public int MaxRecord { get; set; } = 100;
|
||||
|
||||
public int NumRec { get; set; } = 10;
|
||||
|
||||
public string SearchVal { get; set; } = "*";
|
||||
|
||||
public int TotCount { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public SelectPOdlParams clone()
|
||||
{
|
||||
SelectPOdlParams clonedData = new SelectPOdlParams()
|
||||
{
|
||||
CodFase = this.CodFase,
|
||||
CurrPage = this.CurrPage,
|
||||
IdxMacchina = this.IdxMacchina,
|
||||
MaxRecord = this.MaxRecord,
|
||||
NumRec = this.NumRec,
|
||||
SearchVal = this.SearchVal,
|
||||
TotCount = this.TotCount
|
||||
};
|
||||
return clonedData;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (!(obj is SelectPOdlParams item))
|
||||
return false;
|
||||
|
||||
if (CodFase != item.CodFase)
|
||||
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;
|
||||
|
||||
if (SearchVal != item.SearchVal)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.SPEC</RootNamespace>
|
||||
<Version>6.16.2210.1810</Version>
|
||||
<Version>6.16.2210.1910</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -27,6 +27,12 @@ namespace MP.SPEC.Pages
|
||||
public void Dispose()
|
||||
{
|
||||
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
||||
currRecord = null;
|
||||
ListTipoArt = null;
|
||||
ListAziende = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
public async void OnSeachUpdated()
|
||||
|
||||
+12
-14
@@ -38,7 +38,7 @@
|
||||
<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">
|
||||
<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">
|
||||
@@ -75,18 +75,16 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isLoading)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
<ListDossiers SelFilter="@currFilter" RecordSel="@selRecordDoss" RecordSelFlux="@selRecordFlux" TotRecordChanged="updateTotal"></ListDossiers>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</div>
|
||||
@if (isLoading)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
<ListDossiers SelFilter="@currFilter" RecordSel="@selRecordDoss" RecordSelFlux="@selRecordFlux" TotRecordChanged="updateTotal"></ListDossiers>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace MP.SPEC.Pages
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected DataPager pagerODL;
|
||||
protected DataPager pagerODL = null!;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
@@ -44,9 +44,6 @@ namespace MP.SPEC.Pages
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgService { get; set; } = null!;
|
||||
|
||||
protected DateTime selDtEnd
|
||||
{
|
||||
get => currFilter.DtEnd;
|
||||
@@ -87,16 +84,8 @@ namespace MP.SPEC.Pages
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
// abilito ricerca...
|
||||
MsgService.ShowSearch = true;
|
||||
// resetto search
|
||||
MsgService.SearchVal = "";
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
ListMacchine = await MDService.MacchineWithFlux();
|
||||
#if false
|
||||
// carico dati
|
||||
await reloadData();
|
||||
#endif
|
||||
ListMacchine = await MDService.MacchineWithFlux(currFilter.DtStart, currFilter.DtEnd);
|
||||
}
|
||||
|
||||
protected async Task pgResetReq(bool doReset)
|
||||
@@ -134,8 +123,8 @@ namespace MP.SPEC.Pages
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => MsgService.currPage;
|
||||
set => MsgService.currPage = value;
|
||||
get => currFilter.CurrPage;
|
||||
set => currFilter.CurrPage = value;
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
@@ -147,8 +136,8 @@ namespace MP.SPEC.Pages
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
get => MsgService.numRecord;
|
||||
set => MsgService.numRecord = value;
|
||||
get => currFilter.NumRec;
|
||||
set => currFilter.NumRec = value;
|
||||
}
|
||||
|
||||
private string rightStringCSS
|
||||
@@ -169,8 +158,8 @@ namespace MP.SPEC.Pages
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => MsgService.totalCount;
|
||||
set => MsgService.totalCount = value;
|
||||
get => currFilter.TotCount;
|
||||
set => currFilter.TotCount = value;
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
@@ -32,5 +32,3 @@
|
||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace MP.SPEC.Pages
|
||||
if (newParams.CurrPage == 0)
|
||||
{
|
||||
newParams.CurrPage = 1;
|
||||
newParams.LiveUpdate = false;
|
||||
//newParams.LiveUpdate = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="card mb-5">
|
||||
<div class="card-header table-primary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="col-6">
|
||||
<div class="col-6 col-lg-8">
|
||||
<div class="d-flex">
|
||||
<div class="px-2">
|
||||
<h3><b>P</b>romesse <b>ODL</b></h3>
|
||||
@@ -17,9 +17,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="col-6 col-lg-4">
|
||||
<div class="input-group input-group-sm">
|
||||
<label class="input-group-text" for="maxRecord" title="Selezionare l'azienda da visualizzare"><i class="fa-solid fa-industry"></i></label>
|
||||
@*<label class="input-group-text" for="maxRecord" title="Selezionare l'azienda da visualizzare"><i class="fa-solid fa-industry"></i></label>
|
||||
<select @bind="@currAzienda" class="form-select" title="Selezionare l'azienda da visualizzare">
|
||||
@if (ListAziende != null)
|
||||
{
|
||||
@@ -28,9 +28,9 @@
|
||||
<option value="@item.CodGruppo">@item.DescrGruppo</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</select>*@
|
||||
<label class="input-group-text" for="maxRecord" title="Selezionare la fase da visualizzare"><i class="fa-solid fa-screwdriver-wrench"></i></label>
|
||||
<select @bind="@selStato" class="form-select" title="Selezionare la fase da visualizzare">
|
||||
<select @bind="@currFase" class="form-select" title="Selezionare la fase da visualizzare">
|
||||
<option value="*">--- Tutti ---</option>
|
||||
@if (ListStati != null)
|
||||
{
|
||||
@@ -222,13 +222,10 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<ListPODL PagerResetReq="pgResetReq" RecordSel="@selRecord" updateRecordCount="UpdateTotCount"></ListPODL>
|
||||
<ListPODL PagerResetReq="pgResetReq" RecordSel="@selRecord" updateRecordCount="UpdateTotCount" actFilter="@currFilter"></ListPODL>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="@isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
+37
-30
@@ -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
|
||||
{
|
||||
@@ -11,7 +12,7 @@ namespace MP.SPEC.Pages
|
||||
{
|
||||
#region Protected Fields
|
||||
|
||||
protected DataPager pagerODL;
|
||||
protected DataPager pagerODL = null!;
|
||||
|
||||
protected bool reqNew = false;
|
||||
|
||||
@@ -28,9 +29,6 @@ namespace MP.SPEC.Pages
|
||||
[Inject]
|
||||
protected IOApiService MpIoApiCall { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
@@ -70,10 +68,6 @@ namespace MP.SPEC.Pages
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
// abilito ricerca...
|
||||
MsgService.ShowSearch = true;
|
||||
// resetto search
|
||||
MsgService.SearchVal = "";
|
||||
ListAziende = await MDService.ElencoAziende();
|
||||
ListGruppiFase = await MDService.ElencoGruppiFase();
|
||||
ListMacchine = await MDService.MacchineGetAll();
|
||||
@@ -110,7 +104,7 @@ namespace MP.SPEC.Pages
|
||||
var firstArt = ListArticoli.FirstOrDefault();
|
||||
currArticolo = firstArt != null ? firstArt.CodArticolo : "";
|
||||
}
|
||||
string codExt = $"{selStato}";
|
||||
string codExt = $"{currFase}";
|
||||
string codGruppo = "";
|
||||
if (ListGruppiFase != null && ListGruppiFase.Count > 0)
|
||||
{
|
||||
@@ -157,6 +151,9 @@ namespace MP.SPEC.Pages
|
||||
await callSyncDb(selRec);
|
||||
currRecord = null;
|
||||
await reloadData();
|
||||
// forzo update parametri
|
||||
await Task.Delay(1);
|
||||
currFase = "*";
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
@@ -169,16 +166,12 @@ 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;
|
||||
|
||||
private List<AnagGruppi>? ListGruppiFase;
|
||||
|
||||
private List<Macchine>? ListMacchine;
|
||||
|
||||
private List<ListValues>? ListStati;
|
||||
|
||||
#endregion Private Fields
|
||||
@@ -186,12 +179,11 @@ namespace MP.SPEC.Pages
|
||||
#region Private Properties
|
||||
|
||||
private string _artSearch { get; set; } = "";
|
||||
|
||||
private string _currAzienda { get; set; } = "*";
|
||||
|
||||
private bool addEnabled
|
||||
{
|
||||
get => selStato != "*";
|
||||
get => currFase != "*";
|
||||
}
|
||||
|
||||
private string artSearch
|
||||
@@ -217,7 +209,6 @@ namespace MP.SPEC.Pages
|
||||
}
|
||||
|
||||
private List<ConfigModel>? configData { get; set; } = null;
|
||||
|
||||
private string currArticolo { get; set; } = "";
|
||||
|
||||
private string currAzienda
|
||||
@@ -237,10 +228,25 @@ 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
|
||||
{
|
||||
get => MsgService.currPage;
|
||||
set => MsgService.currPage = value;
|
||||
get => currFilter.CurrPage;
|
||||
set => currFilter.CurrPage = value;
|
||||
}
|
||||
|
||||
private PODLModel? currRecord
|
||||
@@ -257,20 +263,14 @@ namespace MP.SPEC.Pages
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
get => MsgService.numRecord;
|
||||
set => MsgService.numRecord = value;
|
||||
}
|
||||
|
||||
private string selStato
|
||||
{
|
||||
get => MsgService.StateSel;
|
||||
set => MsgService.StateSel = value;
|
||||
get => currFilter.NumRec;
|
||||
set => currFilter.NumRec = value;
|
||||
}
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => MsgService.totalCount;
|
||||
set => MsgService.totalCount = value;
|
||||
get => currFilter.TotCount;
|
||||
set => currFilter.TotCount = value;
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
@@ -287,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,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2210.1810</h4>
|
||||
<h4>Versione: 6.16.2210.1910</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2210.1810
|
||||
6.16.2210.1910
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2210.1810</version>
|
||||
<version>6.16.2210.1910</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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -5,5 +5,11 @@
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"ServerConf": {
|
||||
"maxAge": "2000",
|
||||
"cacheCheckArtUsato": 2,
|
||||
"redisLongTimeCache": 15,
|
||||
"MpIoBaseUrl": "https://iis01.egalware.com/MP/IO/"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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/"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user