diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index 046f73d0..535274d2 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -333,10 +333,10 @@ namespace MP.Data.Controllers /// /// * = tutte, altrimenti solo x una data macchina /// * = tutti, altrimenti solo x un dato articolo - /// Data di riferimento (Massima) per estrazioen records - /// numero massimo record da restituire + /// Data minima per estrazione records + /// Data Massima per estrazione records /// - public List DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtRef, int MaxRec) + public List DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd) { List dbResult = new List(); 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 } /// - /// Elenco id Macchine che abbiano dati FLuxLog + /// Elenco id Macchine che abbiano dati FLuxLog, nel periodo indicato /// + /// + /// /// - public async Task> MacchineWithFlux() + public async Task> MacchineWithFlux(DateTime dtStart, DateTime dtEnd) { List dbResult = new List(); 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(); @@ -795,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; diff --git a/MP.SPEC/Components/DossiersFilter.razor b/MP.SPEC/Components/DossiersFilter.razor index 9d549e93..7a6a8689 100644 --- a/MP.SPEC/Components/DossiersFilter.razor +++ b/MP.SPEC/Components/DossiersFilter.razor @@ -37,7 +37,22 @@ } -
+ +
+ +
+
+ + +
+
+ +
+
+ + +
+ @*
@@ -49,7 +64,7 @@ -
+ *@ diff --git a/MP.SPEC/Components/DossiersFilter.razor.cs b/MP.SPEC/Components/DossiersFilter.razor.cs index 49456daf..f5dd2bbe 100644 --- a/MP.SPEC/Components/DossiersFilter.razor.cs +++ b/MP.SPEC/Components/DossiersFilter.razor.cs @@ -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); } diff --git a/MP.SPEC/Components/ListDossiers.razor b/MP.SPEC/Components/ListDossiers.razor index 1728533c..43b8c986 100644 --- a/MP.SPEC/Components/ListDossiers.razor +++ b/MP.SPEC/Components/ListDossiers.razor @@ -17,7 +17,7 @@ else - + Articolo Fase @@ -75,15 +75,15 @@ else - + @@ -91,7 +91,7 @@ else @foreach (var record in listaFlux) { - + @@ -105,8 +105,15 @@ else @record.CodFlux } diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index 09b6ee5b..b3882a7b 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -6,7 +6,7 @@ using MP.SPEC.Data; namespace MP.SPEC.Components { - public partial class ListDossiers: IDisposable + public partial class ListDossiers : IDisposable { #region Public Properties @@ -26,6 +26,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 = ""; @@ -87,6 +105,7 @@ namespace MP.SPEC.Components protected async Task editRecord(FluxLogDTO selRec) { + currFluxLogDto = selRec; // indico record selezionato await RecordSelFlux.InvokeAsync(selRec); } @@ -166,9 +185,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 @@ -203,7 +226,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); @@ -234,8 +257,9 @@ namespace MP.SPEC.Components return answ; } - private async Task unToggleTableFlux() + private async Task closeTableFlux() { + currFluxLogDto = null; currRecord = null; visualizzaFlux = true; await Task.Delay(1); diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 52150c77..2b04387f 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -13,8 +13,6 @@ namespace MP.SPEC.Components [Parameter] public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams(); - private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 }; - [Parameter] public EventCallback PagerResetReq { get; set; } @@ -43,8 +41,6 @@ namespace MP.SPEC.Components return answ; } - #endregion Public Methods - public void Dispose() { currRecord = null; @@ -54,6 +50,8 @@ namespace MP.SPEC.Components GC.Collect(); } + #endregion Public Methods + #region Protected Properties [Inject] @@ -212,11 +210,8 @@ namespace MP.SPEC.Components #region Private Fields private PODLModel? currRecord = null; - private List? ListRecords; - private List? ListStati; - private List? SearchRecords; #endregion Private Fields @@ -232,6 +227,7 @@ namespace MP.SPEC.Components } private bool isLoading { get; set; } = false; + private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 }; private int numRecord { @@ -325,8 +321,15 @@ namespace MP.SPEC.Components /// private bool canStartOdl(string idxMacchina) { - var listOdlCurr = MDService.OdlGetCurrent(); - bool answ = !listOdlCurr.Contains(idxMacchina); + // controllo se lista scaduta... + bool answ = false; + DateTime adesso = DateTime.Now; + if (adesso > odlCurrExp || odlCurrList == null || odlCurrList.Count == 0) + { + odlCurrList = MDService.OdlGetCurrent(); + odlCurrExp = adesso.AddSeconds(2); + } + answ = !odlCurrList.Contains(idxMacchina); return answ; } @@ -376,6 +379,16 @@ namespace MP.SPEC.Components isLoading = false; } + /// + /// scadenza validità lista ODL correnti + /// + private DateTime odlCurrExp = DateTime.Now.AddMinutes(-1); + + /// + /// Elenco ODL correnti... + /// + private List odlCurrList = new List(); + private string tradFase(string codFase) { string answ = codFase; diff --git a/MP.SPEC/Components/ParamsFilter.razor b/MP.SPEC/Components/ParamsFilter.razor index 06434455..769761eb 100644 --- a/MP.SPEC/Components/ParamsFilter.razor +++ b/MP.SPEC/Components/ParamsFilter.razor @@ -1,7 +1,6 @@
- @if (!liveUpdate) {
} + @if (isLoading) + { + + } + else + { + + } +
+ - @if (isLoading) - { - - } - else - { - - }
- - - diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs index a8ff4f78..432543ee 100644 --- a/MP.SPEC/Pages/ODL.razor.cs +++ b/MP.SPEC/Pages/ODL.razor.cs @@ -85,7 +85,7 @@ namespace MP.SPEC.Pages protected override async Task OnInitializedAsync() { ListStati = await MDService.AnagStatiComm(); - ListMacchine = await MDService.MacchineWithFlux(); + ListMacchine = await MDService.MacchineWithFlux(currFilter.DtStart, currFilter.DtEnd); } protected async Task pgResetReq(bool doReset) diff --git a/MP.SPEC/Pages/PARAMS.razor b/MP.SPEC/Pages/PARAMS.razor index 8b4777f0..43c1c7b9 100644 --- a/MP.SPEC/Pages/PARAMS.razor +++ b/MP.SPEC/Pages/PARAMS.razor @@ -32,5 +32,3 @@ - - diff --git a/MP.SPEC/Pages/PARAMS.razor.cs b/MP.SPEC/Pages/PARAMS.razor.cs index 8d05027f..e30c73ad 100644 --- a/MP.SPEC/Pages/PARAMS.razor.cs +++ b/MP.SPEC/Pages/PARAMS.razor.cs @@ -128,7 +128,7 @@ namespace MP.SPEC.Pages if (newParams.CurrPage == 0) { newParams.CurrPage = 1; - newParams.LiveUpdate = false; + //newParams.LiveUpdate = false; } else { diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index b9699f04..36a85db2 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -150,6 +150,9 @@ namespace MP.SPEC.Pages await callSyncDb(selRec); currRecord = null; await reloadData(); + // forzo update parametri + await Task.Delay(1); + currFase = "*"; await Task.Delay(1); } diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 64a26b06..38873420 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2210.1817

+

Versione: 6.16.2210.1820


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 458a9aa8..57be2c69 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1817 +6.16.2210.1820 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 4f3dec63..c55595cd 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1817 + 6.16.2210.1820 https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html false
+ + Macchina Data Data Type
Valore - -
-
Modificato: @record.ValoreEdit
-
Originale: @record.Valore
+ @if (record.ValoreEdit != record.Valore) + { +
@record.ValoreEdit
+
(@record.Valore)
+ } + else + { +
@record.ValoreEdit
+ }