From 178d7a3ef0938254680afe0b0a57e9b46e20bb6f Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 5 Mar 2024 18:47:24 +0100 Subject: [PATCH 1/3] Update pag presenze --- GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj | 2 +- GPW.CORE.WRKLOG/Pages/Presenze.razor | 40 ++++ GPW.CORE.WRKLOG/Pages/Presenze.razor.cs | 238 +++++++++++++++++++ GPW.CORE.WRKLOG/Pages/WeekPlan.razor.cs | 3 - GPW.CORE.WRKLOG/Shared/LoginDisplay.razor | 20 +- GPW.CORE.WRKLOG/Shared/LoginDisplay.razor.cs | 1 + Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 9 files changed, 292 insertions(+), 18 deletions(-) create mode 100644 GPW.CORE.WRKLOG/Pages/Presenze.razor create mode 100644 GPW.CORE.WRKLOG/Pages/Presenze.razor.cs diff --git a/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj b/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj index 486db82..269c9ed 100644 --- a/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj +++ b/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj @@ -2,7 +2,7 @@ net6.0 - 3.0.2403.0517 + 3.0.2403.0518 enable enable diff --git a/GPW.CORE.WRKLOG/Pages/Presenze.razor b/GPW.CORE.WRKLOG/Pages/Presenze.razor new file mode 100644 index 0000000..3399a10 --- /dev/null +++ b/GPW.CORE.WRKLOG/Pages/Presenze.razor @@ -0,0 +1,40 @@ +@page "/Presenze" +@attribute [Authorize] + +
+
+
+

Presenze

+
+
+
+
+
+ +
+ @if (ListRecords == null) + { + @for (int i = 0; i < 7; i++) + { +
+
+ + + + +
+
+ } + } + else + { + @foreach (var currItem in ListRecords) + { +
+ +
+ } + } +
+
+
\ No newline at end of file diff --git a/GPW.CORE.WRKLOG/Pages/Presenze.razor.cs b/GPW.CORE.WRKLOG/Pages/Presenze.razor.cs new file mode 100644 index 0000000..24b380e --- /dev/null +++ b/GPW.CORE.WRKLOG/Pages/Presenze.razor.cs @@ -0,0 +1,238 @@ +using GPW.CORE.Data.DbModels; +using GPW.CORE.Data.DTO; +using GPW.CORE.WRKLOG.Data; +using Microsoft.AspNetCore.Components; + +namespace GPW.CORE.WRKLOG.Pages +{ + public partial class Presenze : IDisposable + { + #region Public Methods + + public void Dispose() + { + //AppMServ.EA_SearchUpdated -= OnSearchUpdated; + //GDataServ.mPipeTimb.EA_NewMessage -= MPipeTimb_EA_NewMessage; + //GDataServ.mPipeRich.EA_NewMessage -= MPipeRich_EA_NewMessage; + UITimer?.Dispose(); + } + + #endregion Public Methods + + #region Protected Fields + + protected DateTime lastRefresh = DateTime.Now; + + /// + /// Timer per refresh dati + /// + /// https://stackoverflow.com/questions/63060065/blazor-timer-call-async-api-task-to-update-ui https://www.janduniec.blog/index.php/100/timers-in-blazor/ + /// + protected System.Timers.Timer UITimer = new System.Timers.Timer(); + + #endregion Protected Fields + + #region Protected Properties + + [Inject] + protected MessageService AppMServ { get; set; } = null!; + + [Inject] + protected GpwDataService GDataServ { get; set; } = null!; + + #endregion Protected Properties + + #region Private Fields + + private int _endHour = 18; + + private int _startHour = 8; + + private DateTime DtSelected = DateTime.Today; + + private int IdxDipendente = 0; + + private List ListFasi = new List(); + + private List? ListRecords = null; + + #endregion Private Fields + + #region Private Properties + + private int endHour + { + get => _endHour; + set + { + // fix --> max 24... + _endHour = value < 25 ? value : 24; + } + } + + private bool isLoading { get; set; } = false; + + private int startHour + { + get => _startHour; + set + { + // fix --> MIN 0... + _startHour = value > 0 ? value : 0; + } + } + + #endregion Private Properties + + #region Private Methods + + private void checkHourRange() + { + int minHour = 12; + int maxHour = 14; + int currStart = 12; + int currEnd = 12; + int roundMin = 30; + //int extraEnd = 30; + if (ListRecords != null) + { + // per ogni giornata + foreach (var giornata in ListRecords) + { + if (giornata.ListTimbr != null) + { + var minRecTimb = giornata.ListTimbr + .Where(x => x.Entrata == true) + .OrderBy(x => x.DataOra) + .FirstOrDefault(); + if (minRecTimb != null) + { + if (minHour > minRecTimb.DataOra.AddMinutes(roundMin / 3).Hour) + { + minHour = minRecTimb.DataOra.AddMinutes(roundMin / 3).Hour; + } + } + var maxRecTimb = giornata.ListTimbr + .Where(x => x.Entrata == false) + .OrderByDescending(x => x.DataOra) + .FirstOrDefault(); + if (maxRecTimb != null) + { + if (maxHour < maxRecTimb.DataOra.AddMinutes(-roundMin / 3).Hour) + { + maxHour = maxRecTimb.DataOra.AddMinutes(-roundMin / 3).Hour + 1; + } + } + } + + if (giornata.ListRA != null) + { + var minRecRa = giornata.ListRA + .OrderBy(x => x.Inizio) + .FirstOrDefault(); + if (minRecRa != null) + { + // verifico se cambia giorno inizio/fine --> seleziono la mezzanotte + currStart = minRecRa.Inizio.AddMinutes(-roundMin).Date.Equals(minRecRa.Fine.Date) ? minRecRa.Inizio.AddMinutes(-roundMin).Hour : 0; + if (minHour > currStart) + { + minHour = currStart; + } + } + var maxRecRa = giornata.ListRA + .OrderByDescending(x => x.Fine) + .FirstOrDefault(); + if (maxRecRa != null) + { + // verifico se cambia giorno inizio/fine --> seleziono la mezzanotte + currEnd = maxRecRa.Inizio.Date.Equals(maxRecRa.Fine.AddMinutes(roundMin).Date) ? maxRecRa.Fine.AddMinutes(roundMin).Hour + 1 : 24; + if (maxHour < currEnd) + { + maxHour = currEnd; + } + } + } + } + } + startHour = minHour;// - 1; + checkOrarioDip(); + // minimo 6 h... x cui "allungo" verso fine + if (maxHour - minHour < AppMServ.orarioDip) + { + minHour--; + maxHour = minHour + AppMServ.orarioDip; + } + endHour = maxHour;// + 1; + } + + protected override async Task OnParametersSetAsync() + { +#if false + weekStatList = null; +#endif + ListRecords = null; + await InvokeAsync(StateHasChanged); + await Task.Delay(1); + +#if false + await InitData(true); +#endif + await TryReload(); + // avvio un timer infinito x refresh pagina COMUNQUE ogni 60 sec anche non succedesse nulla... + UITimer = new System.Timers.Timer + { + Interval = 1000 * 60, + AutoReset = true, + Enabled = true + }; + UITimer.Elapsed += async (s, ea) => await TryReload(); +#if false + AppMServ.EA_SearchUpdated += OnSearchUpdated; + // aggiungo gestione notifica messaggi timbrature... + GDataServ.mPipeTimb.EA_NewMessage += MPipeTimb_EA_NewMessage; + GDataServ.mPipeRich.EA_NewMessage += MPipeRich_EA_NewMessage; +#endif + } + + protected async Task TryReload() + { + // effettuo reload SOLO SE no ho editing in corso... + await ReloadData(); + await InvokeAsync(StateHasChanged); + } + + private void checkOrarioDip() + { + // calcolo minimo da cod orario dipendente + if (AppMServ.orarioDip == 0) + { + AnagOrariModel? schemaOrario = null; + // recupero da DB schema settimanale... + var pUpd = Task.Run(async () => + { + schemaOrario = await GDataServ.AnagOrarioByDip(AppMServ.IdxDipendente); + }); + pUpd.Wait(); + if (schemaOrario != null) + { + AppMServ.orarioDip = (int)(Math.Ceiling(schemaOrario.oreOrdSett / 5)); + } + } + } + + private async Task ReloadData() + { + isLoading = true; + UITimer.Stop(); + ListRecords = await GDataServ.DailyDetails(IdxDipendente, DtSelected, DtSelected.AddDays(1).AddMinutes(-1)); + await Task.Delay(1); + checkHourRange(); + await Task.Delay(1); + lastRefresh = DateTime.Now; + UITimer.Start(); + isLoading = false; + } + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/GPW.CORE.WRKLOG/Pages/WeekPlan.razor.cs b/GPW.CORE.WRKLOG/Pages/WeekPlan.razor.cs index ef1c9d6..5057550 100644 --- a/GPW.CORE.WRKLOG/Pages/WeekPlan.razor.cs +++ b/GPW.CORE.WRKLOG/Pages/WeekPlan.razor.cs @@ -577,8 +577,5 @@ namespace GPW.CORE.WRKLOG.Pages #endregion Private Methods -#if false - //protected void PeriodoSelect(List newList) -#endif } } \ No newline at end of file diff --git a/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor b/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor index 14cfe40..edd0962 100644 --- a/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor +++ b/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor @@ -26,18 +26,16 @@ @if (isAdmin) {
- @if (!string.IsNullOrEmpty(lblDisplay)) - { -
+ + @if (!string.IsNullOrEmpty(lblDisplay)) + { @lblDisplay -
- } - else - { -
- Presenti: @numPres di @numTot -
- } + } + else + { + Presenti: @numPres di @numTot + } +
} diff --git a/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor.cs b/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor.cs index 2e2ada2..d66d81b 100644 --- a/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor.cs +++ b/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor.cs @@ -3,6 +3,7 @@ using GPW.CORE.Data.DbModels; using GPW.CORE.WRKLOG.Data; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.AspNetCore.Components.Routing; using Newtonsoft.Json; namespace GPW.CORE.WRKLOG.Shared diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 99a97fe..aab7b66 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GPW - Gestione Presenze Web -

Versione: 3.0.2403.0517

+

Versione: 3.0.2403.0518


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 320b601..1b0da5d 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -3.0.2403.0517 +3.0.2403.0518 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index ae12cb0..87b62b0 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 3.0.2403.0517 + 3.0.2403.0518 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false From e149445529acfe5d52fbd891c93d5d2915f43e9a Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Mar 2024 10:28:30 +0100 Subject: [PATCH 2/3] Update x display multi-user --- GPW.CORE.Data/Controllers/GPWController.cs | 111 +++++++++++++ GPW.CORE.WRKLOG/Components/DayHoriz.razor | 22 ++- GPW.CORE.WRKLOG/Components/DayHoriz.razor.cs | 161 +++++++++++-------- GPW.CORE.WRKLOG/Data/GpwDataService.cs | 42 +++++ GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj | 2 +- GPW.CORE.WRKLOG/Pages/Presenze.razor | 4 +- GPW.CORE.WRKLOG/Pages/Presenze.razor.cs | 17 +- GPW.CORE.WRKLOG/Shared/LoginDisplay.razor | 2 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 11 files changed, 277 insertions(+), 90 deletions(-) diff --git a/GPW.CORE.Data/Controllers/GPWController.cs b/GPW.CORE.Data/Controllers/GPWController.cs index d3437d6..e0ae979 100644 --- a/GPW.CORE.Data/Controllers/GPWController.cs +++ b/GPW.CORE.Data/Controllers/GPWController.cs @@ -615,6 +615,117 @@ namespace GPW.CORE.Data.Controllers return dbResult; } + /// + /// Recupera l'elenco dei dettaglio giornaliero attività di tutti i dipendenti, dato giorno riferimento + /// + /// Data di riferimento + /// + public List DailyDetailAllDip(DateTime dtRif) + { + //resetto valoredtRif a giornata (mezzanotte) + dtRif = dtRif.Date; + // init dati necessari + List dbResult = new List(); + List rawTimbExp = new List(); + List rawTimbr = new List(); + List rawRegAtt = new List(); + List rawRilTemp = new List(); + List rawCheckC19 = new List(); + + // fermate/festività/ferie + List rawFermateAz = new List(); + List rawMalattie = new List(); + List rawRichDip = new List(); + + // cerco su DB recuperando set di dati.... + using (GPWContext localDbCtx = new GPWContext(_configuration)) + { + // recupero intero set dati timbrature e attività.... + rawTimbExp = localDbCtx + .DbSetTimbratureExpl + .Where(x => dtRif == x.DataLav) + .ToList(); + + rawTimbr = localDbCtx + .DbSetTimbrature + .Where(x => dtRif == x.DataOra ) + .ToList(); + + rawRegAtt = localDbCtx + .DbSetRegAttivita + .Where(x => dtRif == x.Inizio.Date) + .Include(a => a.FasiNav).ThenInclude(p => p.ProgettoNav).ThenInclude(c => c.ClienteNav) + .ToList(); + + rawRilTemp = localDbCtx + .DbSetRilievoTemp + .Where(x => dtRif <= x.DtRilievo.Date) + .ToList(); + + rawCheckC19 = localDbCtx + .DbSetCheckVc19 + .Where(x => dtRif <= x.DtCheck.Date) + .ToList(); + + // recupero fermate e malattie/permessi del dipendente... + rawFermateAz = localDbCtx + .DbSetCalFesteFerie + .Where(x => x.data == dtRif) + .ToList(); + rawMalattie = localDbCtx + .DbSetRegMalattie + .Where(x => x.DtInizio.Date <= dtRif && x.DtInizio.AddDays(x.NumGG) >= dtRif) + .ToList(); + rawRichDip = localDbCtx + .DbSetRegRichieste + .Where(x => x.DtStart.Date <= dtRif && x.DtEnd >= dtRif) + .ToList(); + + // calcolo elenco DIP + List listDip = rawTimbExp.Select(x => x.IdxDipendente).Distinct().ToList(); + + // x ogni giorno scompongo il set di info... + foreach (var idxDip in listDip) + { + DailyDataDTO currDayDto = new DailyDataDTO() + { + IdxDipendente = idxDip, + DtRif = dtRif, + ListRA = rawRegAtt + .Where(x => x.IdxDipendente==idxDip) + .OrderBy(x => x.Inizio) + .ToList(), + ListTimbr = rawTimbr + .Where(x => x.IdxDipendente == idxDip) + .OrderBy(x => x.DataOra) + .ToList(), + TimbrExpl = rawTimbExp + .Where(x => x.IdxDipendente == idxDip) + .FirstOrDefault(), + ListRilTemp = rawRilTemp + .Where(x => x.IdxDipendente == idxDip) + .ToList(), + ListCheckC19 = rawCheckC19 + .Where(x => x.IdxDipendente == idxDip) + .ToList(), + ListFermateAzienda = rawFermateAz, + ListMalattie = rawMalattie + .Where(x => x.IdxDipendente == idxDip) + .ToList(), + ListFerieDip = rawRichDip + .Where(x => x.IdxDipendente == idxDip) + .ToList(), + ListRichiesteDip = rawRichDip + .Where(x => x.IdxDipendente == idxDip) + .ToList() + }; + + dbResult.Add(currDayDto); + } + } + return dbResult; + } + public bool DbForceMigrate() { bool answ = false; diff --git a/GPW.CORE.WRKLOG/Components/DayHoriz.razor b/GPW.CORE.WRKLOG/Components/DayHoriz.razor index 03d01d4..a10fd7b 100644 --- a/GPW.CORE.WRKLOG/Components/DayHoriz.razor +++ b/GPW.CORE.WRKLOG/Components/DayHoriz.razor @@ -4,15 +4,31 @@
    @if (IsTitle) { - DAY + @if (MultiUser) + { +
    @DtRif.ToString("ddd")
    +
    @DtRif.ToString("dd.MM")
    + } + else + { + DAY + } } else { if (DayDTO != null) {
    -
    @DayDTO.DtRif.ToString("ddd")
    -
    @DayDTO.DtRif.ToString("dd.MM")
    + @if (MultiUser) + { +
    @Cognome
    +
    @Nome
    + } + else + { +
    @DayDTO.DtRif.ToString("ddd")
    +
    @DayDTO.DtRif.ToString("dd.MM")
    + } @if (hasFest && DayDTO.ListFermateAzienda != null && DayDTO.ListFermateAzienda.Count > 0) { @foreach (var fermata in DayDTO.ListFermateAzienda) diff --git a/GPW.CORE.WRKLOG/Components/DayHoriz.razor.cs b/GPW.CORE.WRKLOG/Components/DayHoriz.razor.cs index 9efee7d..76c801f 100644 --- a/GPW.CORE.WRKLOG/Components/DayHoriz.razor.cs +++ b/GPW.CORE.WRKLOG/Components/DayHoriz.razor.cs @@ -8,68 +8,12 @@ namespace GPW.CORE.WRKLOG.Components { #region Public Properties - public string cssBadgeLav - { - get - { - string bCtr = "btn"; - string answ = $"{bCtr}-light"; - var deltaComm = oreComm - oreLav; - if (Math.Abs(deltaComm) < 0.5) - { - answ = $"{bCtr}-primary bg-opacity-75"; - } - else if (Math.Abs(deltaComm) < 1) - { - answ = $"{bCtr}-warning"; - } - else - { - answ = $"{bCtr}-danger"; - } - return answ; - } - } - - public string cssCheck - { - get => OkVC19 ? "text-success" : "text-secondary"; - } - - public string cssThermo - { - get - { - string answ = ""; - // verifico in base a ok temp o meno... - if (OkTemp) - { - // colore in base al valore... - var currTemp = tempRil; - if (currTemp >= (decimal)37.5) - { - answ = "text-danger"; - } - else if (currTemp >= 37) - { - answ = "text-warning"; - } - else - { - answ = "text-success"; - } - } - else - { - answ = "text-secondary"; - } - return answ; - } - } - [Parameter] public DailyDataDTO? DayDTO { get; set; } + [Parameter] + public DateTime DtRif { get; set; } = DateTime.MinValue.Date; + [Parameter] public bool EnableActionMenu { get; set; } = true; @@ -91,11 +35,11 @@ namespace GPW.CORE.WRKLOG.Components [Parameter] public List ListFasi { get; set; } = null!; + [Parameter] + public bool MultiUser { get; set; } = false; + [Parameter] public EventCallback PeriodSelected { get; set; } -#if false - //public EventCallback?> PeriodSelected { get; set; } -#endif [Parameter] public EventCallback ReqDayAgenda { get; set; } @@ -128,7 +72,7 @@ namespace GPW.CORE.WRKLOG.Components { await PeriodSelected.InvokeAsync(DayDTO); #if false - //await PeriodSelected.InvokeAsync(DayDTO.ListTimbr); + //await PeriodSelected.InvokeAsync(DayDTO.ListTimbr); #endif } } @@ -179,7 +123,7 @@ namespace GPW.CORE.WRKLOG.Components { await PeriodSelected.InvokeAsync(DayDTO); #if false - //await PeriodSelected.InvokeAsync(DayDTO.ListTimbr); + //await PeriodSelected.InvokeAsync(DayDTO.ListTimbr); #endif } } @@ -188,6 +132,78 @@ namespace GPW.CORE.WRKLOG.Components #region Private Properties + private string Cognome + { + get + { + string answ = "NA"; + if (DayDTO != null) + { + answ = DayDTO.TimbrExpl.CognomeNome.Split(" ")[0] ?? " NA"; + } + return answ; + } + } + + private string cssBadgeLav + { + get + { + string bCtr = "btn"; + string answ = $"{bCtr}-light"; + var deltaComm = oreComm - oreLav; + if (Math.Abs(deltaComm) < 0.5) + { + answ = $"{bCtr}-primary bg-opacity-75"; + } + else if (Math.Abs(deltaComm) < 1) + { + answ = $"{bCtr}-warning"; + } + else + { + answ = $"{bCtr}-danger"; + } + return answ; + } + } + + private string cssCheck + { + get => OkVC19 ? "text-success" : "text-secondary"; + } + + private string cssThermo + { + get + { + string answ = ""; + // verifico in base a ok temp o meno... + if (OkTemp) + { + // colore in base al valore... + var currTemp = tempRil; + if (currTemp >= (decimal)37.5) + { + answ = "text-danger"; + } + else if (currTemp >= 37) + { + answ = "text-warning"; + } + else + { + answ = "text-success"; + } + } + else + { + answ = "text-secondary"; + } + return answ; + } + } + private string dayCardCss { get => hasTimb ? "border border-dark text-dark rounded shadow" : "text-secondary rounded"; @@ -223,6 +239,23 @@ namespace GPW.CORE.WRKLOG.Components get => DayDTO == null || DayDTO.ListRA == null || DayDTO.ListRA.Count == 0; } + private string Nome + { + get + { + string answ = "NA"; + if (DayDTO != null) + { + answ = DayDTO.TimbrExpl.CognomeNome.Replace($"{Cognome} ", ""); + } + return answ; + } + } + +#if false + //public EventCallback?> PeriodSelected { get; set; } +#endif + private bool OkTemp { get diff --git a/GPW.CORE.WRKLOG/Data/GpwDataService.cs b/GPW.CORE.WRKLOG/Data/GpwDataService.cs index 39c129f..a021a62 100644 --- a/GPW.CORE.WRKLOG/Data/GpwDataService.cs +++ b/GPW.CORE.WRKLOG/Data/GpwDataService.cs @@ -770,6 +770,48 @@ namespace GPW.CORE.WRKLOG.Data Log.Debug($"DailyDetails | {source} in: {ts.TotalMilliseconds} ms"); return dbResult; } + /// + /// Recupera l'elenco dei dettaglio giornaliero attività di tutti i dipendenti, dato giorno riferimento + /// + /// Data di riferimento + /// + public async Task> DailyDetailAllDip(DateTime dtRif) + { + string source = "DB"; + List? dbResult = new List(); + string currKey = $"{rKeyDailyData}:ALL:{dtRif.ToString("yyyy-MM-dd")}"; + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string? rawData = await redisDb.StringGetAsync(currKey); + if (!string.IsNullOrEmpty(rawData)) + { + source = "REDIS"; + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult == null) + { + dbResult = new List(); + } + else + { + dbResult = tempResult; + } + } + else + { + dbResult = dbController.DailyDetailAllDip(dtRif); + rawData = JsonConvert.SerializeObject(dbResult, JSSettings); + await redisDb.StringSetAsync(currKey, rawData, FastCache); + } + if (dbResult == null) + { + dbResult = new List(); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"DailyDetailAllDip | {source} in: {ts.TotalMilliseconds} ms"); + return dbResult; + } + public string DeriptData(string encData) { diff --git a/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj b/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj index 269c9ed..daafa53 100644 --- a/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj +++ b/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj @@ -2,7 +2,7 @@ net6.0 - 3.0.2403.0518 + 3.0.2403.0710 enable enable diff --git a/GPW.CORE.WRKLOG/Pages/Presenze.razor b/GPW.CORE.WRKLOG/Pages/Presenze.razor index 3399a10..791585f 100644 --- a/GPW.CORE.WRKLOG/Pages/Presenze.razor +++ b/GPW.CORE.WRKLOG/Pages/Presenze.razor @@ -10,7 +10,7 @@
    - +
    @if (ListRecords == null) { @@ -31,7 +31,7 @@ @foreach (var currItem in ListRecords) {
    - +
    } } diff --git a/GPW.CORE.WRKLOG/Pages/Presenze.razor.cs b/GPW.CORE.WRKLOG/Pages/Presenze.razor.cs index 24b380e..4a9360d 100644 --- a/GPW.CORE.WRKLOG/Pages/Presenze.razor.cs +++ b/GPW.CORE.WRKLOG/Pages/Presenze.razor.cs @@ -11,9 +11,6 @@ namespace GPW.CORE.WRKLOG.Pages public void Dispose() { - //AppMServ.EA_SearchUpdated -= OnSearchUpdated; - //GDataServ.mPipeTimb.EA_NewMessage -= MPipeTimb_EA_NewMessage; - //GDataServ.mPipeRich.EA_NewMessage -= MPipeRich_EA_NewMessage; UITimer?.Dispose(); } @@ -167,16 +164,10 @@ namespace GPW.CORE.WRKLOG.Pages protected override async Task OnParametersSetAsync() { -#if false - weekStatList = null; -#endif ListRecords = null; await InvokeAsync(StateHasChanged); await Task.Delay(1); -#if false - await InitData(true); -#endif await TryReload(); // avvio un timer infinito x refresh pagina COMUNQUE ogni 60 sec anche non succedesse nulla... UITimer = new System.Timers.Timer @@ -186,12 +177,6 @@ namespace GPW.CORE.WRKLOG.Pages Enabled = true }; UITimer.Elapsed += async (s, ea) => await TryReload(); -#if false - AppMServ.EA_SearchUpdated += OnSearchUpdated; - // aggiungo gestione notifica messaggi timbrature... - GDataServ.mPipeTimb.EA_NewMessage += MPipeTimb_EA_NewMessage; - GDataServ.mPipeRich.EA_NewMessage += MPipeRich_EA_NewMessage; -#endif } protected async Task TryReload() @@ -224,7 +209,7 @@ namespace GPW.CORE.WRKLOG.Pages { isLoading = true; UITimer.Stop(); - ListRecords = await GDataServ.DailyDetails(IdxDipendente, DtSelected, DtSelected.AddDays(1).AddMinutes(-1)); + ListRecords = await GDataServ.DailyDetailAllDip(DtSelected); await Task.Delay(1); checkHourRange(); await Task.Delay(1); diff --git a/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor b/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor index edd0962..cf8c216 100644 --- a/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor +++ b/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor @@ -26,7 +26,7 @@ @if (isAdmin) {
    - + @if (!string.IsNullOrEmpty(lblDisplay)) { @lblDisplay diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index aab7b66..2a04a50 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GPW - Gestione Presenze Web -

    Versione: 3.0.2403.0518

    +

    Versione: 3.0.2403.0710


    Note di rilascio:
    • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 1b0da5d..a3d47bc 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -3.0.2403.0518 +3.0.2403.0710 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 87b62b0..6dfc214 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 3.0.2403.0518 + 3.0.2403.0710 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false From 596449f2595ed990ef024efeb624f7688c618470 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Mar 2024 10:37:46 +0100 Subject: [PATCH 3/3] Completata review pag presenze --- GPW.CORE.Data/Controllers/GPWController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GPW.CORE.Data/Controllers/GPWController.cs b/GPW.CORE.Data/Controllers/GPWController.cs index e0ae979..3c3166b 100644 --- a/GPW.CORE.Data/Controllers/GPWController.cs +++ b/GPW.CORE.Data/Controllers/GPWController.cs @@ -648,7 +648,7 @@ namespace GPW.CORE.Data.Controllers rawTimbr = localDbCtx .DbSetTimbrature - .Where(x => dtRif == x.DataOra ) + .Where(x => dtRif == x.DataOra.Date) .ToList(); rawRegAtt = localDbCtx @@ -674,7 +674,7 @@ namespace GPW.CORE.Data.Controllers .ToList(); rawMalattie = localDbCtx .DbSetRegMalattie - .Where(x => x.DtInizio.Date <= dtRif && x.DtInizio.AddDays(x.NumGG) >= dtRif) + .Where(x => x.DtInizio.Date <= dtRif && x.DtInizio.AddDays(x.NumGG) >= dtRif) .ToList(); rawRichDip = localDbCtx .DbSetRegRichieste @@ -692,7 +692,7 @@ namespace GPW.CORE.Data.Controllers IdxDipendente = idxDip, DtRif = dtRif, ListRA = rawRegAtt - .Where(x => x.IdxDipendente==idxDip) + .Where(x => x.IdxDipendente == idxDip) .OrderBy(x => x.Inizio) .ToList(), ListTimbr = rawTimbr