diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index 883e300c..76ebdebf 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -589,6 +589,30 @@ namespace MP.Data.Controllers return dbResult; } + + /// + /// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato) + /// + /// Cod articolo + /// KeyRich (parziale) da cercare (es cod stato x yacht) + /// + public List ListPODLFiltNOOdl(string codArt, string keyRichPart) + { + List dbResult = new List(); + using (var dbCtx = new MoonProContext(_configuration)) + { + dbResult = dbCtx + .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) + .OrderByDescending(x => x.InsertDate) + .ToList(); + } + return dbResult; + } + /// /// Elenco valori ammessi x tabella/colonna /// diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj index e6283c23..3bbca691 100644 --- a/MP.INVE/MP.INVE.csproj +++ b/MP.INVE/MP.INVE.csproj @@ -5,7 +5,7 @@ enable enable MP.INVE - 6.16.2211.2408 + 6.16.2211.2409 diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html index 29a93835..e04041b3 100644 --- a/MP.INVE/Resources/ChangeLog.html +++ b/MP.INVE/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOINVE -

Versione: 6.16.2211.2408

+

Versione: 6.16.2211.2409


Note di rilascio:
  • diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt index d7d07cfe..994b8650 100644 --- a/MP.INVE/Resources/VersNum.txt +++ b/MP.INVE/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.2408 +6.16.2211.2409 diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml index c170f1ec..9e7d53cd 100644 --- a/MP.INVE/Resources/manifest.xml +++ b/MP.INVE/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.2408 + 6.16.2211.2409 https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html false diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index dd5efe89..9417a97e 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -258,6 +258,11 @@ namespace MP.SPEC.Components get => actFilter.CodFase; set => actFilter.CodFase = value; } + private bool hasOdl + { + get => actFilter.hasOdl; + set => actFilter.hasOdl = value; + } private int totalCount { @@ -383,8 +388,16 @@ namespace MP.SPEC.Components private async Task reloadData() { + ListRecords = null; isLoading = true; - SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel); + if (hasOdl) + { + SearchRecords = await MDService.ListPODLFiltNOOdl(SearchVal, StatoSel); + } + else + { + SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel); + } totalCount = SearchRecords.Count; ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); await Task.Delay(1); diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 32635129..f35aab87 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -644,6 +644,44 @@ namespace MP.SPEC.Data return result; } + + /// + /// Elenco PODL avviati filtrati x articolo, KeyRich (che contiene stato) + /// + /// Cod articolo + /// KeyRich (parziale) da cercare (es cod stato x yacht) + /// + public async Task> ListPODLFiltNOOdl(string codArt, string keyRichPart) + { + List? result = new List(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string readType = "DB"; + string currKey = $"{redisPOdlListNOOdl}:{codArt}:{keyRichPart}"; + // cerco in redis dato valore sel macchina... + RedisValue rawData = redisDb.StringGet(currKey); + if (rawData.HasValue) + { + result = JsonConvert.DeserializeObject>($"{rawData}"); + readType = "REDIS"; + } + else + { + result = await Task.FromResult(dbController.ListPODLFiltNOOdl(codArt, keyRichPart)); + // serializzo e salvo... + rawData = JsonConvert.SerializeObject(result); + redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3)); + } + if (result == null) + { + result = new List(); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"ListPODLFiltNOOdl | Read from {readType}: {ts.TotalMilliseconds}ms"); + return result; + } + /// /// Elenco di tutte le macchine gestite /// @@ -1113,6 +1151,7 @@ namespace MP.SPEC.Data private const string redisPOdlByOdl = redisBaseAddr + "SPEC:Cache:POdlByOdl"; private const string redisPOdlByPOdl = redisBaseAddr + "SPEC:Cache:POdlByPOdl"; private const string redisPOdlList = redisBaseAddr + "SPEC:Cache:POdlList"; + private const string redisPOdlListNOOdl = redisBaseAddr + "SPEC:Cache:POdlListNOOdl"; private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom"; private const string redisTipoArt = redisBaseAddr + "SPEC:Cache:TipoArt"; diff --git a/MP.SPEC/Data/SelectPOdlParams.cs b/MP.SPEC/Data/SelectPOdlParams.cs index 0c743ce7..bd0b8706 100644 --- a/MP.SPEC/Data/SelectPOdlParams.cs +++ b/MP.SPEC/Data/SelectPOdlParams.cs @@ -26,6 +26,7 @@ namespace MP.SPEC.Data public string SearchVal { get; set; } = "*"; public int TotCount { get; set; } = 0; + public bool hasOdl { get; set; } = true; #endregion Public Properties @@ -41,7 +42,8 @@ namespace MP.SPEC.Data MaxRecord = this.MaxRecord, NumRec = this.NumRec, SearchVal = this.SearchVal, - TotCount = this.TotCount + TotCount = this.TotCount, + hasOdl = this.hasOdl }; return clonedData; } @@ -72,6 +74,9 @@ namespace MP.SPEC.Data if (SearchVal != item.SearchVal) return false; + if (hasOdl != item.hasOdl) + return false; + return true; } diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 4830c1e9..d553f415 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.2317 + 6.16.2211.2409 diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index 71a4089e..1c008e71 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -6,9 +6,20 @@
    -
    +

    Promesse ODL

    +
    +
    +
    + Con ODL +
    + +
    + Senza ODL +
    +
    +
    @if (addEnabled) { @@ -17,7 +28,7 @@
    -
    +
    @*