diff --git a/GPW.CORE.Data/DTO/ReportDataDTO.cs b/GPW.CORE.Data/DTO/ReportDataDTO.cs index bb9247e..2e130e1 100644 --- a/GPW.CORE.Data/DTO/ReportDataDTO.cs +++ b/GPW.CORE.Data/DTO/ReportDataDTO.cs @@ -36,6 +36,7 @@ namespace GPW.CORE.Data.DTO // calcolo totali x progetto... int idxProj = 0; string gruppo = ""; + string cliente = ""; string nomeProj = ""; string descProj = ""; decimal durItem = 0; @@ -43,12 +44,13 @@ namespace GPW.CORE.Data.DTO { idxProj = recRA.FasiNav.ProgettoNav.IdxProgetto; gruppo = recRA.FasiNav.ProgettoNav.Gruppo; + cliente = recRA.FasiNav.ProgettoNav.ClienteNav?.RagSociale ?? $"{recRA.FasiNav.ProgettoNav.IdxCliente}"; nomeProj = recRA.FasiNav.ProgettoNav.NomeProj; descProj = recRA.FasiNav.ProgettoNav.DescrProj; durItem = recRA.OreTot ?? 0; // cerco proj... var currProj = ProjTotal.FirstOrDefault(x => x.idxProj == idxProj); - if (currProj!=null) + if (currProj != null) { currProj.TotOre += durItem; } @@ -58,9 +60,10 @@ namespace GPW.CORE.Data.DTO { NomeProj = nomeProj, TotOre = durItem, - idxProj=idxProj, - DescProj=descProj, - Gruppo =gruppo + idxProj = idxProj, + DescProj = descProj, + Gruppo = gruppo, + Cliente = cliente }; ProjTotal.Add(newProj); } @@ -168,6 +171,7 @@ namespace GPW.CORE.Data.DTO public int idxProj { get; set; } = 0; public string Gruppo { get; set; } = ""; + public string Cliente { get; set; } = ""; public string NomeProj { get; set; } = ""; public string DescProj { get; set; } = ""; public decimal TotOre { get; set; } = 0; diff --git a/GPW.CORE.WRKLOG/Components/DettAtt.razor b/GPW.CORE.WRKLOG/Components/DettAtt.razor index e9d93ae..dca5c70 100644 --- a/GPW.CORE.WRKLOG/Components/DettAtt.razor +++ b/GPW.CORE.WRKLOG/Components/DettAtt.razor @@ -7,6 +7,10 @@
diff --git a/GPW.CORE.WRKLOG/Components/DettAtt.razor.cs b/GPW.CORE.WRKLOG/Components/DettAtt.razor.cs index aecb3f8..de5d89c 100644 --- a/GPW.CORE.WRKLOG/Components/DettAtt.razor.cs +++ b/GPW.CORE.WRKLOG/Components/DettAtt.razor.cs @@ -29,6 +29,9 @@ namespace GPW.CORE.WRKLOG.Components [Parameter] public double Periodo { get; set; } = 1; + [Parameter] + public bool ShowDate { get; set; } = false; + #endregion Public Properties #region Protected Fields diff --git a/GPW.CORE.WRKLOG/Components/MyRepStats.razor b/GPW.CORE.WRKLOG/Components/MyRepStats.razor index d4f48d8..9c845d1 100644 --- a/GPW.CORE.WRKLOG/Components/MyRepStats.razor +++ b/GPW.CORE.WRKLOG/Components/MyRepStats.razor @@ -27,10 +27,10 @@
@($"{CurrData.OreComm:N2}")
-
+
@if (ShowVert) { -
+
Progetti @@ -38,9 +38,9 @@
    @foreach (var item in paretoDetail) { -
  • +
  • -
    @item.NomeProj
    +
    @item.Cliente | @item.NomeProj
    @($"{item.TotOre:N1}")
    @@ -52,8 +52,15 @@
-
- dettaglio +
+ @if (selProj != 0) + { + + } + @if (currRecord != null) + { + + }
} else diff --git a/GPW.CORE.WRKLOG/Components/MyRepStats.razor.cs b/GPW.CORE.WRKLOG/Components/MyRepStats.razor.cs index a0bbad9..1b22a7a 100644 --- a/GPW.CORE.WRKLOG/Components/MyRepStats.razor.cs +++ b/GPW.CORE.WRKLOG/Components/MyRepStats.razor.cs @@ -1,4 +1,6 @@ +using GPW.CORE.Data.DbModels; using GPW.CORE.Data.DTO; +using GPW.CORE.WRKLOG.Data; using Microsoft.AspNetCore.Components; using static GPW.CORE.Data.DTO.ReportDataDTO; @@ -8,10 +10,6 @@ namespace GPW.CORE.WRKLOG.Components { #region Public Properties - - [Parameter] - public bool ShowVert { get; set; } - [Parameter] public ReportDataDTO? CurrData { @@ -20,16 +18,153 @@ namespace GPW.CORE.WRKLOG.Components { currData = value; // sistemazione etichette e dati grafico.. - firHist(); + fixHist(); } } - private void firHist() + [Parameter] + public EventCallback E_ReqReload { get; set; } + + [Parameter] + public bool ShowVert { get; set; } + + #endregion Public Properties + + #region Protected Fields + + protected decimal maxVal = 1; + + #endregion Protected Fields + + #region Protected Properties + + [Inject] + protected MessageService AppMServ { get; set; } = null!; + + protected RegAttivitaModel? clonedRA + { + get + { + return AppMServ.clonedRA; + } + set + { + AppMServ.clonedRA = value; + } + } + + [Inject] + protected GpwDataService DataService { get; set; } = null!; + + protected string[]? histData { get; set; } = null; + + protected string[]? histLabel { get; set; } = null; + + protected int numDays + { + get => (CurrData != null) ? CurrData.TimbrExpl.Count : 0; + } + + protected int numProj + { + get => (CurrData != null) ? CurrData.ProjTotal.Count : 0; + } + + protected int numRA + { + get => (CurrData != null) ? CurrData.ListRA.Count : 0; + } + + protected List? paretoDetail { get; set; } = null; + + protected int selProj { get; set; } = 0; + + #endregion Protected Properties + + #region Protected Methods + + protected string progrWidth(decimal itemVal) + { + return $"{itemVal / maxVal:P1}".Replace(",", "."); + } + + protected async Task ReportDeleted() + { + selProj = 0; + await Task.Delay(1); + } + + /// + /// Indico item selezionato + /// + protected void ReportSelect(RegAttivitaModel selRecord) + { + // recupero attivita selezionata in curr record + currRecord = selRecord; + } + + protected void ResetClone() + { + clonedRA = null; + } + + protected async Task ResetDayAgenda() + { + selProj = 0; + await Task.Delay(1); + } + + protected async Task selectProj(int idxProj) + { + await Task.Delay(1); + selProj = idxProj; + if (currData.ListRA != null) + { + selRA = currData.ListRA + .Where(x => x.FasiNav.IdxProgetto == idxProj) + .OrderByDescending(x => x.Inizio) + .ToList(); + } + } + + protected string checkCss(int idxProj) + { + return selProj == idxProj ? "bg-dark text-light" : ""; + } + + protected async Task UpdRegAttData() + { + currRecord = null; + // resetto tutte le cache report + await DataService.ReportResetCacheDip(0); + // evento x reload... + await E_ReqReload.InvokeAsync(true); + } + + #endregion Protected Methods + + #region Private Fields + + private RegAttivitaModel? currRecord = null; + + #endregion Private Fields + + #region Private Properties + + private ReportDataDTO? currData { get; set; } + + private List? selRA { get; set; } = null; + + #endregion Private Properties + + #region Private Methods + + private void fixHist() { // prendo i dati progetti ordinati... if (currData != null && currData.ProjTotal != null) { - var pareto = currData.ProjTotal.OrderByDescending(x => x.TotOre).ToDictionary(x => x.NomeProj, x => $"{x.TotOre:N1}".Replace(",", ".")); + var pareto = currData.ProjTotal.OrderByDescending(x => x.TotOre).ToDictionary(x => x.Cliente + "|" + x.NomeProj, x => $"{x.TotOre:N1}".Replace(",", ".")); // costruisco elenco valori histData = pareto.Values.ToArray(); // elenco labels @@ -40,45 +175,6 @@ namespace GPW.CORE.WRKLOG.Components } } - #endregion Public Properties - - #region Protected Properties - - protected int numDays - { - get => (CurrData != null) ? CurrData.TimbrExpl.Count : 0; - } - - protected int numRA - { - get => (CurrData != null) ? CurrData.ListRA.Count : 0; - } - protected int numProj - { - get => (CurrData != null) ? CurrData.ProjTotal.Count : 0; - } - - #endregion Protected Properties - - #region Private Properties - - private ReportDataDTO? currData { get; set; } - - - protected string[]? histData { get; set; } = null; - - protected string[]? histLabel { get; set; } = null; - - protected decimal maxVal = 1; - - protected List? paretoDetail { get; set; } = null; - - protected string progrWidth(decimal itemVal) - { - return $"{itemVal / maxVal:P1}".Replace(",", "."); - } - - #endregion Private Properties - + #endregion Private Methods } } \ No newline at end of file diff --git a/GPW.CORE.WRKLOG/Components/ProjAgendaDetail.razor b/GPW.CORE.WRKLOG/Components/ProjAgendaDetail.razor new file mode 100644 index 0000000..6adb09e --- /dev/null +++ b/GPW.CORE.WRKLOG/Components/ProjAgendaDetail.razor @@ -0,0 +1,39 @@ +@using CORE.Data.DbModels +@using WRKLOG.Data + +@inject IJSRuntime JSRuntime +@inject GpwDataService GDataServ +@inject MessageService AppMServ + +
+
+
+
+

Project Activity Detail

+
+
+ +
+
+
+
+
+ @if (ListRA != null) + { + foreach (var item in ListRA) + { +
+ +
+ } + + @if (clonedRA != null) + { + + } + } +
+
+
+ + diff --git a/GPW.CORE.WRKLOG/Components/ProjAgendaDetail.razor.cs b/GPW.CORE.WRKLOG/Components/ProjAgendaDetail.razor.cs new file mode 100644 index 0000000..e269cf1 --- /dev/null +++ b/GPW.CORE.WRKLOG/Components/ProjAgendaDetail.razor.cs @@ -0,0 +1,127 @@ +using GPW.CORE.Data.DbModels; +using Microsoft.AspNetCore.Components; + +namespace GPW.CORE.WRKLOG.Components +{ + public partial class ProjAgendaDetail + { + #region Public Properties + + [Parameter] + public EventCallback CloseReq { get; set; } + + [Parameter] + public int IdxDipSel { get; set; } = 0; + + [Parameter] + public EventCallback ItemCloned { get; set; } + + [Parameter] + public EventCallback ItemDeleted { get; set; } + + [Parameter] + public EventCallback ItemSelected { get; set; } + + [Parameter] + public List ListFasi { get; set; } = null!; + + [Parameter] + public List? ListRA { get; set; } + + [Parameter] + public int MaxChar { get; set; } = 100; + + #endregion Public Properties + + #region Protected Properties + + protected RegAttivitaModel? currRecord { get; set; } = null; + + #endregion Protected Properties + + #region Protected Methods + + /// + /// Indico item selezionato + /// + protected async void DoClose() + { + currRecord = null; + await CloseReq.InvokeAsync(true); + } + + protected string getItemCss(RegAttivitaModel itemRecord) + { + string answ = ""; + if (currRecord != null) + { + if (itemRecord.Equals(currRecord)) + { + answ = "bg-info bg-opacity-25"; + } + } + return answ; + } + + protected override Task OnParametersSetAsync() + { + if (ListRA != null) + { + // sistemo la prima timbratura + if (ListRA.Count > 0) + { + var lastRec = ListRA.OrderByDescending(x => x.Inizio).FirstOrDefault(); + if (lastRec != null) + { + LastTimb = CORE.Data.Utils.DateRounded(lastRec.Inizio.Add(lastRec.Durata), 5, false); + } + } + } + return base.OnParametersSetAsync(); + } + + /// + /// Indico item selezionato + /// + protected async void ReportDeleted() + { + await ItemDeleted.InvokeAsync(null); + } + + /// + /// Indico item selezionato + /// + protected async void ReportSelected(RegAttivitaModel selRecord) + { + currRecord = selRecord; + await ItemSelected.InvokeAsync(selRecord); + } + + #endregion Protected Methods + + #region Private Fields + + /// + /// record prima timbratura utile + /// + private DateTime LastTimb = DateTime.Now; + + #endregion Private Fields + + #region Private Properties + + private RegAttivitaModel? clonedRA + { + get + { + return AppMServ.clonedRA; + } + set + { + AppMServ.clonedRA = value; + } + } + + #endregion Private Properties + } +} \ No newline at end of file diff --git a/GPW.CORE.WRKLOG/Data/GpwDataService.cs b/GPW.CORE.WRKLOG/Data/GpwDataService.cs index d718775..f03778d 100644 --- a/GPW.CORE.WRKLOG/Data/GpwDataService.cs +++ b/GPW.CORE.WRKLOG/Data/GpwDataService.cs @@ -1300,6 +1300,23 @@ namespace GPW.CORE.WRKLOG.Data return dbResult; } + /// + /// Reset dati report x dipendente, se 0 = tutti + /// + /// + /// + public async Task ReportResetCacheDip(int idxDipendente) + { + if (idxDipendente == 0) + { + await ExecFlushRedisPattern($"{rKeyReportData}:*"); + } + else + { + await ExecFlushRedisPattern($"{rKeyReportData}:{idxDipendente}:*"); + } + } + /// /// Recupera l'elenco dei Rilievi temperatura nel periodo indicato x dipendente /// diff --git a/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj b/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj index 37f8e3a..d6f56ba 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.2306.2912 + 3.0.2306.2916 enable enable diff --git a/GPW.CORE.WRKLOG/Pages/MyReport.razor b/GPW.CORE.WRKLOG/Pages/MyReport.razor index e320c39..47bbd43 100644 --- a/GPW.CORE.WRKLOG/Pages/MyReport.razor +++ b/GPW.CORE.WRKLOG/Pages/MyReport.razor @@ -20,7 +20,7 @@ } else { - + }
diff --git a/GPW.CORE.WRKLOG/Pages/MyReport.razor.cs b/GPW.CORE.WRKLOG/Pages/MyReport.razor.cs index 6e8eae7..8cfa318 100644 --- a/GPW.CORE.WRKLOG/Pages/MyReport.razor.cs +++ b/GPW.CORE.WRKLOG/Pages/MyReport.razor.cs @@ -44,6 +44,15 @@ namespace GPW.CORE.WRKLOG.Pages } } + private async Task ForceReload(bool doReload) + { + await Task.Delay(1); + if (doReload) + { + await ReloadData(); + } + } + protected override async Task OnInitializedAsync() { await ReloadData(); @@ -52,11 +61,15 @@ namespace GPW.CORE.WRKLOG.Pages private async Task ReloadData() { isLoading = true; - userReportData = null; + //userReportData = null; await Task.Delay(1); if (IdxDipendente > 0) { - userReportData = await DataService.ReportDetails(IdxDipendente, periodo); + var rawData = await DataService.ReportDetails(IdxDipendente, periodo); + if (rawData != null) + { + userReportData = rawData; + } } isLoading = false; } diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 9860fc2..60c1616 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GPW - Gestione Presenze Web -

Versione: 3.0.2306.2912

+

Versione: 3.0.2306.2916


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 30eef55..253cfb7 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -3.0.2306.2912 +3.0.2306.2916 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 7a57a60..0597304 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 3.0.2306.2912 + 3.0.2306.2916 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false