Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c929e3cf65 | |||
| 43f0569fe3 | |||
| 2807bd9edc | |||
| c4a682cc24 | |||
| 5ef3139bd5 | |||
| 2a679504eb | |||
| 10f9ed08a8 | |||
| 374902d5f0 | |||
| 59b43f6005 | |||
| 1ad6222543 | |||
| b97394b067 | |||
| 9d35441b07 | |||
| f71ec80c16 | |||
| d1b6c804be | |||
| 391078dd06 | |||
| 55c6790d7b | |||
| 66642032bf | |||
| da76bc96f8 | |||
| 23fbacba87 | |||
| b9d67616cb | |||
| 79da055771 | |||
| 7e879fe2f6 |
@@ -325,6 +325,8 @@ namespace MP.Data.Controllers
|
||||
.DbSetDossiers
|
||||
.AsNoTracking()
|
||||
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && x.DtRif <= DtRef)
|
||||
.Include(m => m.MachineNav)
|
||||
.Include(o => o.OdlNav)
|
||||
.OrderByDescending(x => x.DtRif)
|
||||
.Take(MaxRec)
|
||||
.ToList();
|
||||
@@ -355,6 +357,29 @@ namespace MP.Data.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina">macchina</param>
|
||||
/// <param name="dtMin">Data min x selezione</param>
|
||||
/// <param name="dtMax">Data MAX x selezione</param>
|
||||
public bool DossiersTakeParamsSnapshotLast(string idxMacchina, DateTime dtMin, DateTime dtMax)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var pIdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var pDtMin = new SqlParameter("@DtMin", dtMin);
|
||||
var pDtMax = new SqlParameter("@DtMax", dtMax);
|
||||
|
||||
var dbResult = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("EXEC stp_FL_TakeSnapshotLast @IdxMacchina,@DtMin,@DtMax", pIdxMacchina, pDtMin, pDtMax);
|
||||
answ = true;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco valori link (x home e navMenu laterale)
|
||||
/// </summary>
|
||||
@@ -440,6 +465,8 @@ namespace MP.Data.Controllers
|
||||
.DbSetPODL
|
||||
.Where(x => (x.IdxOdl == 0) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (codArt == "*" || x.CodArticolo.Contains(codArt)))
|
||||
.AsNoTracking()
|
||||
.Include(m => m.MachineNav)
|
||||
.Include(a => a.ArticoloNav)
|
||||
.OrderBy(x => x.InsertDate)
|
||||
.ToList();
|
||||
}
|
||||
@@ -600,6 +627,7 @@ namespace MP.Data.Controllers
|
||||
currRec.KeyRichiesta = editRec.KeyRichiesta;
|
||||
currRec.NumPezzi = editRec.NumPezzi;
|
||||
currRec.Tcassegnato = editRec.Tcassegnato;
|
||||
currRec.Note = editRec.Note;
|
||||
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -26,8 +26,23 @@ namespace MP.Data.DatabaseModels
|
||||
public string IdxMacchina { get; set; }
|
||||
|
||||
public int IdxODL { get; set; }
|
||||
|
||||
public string Valore { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Machine
|
||||
/// </summary>
|
||||
[ForeignKey("IdxMacchina")]
|
||||
public virtual Macchine MachineNav { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Navigazione oggetto ODL
|
||||
/// </summary>
|
||||
[ForeignKey("IdxODL")]
|
||||
public virtual ODLModel OdlNav { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,17 @@ namespace MP.Data.DatabaseModels
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Machine
|
||||
/// </summary>
|
||||
[ForeignKey("IdxMacchina")]
|
||||
public virtual Macchine MachineNav { get; set; } = null!;
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Articolo
|
||||
/// </summary>
|
||||
[ForeignKey("CodArticolo")]
|
||||
public virtual AnagArticoli ArticoloNav { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,20 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="px-0 col-6">
|
||||
<div class="px-0 col-8">
|
||||
<div class="">
|
||||
<div class="px-0 py-1">
|
||||
<div class="px-2 input-group" id="basic-addon1">
|
||||
<div class="px-2 input-group">
|
||||
|
||||
<label class="input-group-text" for="maxRecord" title="Selezionare il numero massimo di record da visualizzare"><i class="fa-solid fa-list-ol"></i></label>
|
||||
<select @bind="@selMaxRecord" class="form-select" id="maxRecord" title="Selezionare il numero massimo di record da visualizzare">
|
||||
<option value="10">10</option>
|
||||
<option value="25">25</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<option value="250">250</option>
|
||||
<option value="500">500</option>
|
||||
</select>
|
||||
<label class="input-group-text" for="macchina" title="Selezionare la macchina"><i class="fa-solid fa-hard-drive"></i></label>
|
||||
<select @bind="@selMacchina" class="form-select" id="macchina" title="Selezionare la macchina">
|
||||
<option value="*">--- Tutti ---</option>
|
||||
@@ -18,8 +28,8 @@
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label class="input-group-text" for="DtRef" title="Selezionare la data da visualizzare"><i class="fa-solid fa-calendar-check"></i></label>
|
||||
<input @bind="@selDtRef" id="DtRef" class="form-control" type="datetime-local" title="Selezionare la data da visualizzare" />
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected string selMacchina
|
||||
{
|
||||
|
||||
@@ -19,10 +19,12 @@ else
|
||||
<th>
|
||||
<button @onclick="() => unToggleTableFlux()" 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>
|
||||
<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> ODL</th>
|
||||
<th><i class="fa-solid fa-circle-info"></i> DATA TYPE</th>
|
||||
@*<th><i class="fa-solid fa-circle-info"></i> DATA TYPE</th>*@
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -33,6 +35,12 @@ else
|
||||
<td>
|
||||
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
@record.OdlNav.CodArticolo
|
||||
</td>
|
||||
<td>
|
||||
@tradFase(record.OdlNav.KeyRichiesta)
|
||||
</td>
|
||||
<td>
|
||||
@record.IdxMacchina
|
||||
</td>
|
||||
@@ -42,9 +50,9 @@ else
|
||||
<td>
|
||||
@record.IdxODL
|
||||
</td>
|
||||
<td>
|
||||
@*<td>
|
||||
@record.DataType
|
||||
</td>
|
||||
</td>*@
|
||||
<td>
|
||||
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button></td>
|
||||
</tr>
|
||||
|
||||
@@ -37,22 +37,6 @@ namespace MP.SPEC.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione record selezionato (previa conferma)
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task deleteRecord(Dossiers selRec)
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione Dossier: sei sicuro di voler procedere?"))
|
||||
return;
|
||||
await Task.Delay(1);
|
||||
var done = await MDService.DossiersDeleteRecord(selRec);
|
||||
currRecord = null;
|
||||
await reloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
public async Task reloadData(bool setChanged)
|
||||
{
|
||||
isLoading = true;
|
||||
@@ -84,11 +68,29 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione record selezionato (previa conferma)
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task deleteRecord(Dossiers selRec)
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione Dossier: sei sicuro di voler procedere?"))
|
||||
return;
|
||||
await Task.Delay(1);
|
||||
var done = await MDService.DossiersDeleteRecord(selRec);
|
||||
currRecord = null;
|
||||
await reloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
|
||||
ListRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelDtRef, MaxRecord);
|
||||
|
||||
await reloadData();
|
||||
@@ -124,6 +126,7 @@ namespace MP.SPEC.Components
|
||||
private int _totalCount = 0;
|
||||
private Dossiers? currRecord = null;
|
||||
private List<Dossiers>? ListRecords;
|
||||
private List<ListValues>? ListStati;
|
||||
private List<Dossiers>? SearchRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
@@ -137,6 +140,7 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
private List<FluxLog>? listaFlux { get; set; } = null;
|
||||
|
||||
private int MaxRecord
|
||||
@@ -201,6 +205,20 @@ namespace MP.SPEC.Components
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private string tradFase(string codFase)
|
||||
{
|
||||
string answ = codFase;
|
||||
if (ListStati != null && ListStati.Count > 0)
|
||||
{
|
||||
var recSel = ListStati.FirstOrDefault(x => x.value == codFase);
|
||||
if (recSel != null)
|
||||
{
|
||||
answ = recSel.label;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private async Task unToggleTableFlux()
|
||||
{
|
||||
currRecord = null;
|
||||
|
||||
@@ -5,12 +5,14 @@ using MP.SPEC.Data;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ListODL
|
||||
public partial class ListODL : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> PagerResetReq { get; set; }
|
||||
[Parameter]
|
||||
public EventCallback<int> updateRecordCount { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string StatoSel
|
||||
@@ -21,8 +23,6 @@ namespace MP.SPEC.Components
|
||||
if (_statoSel != value)
|
||||
{
|
||||
_statoSel = value;
|
||||
var pUpd = Task.Run(async () => await reloadData());
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,12 @@ namespace MP.SPEC.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
|
||||
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
@@ -63,10 +69,14 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
@@ -122,11 +132,7 @@ namespace MP.SPEC.Components
|
||||
get => string.IsNullOrEmpty(MessageService.SearchVal) ? "*" : MessageService.SearchVal;
|
||||
}
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => MessageService.totalCount;
|
||||
set => MessageService.totalCount = value;
|
||||
}
|
||||
private int totalCount { get; set; } = 0;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
@@ -145,6 +151,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);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,22 +25,26 @@ else
|
||||
<th># pz</th>
|
||||
<th><i class="fa-solid fa-clock"></i> T.Ciclo</th>
|
||||
<th><i class="fa-solid fa-pen-to-square"></i> Note</th>
|
||||
<th title="Attivabile"><i class="fa-regular fa-square-check"></i> Att</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record.CodArticolo)">
|
||||
<tr class="@checkSelect(@record)">
|
||||
<td>
|
||||
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm"><i class="bi bi-pencil-square"></i></button>
|
||||
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
|
||||
<button @onclick="() => cloneRecord(record)" class="btn btn-info btn-sm" title="Duplica Record"><i class="bi bi-clipboard-check"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
@record.CodArticolo
|
||||
<div class="small textConsensed text-secondary">@record.ArticoloNav.DescArticolo</div>
|
||||
</td>
|
||||
<td>@tradFase(record.KeyRichiesta)</td>
|
||||
<td>
|
||||
@record.IdxMacchina
|
||||
<div class="small textConsensed text-secondary">@record.MachineNav.Descrizione</div>
|
||||
</td>
|
||||
<td>
|
||||
@record.NumPezzi
|
||||
@@ -49,6 +53,16 @@ else
|
||||
@record.Tcassegnato.ToString("N3")
|
||||
</td>
|
||||
<td>@record.Note</td>
|
||||
<td>
|
||||
@if (@record.Attivabile)
|
||||
{
|
||||
<i class="fa-regular fa-square-check text-success"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="fa-regular fa-square text-secondary"></i>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (POdlDelEnabled(record.IdxOdl))
|
||||
{
|
||||
|
||||
@@ -15,18 +15,21 @@ namespace MP.SPEC.Components
|
||||
[Parameter]
|
||||
public EventCallback<PODLModel> RecordSel { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> updateRecordCount { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public string checkSelect(string CodArticolo)
|
||||
public string checkSelect(PODLModel record)
|
||||
{
|
||||
string answ = "";
|
||||
if (currRecord != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = (currRecord.CodArticolo == CodArticolo) ? "table-info" : "";
|
||||
answ = ((currRecord.IdxMacchina == record.IdxMacchina) && (currRecord.CodArticolo == record.CodArticolo) && (currRecord.CodFase == record.CodFase)) ? "table-info" : "";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -51,6 +54,32 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task cloneRecord(PODLModel selRec)
|
||||
{
|
||||
// creo record duplicato...
|
||||
PODLModel newRec = new PODLModel()
|
||||
{
|
||||
Attivabile = selRec.Attivabile,
|
||||
CodArticolo = selRec.CodArticolo,
|
||||
CodCli = selRec.CodCli,
|
||||
CodGruppo = selRec.CodGruppo,
|
||||
DueDate = selRec.DueDate,
|
||||
IdxMacchina = selRec.IdxMacchina,
|
||||
IdxOdl = selRec.IdxOdl,
|
||||
IdxPromessa = 0,
|
||||
InsertDate = selRec.InsertDate,
|
||||
KeyBCode = selRec.KeyBCode,
|
||||
KeyRichiesta = selRec.KeyRichiesta,
|
||||
Note = $"DUPLICATED - {selRec.Note}",
|
||||
NumPezzi = selRec.NumPezzi,
|
||||
Priorita = selRec.Priorita,
|
||||
PzPallet = selRec.PzPallet,
|
||||
Tcassegnato = selRec.Tcassegnato
|
||||
};
|
||||
currRecord = selRec;
|
||||
await RecordSel.InvokeAsync(newRec);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione record selezionato (previa conferma)
|
||||
/// </summary>
|
||||
@@ -73,6 +102,10 @@ namespace MP.SPEC.Components
|
||||
MsgService.EA_SearchUpdated += OnSeachUpdated;
|
||||
MsgService.EA_StatoSearch += MsgService_EA_StatoSearch;
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
@@ -94,11 +127,13 @@ namespace MP.SPEC.Components
|
||||
|
||||
protected async Task resetSel()
|
||||
{
|
||||
currRecord = null;
|
||||
await RecordSel.InvokeAsync(null);
|
||||
}
|
||||
|
||||
protected async Task selRecord(PODLModel selRec)
|
||||
{
|
||||
currRecord = selRec;
|
||||
await RecordSel.InvokeAsync(selRec);
|
||||
}
|
||||
|
||||
@@ -148,11 +183,7 @@ namespace MP.SPEC.Components
|
||||
set => MsgService.StateSel = value;
|
||||
}
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => MsgService.totalCount;
|
||||
set => MsgService.totalCount = value;
|
||||
}
|
||||
private int totalCount { get; set; } = 0;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
@@ -182,6 +213,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);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,14 +98,16 @@
|
||||
}
|
||||
}
|
||||
</select>
|
||||
@if (dtMax == null)
|
||||
@if (selDtMax == null)
|
||||
{
|
||||
<button class="btn btn-primary" @onclick="() => setDtMax()"><i class="fa-regular fa-calendar-check"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text" for="flusso" title="Selezionare il tipo di flusso"><i class="fa-solid fa-sliders"></i></label>
|
||||
<input class="form" @bind="@dtMax" type="datetime-local" title="Data massima eventi da visualizzare">
|
||||
<label class="input-group-text" for="flusso" title="Selezionare la data minima eventi da visualizzare"><i class="fa-regular fa-calendar-minus"></i></label>
|
||||
<input class="form-control" @bind="@selDtMin" type="datetime-local" title="Data minima eventi da visualizzare">
|
||||
<label class="input-group-text" for="flusso" title="Selezionare la data massima eventi da visualizzare"><i class="fa-regular fa-calendar-plus"></i></label>
|
||||
<input class="form-control" @bind="@selDtMax" type="datetime-local" title="Selezionare la data massima eventi da visualizzare">
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.SPEC.Data;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
@@ -170,6 +169,14 @@ namespace MP.SPEC.Components
|
||||
SelFilter = new SelectFluxParams();
|
||||
ListMacchine = await MDService.MacchineWithFlux();
|
||||
ListFlux = await MDService.ParametriGetFilt(selMacchina);
|
||||
|
||||
var configData = await MDService.ConfigGetAll();
|
||||
var currRec = configData.FirstOrDefault(x => x.Chiave == "numOreAnticipoSnapshot");
|
||||
if (currRec != null)
|
||||
{
|
||||
int.TryParse(currRec.Valore, out numOreAnticipoSnapshot);
|
||||
}
|
||||
|
||||
await FilterChanged.InvokeAsync(SelFilter);
|
||||
}
|
||||
|
||||
@@ -182,6 +189,7 @@ namespace MP.SPEC.Components
|
||||
currFilt.CurrPage = 0;
|
||||
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
currFilt.dtMax = RoundDatetime(5);
|
||||
currFilt.dtMin = RoundDatetime(5).AddHours(-numOreAnticipoSnapshot);
|
||||
SelFilter = currFilt;
|
||||
}
|
||||
|
||||
@@ -195,22 +203,25 @@ namespace MP.SPEC.Components
|
||||
|
||||
protected async Task takeSnapshot()
|
||||
{
|
||||
// indico snapshot fatto
|
||||
snapshotDone = true;
|
||||
startTimer();
|
||||
// fermo udpate
|
||||
liveUpdate = false;
|
||||
// se non ho data rif uso adesso...
|
||||
DateTime dtRif = SelFilter.dtRif == null ? DateTime.Now : (DateTime)SelFilter.dtRif;
|
||||
DateTime dtMax = selDtMax == null ? RoundDatetime(5) : (DateTime)selDtMax;
|
||||
DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddHours(-numOreAnticipoSnapshot) : (DateTime)selDtMin;
|
||||
// aggiungo 2 sec
|
||||
dtRif = dtRif.AddSeconds(1);
|
||||
await MDService.DossiersTakeParamsSnapshot(selMacchina, 10, dtRif);
|
||||
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
|
||||
snapshotDone = true;
|
||||
startTimer();
|
||||
}
|
||||
|
||||
protected void toggleParams()
|
||||
{
|
||||
showEditPar = !showEditPar;
|
||||
selDtMax = null;
|
||||
}
|
||||
|
||||
protected async Task toggleUpdate()
|
||||
@@ -223,7 +234,7 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
dtMax = null;
|
||||
selDtMax = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,16 +244,18 @@ namespace MP.SPEC.Components
|
||||
|
||||
private static System.Timers.Timer aTimer = new System.Timers.Timer();
|
||||
private List<string>? ListFlux = null;
|
||||
|
||||
private List<string>? ListMacchine = null;
|
||||
|
||||
private int numOreAnticipoSnapshot = 5;
|
||||
private bool snapshotDone = false;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private DateTime? dtMax
|
||||
[Inject]
|
||||
private NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
private DateTime? selDtMax
|
||||
{
|
||||
get => SelFilter.dtMax;
|
||||
set
|
||||
@@ -262,8 +275,25 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private NavigationManager NavManager { get; set; } = null!;
|
||||
private DateTime? selDtMin
|
||||
{
|
||||
get => SelFilter.dtMin;
|
||||
set
|
||||
{
|
||||
if (SelFilter.dtMin != value)
|
||||
{
|
||||
// copio il filtro
|
||||
var currFilt = SelFilter;
|
||||
// fermo update
|
||||
currFilt.LiveUpdate = false;
|
||||
currFilt.CurrPage = 0;
|
||||
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
currFilt.dtMin = value;
|
||||
SelFilter = currFilt;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool showEditPar { get; set; } = false;
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ namespace MP.SPEC.Data
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{redisDossByMac}:{IdxMacchina}";
|
||||
string currKey = $"{redisDossByMac}:{IdxMacchina}:{DtRef:yyyy/MM/dd HH:mm:ss}:{MaxRec}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
@@ -369,6 +369,27 @@ namespace MP.SPEC.Data
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">macchina</param>
|
||||
/// <param name="MaxSec">NUm massimo secondi per recuperare dati correnti</param>
|
||||
/// <param name="DtRif">DataOra riferimento x cui prendere valori antecedenti</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersTakeParamsSnapshotLast(string IdxMacchina, DateTime dtMin, DateTime dtMax)
|
||||
{
|
||||
bool answ = false;
|
||||
await Task.Delay(1);
|
||||
// chiamo stored x salvare parametri
|
||||
dbController.DossiersTakeParamsSnapshotLast(IdxMacchina, dtMin, dtMax);
|
||||
// svuoto cache redis x macchina
|
||||
string currKey = $"{redisDossByMac}:{IdxMacchina}";
|
||||
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
|
||||
currKey = $"{redisDossByMac}:*";
|
||||
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restitusice elenco aziende
|
||||
/// </summary>
|
||||
@@ -400,35 +421,6 @@ namespace MP.SPEC.Data
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue flush memoria redis dato pattern
|
||||
/// </summary>
|
||||
/// <param name="pattern"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<bool> ExecFlushRedisPattern(RedisValue pattern)
|
||||
{
|
||||
bool answ = false;
|
||||
var listEndpoints = redisConnAdmin.GetEndPoints();
|
||||
foreach (var endPoint in listEndpoints)
|
||||
{
|
||||
//var server = redisConnAdmin.GetServer(listEndpoints[0]);
|
||||
var server = redisConnAdmin.GetServer(endPoint);
|
||||
if (server != null)
|
||||
{
|
||||
var keyList = server.Keys(redisDb.Database, pattern);
|
||||
foreach (var item in keyList)
|
||||
{
|
||||
await redisDb.KeyDeleteAsync(item);
|
||||
}
|
||||
// brutalmente rimuovo intero contenuto DB... DANGER
|
||||
//await server.FlushDatabaseAsync();
|
||||
answ = true;
|
||||
}
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
|
||||
/// </summary>
|
||||
@@ -649,15 +641,25 @@ namespace MP.SPEC.Data
|
||||
#region Private Fields
|
||||
|
||||
private const string redisBaseAddr = "MP:";
|
||||
|
||||
private const string redisConfKey = redisBaseAddr + "SPEC:Cache:Config";
|
||||
|
||||
private const string redisDossByMac = redisBaseAddr + "SPEC:Cache:DossByMac";
|
||||
|
||||
private const string redisFluxByMac = redisBaseAddr + "SPEC:Cache:FluxByMac";
|
||||
|
||||
private const string redisMacByFlux = redisBaseAddr + "SPEC:Cache:MacByFlux";
|
||||
|
||||
private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList";
|
||||
|
||||
private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom";
|
||||
|
||||
private const string redisTipoArt = redisBaseAddr + "SPEC:Cache:TipoArt";
|
||||
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static ILogger<MpDataService> _logger = null!;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
@@ -678,5 +680,38 @@ namespace MP.SPEC.Data
|
||||
private int redisLongTimeCache = 5;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Esegue flush memoria redis dato pattern
|
||||
/// </summary>
|
||||
/// <param name="pattern"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<bool> ExecFlushRedisPattern(RedisValue pattern)
|
||||
{
|
||||
bool answ = false;
|
||||
var listEndpoints = redisConnAdmin.GetEndPoints();
|
||||
foreach (var endPoint in listEndpoints)
|
||||
{
|
||||
//var server = redisConnAdmin.GetServer(listEndpoints[0]);
|
||||
var server = redisConnAdmin.GetServer(endPoint);
|
||||
if (server != null)
|
||||
{
|
||||
var keyList = server.Keys(redisDb.Database, pattern);
|
||||
foreach (var item in keyList)
|
||||
{
|
||||
await redisDb.KeyDeleteAsync(item);
|
||||
}
|
||||
// brutalmente rimuovo intero contenuto DB... DANGER
|
||||
//await server.FlushDatabaseAsync();
|
||||
answ = true;
|
||||
}
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
public string IdxMacchina { get; set; } = "*";
|
||||
|
||||
public int MaxRecord { get; set; } = 100;
|
||||
public int MaxRecord { get; set; } = 10;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
public int CurrPage { get; set; } = 1;
|
||||
public DateTime? dtRif { get; set; } = null;
|
||||
public DateTime? dtMax { get; set; } = null;
|
||||
public DateTime? dtMin { get; set; } = null;
|
||||
public string IdxMacchina { get; set; } = "*";
|
||||
public string lastUpdate { get; set; } = "-";
|
||||
public bool LiveUpdate { get; set; } = true;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.SPEC</RootNamespace>
|
||||
<Version>6.16.2209.2711</Version>
|
||||
<Version>6.16.2210.511</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -135,7 +135,8 @@
|
||||
{
|
||||
<tr class="@checkSelect(@record.CodArticolo)">
|
||||
<td>
|
||||
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm"><i class="bi bi-pencil-square"></i></button>
|
||||
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
|
||||
<button @onclick="() => cloneRecord(record)" class="btn btn-info btn-sm" title="Duplica Record"><i class="bi bi-clipboard-check"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.CodArticolo</div>
|
||||
|
||||
@@ -136,6 +136,10 @@ namespace MP.SPEC.Pages
|
||||
}
|
||||
ListAziende = await MDService.ElencoAziende();
|
||||
ListTipoArt = await MDService.AnagTipoArtLV();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
@@ -155,6 +159,21 @@ namespace MP.SPEC.Pages
|
||||
currRecord = selRec;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
protected async Task cloneRecord(AnagArticoli selRec)
|
||||
{
|
||||
// creo record duplicato...
|
||||
AnagArticoli newRec = new AnagArticoli()
|
||||
{
|
||||
Azienda = selRec.Azienda,
|
||||
CodArticolo = selRec.CodArticolo,
|
||||
DescArticolo = $"CLONE - { selRec.DescArticolo }",
|
||||
Disegno = selRec.Disegno,
|
||||
Tipo=selRec.Tipo
|
||||
};
|
||||
currRecord = newRec;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
|
||||
protected async Task update(AnagArticoli selRec)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ListODL StatoSel="@selStato" PagerResetReq="pgResetReq"></ListODL>
|
||||
<ListODL StatoSel="@selStato" PagerResetReq="pgResetReq" updateRecordCount="UpdateTotCount"></ListODL>
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
|
||||
@@ -28,6 +28,11 @@ namespace MP.SPEC.Pages
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void UpdateTotCount(int newTotCount)
|
||||
{
|
||||
totalCount = newTotCount;
|
||||
}
|
||||
|
||||
protected void ForceReload(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
@@ -44,7 +49,6 @@ namespace MP.SPEC.Pages
|
||||
MsgService.ShowSearch = true;
|
||||
// resetto search
|
||||
MsgService.SearchVal = "";
|
||||
ListAziende = await MDService.ElencoAziende();
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
// carico dati
|
||||
await reloadData();
|
||||
@@ -62,9 +66,6 @@ namespace MP.SPEC.Pages
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private MP.Data.DatabaseModels.ODLModel? currRecordOdl = null;
|
||||
private MP.Data.DatabaseModels.PODLModel? currRecordPOdl = null;
|
||||
private List<MP.Data.DatabaseModels.AnagGruppi>? ListAziende;
|
||||
private List<MP.Data.DatabaseModels.ListValues>? ListStati;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
@if (currRecord != null)
|
||||
{
|
||||
@@ -77,6 +77,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm"># pz</span>
|
||||
<input type="text" class="form-control" aria-label="Num Pezzi" aria-describedby="inputGroup-sizing-sm" @bind-value="@currRecord.NumPezzi">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">T.Ciclo</span>
|
||||
<input type="text" class="form-control" aria-label="Tempo Ciclo" aria-describedby="inputGroup-sizing-sm" @bind-value="@currRecord.Tcassegnato">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="input-group input-group-sm">
|
||||
@@ -94,7 +100,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
|
||||
<div class="col-3">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group input-group-sm">
|
||||
@@ -129,6 +134,28 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">Note</span>
|
||||
<input type="text" class="form-control" aria-label="Note" aria-describedby="inputGroup-sizing-sm" @bind-value="@currRecord.Note">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col-3">
|
||||
<div class="input-group input-group-sm d-flex justify-content-between">
|
||||
<div class="input-group-text" id="inputGroup-sizing-sm">
|
||||
<div class="pe-3" title="Attivabile">
|
||||
Attivabile
|
||||
</div>
|
||||
<div class="form-check form-check-sm form-switch py-1" title="Attivabile">
|
||||
<input class="form-check-input" type="checkbox" id="mySwitch" name="setupAlarms" title="Attivabile" @bind="@currRecord.Attivabile">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="d-grid gap-2">
|
||||
<button class="btn btn-warning" @onclick="() => cancel()">Annulla <i class="bi bi-x-circle"></i></button>
|
||||
@@ -195,7 +222,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<ListPODL PagerResetReq="pgResetReq" RecordSel="@selRecord"></ListPODL>
|
||||
<ListPODL PagerResetReq="pgResetReq" RecordSel="@selRecord" updateRecordCount="UpdateTotCount"></ListPODL>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
|
||||
@@ -155,6 +155,11 @@ namespace MP.SPEC.Pages
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected void UpdateTotCount(int newTotCount)
|
||||
{
|
||||
totalCount = newTotCount;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
@@ -11,14 +11,19 @@ namespace MP.SPEC.Pages
|
||||
{
|
||||
await Task.Delay(1);
|
||||
await MDService.FlushRedisCache();
|
||||
// rimando a home
|
||||
NavManager.NavigateTo("", true);
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; }
|
||||
protected MpDataService MDService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2209.2711</h4>
|
||||
<h4>Versione: 6.16.2210.511</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2209.2711
|
||||
6.16.2210.511
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2209.2711</version>
|
||||
<version>6.16.2210.511</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>
|
||||
|
||||
@@ -15,6 +15,6 @@
|
||||
"ServerConf": {
|
||||
"maxAge": "2000",
|
||||
"cacheCheckArtUsato": 2,
|
||||
"redisLongTimeCache": 15
|
||||
"redisLongTimeCache": 15
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user