- Update gestione spostamento fasi con stored clona/sposta
- gestione abilitazione rapida azioni da stato sel
- ottimizzazione meccanismo preselezione cli/proj
This commit is contained in:
Samuele Locatelli
2024-10-03 10:04:19 +02:00
parent b072312a71
commit ac5c8b3880
10 changed files with 556 additions and 135 deletions
+13 -11
View File
@@ -15,16 +15,22 @@
</div>
}
<div class="card">
<div class="card-header">
<div class="card-header @HeadCss">
<div class="d-flex justify-content-between">
@if (CanSelProj)
{
@if (!string.IsNullOrEmpty(Title))
{
<div class="ps-0 pe-2">
<h4>@Title</h4>
</div>
}
<div class="px-0">
<div class="px-0 d-flex">
<div class="px-0">
<div class="input-group">
<span class="input-group-text" title="Cliente">C</span>
<select @bind="@idxCli" class="form-select form-select-sm" title="Cliente" @bind:after=ReloadProj>
<select @bind="@IdxCli" class="form-select form-select-sm" title="Cliente" @bind:after=SaveCli>
<option value="0">--- Selezionare ---</option>
@foreach (var item in ListClienti)
{
@@ -37,7 +43,7 @@
<div class="input-group">
<span class="input-group-text" title="Progetto">P</span>
<select @bind="@idxPrj" class="form-select form-select-sm" title="Progetto" @bind:after=ReloadData>
<select @bind="@IdxPrj" class="form-select form-select-sm" title="Progetto" @bind:after=SaveProj>
<option value="0">--- Selezionare ---</option>
@foreach (var item in ListProgetti)
{
@@ -113,12 +119,12 @@
{
<tr class="align-middle @CheckSel(item)">
<td>
@if (ShowSelect)
{
<button class="btn btn-info btn-sm" @onclick="() => DoSelect(item)"><i class="fa-solid fa-search"></i></button>
}
@if (RecordSel == null)
{
@if (ShowSelect)
{
<button class="btn btn-info btn-sm" @onclick="() => DoSelect(item)"><i class="fa-solid fa-search"></i></button>
}
@if (!CanSelProj)
{
<button class="btn btn-primary btn-sm" @onclick="() => DoEdit(item)"><i class="fa-solid fa-edit"></i></button>
@@ -126,10 +132,6 @@
}
else
{
@if (ShowSelect)
{
<button class="btn btn-secondary btn-sm" disabled><i class="fa-solid fa-search"></i></button>
}
@if (!CanSelProj)
{
<button class="btn btn-secondary btn-sm" disabled><i class="fa-solid fa-edit"></i></button>
+78 -9
View File
@@ -18,12 +18,21 @@ namespace GPW.CORE.ADM.Components.Compo
[Parameter]
public bool ChkLicOk { get; set; } = true;
[Parameter]
public EventCallback<AnagFasiExplModel> EC_FaseSel { get; set; }
[Parameter]
public EventCallback<int> EC_ProjSel { get; set; }
[Parameter]
public EventCallback<bool> EC_update { get; set; }
[Parameter]
public bool EnableAddFasi { get; set; } = true;
[Parameter]
public string HeadCss { get; set; } = "";
[Parameter]
public List<AnagFasiExplModel>? ListRecords
{
@@ -37,6 +46,9 @@ namespace GPW.CORE.ADM.Components.Compo
[Parameter]
public bool ShowSelect { get; set; } = true;
[Parameter]
public string Title { get; set; } = "";
#endregion Public Properties
#region Protected Properties
@@ -47,6 +59,30 @@ namespace GPW.CORE.ADM.Components.Compo
[Inject]
protected GpwDataService GDataServ { get; set; } = null!;
protected int IdxCli
{
get => idxCli;
set
{
if (idxCli != value)
{
idxCli = value;
}
}
}
protected int IdxPrj
{
get => idxPrj;
set
{
if (idxPrj != value)
{
idxPrj = value;
}
}
}
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
@@ -145,16 +181,18 @@ namespace GPW.CORE.ADM.Components.Compo
}
}
protected void DoSelect(AnagFasiExplModel? selItem)
protected async Task DoSelect(AnagFasiExplModel? selItem)
{
RecordSel = selItem;
RecordEdit = null;
await EC_FaseSel.InvokeAsync(selItem);
}
protected async Task ForceReload()
{
RecordEdit = null;
RecordSel = null;
await EC_FaseSel.InvokeAsync(null);
await EC_update.InvokeAsync(true);
await Task.Delay(1);
isLoading = false;
@@ -164,7 +202,7 @@ namespace GPW.CORE.ADM.Components.Compo
/// init valori da config
/// </summary>
/// <returns></returns>
protected async Task initConf()
protected async Task InitConf()
{
// leggo conf standard controllo RegAtt
var sWarningRatioPerc = await GDataServ.ConfigGetKey("WarningRatioPerc");
@@ -176,7 +214,8 @@ namespace GPW.CORE.ADM.Components.Compo
protected override async Task OnInitializedAsync()
{
await initConf();
await InitConf();
await ReloadSel();
await ReloadData();
}
@@ -185,6 +224,21 @@ namespace GPW.CORE.ADM.Components.Compo
await ReloadData();
}
/// <summary>
/// Tentativo rilettura selezione se possibile..
/// </summary>
/// <returns></returns>
protected async Task ReloadSel()
{
// verifico di essere in modalità con selezione permessa x preselezione
if (CanSelProj)
{
IdxCli = await AppMServ.UserPrefGet<int>($"FasiMan_{Title}_idxCli");
IdxPrj = await AppMServ.UserPrefGet<int>($"FasiMan_{Title}_idxPrj");
await EC_ProjSel.InvokeAsync(IdxPrj);
}
}
#endregion Protected Methods
#region Private Fields
@@ -280,28 +334,43 @@ namespace GPW.CORE.ADM.Components.Compo
ListClienti = ListClienti.Where(x => x.Attivo).ToList();
}
// seleziono proj da client
if (idxCli > 0)
if (IdxCli > 0)
{
ListProgetti = await GDataServ.AnagProjByCli(idxCli);
ListProgetti = await GDataServ.AnagProjByCli(IdxCli);
if (ShowOnlyActive)
{
ListProgetti = ListProgetti.Where(x => x.Attivo ?? false).ToList();
}
}
// se abilitato x rilettura locale --> leggo fasi!
if (CanSelProj && idxCli > 0 && idxPrj > 0)
if (CanSelProj && IdxCli > 0 && IdxPrj > 0)
{
listRecords = await GDataServ.AnagFasiExplByProj(idxPrj);
listRecords = await GDataServ.AnagFasiExplByProj(IdxPrj);
}
}
totalCount = listRecords.Count;
isLoading = false;
}
private async Task ReloadProj()
private async Task SaveCli()
{
idxPrj = 0;
IdxPrj = 0;
await ReloadData();
await EC_ProjSel.InvokeAsync(IdxPrj);
await SaveSelection();
}
private async Task SaveProj()
{
await ReloadData();
await EC_ProjSel.InvokeAsync(IdxPrj);
await SaveSelection();
}
private async Task SaveSelection()
{
await AppMServ.UserPrefSet($"FasiMan_{Title}_idxCli", $"{IdxCli}");
await AppMServ.UserPrefSet($"FasiMan_{Title}_idxPrj", $"{IdxPrj}");
}
#endregion Private Methods
@@ -3,7 +3,7 @@
<div class="card-header">
<div class="d-flex justify-content-between">
<div class="px-0">
<h3>Spostamento Fasi</h3>
<h3>Spostamento Fasi</h3>
</div>
<div class="px-0 align-content-center">
<div class="form-check form-switch">
@@ -14,13 +14,60 @@
</div>
</div>
<div class="card-body p-1">
<div class="row my-1">
@if (OkFase)
{
<div class="col-3">
<button class="btn btn-primary w-100" @onclick=SpostaFase>Sposta Fase</button>
</div>
<div class="col-3">
<button class="btn btn-success w-100" @onclick=ClonaFase>Clona Fase</button>
</div>
}
else
{
<div class="col-3">
<button class="btn btn-secondary w-100" disabled>Sposta Fase</button>
</div>
<div class="col-3">
<button class="btn btn-secondary w-100" disabled>Clona Fase</button>
</div>
}
@if (OkSubFase)
{
<div class="col-3">
<button class="btn btn-primary w-100" @onclick=SpostaSubFase>Sposta SottoFase</button>
</div>
<div class="col-3">
<button class="btn btn-success w-100" @onclick=ClonaSubFase>Clona SottoFase</button>
</div>
}
else
{
<div class="col-3">
<button class="btn btn-secondary w-100" disabled>Sposta SottoFase</button>
</div>
<div class="col-3">
<button class="btn btn-secondary w-100" disabled>Clona SottoFase</button>
</div>
}
</div>
<div class="row">
<div class="col-6">
<FasiMan CanSelProj="true" ShowOnlyActive="!ShowPrjArc"></FasiMan>
</div>
<div class="col-6">
<FasiMan CanSelProj="true" ShowOnlyActive="!ShowPrjArc"></FasiMan>
</div>
@if (isLoading)
{
<div class="col-12">
<LoadingData DisplaySize="LoadingData.CtrlSize.Large"></LoadingData>
</div>
}
else
{
<div class="col-6">
<FasiMan Title="Origine" HeadCss="bg-info bg-opacity-75 bg-gradient" CanSelProj="true" ShowOnlyActive="!ShowPrjArc" EC_FaseSel="SetFaseOrig"></FasiMan>
</div>
<div class="col-6">
<FasiMan Title="Destinazione" HeadCss="bg-success bg-opacity-75 bg-gradient" CanSelProj="true" ShowOnlyActive="!ShowPrjArc" EC_FaseSel="SetFaseDest" EC_ProjSel="SetProjDest"></FasiMan>
</div>
}
</div>
</div>
</div>
@@ -1,7 +1,105 @@
using GPW.CORE.Data.DbModels;
using GPW.CORE.Data.Services;
using Microsoft.AspNetCore.Components;
namespace GPW.CORE.ADM.Components.Compo
{
public partial class SpostaFasiMan
{
protected bool ShowPrjArc = false;
#region Protected Properties
[Inject]
protected GpwDataService GDataServ { get; set; } = null!;
protected bool OkFase
{
get => selFaseOrig != null && selFaseOrig.IdxFaseAncest == 0 && selFaseDest == null && selIdxProjDest > 0;
}
protected bool OkSubFase
{
get => selFaseOrig != null && selFaseOrig.IdxFaseAncest != 0 && selFaseDest != null && selFaseDest.IdxFaseAncest == 0;
}
#endregion Protected Properties
#region Protected Methods
protected async Task ClonaFase()
{
isLoading = true;
if (selFaseOrig != null)
{
await GDataServ.AnagFasiDupFase(selIdxProjDest, selFaseOrig.IdxFase);
}
await Task.Delay(100);
isLoading = false;
}
protected async Task ClonaSubFase()
{
isLoading = true;
if (selFaseOrig != null && selFaseDest != null)
{
await GDataServ.AnagFasiDupSubFase(selFaseDest.IdxFase, selFaseOrig.IdxFase);
}
await Task.Delay(100);
isLoading = false;
}
protected void SetFaseDest(AnagFasiExplModel selFase)
{
selFaseDest = selFase;
}
protected void SetFaseOrig(AnagFasiExplModel selFase)
{
selFaseOrig = selFase;
}
protected void SetProjDest(int idxProj)
{
selIdxProjDest = idxProj;
}
protected async Task SpostaFase()
{
isLoading = true;
if (selFaseOrig != null)
{
await GDataServ.AnagFasiMovFase(selIdxProjDest, selFaseOrig.IdxFase);
}
await Task.Delay(100);
isLoading = false;
}
protected async Task SpostaSubFase()
{
isLoading = true;
if (selFaseOrig != null && selFaseDest != null)
{
await GDataServ.AnagFasiMovSubFase(selFaseDest.IdxFase, selFaseOrig.IdxFase);
}
await Task.Delay(100);
isLoading = false;
}
#endregion Protected Methods
#region Private Fields
private bool isLoading = false;
private bool ShowPrjArc = false;
#endregion Private Fields
#region Private Properties
private AnagFasiExplModel? selFaseDest { get; set; } = null;
private AnagFasiExplModel? selFaseOrig { get; set; } = null;
private int selIdxProjDest { get; set; } = 0;
#endregion Private Properties
}
}
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>4.1.2410.0209</Version>
<Version>4.1.2410.0310</Version>
</PropertyGroup>
<ItemGroup>
+121 -2
View File
@@ -427,6 +427,66 @@ namespace GPW.CORE.Data.Controllers
return answ;
}
/// <summary>
/// Esegue stored x DUPLICARE Fase (ancestor) tra progetti
/// </summary>
/// <param name="idxProjDest"></param>
/// <param name="idxFaseSrc"></param>
/// <returns></returns>
public bool AnagFasiDupFase(int idxProjDest, int idxFaseSrc)
{
bool fatto = false;
// cerco su DB recuperando set di dati....
using (GPWContext dbCtx = new GPWContext(_configuration))
{
try
{
var pIdxPrj = new SqlParameter("@idxProgetto", idxProjDest);
var pIdxFase = new SqlParameter("@Original_idxFase", idxFaseSrc);
var dbResult = dbCtx
.Database
.ExecuteSqlRaw("EXEC stp_AF_clonaFaseAnc @idxProgetto, @Original_idxFase", pIdxPrj, pIdxFase);
fatto = dbResult != 0;
}
catch (Exception exc)
{
Log.Error($"Errore in AnagFasiDupFase:{Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Esegue stored x DUPLICARE SottoFase in un altra Fase (ancestor)
/// </summary>
/// <param name="idxFaseDest"></param>
/// <param name="idxFaseSrc"></param>
/// <returns></returns>
public bool AnagFasiDupSubFase(int idxFaseDest, int idxFaseSrc)
{
bool fatto = false;
// cerco su DB recuperando set di dati....
using (GPWContext dbCtx = new GPWContext(_configuration))
{
try
{
var pIdxFaseDest = new SqlParameter("@idxFaseAncest", idxFaseDest);
var pIdxFaseSrc = new SqlParameter("@Original_idxFase", idxFaseSrc);
var dbResult = dbCtx
.Database
.ExecuteSqlRaw("EXEC stp_AF_clonaFase @idxFaseAncest, @Original_idxFase", pIdxFaseDest, pIdxFaseSrc);
fatto = dbResult != 0;
}
catch (Exception exc)
{
Log.Error($"Errore in AnagFasiDupSubFase:{Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Elenco FasiExpl dato chiave progetto
/// </summary>
@@ -485,6 +545,66 @@ namespace GPW.CORE.Data.Controllers
return result != 0;
}
/// <summary>
/// Esegue stored x spostare Fase (ancestor) tra progetti
/// </summary>
/// <param name="idxProjDest"></param>
/// <param name="idxFaseSrc"></param>
/// <returns></returns>
public bool AnagFasiMovFase(int idxProjDest, int idxFaseSrc)
{
bool fatto = false;
// cerco su DB recuperando set di dati....
using (GPWContext dbCtx = new GPWContext(_configuration))
{
try
{
var pIdxPrj = new SqlParameter("@idxProgetto", idxProjDest);
var pIdxFase = new SqlParameter("@Original_idxFase", idxFaseSrc);
var dbResult = dbCtx
.Database
.ExecuteSqlRaw("EXEC stp_AF_updateProgetto @idxProgetto, @Original_idxFase", pIdxPrj, pIdxFase);
fatto = dbResult != 0;
}
catch (Exception exc)
{
Log.Error($"Errore in AnagFasiMovFase:{Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Esegue stored x spostare SottoFase in un altra Fase (ancestor)
/// </summary>
/// <param name="idxFaseDest"></param>
/// <param name="idxFaseSrc"></param>
/// <returns></returns>
public bool AnagFasiMovSubFase(int idxFaseDest, int idxFaseSrc)
{
bool fatto = false;
// cerco su DB recuperando set di dati....
using (GPWContext dbCtx = new GPWContext(_configuration))
{
try
{
var pIdxFaseDest = new SqlParameter("@idxFaseAncest", idxFaseDest);
var pIdxFaseSrc = new SqlParameter("@Original_idxFase", idxFaseSrc);
var dbResult = dbCtx
.Database
.ExecuteSqlRaw("EXEC stp_AF_updateFaseAncest @idxFaseAncest, @Original_idxFase", pIdxFaseDest, pIdxFaseSrc);
fatto = dbResult != 0;
}
catch (Exception exc)
{
Log.Error($"Errore in AnagFasiMovSubFase:{Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Esecuzione upsert fase
/// </summary>
@@ -789,7 +909,6 @@ namespace GPW.CORE.Data.Controllers
return dbResult;
}
/// <summary>
/// Recupera elenco record da idx cliente
/// </summary>
@@ -806,7 +925,7 @@ namespace GPW.CORE.Data.Controllers
// recupero intero set....
dbResult = dbCtx
.DbSetAnagProgetti
.Where(x => x.IdxCliente==idxCliente)
.Where(x => x.IdxCliente == idxCliente)
.OrderBy(x => x.NomeProj)
.ToList();
}
+187 -101
View File
@@ -393,6 +393,50 @@ namespace GPW.CORE.Data.Services
return answ;
}
/// <summary>
/// Esegue stored x DUPLICARE Fase (ancestor) tra progetti
/// </summary>
/// <param name="idxProjDest"></param>
/// <param name="idxFaseSrc"></param>
/// <returns></returns>
public async Task<bool> AnagFasiDupFase(int idxProjDest, int idxFaseSrc)
{
bool answ = false;
try
{
answ = dbController.AnagFasiDupFase(idxProjDest, idxFaseSrc);
// invalido la cache...
await ExecFlushRedisPattern($"{redisBaseAddr}:*");
}
catch (Exception exc)
{
Log.Error($"Eccezione in AnagFasiDupFase{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
/// Esegue stored x DUPLICARE SottoFase in un altra Fase (ancestor)
/// </summary>
/// <param name="idxFaseDest"></param>
/// <param name="idxFaseSrc"></param>
/// <returns></returns>
public async Task<bool> AnagFasiDupSubFase(int idxFaseDest, int idxFaseSrc)
{
bool answ = false;
try
{
answ = dbController.AnagFasiDupSubFase(idxFaseDest, idxFaseSrc);
// invalido la cache...
await ExecFlushRedisPattern($"{redisBaseAddr}:*");
}
catch (Exception exc)
{
Log.Error($"Eccezione in AnagFasiDupSubFase{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
/// Elenco fasi dato progetto
/// </summary>
@@ -458,6 +502,50 @@ namespace GPW.CORE.Data.Services
return answ;
}
/// <summary>
/// Esegue stored x spostare Fase (ancestor) tra progetti
/// </summary>
/// <param name="idxProjDest"></param>
/// <param name="idxFaseSrc"></param>
/// <returns></returns>
public async Task<bool> AnagFasiMovFase(int idxProjDest, int idxFaseSrc)
{
bool answ = false;
try
{
answ = dbController.AnagFasiMovFase(idxProjDest, idxFaseSrc);
// invalido la cache...
await ExecFlushRedisPattern($"{redisBaseAddr}:*");
}
catch (Exception exc)
{
Log.Error($"Eccezione in AnagFasiMovFase{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
/// Esegue stored x spostare SottoFase in un altra Fase (ancestor)
/// </summary>
/// <param name="idxFaseDest"></param>
/// <param name="idxFaseSrc"></param>
/// <returns></returns>
public async Task<bool> AnagFasiMovSubFase(int idxFaseDest, int idxFaseSrc)
{
bool answ = false;
try
{
answ = dbController.AnagFasiMovSubFase(idxFaseDest, idxFaseSrc);
// invalido la cache...
await ExecFlushRedisPattern($"{redisBaseAddr}:*");
}
catch (Exception exc)
{
Log.Error($"Eccezione in AnagFasiMovSubFase{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
/// Aggiornamento record Fasi
/// </summary>
@@ -562,49 +650,6 @@ namespace GPW.CORE.Data.Services
return dbResult;
}
/// <summary>
/// Recupera l'elenco gruppi abilitati x il dipendente
/// </summary>
/// <param name="idxDipendente"></param>
/// <returns></returns>
public async Task<List<AnagGruppiModel>> AnagGruppiUser(int idxDipendente)
{
string source = "DB";
List<AnagGruppiModel>? dbResult = new List<AnagGruppiModel>();
string currKey = $"{rKeyGrpUser}:{idxDipendente}";
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string? rawData = await redisDb.StringGetAsync(currKey);
if (!string.IsNullOrEmpty(rawData))
{
source = "REDIS";
var tempResult = JsonConvert.DeserializeObject<List<AnagGruppiModel>>(rawData);
if (tempResult == null)
{
dbResult = new List<AnagGruppiModel>();
}
else
{
dbResult = tempResult;
}
}
else
{
dbResult = dbController.AnagGruppiUser(idxDipendente);
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
}
if (dbResult == null)
{
dbResult = new List<AnagGruppiModel>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"AnagGruppiUser | {source} in: {ts.TotalMilliseconds} ms");
return dbResult;
}
/// <summary>
/// Eliminazione record Gruppo
/// </summary>
@@ -647,6 +692,47 @@ namespace GPW.CORE.Data.Services
return answ;
}
/// <summary>
/// Recupera l'elenco gruppi abilitati x il dipendente
/// </summary>
/// <param name="idxDipendente"></param>
/// <returns></returns>
public async Task<List<AnagGruppiModel>> AnagGruppiUser(int idxDipendente)
{
string source = "DB";
List<AnagGruppiModel>? dbResult = new List<AnagGruppiModel>();
string currKey = $"{rKeyGrpUser}:{idxDipendente}";
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string? rawData = await redisDb.StringGetAsync(currKey);
if (!string.IsNullOrEmpty(rawData))
{
source = "REDIS";
var tempResult = JsonConvert.DeserializeObject<List<AnagGruppiModel>>(rawData);
if (tempResult == null)
{
dbResult = new List<AnagGruppiModel>();
}
else
{
dbResult = tempResult;
}
}
else
{
dbResult = dbController.AnagGruppiUser(idxDipendente);
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
}
if (dbResult == null)
{
dbResult = new List<AnagGruppiModel>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"AnagGruppiUser | {source} in: {ts.TotalMilliseconds} ms");
return dbResult;
}
/// <summary>
/// Dati orario del dipendente indicato
@@ -731,23 +817,6 @@ namespace GPW.CORE.Data.Services
return dbResult;
}
/// <summary>
/// Recupera record da idx richiesto
/// </summary>
/// <returns></returns>
public AnagProgettiModel AnagProjByKey(int IdxProj)
{
string source = "DB";
AnagProgettiModel dbResult = new AnagProgettiModel();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = dbController.AnagProjByKey(IdxProj);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"AnagProjByKey | {source} in: {ts.TotalMilliseconds} ms");
return dbResult;
}
/// <summary>
/// Recupera elenco record da idx cliente
/// </summary>
@@ -789,6 +858,23 @@ namespace GPW.CORE.Data.Services
return dbResult;
}
/// <summary>
/// Recupera record da idx richiesto
/// </summary>
/// <returns></returns>
public AnagProgettiModel AnagProjByKey(int IdxProj)
{
string source = "DB";
AnagProgettiModel dbResult = new AnagProgettiModel();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = dbController.AnagProjByKey(IdxProj);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"AnagProjByKey | {source} in: {ts.TotalMilliseconds} ms");
return dbResult;
}
/// <summary>
/// Elenco progetti calcolati con ore avanzamento filtrata
/// </summary>
@@ -1483,47 +1569,6 @@ namespace GPW.CORE.Data.Services
return EgwCoreLib.Utils.SteamCrypto.DecryptString(encData, passPhrase);
}
/// <summary>
/// Elenco dip dato un gruppo (se "" ritorna tutti)
/// </summary>
/// <returns></returns>
public async Task<List<DipendentiModel>> DipendentiByGrp(string Gruppo)
{
string source = "DB";
List<DipendentiModel>? dbResult = new List<DipendentiModel>();
string currKey = $"{rKeyDipendenti}:ByGrp:{Gruppo}";
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string? rawData = await redisDb.StringGetAsync(currKey);
if (!string.IsNullOrEmpty(rawData))
{
source = "REDIS";
var tempResult = JsonConvert.DeserializeObject<List<DipendentiModel>>(rawData);
if (tempResult == null)
{
dbResult = new List<DipendentiModel>();
}
else
{
dbResult = tempResult;
}
}
else
{
dbResult = dbController.DipendentiByGrp(Gruppo);
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
}
if (dbResult == null)
{
dbResult = new List<DipendentiModel>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"DipendentiByGrp | {source} in: {ts.TotalMilliseconds} ms");
return dbResult;
}
/// <summary>
/// Clona assegnazione gruppi dipendente
/// </summary>
@@ -1590,6 +1635,47 @@ namespace GPW.CORE.Data.Services
return answ;
}
/// <summary>
/// Elenco dip dato un gruppo (se "" ritorna tutti)
/// </summary>
/// <returns></returns>
public async Task<List<DipendentiModel>> DipendentiByGrp(string Gruppo)
{
string source = "DB";
List<DipendentiModel>? dbResult = new List<DipendentiModel>();
string currKey = $"{rKeyDipendenti}:ByGrp:{Gruppo}";
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string? rawData = await redisDb.StringGetAsync(currKey);
if (!string.IsNullOrEmpty(rawData))
{
source = "REDIS";
var tempResult = JsonConvert.DeserializeObject<List<DipendentiModel>>(rawData);
if (tempResult == null)
{
dbResult = new List<DipendentiModel>();
}
else
{
dbResult = tempResult;
}
}
else
{
dbResult = dbController.DipendentiByGrp(Gruppo);
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
}
if (dbResult == null)
{
dbResult = new List<DipendentiModel>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"DipendentiByGrp | {source} in: {ts.TotalMilliseconds} ms");
return dbResult;
}
public async Task<List<DipendentiModel>> DipendentiGetAll()
{
string source = "DB";
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>GPW - Gestione Presenze Web</i>
<h4>Versione: 4.1.2410.0209</h4>
<h4>Versione: 4.1.2410.0310</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
4.1.2410.0209
4.1.2410.0310
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>4.1.2410.0209</version>
<version>4.1.2410.0310</version>
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>