Preparazione metodi x spostamento cache Async
This commit is contained in:
@@ -1273,18 +1273,14 @@ namespace MP.Data.Controllers
|
||||
/// <param name="keyKit"></param>
|
||||
/// <param name="keyExtOrd"></param>
|
||||
/// <returns></returns>
|
||||
public List<IstanzeKitModel> IstKitFilt(string keyKit, string keyExtOrd)
|
||||
public async Task<List<IstanzeKitModel>> IstKitFiltAsync(string keyKit, string keyExtOrd)
|
||||
{
|
||||
List<IstanzeKitModel> dbResult = new List<IstanzeKitModel>();
|
||||
using (var dbCtx = new MoonProContext(options))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
using var dbCtx = new MoonProContext(options);
|
||||
return await dbCtx
|
||||
.DbSetInstKit
|
||||
.Where(x => (string.IsNullOrEmpty(keyKit) && string.IsNullOrEmpty(keyExtOrd)) || (x.KeyKit.Contains(keyKit) && !string.IsNullOrEmpty(keyKit)) || (x.KeyExtOrd.Contains(keyExtOrd) && !string.IsNullOrEmpty(keyExtOrd)))
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
.ToListAsync() ?? new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2590,22 +2586,19 @@ namespace MP.Data.Controllers
|
||||
/// <param name="KeyFilt"></param>
|
||||
/// <param name="MaxResult"></param>
|
||||
/// <returns></returns>
|
||||
public List<TksScoreModel> TksScore(string KeyFilt, int MaxResult)
|
||||
public async Task<List<TksScoreModel>> TksScoreAsync(string KeyFilt, int MaxResult)
|
||||
{
|
||||
List<TksScoreModel> dbResult = new List<TksScoreModel>();
|
||||
if (!string.IsNullOrEmpty(KeyFilt))
|
||||
{
|
||||
using (var dbCtx = new MoonProContext(options))
|
||||
{
|
||||
var pKeyFilt = new SqlParameter("@KeyFilt", KeyFilt);
|
||||
var pMaxRes = new SqlParameter("@maxResult", MaxResult);
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetTksScore
|
||||
.FromSqlRaw("EXEC stp_TKS_Search @KeyFilt, @maxResult", pKeyFilt, pMaxRes)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
using var dbCtx = new MoonProContext(options);
|
||||
var pKeyFilt = new SqlParameter("@KeyFilt", KeyFilt);
|
||||
var pMaxRes = new SqlParameter("@maxResult", MaxResult);
|
||||
dbResult = await dbCtx
|
||||
.DbSetTksScore
|
||||
.FromSqlRaw("EXEC stp_TKS_Search @KeyFilt, @maxResult", pKeyFilt, pMaxRes)
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
@@ -2712,20 +2705,18 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="KeyFilt"></param>
|
||||
/// <returns></returns>
|
||||
public List<WipSetupKitModel> WipKitFilt(string KeyFilt)
|
||||
public async Task<List<WipSetupKitModel>> WipKitFiltAsync(string KeyFilt)
|
||||
{
|
||||
List<WipSetupKitModel> dbResult = new List<WipSetupKitModel>();
|
||||
// solo se filtro valido...
|
||||
if (!string.IsNullOrEmpty(KeyFilt))
|
||||
{
|
||||
using (var dbCtx = new MoonProContext(options))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetWipKit
|
||||
.Where(x => x.KeyFilt.Contains(KeyFilt))
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
using var dbCtx = new MoonProContext(options);
|
||||
dbResult = await dbCtx
|
||||
.DbSetWipKit
|
||||
.Where(x => x.KeyFilt.Contains(KeyFilt))
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>MP.Land</RootNamespace>
|
||||
<Version>8.16.2605.2810</Version>
|
||||
<Version>8.16.2605.2811</Version>
|
||||
<Configurations>Debug;Release;Debug_LiManDebug</Configurations>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
<RunAnalyzersDuringBuild>True</RunAnalyzersDuringBuild>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo Tablet MAPO - DotNet6</i>
|
||||
<h4>Versione: 8.16.2605.2810</h4>
|
||||
<h4>Versione: 8.16.2605.2811</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2605.2810
|
||||
8.16.2605.2811
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2605.2810</version>
|
||||
<version>8.16.2605.2811</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -68,10 +68,9 @@ namespace MP.SPEC.Components.ProdKit
|
||||
DateTime oggi = DateTime.Today;
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
//base.OnParametersSet();
|
||||
ReloadData();
|
||||
await ReloadDataAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -106,7 +105,7 @@ namespace MP.SPEC.Components.ProdKit
|
||||
await EC_IsComposing.InvokeAsync(isComposing);
|
||||
|
||||
// rileggo
|
||||
ReloadData();
|
||||
await ReloadDataAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +161,7 @@ namespace MP.SPEC.Components.ProdKit
|
||||
{
|
||||
calcKitCode();
|
||||
}
|
||||
ReloadData();
|
||||
await ReloadDataAsync();
|
||||
isComposing = false;
|
||||
await EC_IsComposing.InvokeAsync(isComposing);
|
||||
}
|
||||
@@ -171,7 +170,7 @@ namespace MP.SPEC.Components.ProdKit
|
||||
{
|
||||
ActFilt.HasOdl = setHasOdl;
|
||||
await EC_FiltUpdated.InvokeAsync(ActFilt);
|
||||
ReloadData();
|
||||
await ReloadDataAsync();
|
||||
}
|
||||
|
||||
private async Task ForceReset()
|
||||
@@ -184,13 +183,13 @@ namespace MP.SPEC.Components.ProdKit
|
||||
await EC_FiltUpdated.InvokeAsync(ActFilt);
|
||||
}
|
||||
|
||||
private void ReloadData()
|
||||
private async Task ReloadDataAsync()
|
||||
{
|
||||
listPOdlCheck = new List<PODLExpModel>();
|
||||
listPOdlAct = MDService.POdlListGetFilt(ActFilt.HasOdl, ActFilt.CodFase, ActFilt.IdxMacchina, ActFilt.CodReparto, ActFilt.DtStart, ActFilt.DtEnd);
|
||||
listWSM = MDService.WipKitFilt(keyFilt);
|
||||
listTSM = MDService.TksScore(keyFilt, 1000, true);
|
||||
listIKP = MDService.IstKitFilt("", "");
|
||||
listPOdlAct = await MDService.POdlListGetFiltAsync(ActFilt.HasOdl, ActFilt.CodFase, ActFilt.IdxMacchina, ActFilt.CodReparto, ActFilt.DtStart, ActFilt.DtEnd);
|
||||
listWSM = await MDService.WipKitFiltAsync(keyFilt);
|
||||
listTSM = await MDService.TksScoreAsync(keyFilt, 1000, true);
|
||||
listIKP = await MDService.IstKitFiltAsync("", "");
|
||||
// verifico se ho score 100%...
|
||||
var recMaxScore = listTSM
|
||||
.Where(x => x.TotalScore == 1)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<div class="input-group me-2" style="min-width: 20rem;">
|
||||
<span class="input-group-text"><i class="fa fa-search"></i></span>
|
||||
<input type="text" class="form-control" placeholder="@($"Cod Commessa | Ctrl-R")" aria-label="Ricerca" title="@($"Ricerca Commessa | Ctrl-R")" @bind="@SearchComm" accesskey="R">
|
||||
<input type="text" class="form-control" placeholder="@($"Cod Commessa | Ctrl-R")" aria-label="Ricerca" title="@($"Ricerca Commessa | Ctrl-R")" @bind="@SearchComm" @bind:after="ResetDataAsync" accesskey="R">
|
||||
<button class="btn @sParentCss" @onclick="() => ResetParent()"><i class="fa fa-ban"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -46,13 +46,17 @@ namespace MP.SPEC.Components
|
||||
if (sCodComm != value)
|
||||
{
|
||||
sCodComm = value;
|
||||
currPage = 1;
|
||||
ListRecords = null;
|
||||
ReloadData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ResetDataAsync()
|
||||
{
|
||||
currPage = 1;
|
||||
ListRecords = null;
|
||||
await ReloadDataAsync();
|
||||
}
|
||||
|
||||
protected string sParentCss
|
||||
{
|
||||
get => string.IsNullOrEmpty(sCodComm) ? "btn-secondary" : "btn-primary";
|
||||
@@ -92,8 +96,7 @@ namespace MP.SPEC.Components
|
||||
protected async Task DoCancel()
|
||||
{
|
||||
EditRecord = null;
|
||||
ReloadData();
|
||||
await Task.Delay(1);
|
||||
await ResetDataAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -106,11 +109,9 @@ namespace MP.SPEC.Components
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione riga Istanza KIT: sei sicuro di voler procedere?"))
|
||||
return;
|
||||
|
||||
await Task.Delay(1);
|
||||
var done = await MDService.IstKitDelete(selRec);
|
||||
EditRecord = null;
|
||||
ReloadData();
|
||||
await Task.Delay(1);
|
||||
await ResetDataAsync();
|
||||
}
|
||||
|
||||
protected async Task DoUpdate(IstanzeKitModel selRec)
|
||||
@@ -118,11 +119,9 @@ namespace MP.SPEC.Components
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare le modifiche?"))
|
||||
return;
|
||||
|
||||
await Task.Delay(1);
|
||||
var done = await MDService.IstKitUpsert(selRec);
|
||||
EditRecord = null;
|
||||
ReloadData();
|
||||
await Task.Delay(1);
|
||||
await ResetDataAsync();
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
@@ -147,20 +146,16 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
ReloadData();
|
||||
await ReloadDataAsync();
|
||||
}
|
||||
|
||||
protected void ResetData()
|
||||
{
|
||||
EditRecord = null;
|
||||
}
|
||||
|
||||
protected void ResetParent()
|
||||
protected async Task ResetParent()
|
||||
{
|
||||
SearchComm = "";
|
||||
ReloadData();
|
||||
await ResetDataAsync();
|
||||
}
|
||||
|
||||
protected void ResetSel()
|
||||
@@ -184,10 +179,10 @@ namespace MP.SPEC.Components
|
||||
numRecord = newNum;
|
||||
}
|
||||
|
||||
protected void UpdateData()
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
EditRecord = null;
|
||||
ReloadData();
|
||||
await ResetDataAsync();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
@@ -242,7 +237,7 @@ namespace MP.SPEC.Components
|
||||
if (_currPage != value)
|
||||
{
|
||||
_currPage = value;
|
||||
ReloadData();
|
||||
ReloadDataAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,7 +252,7 @@ namespace MP.SPEC.Components
|
||||
if (_numRecord != value)
|
||||
{
|
||||
_numRecord = value;
|
||||
ReloadData();
|
||||
ReloadDataAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -270,17 +265,22 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void ReloadData()
|
||||
private async Task ReloadDataAsync()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = MDService.IstKitFilt("", "");
|
||||
SearchRecords = await MDService.IstKitFiltAsync("", "");
|
||||
totalCount = SearchRecords.Count;
|
||||
// conto i kit = distinct...
|
||||
kitCount = SearchRecords.GroupBy(x => x.CodArtParent).Count();
|
||||
ListRecords = SearchRecords
|
||||
UpdateTable();
|
||||
}
|
||||
|
||||
private void UpdateTable()
|
||||
{
|
||||
ListRecords = SearchRecords?
|
||||
.Skip(numRecord * (currPage - 1))
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
.ToList() ?? new();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1102,38 +1102,19 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Gruppi
|
||||
/// Elenco FluxLog in modalità Pareto
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ParetoFluxLogDTO>> FluxLogParetoAsync(string idxMacchina, DateTime dtFrom, DateTime dtTo)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("FluxLogParetoAsync");
|
||||
string source = "DB";
|
||||
List<ParetoFluxLogDTO>? result = new List<ParetoFluxLogDTO>();
|
||||
// cerco in redis...
|
||||
string redKey = $"{Utils.redisParetoFLKey}:{idxMacchina}:{dtFrom:yyyyMMdd}:{dtTo:yyyyMMdd}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(redKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<ParetoFluxLogDTO>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await dbController.FluxLogParetoAsync(idxMacchina, dtFrom, dtTo);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(redKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<ParetoFluxLogDTO>();
|
||||
}
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.SetTag("result.count", result.Count);
|
||||
activity?.Stop();
|
||||
LogTrace($"FluxLogParetoAsync | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
return await GetOrFetchAsync(
|
||||
operationName: "FluxLogParetoAsync",
|
||||
cacheKey: redKey,
|
||||
expiration: TimeSpan.FromMinutes(redisLongTimeCache),
|
||||
fetchFunc: async () => await dbController.FluxLogParetoAsync(idxMacchina, dtFrom, dtTo) ?? new List<ParetoFluxLogDTO>(),
|
||||
tagList: [Utils.redisParetoFLKey]
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1270,14 +1251,14 @@ namespace MP.SPEC.Data
|
||||
/// <param name="keyKit"></param>
|
||||
/// <param name="keyExtOrd"></param>
|
||||
/// <returns></returns>
|
||||
public List<IstanzeKitModel> IstKitFilt(string keyKit, string keyExtOrd)
|
||||
public async Task<List<IstanzeKitModel>> IstKitFiltAsync(string keyKit, string keyExtOrd)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("IstKitFilt");
|
||||
using var activity = ActivitySource.StartActivity("IstKitFiltAsync");
|
||||
string source = "DB";
|
||||
List<IstanzeKitModel>? result = new List<IstanzeKitModel>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{Utils.redisKitInst}:{keyKit}:{keyExtOrd}";
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<IstanzeKitModel>>($"{rawData}");
|
||||
@@ -1285,10 +1266,10 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbController.IstKitFilt(keyKit, keyExtOrd);
|
||||
result = await dbController.IstKitFiltAsync(keyKit, keyExtOrd);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, TimeSpan.FromMinutes(redisLongTimeCache));
|
||||
await redisDb.StringSetAsync(currKey, rawData, TimeSpan.FromMinutes(redisLongTimeCache));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
@@ -1297,7 +1278,7 @@ namespace MP.SPEC.Data
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.SetTag("result.count", result.Count);
|
||||
activity?.Stop();
|
||||
LogTrace($"IstKitFilt | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"IstKitFiltAsync | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1547,33 +1528,14 @@ namespace MP.SPEC.Data
|
||||
/// <returns></returns>
|
||||
public async Task<List<string>> MacchineWithFluxAsync(DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("MacchineWithFluxAsync");
|
||||
List<string>? result = new List<string>();
|
||||
string source = "DB";
|
||||
string currKey = $"{Utils.redisMacByFlux}:{dtStart:yyyyMMddHHmm}:{dtEnd:yyyyMMddHHmm}";
|
||||
// cerco in redis dato valore sel idxMaccSel...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<string>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await dbController.MacchineWithFluxAsync(dtStart, dtEnd);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<string>();
|
||||
}
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.SetTag("result.count", result.Count);
|
||||
activity?.Stop();
|
||||
LogTrace($"MacchineWithFluxAsync | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
return await GetOrFetchAsync(
|
||||
operationName: "MacchineWithFluxAsync",
|
||||
cacheKey: currKey,
|
||||
expiration: TimeSpan.FromMinutes(redisLongTimeCache),
|
||||
fetchFunc: async () => await dbController.MacchineWithFluxAsync(dtStart, dtEnd) ?? new List<string>(),
|
||||
tagList: [Utils.redisMacByFlux]
|
||||
);
|
||||
}
|
||||
|
||||
public async Task<List<string>> MachineWithOdlAsync()
|
||||
@@ -2526,14 +2488,14 @@ namespace MP.SPEC.Data
|
||||
/// <param name="MaxResult"></param>
|
||||
/// <param name="ForceDb"></param>
|
||||
/// <returns></returns>
|
||||
public List<TksScoreModel> TksScore(string KeyFilt, int MaxResult, bool ForceDb)
|
||||
public async Task<List<TksScoreModel>> TksScoreAsync(string KeyFilt, int MaxResult, bool ForceDb)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("TksScore");
|
||||
using var activity = ActivitySource.StartActivity("TksScoreAsync");
|
||||
string source = "DB";
|
||||
List<TksScoreModel>? result = new List<TksScoreModel>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{Utils.redisKitScore}:{KeyFilt}:{MaxResult}";
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (rawData.HasValue && !ForceDb)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<TksScoreModel>>($"{rawData}");
|
||||
@@ -2541,10 +2503,10 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbController.TksScore(KeyFilt, MaxResult);
|
||||
result = await dbController.TksScoreAsync(KeyFilt, MaxResult);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, TimeSpan.FromMinutes(redisLongTimeCache));
|
||||
await redisDb.StringSetAsync(currKey, rawData, TimeSpan.FromMinutes(redisLongTimeCache));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
@@ -2553,7 +2515,7 @@ namespace MP.SPEC.Data
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.SetTag("result.count", result.Count);
|
||||
activity?.Stop();
|
||||
LogTrace($"TksScore | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"TksScoreAsync | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2657,14 +2619,14 @@ namespace MP.SPEC.Data
|
||||
/// </summary>
|
||||
/// <param name="KeyFilt"></param>
|
||||
/// <returns></returns>
|
||||
public List<WipSetupKitModel> WipKitFilt(string KeyFilt)
|
||||
public async Task<List<WipSetupKitModel>> WipKitFiltAsync(string KeyFilt)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("WipKitFilt");
|
||||
using var activity = ActivitySource.StartActivity("WipKitFiltAsync");
|
||||
string source = "DB";
|
||||
List<WipSetupKitModel>? result = new List<WipSetupKitModel>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{Utils.redisKitWip}:{KeyFilt}";
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<WipSetupKitModel>>($"{rawData}");
|
||||
@@ -2672,10 +2634,10 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbController.WipKitFilt(KeyFilt);
|
||||
result = await dbController.WipKitFiltAsync(KeyFilt);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, TimeSpan.FromMinutes(redisLongTimeCache));
|
||||
await redisDb.StringSetAsync(currKey, rawData, TimeSpan.FromMinutes(redisLongTimeCache));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
@@ -2684,7 +2646,7 @@ namespace MP.SPEC.Data
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.SetTag("result.count", result.Count);
|
||||
activity?.Stop();
|
||||
LogTrace($"WipKitFilt | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"WipKitFiltAsync | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.SPEC</RootNamespace>
|
||||
<Version>8.16.2605.2810</Version>
|
||||
<Version>8.16.2605.2811</Version>
|
||||
<UserSecretsId>1800a78a-6ff1-40f9-b490-87fb8bfc1394</UserSecretsId>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -361,8 +361,8 @@ namespace MP.SPEC.Pages
|
||||
{
|
||||
ListGruppiFase = allGruppiData.Where(x => x.SelEnabled).ToList();
|
||||
}
|
||||
ListMacchine = MDService.MacchineGetFilt(repartoSel);
|
||||
SearchRecords = MDService.IstKitFilt("", "");
|
||||
ListMacchine = await MDService.MacchineGetFiltAsync(repartoSel);
|
||||
SearchRecords = await MDService.IstKitFiltAsync("", "");
|
||||
totalCount = SearchRecords.Count;
|
||||
// conto i kit = distinct...
|
||||
kitCount = SearchRecords.GroupBy(x => x.CodArtParent).Count();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 8.16.2605.2810</h4>
|
||||
<h4>Versione: 8.16.2605.2811</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2605.2810
|
||||
8.16.2605.2811
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2605.2810</version>
|
||||
<version>8.16.2605.2811</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user