From 7f1c45056984feb73bbc4dbdadeabafd697a131d Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 4 Jan 2022 20:10:06 +0100 Subject: [PATCH] Ancora editing pagina planner, completata --- GPW.CORE.Data/Controllers/GPWController.cs | 20 ++++++++++- GPW.CORE.Data/DTO/DailyDataDTO.cs | 2 ++ GPW.CORE.UI/Components/DayHoriz.razor | 1 + GPW.CORE.UI/Components/DayHoriz.razor.cs | 39 ++++++++++++++++++++-- GPW.CORE.UI/Pages/Planner.razor | 8 ----- 5 files changed, 58 insertions(+), 12 deletions(-) diff --git a/GPW.CORE.Data/Controllers/GPWController.cs b/GPW.CORE.Data/Controllers/GPWController.cs index b3cbf9d..27b6e56 100644 --- a/GPW.CORE.Data/Controllers/GPWController.cs +++ b/GPW.CORE.Data/Controllers/GPWController.cs @@ -139,6 +139,8 @@ namespace GPW.CORE.Data.Controllers List rawTimbExp = new List(); List rawTimbr = new List(); List rawRegAtt = new List(); + List rawRilTemp = new List(); + List rawCheckC19 = new List(); // cerco su DB recuperando set di dati.... using (GPWContext localDbCtx = new GPWContext(_configuration)) @@ -160,6 +162,16 @@ namespace GPW.CORE.Data.Controllers .Include(a => a.FasiNav).ThenInclude(p => p.ProgettoNav).ThenInclude(c => c.ClienteNav) .ToList(); + rawRilTemp = localDbCtx + .DbSetRilievoTemp + .Where(x => x.IdxDipendente == idxDipendente && dtInizio <= x.DtRilievo && x.DtRilievo <= dtFine) + .ToList(); + + rawCheckC19 = localDbCtx + .DbSetCheckVc19 + .Where(x => x.IdxDipendente == idxDipendente && dtInizio <= x.DtCheck && x.DtCheck <= dtFine) + .ToList(); + // calcolo intervallo date... int numDays = dtFine.Subtract(dtInizio).Days; @@ -179,7 +191,13 @@ namespace GPW.CORE.Data.Controllers .ToList(), TimbrExpl = rawTimbExp .Where(x => thisDay == x.DataLav) - .FirstOrDefault() + .FirstOrDefault(), + ListRilTemp = rawRilTemp + .Where(x => thisDay <= x.DtRilievo && x.DtRilievo <= thisDay.AddDays(1)) + .ToList(), + ListCheckC19 = rawCheckC19 + .Where(x => thisDay <= x.DtCheck && x.DtCheck <= thisDay.AddDays(1)) + .ToList() }; dbResult.Add(currDayDto); diff --git a/GPW.CORE.Data/DTO/DailyDataDTO.cs b/GPW.CORE.Data/DTO/DailyDataDTO.cs index 379e70e..dfd99d6 100644 --- a/GPW.CORE.Data/DTO/DailyDataDTO.cs +++ b/GPW.CORE.Data/DTO/DailyDataDTO.cs @@ -19,6 +19,8 @@ namespace GPW.CORE.Data.DTO public List? ListRA { get; set; } public List? ListTimbr { get; set; } public TimbratureExplModel? TimbrExpl { get; set; } + public List? ListRilTemp { get; set; } + public List? ListCheckC19 { get; set; } public DateTime DtInizio { diff --git a/GPW.CORE.UI/Components/DayHoriz.razor b/GPW.CORE.UI/Components/DayHoriz.razor index 964afa8..681d4de 100644 --- a/GPW.CORE.UI/Components/DayHoriz.razor +++ b/GPW.CORE.UI/Components/DayHoriz.razor @@ -49,6 +49,7 @@ {
@TotLav
@TotComm
+
} diff --git a/GPW.CORE.UI/Components/DayHoriz.razor.cs b/GPW.CORE.UI/Components/DayHoriz.razor.cs index 1eb3e8e..0b3ae6a 100644 --- a/GPW.CORE.UI/Components/DayHoriz.razor.cs +++ b/GPW.CORE.UI/Components/DayHoriz.razor.cs @@ -93,6 +93,39 @@ namespace GPW.CORE.UI.Components } } + private bool OkTemp + { + get + { + bool answ = false; + if (DayDTO != null && DayDTO.ListRilTemp != null) + { + answ = DayDTO.ListRilTemp.Count > 0; + } + return answ; + } + } + private bool OkVC19 + { + get + { + bool answ = false; + if (DayDTO != null && DayDTO.ListCheckC19 != null) + { + answ = DayDTO.ListCheckC19.Count > 0; + } + return answ; + } + } + + public string cssThermo + { + get => OkTemp ? "text-success" : "text-secondary"; + } + public string cssCheck + { + get => OkVC19 ? "text-success" : "text-secondary"; + } private List ListRegAtt() { @@ -110,9 +143,9 @@ namespace GPW.CORE.UI.Components { Inizio = currHour, IdxFase = 0, - Descrizione="-", - Fine =item.Inizio, - OreTot=(decimal)item.Inizio.Subtract(currHour).TotalHours + Descrizione = "-", + Fine = item.Inizio, + OreTot = (decimal)item.Inizio.Subtract(currHour).TotalHours }; result.Add(newItem); } diff --git a/GPW.CORE.UI/Pages/Planner.razor b/GPW.CORE.UI/Pages/Planner.razor index 3948348..94cd752 100644 --- a/GPW.CORE.UI/Pages/Planner.razor +++ b/GPW.CORE.UI/Pages/Planner.razor @@ -69,14 +69,6 @@ } } -
- Pagina principale formato "agenda": -
    -
  • click --> modal compilazione record (selettore gerarchico + ricerca ultimi progetti pareto a dx)
  • -
  • click + trascina?!?!? da verificare
  • -
  • in testa 2 icone x indicare OK temperatura e OK x check C19
  • -
-