aggiunti metodi x filtro PODL

This commit is contained in:
zaccaria.majid
2022-11-24 18:30:44 +01:00
parent 0ece87fc87
commit efc59349f3
14 changed files with 373 additions and 62 deletions
+9 -9
View File
@@ -696,30 +696,30 @@ namespace MP.SPEC.Data
/// <param name="codArt">Cod articolo</param>
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
/// <returns></returns>
public async Task<List<PODLModel>> ListPODLFilt(string codArt, string keyRichPart)
public async Task<List<PODLExpModel>> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo)
{
List<PODLModel>? result = new List<PODLModel>();
List<PODLExpModel>? result = new List<PODLExpModel>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisPOdlList}:{codArt}:{keyRichPart}";
string currKey = $"{redisPOdlList}:{lanciato}:{keyRichPart}:{idxMacchina}:{codGruppo}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<PODLModel>>($"{rawData}");
result = JsonConvert.DeserializeObject<List<PODLExpModel>>($"{rawData}");
readType = "REDIS";
}
else
{
result = await Task.FromResult(dbController.ListPODLFilt(codArt, keyRichPart));
result = await Task.FromResult(dbController.ListPODLFilt(lanciato, keyRichPart, idxMacchina, codGruppo));
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache));
}
if (result == null)
{
result = new List<PODLModel>();
result = new List<PODLExpModel>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
@@ -1050,7 +1050,7 @@ namespace MP.SPEC.Data
/// </summary>
/// <param name="currRec"></param>
/// <returns></returns>
public async Task<bool> PODLDeleteRecord(PODLModel currRec)
public async Task<bool> PODLDeleteRecord(PODLExpModel currRec)
{
return await dbController.PODLDeleteRecord(currRec);
}
@@ -1060,7 +1060,7 @@ namespace MP.SPEC.Data
/// </summary>
/// <param name="currRec"></param>
/// <returns></returns>
public async Task<bool> POdlDoSetup(PODLModel currRec)
public async Task<bool> POdlDoSetup(PODLExpModel currRec)
{
return await dbController.PODL_startSetup(currRec, 0, 1, 1, "");
}
@@ -1070,7 +1070,7 @@ namespace MP.SPEC.Data
/// </summary>
/// <param name="currRec"></param>
/// <returns></returns>
public async Task<bool> POdlUpdateRecord(PODLModel currRec)
public async Task<bool> POdlUpdateRecord(PODLExpModel currRec)
{
var dbResult = await dbController.PODLUpdateRecord(currRec);
// elimino cache redis...
+5
View File
@@ -16,6 +16,7 @@ namespace MP.SPEC.Data
public string CodFase { get; set; } = "*";
public int CurrPage { get; set; } = 1;
public string CodReparto { get; set; } = "*";
public string IdxMacchina { get; set; } = "*";
@@ -39,6 +40,7 @@ namespace MP.SPEC.Data
CodFase = this.CodFase,
CurrPage = this.CurrPage,
IdxMacchina = this.IdxMacchina,
CodReparto = this.CodReparto,
MaxRecord = this.MaxRecord,
NumRec = this.NumRec,
SearchVal = this.SearchVal,
@@ -56,6 +58,9 @@ namespace MP.SPEC.Data
if (CodFase != item.CodFase)
return false;
if (CodReparto != item.CodReparto)
return false;
if (MaxRecord != item.MaxRecord)
return false;