OK metodo PODLNext
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user