From 55c6790d7b84fc4ebc353e029d077200b30a45d5 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Tue, 27 Sep 2022 18:03:36 +0200 Subject: [PATCH 01/11] update per takesnapshotList --- MP.SPEC/Components/DossiersFilter.razor | 4 ++-- MP.SPEC/Components/DossiersFilter.razor.cs | 1 + MP.SPEC/Components/ParamsFilter.razor.cs | 27 +++++++++++++++++++--- MP.SPEC/Data/MpDataService.cs | 21 +++++++++++++++++ MP.SPEC/Data/SelectFluxParams.cs | 1 + MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 9 files changed, 53 insertions(+), 9 deletions(-) diff --git a/MP.SPEC/Components/DossiersFilter.razor b/MP.SPEC/Components/DossiersFilter.razor index 906f5c56..f62d936c 100644 --- a/MP.SPEC/Components/DossiersFilter.razor +++ b/MP.SPEC/Components/DossiersFilter.razor @@ -18,8 +18,8 @@ } } - - + + diff --git a/MP.SPEC/Components/DossiersFilter.razor.cs b/MP.SPEC/Components/DossiersFilter.razor.cs index eefd1f4f..2ae4b100 100644 --- a/MP.SPEC/Components/DossiersFilter.razor.cs +++ b/MP.SPEC/Components/DossiersFilter.razor.cs @@ -37,6 +37,7 @@ namespace MP.SPEC.Components } } } + protected string selMacchina { diff --git a/MP.SPEC/Components/ParamsFilter.razor.cs b/MP.SPEC/Components/ParamsFilter.razor.cs index 454b7827..f2989711 100644 --- a/MP.SPEC/Components/ParamsFilter.razor.cs +++ b/MP.SPEC/Components/ParamsFilter.razor.cs @@ -201,10 +201,12 @@ namespace MP.SPEC.Components // fermo udpate liveUpdate = false; // se non ho data rif uso adesso... - DateTime dtRif = SelFilter.dtRif == null ? DateTime.Now : (DateTime)SelFilter.dtRif; + DateTime dtMax = SelFilter.dtMax == null ? DateTime.Now : (DateTime)SelFilter.dtMax; + DateTime dtMin = SelFilter.dtMin == null ? DateTime.Now : (DateTime)SelFilter.dtMin; // 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}"; } @@ -261,6 +263,25 @@ namespace MP.SPEC.Components } } } + private DateTime? dtMin + { + 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(); + } + } + } [Inject] private NavigationManager NavManager { get; set; } = null!; diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 7210a2a1..ab2d312b 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -368,6 +368,27 @@ namespace MP.SPEC.Data redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1)); return answ; } + + /// + /// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis + /// + /// macchina + /// NUm massimo secondi per recuperare dati correnti + /// DataOra riferimento x cui prendere valori antecedenti + /// + public async Task 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; + } /// /// Restitusice elenco aziende diff --git a/MP.SPEC/Data/SelectFluxParams.cs b/MP.SPEC/Data/SelectFluxParams.cs index 4f416c7a..bf17616f 100644 --- a/MP.SPEC/Data/SelectFluxParams.cs +++ b/MP.SPEC/Data/SelectFluxParams.cs @@ -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; diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 1a5d061f..0a551df9 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2209.2716 + 6.16.2209.2717 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 55703e20..a728c15a 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2209.2716

+

Versione: 6.16.2209.2717


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index c950d49c..4d19dd32 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2209.2716 +6.16.2209.2717 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index e107bb05..f797a793 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2209.2716 + 6.16.2209.2717 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 From 391078dd06d2f23fca61d42281ab19e6e3a98b2b Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 27 Sep 2022 18:08:17 +0200 Subject: [PATCH 02/11] Aggiunto edit numpz e TCiclo --- MP.SPEC/Pages/PODL.razor | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index 46c6fe3e..0501a0ac 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -42,7 +42,7 @@ - + @if (currRecord != null) { @@ -77,6 +77,12 @@
    +
    + # pz + + T.Ciclo + +
    From d1b6c804be902117506255bf06e129d678b73559 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 27 Sep 2022 18:14:40 +0200 Subject: [PATCH 03/11] Aggiunta editing note --- MP.SPEC/Pages/PODL.razor | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index 0501a0ac..274030bd 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -100,7 +100,6 @@
    -
    @@ -135,6 +134,16 @@
    +
    +
    + Note + +
    +
    +
    +
    +
    +
    @@ -142,7 +151,13 @@
    - +
    (currRecord)">Salva
    From f71ec80c162d494444c2ada4e058e3777453fa84 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 27 Sep 2022 18:27:46 +0200 Subject: [PATCH 04/11] Aggiunta duplicazione riga --- MP.Data/Controllers/MpSpecController.cs | 1 + MP.SPEC/Components/ListPODL.razor | 1 + MP.SPEC/Components/ListPODL.razor.cs | 28 +++++++++++++++++++++++++ MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/PODL.razor | 8 +------ MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 8 files changed, 35 insertions(+), 11 deletions(-) diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index f9229d82..561536ed 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -625,6 +625,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 diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index 966b1e2e..f1112783 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -34,6 +34,7 @@ else + @record.CodArticolo diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 6e3d1422..e38b9316 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -73,6 +73,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(); } @@ -101,6 +105,30 @@ namespace MP.SPEC.Components { await RecordSel.InvokeAsync(selRec); } + 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 = selRec.Note, + NumPezzi = selRec.NumPezzi, + Priorita = selRec.Priorita, + PzPallet = selRec.PzPallet, + Tcassegnato = selRec.Tcassegnato + }; + await RecordSel.InvokeAsync(newRec); + } protected async Task UpdateData() { diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 1a5d061f..032bbd3f 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2209.2716 + 6.16.2209.2718 diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index 274030bd..8f185474 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -151,13 +151,7 @@
    -
    (currRecord)">Salva +
    diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 55703e20..f8027d31 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

    Versione: 6.16.2209.2716

    +

    Versione: 6.16.2209.2718


    Note di rilascio:
    • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index c950d49c..61ee6211 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2209.2716 +6.16.2209.2718 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index e107bb05..4548f907 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2209.2716 + 6.16.2209.2718 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 From b97394b067b86e9d6755d518d56dae1a3cb7586a Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 27 Sep 2022 18:47:47 +0200 Subject: [PATCH 05/11] Aggiunta duplicazione articoli --- MP.SPEC/Components/ListODL.razor.cs | 4 -- MP.SPEC/Components/ListPODL.razor | 4 +- MP.SPEC/Components/ListPODL.razor.cs | 59 +++++++++++----------- MP.SPEC/Data/MpDataService.cs | 74 +++++++++++++++++----------- MP.SPEC/Pages/Articoli.razor | 3 +- MP.SPEC/Pages/Articoli.razor.cs | 19 +++++++ MP.SPEC/Pages/PODL.razor | 2 +- MP.SPEC/Pages/PODL.razor.cs | 5 ++ 8 files changed, 103 insertions(+), 67 deletions(-) diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 3acc8de4..13af41c6 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -133,10 +133,6 @@ namespace MP.SPEC.Components } private int totalCount { get; set; } = 0; - //{ - // get => MessageService.totalCount; - // set => MessageService.totalCount = value; - //} #endregion Private Properties diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index f1112783..cb4fdeb6 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -33,8 +33,8 @@ else { - - + + @record.CodArticolo diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index e38b9316..08e811b7 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -15,6 +15,9 @@ namespace MP.SPEC.Components [Parameter] public EventCallback RecordSel { get; set; } + [Parameter] + public EventCallback updateRecordCount { get; set; } + #endregion Public Properties #region Public Methods @@ -51,6 +54,31 @@ 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 + }; + await RecordSel.InvokeAsync(newRec); + } + /// /// Eliminazione record selezionato (previa conferma) /// @@ -105,30 +133,6 @@ namespace MP.SPEC.Components { await RecordSel.InvokeAsync(selRec); } - 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 = selRec.Note, - NumPezzi = selRec.NumPezzi, - Priorita = selRec.Priorita, - PzPallet = selRec.PzPallet, - Tcassegnato = selRec.Tcassegnato - }; - await RecordSel.InvokeAsync(newRec); - } protected async Task UpdateData() { @@ -176,11 +180,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 @@ -210,6 +210,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; } diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index ab2d312b..2c9116a5 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -368,7 +368,7 @@ namespace MP.SPEC.Data redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1)); return answ; } - + /// /// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis /// @@ -421,35 +421,6 @@ namespace MP.SPEC.Data return answ; } - /// - /// Esegue flush memoria redis dato pattern - /// - /// - /// - private async Task 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; - } - /// /// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione) /// @@ -670,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 _logger = null!; + private static Logger Log = LogManager.GetCurrentClassLogger(); /// @@ -699,5 +680,38 @@ namespace MP.SPEC.Data private int redisLongTimeCache = 5; #endregion Private Fields + + #region Private Methods + + /// + /// Esegue flush memoria redis dato pattern + /// + /// + /// + private async Task 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 } } \ No newline at end of file diff --git a/MP.SPEC/Pages/Articoli.razor b/MP.SPEC/Pages/Articoli.razor index 8e161a2b..2cc76697 100644 --- a/MP.SPEC/Pages/Articoli.razor +++ b/MP.SPEC/Pages/Articoli.razor @@ -135,7 +135,8 @@ { - + +
      @record.CodArticolo
      diff --git a/MP.SPEC/Pages/Articoli.razor.cs b/MP.SPEC/Pages/Articoli.razor.cs index 2dabf683..577db802 100644 --- a/MP.SPEC/Pages/Articoli.razor.cs +++ b/MP.SPEC/Pages/Articoli.razor.cs @@ -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) { diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index 8f185474..f739d21a 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -210,7 +210,7 @@ } else { - + } diff --git a/MP.SPEC/Components/ParamsFilter.razor.cs b/MP.SPEC/Components/ParamsFilter.razor.cs index f2989711..fba1461c 100644 --- a/MP.SPEC/Components/ParamsFilter.razor.cs +++ b/MP.SPEC/Components/ParamsFilter.razor.cs @@ -182,6 +182,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(-2); SelFilter = currFilt; } @@ -201,11 +202,11 @@ namespace MP.SPEC.Components // fermo udpate liveUpdate = false; // se non ho data rif uso adesso... - DateTime dtMax = SelFilter.dtMax == null ? DateTime.Now : (DateTime)SelFilter.dtMax; - DateTime dtMin = SelFilter.dtMin == null ? DateTime.Now : (DateTime)SelFilter.dtMin; + DateTime dtMax = selDtMax == null ? DateTime.Now : (DateTime)selDtMax; + DateTime dtMin = selDtMin == null ? DateTime.Now : (DateTime)selDtMin; // aggiungo 2 sec dtMax = dtMax.AddSeconds(15); - dtMin = dtMin.AddMinutes(-30); + //dtMin = dtMin.AddMinutes(-30); await MDService.DossiersTakeParamsSnapshotLast(selMacchina, dtMin, dtMax); lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}"; } @@ -213,6 +214,7 @@ namespace MP.SPEC.Components protected void toggleParams() { showEditPar = !showEditPar; + selDtMax = null; } protected async Task toggleUpdate() @@ -225,7 +227,7 @@ namespace MP.SPEC.Components } else { - dtMax = null; + selDtMax = null; } } @@ -244,7 +246,7 @@ namespace MP.SPEC.Components #region Private Properties - private DateTime? dtMax + private DateTime? selDtMax { get => SelFilter.dtMax; set @@ -263,7 +265,7 @@ namespace MP.SPEC.Components } } } - private DateTime? dtMin + private DateTime? selDtMin { get => SelFilter.dtMin; set diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 032bbd3f..4fec5a42 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2209.2718 + 6.16.2209.2809 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index f8027d31..73a3d73c 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

      Versione: 6.16.2209.2718

      +

      Versione: 6.16.2209.2809


      Note di rilascio:
      • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 61ee6211..d3f097ee 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2209.2718 +6.16.2209.2809 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 4548f907..3a813e4d 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2209.2718 + 6.16.2209.2809 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 From 59b43f60057ef67f0096a9a1ca5d82ee7313d22e Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 5 Oct 2022 10:24:19 +0200 Subject: [PATCH 07/11] Update pagina PODL --- MP.Data/Controllers/MpSpecController.cs | 2 ++ MP.Data/DatabaseModels/PODLModel.cs | 11 +++++++++++ MP.SPEC/Components/ListPODL.razor | 13 +++++++++++++ MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/PODL.razor | 9 ++++++++- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 8 files changed, 38 insertions(+), 5 deletions(-) diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index 561536ed..39568dbe 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -465,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(); } diff --git a/MP.Data/DatabaseModels/PODLModel.cs b/MP.Data/DatabaseModels/PODLModel.cs index 73b5b19d..2575e287 100644 --- a/MP.Data/DatabaseModels/PODLModel.cs +++ b/MP.Data/DatabaseModels/PODLModel.cs @@ -55,6 +55,17 @@ namespace MP.Data.DatabaseModels } } + /// + /// Navigazione oggetto Machine + /// + [ForeignKey("IdxMacchina")] + public virtual Macchine MachineNav { get; set; } = null!; + /// + /// Navigazione oggetto Articolo + /// + [ForeignKey("CodArticolo")] + public virtual AnagArticoli ArticoloNav { get; set; } = null!; + #endregion Public Properties } } \ No newline at end of file diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index cb4fdeb6..b7bf7cb8 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -25,6 +25,7 @@ else # pz T.Ciclo Note + Att @@ -38,10 +39,12 @@ else @record.CodArticolo +
        @record.ArticoloNav.DescArticolo
        @tradFase(record.KeyRichiesta) @record.IdxMacchina +
        @record.MachineNav.Descrizione
        @record.NumPezzi @@ -50,6 +53,16 @@ else @record.Tcassegnato.ToString("N3") @record.Note + + @if (@record.Attivabile) + { + + } + else + { + + } + @if (POdlDelEnabled(record.IdxOdl)) { diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 4fec5a42..0c5728b0 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2209.2809 + 6.16.2210.510 diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index f739d21a..9ce35a87 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -142,7 +142,14 @@
        -
        +
        + Att + +
        + +
        +
        +
        diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 73a3d73c..daa5c95c 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

        Versione: 6.16.2209.2809

        +

        Versione: 6.16.2210.510


        Note di rilascio:
        • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index d3f097ee..1324a324 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2209.2809 +6.16.2210.510 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 3a813e4d..b7774a44 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2209.2809 + 6.16.2210.510 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 From 10f9ed08a80681a9b862328e514d3b933b8370f8 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 5 Oct 2022 10:47:57 +0200 Subject: [PATCH 08/11] Fix query anticipo a 24h --- MP.SPEC/Components/ParamsFilter.razor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MP.SPEC/Components/ParamsFilter.razor.cs b/MP.SPEC/Components/ParamsFilter.razor.cs index fba1461c..eae78d0e 100644 --- a/MP.SPEC/Components/ParamsFilter.razor.cs +++ b/MP.SPEC/Components/ParamsFilter.razor.cs @@ -182,7 +182,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(-2); + currFilt.dtMin = RoundDatetime(5).AddDays(-1); SelFilter = currFilt; } @@ -202,8 +202,8 @@ namespace MP.SPEC.Components // fermo udpate liveUpdate = false; // se non ho data rif uso adesso... - DateTime dtMax = selDtMax == null ? DateTime.Now : (DateTime)selDtMax; - DateTime dtMin = selDtMin == null ? DateTime.Now : (DateTime)selDtMin; + DateTime dtMax = selDtMax == null ? RoundDatetime(5) : (DateTime)selDtMax; + DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddDays(-1) : (DateTime)selDtMin; // aggiungo 2 sec dtMax = dtMax.AddSeconds(15); //dtMin = dtMin.AddMinutes(-30); From 2a679504ebd3977d51f82e51ac359c9ec6a1af86 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Wed, 5 Oct 2022 10:53:17 +0200 Subject: [PATCH 09/11] fix selRecord + fix grafico toggle att --- MP.SPEC/Components/ListPODL.razor | 2 +- MP.SPEC/Components/ListPODL.razor.cs | 7 +++++-- MP.SPEC/Pages/PODL.razor | 13 +++++++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index b7bf7cb8..b88df56a 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -32,7 +32,7 @@ else @foreach (var record in ListRecords) { - + diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 08e811b7..8b69b7a0 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -22,14 +22,14 @@ namespace MP.SPEC.Components #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 { } @@ -76,6 +76,7 @@ namespace MP.SPEC.Components PzPallet = selRec.PzPallet, Tcassegnato = selRec.Tcassegnato }; + currRecord = selRec; await RecordSel.InvokeAsync(newRec); } @@ -126,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); } diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index 9ce35a87..a890faa2 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -143,10 +143,15 @@
        - Att - -
        - +
        +
        +
        + Attivabile +
        +
        + +
        +
        From c4a682cc24c6c5f3cc10f9a4f64bba6787b9be30 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 5 Oct 2022 10:58:49 +0200 Subject: [PATCH 10/11] Gestione snapshot - anticipo parametricod a tab config --- MP.SPEC/Components/ParamsFilter.razor.cs | 29 +++++++++++++++--------- MP.SPEC/appsettings.json | 2 +- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/MP.SPEC/Components/ParamsFilter.razor.cs b/MP.SPEC/Components/ParamsFilter.razor.cs index eae78d0e..9930b251 100644 --- a/MP.SPEC/Components/ParamsFilter.razor.cs +++ b/MP.SPEC/Components/ParamsFilter.razor.cs @@ -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,7 +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).AddDays(-1); + currFilt.dtMin = RoundDatetime(5).AddHours(-numOreAnticipoSnapshot); SelFilter = currFilt; } @@ -196,19 +203,19 @@ 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 dtMax = selDtMax == null ? RoundDatetime(5) : (DateTime)selDtMax; - DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddDays(-1) : (DateTime)selDtMin; + DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddHours(-numOreAnticipoSnapshot) : (DateTime)selDtMin; // aggiungo 2 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 + snapshotDone = true; + startTimer(); } protected void toggleParams() @@ -237,15 +244,17 @@ namespace MP.SPEC.Components private static System.Timers.Timer aTimer = new System.Timers.Timer(); private List? ListFlux = null; - private List? ListMacchine = null; - + private int numOreAnticipoSnapshot = 5; private bool snapshotDone = false; #endregion Private Fields #region Private Properties + [Inject] + private NavigationManager NavManager { get; set; } = null!; + private DateTime? selDtMax { get => SelFilter.dtMax; @@ -265,6 +274,7 @@ namespace MP.SPEC.Components } } } + private DateTime? selDtMin { get => SelFilter.dtMin; @@ -285,9 +295,6 @@ namespace MP.SPEC.Components } } - [Inject] - private NavigationManager NavManager { get; set; } = null!; - private bool showEditPar { get; set; } = false; private string snapMode diff --git a/MP.SPEC/appsettings.json b/MP.SPEC/appsettings.json index f99535b9..f4116e61 100644 --- a/MP.SPEC/appsettings.json +++ b/MP.SPEC/appsettings.json @@ -15,6 +15,6 @@ "ServerConf": { "maxAge": "2000", "cacheCheckArtUsato": 2, - "redisLongTimeCache": 15 + "redisLongTimeCache": 15 } } From 43f0569fe36bb777f877cc9745f433153474acd8 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 5 Oct 2022 11:03:18 +0200 Subject: [PATCH 11/11] Fix flush + reload home --- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/Utils.razor.cs | 7 ++++++- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 0c5728b0..539ad3ac 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.510 + 6.16.2210.511 diff --git a/MP.SPEC/Pages/Utils.razor.cs b/MP.SPEC/Pages/Utils.razor.cs index b706f3b9..f26cdad2 100644 --- a/MP.SPEC/Pages/Utils.razor.cs +++ b/MP.SPEC/Pages/Utils.razor.cs @@ -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 } diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index daa5c95c..0c0ee268 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

        Versione: 6.16.2210.510

        +

        Versione: 6.16.2210.511


        Note di rilascio:
        • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 1324a324..806c3689 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.510 +6.16.2210.511 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index b7774a44..d5f9ff5d 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.510 + 6.16.2210.511 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