diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index d6819e96..873afa7f 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -1312,7 +1312,7 @@ namespace MP.Data.Controllers var dbResult = await dbCtx .Database .ExecuteSqlRawAsync("EXEC dbo.stp_IstKit_insertByWKS @CodArtParent,@KeyFilt", pCodArtParent, pKeyFilt); - return dbResult > 0; + return dbResult != 0; } /// diff --git a/MP.SPEC/Components/ProdKit/KitVerify.razor.cs b/MP.SPEC/Components/ProdKit/KitVerify.razor.cs index 796755e4..aecb9913 100644 --- a/MP.SPEC/Components/ProdKit/KitVerify.razor.cs +++ b/MP.SPEC/Components/ProdKit/KitVerify.razor.cs @@ -100,11 +100,8 @@ namespace MP.SPEC.Components.ProdKit // eseguo stored... bool fatto = await MDService.IstKitInsertByWKSAsync(currRec.CodArtParent, KeyFilt); - if (fatto) - { - // segnalo update - await EC_KitCreated.InvokeAsync(true); - } + // segnalo update + await EC_KitCreated.InvokeAsync(fatto); } private void ReloadData() diff --git a/MP.SPEC/Components/ProdKit/Manager.razor b/MP.SPEC/Components/ProdKit/Manager.razor index 5f0f7405..98156c3c 100644 --- a/MP.SPEC/Components/ProdKit/Manager.razor +++ b/MP.SPEC/Components/ProdKit/Manager.razor @@ -16,7 +16,7 @@
- +
}
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 90f0a7a3..0cf62585 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -881,7 +881,7 @@ namespace MP.SPEC.Data /// Cancellazione FusionCache dato elenco tags ///
/// - public async Task FlushCacheByTagsAsync(List listTags) + public async Task FlushCacheByTagAsync(List listTags) { if (listTags == null || listTags.Count == 0) return false; @@ -1152,9 +1152,8 @@ namespace MP.SPEC.Data { using var activity = ActivitySource.StartActivity("IstKitDeleteAsync"); string source = "DB"; - bool fatto = false; // salvo - fatto = await dbController.IstKitDeleteAsync(currRecord); + bool fatto = await dbController.IstKitDeleteAsync(currRecord); // svuoto cache await FlushKitCache(); activity?.SetTag("data.source", source); @@ -1163,15 +1162,6 @@ namespace MP.SPEC.Data return fatto; } - private async Task FlushKitCache() - { -#if false - RedisValue pattern = $"{Utils.redisKitInst}:*"; - await ExecFlushRedisPatternAsync(pattern); -#endif - await FlushCacheByTagsAsync(new List() { Utils.redisPOdlList, Utils.redisKitInst, Utils.redisKitWip, Utils.redisKitScore, Utils.redisPOdlByCodArt }); - } - /// /// Elenco Istanze KIT da ricerca /// @@ -1197,11 +1187,10 @@ namespace MP.SPEC.Data /// Chiave x filtro conf su tab WKS public async Task IstKitInsertByWKSAsync(string CodArtParent, string KeyFilt) { - bool fatto = false; using var activity = ActivitySource.StartActivity("IstKitInsertByWKSAsync"); string source = "DB"; // salvo - fatto = await dbController.IstKitInsertByWKSAsync(CodArtParent, KeyFilt); + bool fatto = await dbController.IstKitInsertByWKSAsync(CodArtParent, KeyFilt); // svuoto cache await FlushKitCache(); activity?.SetTag("data.source", source); @@ -1218,9 +1207,8 @@ namespace MP.SPEC.Data { using var activity = ActivitySource.StartActivity("IstKitUpsertAsync"); string source = "DB"; - bool fatto = false; // salvo - fatto = await dbController.IstKitUpsertAsync(currRecord); + bool fatto = await dbController.IstKitUpsertAsync(currRecord); // svuoto cache await FlushKitCache(); activity?.SetTag("data.source", source); @@ -1263,46 +1251,6 @@ namespace MP.SPEC.Data fetchFunc: async () => await dbController.ListPODL_ByCodArtAsync(CodArticolo, OnlyAvail) ?? new(), tagList: [Utils.redisPOdlByCodArt] ); - -#if false - List result = new List(); - if (!string.IsNullOrEmpty(CodArticolo)) - { - using var activity = ActivitySource.StartActivity("ListPODL_ByCodArt"); - string source = "DB"; - // cerco in redis dato valore sel idxMaccSel... - RedisValue rawData = redisDb.StringGet(currKey); - if (rawData.HasValue && rawData.Length() > 2) - { - var rawResult = JsonConvert.DeserializeObject>($"{rawData}"); - if (rawResult != null) - { - result = rawResult; - source = "REDIS"; - } - } - else - { - result = dbController.ListPODL_ByCodArt(CodArticolo, OnlyAvail); - // serializzo e salvo... - rawData = JsonConvert.SerializeObject(result); - redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache)); - } - if (result == null) - { - result = new List(); - } - activity?.SetTag("data.source", source); - activity?.SetTag("result.count", result.Count); - activity?.Stop(); - Log.Trace($"ListPODL_ByCodArt | {source} | {activity?.Duration.TotalMilliseconds}ms"); - } - else - { - Log.Debug("Errore CodArt vuoto"); - } - return result; -#endif } /// @@ -1541,7 +1489,6 @@ namespace MP.SPEC.Data return fatto; } - /// /// Elenco ODL filtrati x stato, articolo, KeyRich (che contiene stato) /// @@ -1781,14 +1728,7 @@ namespace MP.SPEC.Data // salvo fatto = await dbController.PodlIstKitDeleteAsync(IdxPODL); // svuoto cache - await FlushCacheByTagsAsync(new List() { Utils.redisPOdlList }); -#if false - string pattern = $"{Utils.redisKit}:*"; - if (!string.IsNullOrEmpty(pattern)) - { - ExecFlushRedisPattern(pattern); - } -#endif + await FlushCacheByTagAsync(new List() { Utils.redisPOdlList }); activity?.SetTag("data.source", "DB"); return fatto; } @@ -1809,35 +1749,6 @@ namespace MP.SPEC.Data tagList: [Utils.redisPOdlList] ); -#if false - using var activity = ActivitySource.StartActivity("POdlListByKitParent"); - List? result = new List(); - string source = "DB"; - string currKey = $"{Utils.redisPOdlList}_kit:ByParent:{IdxPodlParent}"; - // cerco in redis dato valore sel idxMaccSel... - RedisValue rawData = redisDb.StringGet(currKey); - if (rawData.HasValue) - { - result = JsonConvert.DeserializeObject>($"{rawData}"); - source = "REDIS"; - } - else - { - result = await dbController.ListPODL_ByKitParentAsync(IdxPodlParent); - // serializzo e salvo... - rawData = JsonConvert.SerializeObject(result); - redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache)); - } - if (result == null) - { - result = new List(); - } - activity?.SetTag("data.source", source); - activity?.SetTag("result.count", result.Count); - activity?.Stop(); - LogTrace($"POdlListByKitParent | Read from {source}: {activity?.Duration.TotalMilliseconds}ms"); - return result; -#endif } /// @@ -2394,10 +2305,15 @@ namespace MP.SPEC.Data private static readonly ActivitySource ActivitySource = new ActivitySource("MP.DATA.Tracer"); private static IConfiguration _configuration = null!; + private static Logger Log = LogManager.GetCurrentClassLogger(); + private readonly IFusionCache _cache; + private DateTime _artCacheExpiry = DateTime.MinValue; + private Dictionary _configData = new(); + private DateTime _dtParamExpiry = DateTime.Now; /// @@ -2457,7 +2373,6 @@ namespace MP.SPEC.Data #region Private Methods - /// /// Verifica caricamento dizionario ConfigData /// @@ -2474,6 +2389,11 @@ namespace MP.SPEC.Data } } + private async Task FlushKitCache() + { + await FlushCacheByTagAsync(new List() { Utils.redisPOdlList, Utils.redisKitInst, Utils.redisKitWip, Utils.redisKitScore, Utils.redisPOdlByCodArt }); + } + /// /// Implementa gestione recupero cache da memoria o da obj esterno + cache memoria + tracking attività /// @@ -2596,7 +2516,7 @@ namespace MP.SPEC.Data await ExecFlushRedisPatternAsync(pattern); // elimino anche in FusionCache List tags2del = new List() { Utils.redisArtList, Utils.redisArtByDossier }; - await FlushCacheByTagsAsync(tags2del); + await FlushCacheByTagAsync(tags2del); activity?.SetTag("data.source", "REDIS"); } @@ -2604,7 +2524,7 @@ namespace MP.SPEC.Data { await redisDb.StringSetAsync(Utils.redisConfKey, ""); List tags2del = new List() { Utils.redisConfKey }; - await FlushCacheByTagsAsync(tags2del); + await FlushCacheByTagAsync(tags2del); } /// @@ -2612,7 +2532,7 @@ namespace MP.SPEC.Data /// private async Task ResetMacGrpCache() { - await FlushCacheByTagsAsync(new List { Utils.redisAnagGruppi, Utils.redisMacList }); + await FlushCacheByTagAsync(new List { Utils.redisAnagGruppi, Utils.redisMacList }); } /// @@ -2622,7 +2542,7 @@ namespace MP.SPEC.Data { //ExecFlushRedisPattern($"{Utils.redisAnagGruppi}:*"); //ExecFlushRedisPattern($"{Utils.redisOprList}:*"); - await FlushCacheByTagsAsync(new List { Utils.redisAnagGruppi, Utils.redisOprList }); + await FlushCacheByTagAsync(new List { Utils.redisAnagGruppi, Utils.redisOprList }); } #endregion Private Methods diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index b0dddc59..982527dc 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 8.16.2605.3009 + 8.16.2605.3010 1800a78a-6ff1-40f9-b490-87fb8bfc1394 en diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 67011e00..af4e92ba 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 8.16.2605.3009

+

Versione: 8.16.2605.3010


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 77349332..fac721dd 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -8.16.2605.3009 +8.16.2605.3010 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 8818602e..aefa43a4 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 8.16.2605.3009 + 8.16.2605.3010 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