OK metodo PODLNext

This commit is contained in:
Samuele Locatelli
2026-04-16 11:35:58 +02:00
parent ac5ccc3a13
commit 3eca7da2e9
8 changed files with 248 additions and 11 deletions
+33
View File
@@ -811,6 +811,39 @@ namespace MP.IOC.Data
return result;
}
public async Task<List<PODLExpModel>> POdlGetByMaccArtAsync(string idxMacchina, string codArticolo, string codGruppo, bool onlyFree)
{
List<PODLExpModel> result = new List<PODLExpModel>();
var currKey = $"{Utils.redisPOdlByMaccArt}:{idxMacchina}";
if (!string.IsNullOrEmpty(codArticolo))
{
currKey += $":A{codArticolo}";
}
if (!string.IsNullOrEmpty(codGruppo))
{
currKey += $":G{codGruppo}";
}
currKey += onlyFree ? $":FREE" : ":ALL";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<PODLExpModel>>($"{rawData}") ?? new();
}
else
{
result = await IocDbController.POdlGetByMaccArtAsync(idxMacchina, codArticolo, codGruppo, onlyFree);
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, getRandTOut(redisLongTimeCache));
}
if (result == null)
{
result = new List<PODLExpModel>();
}
return result;
}
/// <summary>
/// Eliminazione di un dossier
/// </summary>