@@ -234,11 +244,12 @@ else
@if (statRecord != null && ListOdlStats != null)
{
-
+
- @statRecord.DurataMinuti
+ @durataFilt
+ @*@statRecord.DurataMinuti*@
}
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs
index 9511dfc4..1ca54e7c 100644
--- a/MP.SPEC/Components/ListODL.razor.cs
+++ b/MP.SPEC/Components/ListODL.razor.cs
@@ -46,6 +46,7 @@ namespace MP.SPEC.Components
ListRecords = null;
ListStati = null;
ListOdlStats = null;
+ ListOdlStatsNetto = null;
statRecord = null;
GC.Collect();
}
@@ -87,7 +88,7 @@ namespace MP.SPEC.Components
await MDService.ODLClose(currRecord.IdxOdl, currRecord.IdxMacchina, 0, true);
Log.Info($"Effettuata chiusura ODL {currRecord.IdxOdl}");
// ricarica...
- await selectRecord(null);
+ await selRecord(null);
}
await reloadData();
}
@@ -116,7 +117,7 @@ namespace MP.SPEC.Components
await callSyncDb(currRecord.IdxMacchina);
Log.Info($"Richiesto forceSyncDb per idxMacc {currRecord.IdxMacchina}");
// ricarica...
- await selectRecord(null);
+ await selRecord(null);
}
await reloadData();
}
@@ -143,27 +144,10 @@ namespace MP.SPEC.Components
protected async Task resetSel()
{
- await selectRecord(null);
+ await selRecord(null);
await reloadData();
}
- protected async Task selectRecord(ODLModel? currRec)
- {
- showStats = true;
- await Task.Delay(1);
- currRecord = currRec;
- if (currRec != null)
- {
- showStats = true;
- ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
- }
- else
- {
- showStats = false;
- ListOdlStats = null;
- }
- }
-
protected async Task selectStatRecord(ODLModel? currRec)
{
showStats = true;
@@ -171,8 +155,7 @@ namespace MP.SPEC.Components
statRecord = currRec;
if (currRec != null)
{
- showStats = true;
- ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
+ await reloadStatsData(currRec);
}
else
{
@@ -188,11 +171,22 @@ namespace MP.SPEC.Components
currRecord = currRec;
showStats = false;
ListOdlStats = null;
+ ListOdlStatsNetto = null;
+ }
+
+ protected async Task toggleSpenta()
+ {
+ hideSpenta = !hideSpenta;
+ await Task.Delay(1);
+ if (statRecord != null)
+ {
+ await reloadStatsData(statRecord);
+ }
}
protected async Task UpdateData()
{
- await selectRecord(null);
+ await selRecord(null);
await reloadData();
}
@@ -201,10 +195,13 @@ namespace MP.SPEC.Components
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
+
private ODLModel? currRecord = null;
private List
? ListOdlStats;
+ private List? ListOdlStatsNetto;
+
private List? ListRecords;
private List? ListStati;
@@ -225,6 +222,39 @@ namespace MP.SPEC.Components
set => currFilter.CurrPage = value;
}
+ private string durataFilt
+ {
+ get
+ {
+ string answ = "ND";
+ if (statRecord != null)
+ {
+ if (hideSpenta)
+ {
+ if (ListOdlStatsNetto != null)
+ {
+ var tsDurata = TimeSpan.FromMinutes(ListOdlStatsNetto.Sum(x => x.TotDurata));
+ if (tsDurata.TotalDays < 1)
+ {
+ answ = $"{tsDurata.Hours:00}h {tsDurata.Minutes:00}'";
+ }
+ else
+ {
+ answ = $"{tsDurata.Days}gg {tsDurata.Hours:00}h";
+ }
+ }
+ }
+ else
+ {
+ answ = statRecord.DurataMinuti;
+ }
+ }
+ return answ;
+ }
+ }
+
+ private bool hideSpenta { get; set; } = false;
+
///
/// Indica se si tratti di ODL correnti
///
@@ -235,12 +265,39 @@ namespace MP.SPEC.Components
private bool isLoading { get; set; } = false;
+ private string leftStringCSS
+ {
+ get => hideSpenta ? "text-secondary" : "text-dark fw-bold";
+ }
+
+ private List? ListOdlStatsAct
+ {
+ get
+ {
+ List answ = new List();
+ if (hideSpenta)
+ {
+ answ = ListOdlStatsNetto;
+ }
+ else
+ {
+ answ = ListOdlStats;
+ }
+ return answ;
+ }
+ }
+
private int numRecord
{
get => currFilter.NumRec;
set => currFilter.NumRec = value;
}
+ private string rightStringCSS
+ {
+ get => hideSpenta ? "text-dark fw-bold" : "text-secondary";
+ }
+
private DateTime selDtFine { get; set; } = DateTime.Now;
private bool showStats { get; set; } = false;
@@ -286,12 +343,9 @@ namespace MP.SPEC.Components
double answ = 0;
double tot = 0;
- if (ListOdlStats != null)
+ if (ListOdlStatsAct != null)
{
- foreach (var item in ListOdlStats)
- {
- tot += item.TotDurata;
- }
+ tot = ListOdlStatsAct.Sum(x => x.TotDurata);
double perc = (durata / tot) * 100;
if (perc > 1)
@@ -349,6 +403,21 @@ namespace MP.SPEC.Components
isLoading = false;
}
+ private async Task reloadStatsData(ODLModel? currRec)
+ {
+ showStats = true;
+ if (currRec != null)
+ {
+ ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
+ ListOdlStatsNetto = ListOdlStats.Where(x => x.Semaforo != "sGr").ToList();
+ }
+ else
+ {
+ ListOdlStats = null;
+ ListOdlStatsNetto = null;
+ }
+ }
+
private string tradFase(string codFase)
{
string answ = codFase;
diff --git a/MP.SPEC/Components/ListPARAMS.razor.cs b/MP.SPEC/Components/ListPARAMS.razor.cs
index 9b8844ed..2ef8726a 100644
--- a/MP.SPEC/Components/ListPARAMS.razor.cs
+++ b/MP.SPEC/Components/ListPARAMS.razor.cs
@@ -25,7 +25,7 @@ namespace MP.SPEC.Components
#endregion Public Properties
#region Public Methods
-
+ private SelectFluxParams lastFilter { get; set; } = new SelectFluxParams() { CurrPage = -1 };
public string checkSelect(FluxLog selRecord)
{
string answ = "";
@@ -45,10 +45,10 @@ namespace MP.SPEC.Components
{
await Task.Delay(1);
// se sono cambiati --> rileggo...
- if (LastFilter==null || !SelFilter.Equals(LastFilter))
+ if (!lastFilter.Equals(SelFilter))
{
- await reloadData(false);
- LastFilter = SelFilter;
+ lastFilter = SelFilter.clone();
+ await reloadData(true);
}
}
@@ -58,8 +58,6 @@ namespace MP.SPEC.Components
public void Dispose()
{
aTimer.Elapsed -= ElapsedTimer;
- MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
- MessageService.EA_SearchUpdated -= OnSeachUpdated;
aTimer.Stop();
aTimer.Dispose();
currRecord = null;
@@ -128,9 +126,6 @@ namespace MP.SPEC.Components
[Inject]
protected MpDataService MDService { get; set; } = null!;
- [Inject]
- protected MessageService MessageService { get; set; } = null!;
-
protected int RefreshPeriod
{
get => SelFilter.TempoAgg;
@@ -142,8 +137,6 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync()
{
- MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
- MessageService.EA_SearchUpdated += OnSeachUpdated;
StartTimer();
}
@@ -197,8 +190,8 @@ namespace MP.SPEC.Components
private int currPage
{
- get => MessageService.currPage;
- set => MessageService.currPage = value;
+ get => SelFilter.CurrPage;
+ set => SelFilter.CurrPage = value;
}
private bool isLoading { get; set; } = false;
@@ -215,8 +208,8 @@ namespace MP.SPEC.Components
private int numRecord
{
- get => MessageService.numRecord;
- set => MessageService.numRecord = value;
+ get => SelFilter.NumRec;
+ set => SelFilter.NumRec = value;
}
private string SelFlux
@@ -250,11 +243,6 @@ namespace MP.SPEC.Components
#region Private Methods
- private async void MessageService_EA_PageUpdated()
- {
- await reloadData(true);
- }
-
#endregion Private Methods
}
}
\ No newline at end of file
diff --git a/MP.SPEC/Components/ODLPlot.razor.cs b/MP.SPEC/Components/ODLPlot.razor.cs
index 666e3af4..d14c1fcb 100644
--- a/MP.SPEC/Components/ODLPlot.razor.cs
+++ b/MP.SPEC/Components/ODLPlot.razor.cs
@@ -1,14 +1,25 @@
using Microsoft.AspNetCore.Components;
-using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
-using MP.SPEC.Components;
using MP.SPEC.Data;
namespace MP.SPEC.Components
{
public partial class ODLPlot
{
- #region Public Properties
+ #region Public Fields
+
+ public List colors = new List();
+
+ public List Data = new List();
+
+ public List Labels = new List();
+
+ #endregion Public Fields
+
+ #region Public Properties
+
+ [Parameter]
+ public bool hideSpenta { get; set; }
public int OdlId
{
@@ -29,34 +40,36 @@ namespace MP.SPEC.Components
//protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter();
protected int _selParam { get; set; } = -1;
+ [Inject]
+ protected MpDataService MDService { get; set; } = null!;
+
#endregion Protected Properties
#region Protected Methods
- private bool isLoading { get; set; } = false;
-
protected override async Task OnInitializedAsync()
{
isLoading = true;
await Task.Delay(1);
}
- private List? ListRecords = null;
+
protected override async Task OnParametersSetAsync()
{
await ReloadData();
await Task.Delay(1);
}
- public List Data = new List();
- public List Labels = new List();
- public List colors = new List();
-
protected async Task ReloadData()
{
Data.Clear();
Labels.Clear();
colors.Clear();
ListRecords = await MDService.StatOdl(SelectedOdl);
+ // se hideSpenta --> filtro stato 11 = spenta...
+ if (hideSpenta)
+ {
+ ListRecords = ListRecords.Where(x => x.Semaforo != "sGr").ToList();
+ }
foreach (var record in ListRecords)
{
Data.Add(record.TotDurata);
@@ -73,18 +86,23 @@ namespace MP.SPEC.Components
{
colors.Add(new DoughnutStyling(record.Css, "ccc"));
}
-
-
}
await Task.Delay(1);
isLoading = false;
}
-
-
- [Inject]
- protected MpDataService MDService { get; set; } = null!;
-
#endregion Protected Methods
+
+ #region Private Fields
+
+ private List? ListRecords = null;
+
+ #endregion Private Fields
+
+ #region Private Properties
+
+ private bool isLoading { get; set; } = false;
+
+ #endregion Private Properties
}
}
\ No newline at end of file
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index 6a872982..f0b9eaf8 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -886,6 +886,15 @@ namespace MP.SPEC.Data
return answ;
}
+
+ public async Task DossiersUpdateValore(Dossiers currDoss)
+ {
+ // aggiorno record sul DB
+ bool answ = await dbController.DossiersUpdateValore(currDoss);
+
+ return answ;
+ }
+
#endregion Public Methods
#region Protected Fields
diff --git a/MP.SPEC/Data/SelectArticoliParams.cs b/MP.SPEC/Data/SelectArticoliParams.cs
new file mode 100644
index 00000000..7158c192
--- /dev/null
+++ b/MP.SPEC/Data/SelectArticoliParams.cs
@@ -0,0 +1,74 @@
+namespace MP.SPEC.Data
+{
+ public class SelectArticoliParams
+ {
+ #region Public Constructors
+
+ public SelectArticoliParams()
+ { }
+
+ #endregion Public Constructors
+
+ #region Public Properties
+
+
+ public int CurrPage { get; set; } = 1;
+
+ public string IdxMacchina { get; set; } = "*";
+ public string Azienda { get; set; } = "*";
+
+ public int MaxRecord { get; set; } = 100;
+
+ public int NumRec { get; set; } = 10;
+
+ public int TotCount { get; set; } = 0;
+
+ #endregion Public Properties
+
+ #region Public Methods
+
+ public SelectArticoliParams clone()
+ {
+ SelectArticoliParams clonedData = new SelectArticoliParams()
+ {
+ CurrPage = this.CurrPage,
+ IdxMacchina = this.IdxMacchina,
+ Azienda = this.Azienda,
+ MaxRecord = this.MaxRecord,
+ NumRec = this.NumRec,
+ TotCount = this.TotCount
+ };
+ return clonedData;
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (!(obj is SelectArticoliParams item))
+ return false;
+
+ if (MaxRecord != item.MaxRecord)
+ return false;
+
+ if (NumRec != item.NumRec)
+ return false;
+
+ if (TotCount != item.TotCount)
+ return false;
+
+ if (CurrPage != item.CurrPage)
+ return false;
+
+ if (IdxMacchina != item.IdxMacchina)
+ return false;
+
+ return true;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ #endregion Public Methods
+ }
+}
\ No newline at end of file
diff --git a/MP.SPEC/Data/SelectDossierParams.cs b/MP.SPEC/Data/SelectDossierParams.cs
index c743e535..4ffac42b 100644
--- a/MP.SPEC/Data/SelectDossierParams.cs
+++ b/MP.SPEC/Data/SelectDossierParams.cs
@@ -1,4 +1,6 @@
-namespace MP.SPEC.Data
+using MP.Data;
+
+namespace MP.SPEC.Data
{
public class SelectDossierParams
{
@@ -13,31 +15,35 @@
public int CurrPage { get; set; } = 1;
- public DateTime DtEnd { get; set; } = InitDatetime(5);
+ public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
- public DateTime DtStart { get; set; } = InitDatetime(5).AddDays(-730);
+ public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-730);
public string IdxMacchina { get; set; } = "*";
public string CodArticolo { get; set; } = "*";
-
+ public int NumRec { get; set; } = 10;
+ public int TotCount { get; set; } = 0;
public int MaxRecord { get; set; } = 100;
+ public bool isEditing { get; set; } = false;
#endregion Public Properties
#region Public Methods
-
- ///
- /// Inizializzazione con periodo e arrotondamento
- ///
- ///
- ///
- public static DateTime InitDatetime(int minRound)
+ public SelectDossierParams clone()
{
- TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
- int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
- DateTime endRounded = DateTime.Today.AddMinutes(minDay);
- return endRounded;
+ SelectDossierParams clonedData = new SelectDossierParams()
+ {
+ DtEnd = this.DtEnd,
+ DtStart = this.DtStart,
+ CurrPage = this.CurrPage,
+ IdxMacchina = this.IdxMacchina,
+ CodArticolo = this.CodArticolo,
+ MaxRecord = this.MaxRecord,
+ NumRec = this.NumRec,
+ TotCount = this.TotCount
+ };
+ return clonedData;
}
public override bool Equals(object obj)
@@ -54,6 +60,12 @@
if (MaxRecord != item.MaxRecord)
return false;
+ if (TotCount != item.TotCount)
+ return false;
+
+ if (NumRec != item.NumRec)
+ return false;
+
if (DtEnd != item.DtEnd)
return false;
diff --git a/MP.SPEC/Data/SelectFluxParams.cs b/MP.SPEC/Data/SelectFluxParams.cs
index bf17616f..c78c85c1 100644
--- a/MP.SPEC/Data/SelectFluxParams.cs
+++ b/MP.SPEC/Data/SelectFluxParams.cs
@@ -19,14 +19,33 @@
public string IdxMacchina { get; set; } = "*";
public string lastUpdate { get; set; } = "-";
public bool LiveUpdate { get; set; } = true;
-
+ public int NumRec { get; set; } = 10;
public int MaxRecord { get; set; } = 100;
public int TempoAgg { get; set; } = 10000;
+ public int TotCount { get; set; } = 0;
#endregion Public Properties
#region Public Methods
-
+ public SelectFluxParams clone()
+ {
+ SelectFluxParams clonedData = new SelectFluxParams()
+ {
+ CodFlux = this.CodFlux,
+ CurrPage = this.CurrPage,
+ dtRif = this.dtRif,
+ dtMax = this.dtMax,
+ dtMin = this.dtMin,
+ IdxMacchina = this.IdxMacchina,
+ lastUpdate = this.lastUpdate,
+ LiveUpdate = this.LiveUpdate,
+ NumRec = this.NumRec,
+ MaxRecord = this.MaxRecord,
+ TotCount = this.TotCount,
+ TempoAgg = this.TempoAgg
+ };
+ return clonedData;
+ }
public override bool Equals(object obj)
{
if (!(obj is SelectFluxParams item))
@@ -46,6 +65,12 @@
if (TempoAgg != item.TempoAgg)
return false;
+
+ if (NumRec!= item.NumRec)
+ return false;
+
+ if (TotCount!= item.TotCount)
+ return false;
if (CurrPage != item.CurrPage)
return false;
diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj
index c0371246..048240b5 100644
--- a/MP.SPEC/MP.SPEC.csproj
+++ b/MP.SPEC/MP.SPEC.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.SPEC
- 6.16.2210.1910
+ 6.16.2210.2014
diff --git a/MP.SPEC/Pages/Articoli.razor.cs b/MP.SPEC/Pages/Articoli.razor.cs
index 25bceea2..fec8a210 100644
--- a/MP.SPEC/Pages/Articoli.razor.cs
+++ b/MP.SPEC/Pages/Articoli.razor.cs
@@ -24,9 +24,11 @@ namespace MP.SPEC.Pages
return answ;
}
+ private SelectArticoliParams currFilter = new SelectArticoliParams();
+
public void Dispose()
{
- MessageService.EA_SearchUpdated -= OnSeachUpdated;
+ //MessageService.EA_SearchUpdated -= OnSeachUpdated;
currRecord = null;
ListTipoArt = null;
ListAziende = null;
@@ -55,9 +57,6 @@ namespace MP.SPEC.Pages
[Inject]
protected MpDataService MDService { get; set; } = null!;
- [Inject]
- protected MessageService MessageService { get; set; } = null!;
-
[Inject]
protected NavigationManager NavManager { get; set; }
@@ -131,9 +130,6 @@ namespace MP.SPEC.Pages
protected override async Task OnInitializedAsync()
{
numRecord = 10;
- // mostro ricerca
- MessageService.ShowSearch = true;
- MessageService.EA_SearchUpdated += OnSeachUpdated;
configData = await MDService.ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
if (currRec != null)
@@ -172,14 +168,14 @@ namespace MP.SPEC.Pages
{
Azienda = selRec.Azienda,
CodArticolo = selRec.CodArticolo,
- DescArticolo = $"CLONE - { selRec.DescArticolo }",
+ DescArticolo = $"CLONE - {selRec.DescArticolo}",
Disegno = selRec.Disegno,
- Tipo=selRec.Tipo
+ Tipo = selRec.Tipo
};
currRecord = newRec;
await Task.Delay(1);
}
-
+
protected async Task update(AnagArticoli selRec)
{
@@ -294,7 +290,7 @@ namespace MP.SPEC.Pages
private async Task reloadData()
{
isLoading = true;
- SearchRecords = await MDService.ArticoliGetSearch(100000, selAzienda, MessageService.SearchVal);
+ SearchRecords = await MDService.ArticoliGetSearch(100000, selAzienda, "*");
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
isLoading = false;
}
diff --git a/MP.SPEC/Pages/DOSS.razor b/MP.SPEC/Pages/DOSS.razor
index 3ce277cd..edbc2926 100644
--- a/MP.SPEC/Pages/DOSS.razor
+++ b/MP.SPEC/Pages/DOSS.razor
@@ -21,67 +21,13 @@