From b9ef7e18d9d249b472259d2485a88db50d128f7c Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 5 Dec 2025 19:25:34 +0100 Subject: [PATCH] Update parziale oggetto merged x fare meglio gestione ordini (da rivedere) --- .../RestPayload/WorkLoadDetailDTO.cs | 82 ++++++++++++------- Lux.API/Lux.API.csproj | 2 +- Lux.UI/Components/Compo/OrderRowMan.razor | 30 ++++++- Lux.UI/Components/Compo/OrderRowMan.razor.cs | 46 ++++++++++- Lux.UI/Lux.UI.csproj | 2 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 8 files changed, 127 insertions(+), 41 deletions(-) diff --git a/EgwCoreLib.Lux.Core/RestPayload/WorkLoadDetailDTO.cs b/EgwCoreLib.Lux.Core/RestPayload/WorkLoadDetailDTO.cs index 234a6d10..a6a1ed7a 100644 --- a/EgwCoreLib.Lux.Core/RestPayload/WorkLoadDetailDTO.cs +++ b/EgwCoreLib.Lux.Core/RestPayload/WorkLoadDetailDTO.cs @@ -31,46 +31,73 @@ namespace EgwCoreLib.Lux.Core.RestPayload if (!workable) { var listKo = new List(); - // cerco l'insieme dei pezzi DAVVERO non lavorabili - var listUnWorkable = MachineCalc.Utils.IntersectTags(machineCalcResults, p => p.CalcResult != Enums.PartVerificationResult.MACHINABLE); + // cerco l'insieme dei pezzi DAVVERO non lavorabili + listUnWorkable = MachineCalc.Utils.IntersectTags(machineCalcResults, p => p.CalcResult != Enums.PartVerificationResult.MACHINABLE).ToList(); workable = !listUnWorkable.Any(); numKo = listUnWorkable.Count(); } LoadDetail = MachineCalc.Utils.CalculateIntersections(machineCalcResults); - - } - - /// - /// Dettaglio combinazioni carico di lavoro - /// - public List LoadDetail { get; set; } = new List(); - - /// - /// Tempo minimo complessivo - /// - public decimal TotMinTime - { - get => LoadDetail.Sum(x => x.MinTime); - } - - /// - /// Tempo massimo complessivo - /// - public decimal TotMaxTime - { - get => LoadDetail.Sum(x => x.MaxTime); } #endregion Public Constructors #region Public Properties + /// + /// Elenco Macchine + /// + public string ListMachines + { + get => string.Join(", ", machineCalcResults.Select(x => x.Name).OrderBy(x => x).ToList()); + } + /// + /// Num Macchine + /// + public int NumMachines + { + get => machineCalcResults.Count(); + } + + /// + /// Elenco delle etichette parts non OK + /// + public List ListUnWorkable + { + get => listUnWorkable ?? new List(); + } + + /// + /// Dettaglio combinazioni carico di lavoro + /// + public List LoadDetail { get; set; } = new List(); + public List MachineCalcResults { get => machineCalcResults; } + public int NumKo + { + get => numKo; + } + + /// + /// Tempo massimo complessivo in ORE + /// + public decimal TotMaxTime + { + get => LoadDetail.Sum(x => x.MaxTime) / 3600; + } + + /// + /// Tempo minimo complessivo in ORE + /// + public decimal TotMinTime + { + get => LoadDetail.Sum(x => x.MinTime) / 3600; + } + public string UID { get => uID; @@ -80,18 +107,15 @@ namespace EgwCoreLib.Lux.Core.RestPayload { get => workable; } - public int NumKo - { - get => numKo; - } #endregion Public Properties #region Private Fields + private List? listUnWorkable = null; private List machineCalcResults = new List(); - private string uID = ""; private int numKo = 0; + private string uID = ""; private bool workable = false; #endregion Private Fields diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index 10c81d37..35cffb40 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 0.9.2512.0518 + 0.9.2512.0519 diff --git a/Lux.UI/Components/Compo/OrderRowMan.razor b/Lux.UI/Components/Compo/OrderRowMan.razor index 94be2d1c..89c562a3 100644 --- a/Lux.UI/Components/Compo/OrderRowMan.razor +++ b/Lux.UI/Components/Compo/OrderRowMan.razor @@ -84,6 +84,7 @@ else Descrizione Qty @* Importo *@ + # Macc # Prod @if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit) { @@ -232,6 +233,8 @@ else
(@item.UnitCost.ToString("C2"))
*@ + + @itemWLD.NumMachines
@($"{item.ProdItemQtyTot:N0}") @@ -287,7 +290,16 @@ else
- @($"{itemWLD.TotMinTime} - {itemWLD.TotMaxTime}") + @if ((itemWLD.TotMaxTime - itemWLD.TotMinTime) > 1) + { + @($"{itemWLD.TotMinTime:N2} - {itemWLD.TotMaxTime:N2}") + } + else + { + + @($"{itemWLD.TotMaxTime:N2}") + } + } @if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit) @@ -326,11 +338,21 @@ else { } + @($"{GrandTotNumItems:N0}") - @($"{GrandTotPrice:C2}") -
(@($"{GrandTotCost:C2}"))
+ @GrandTotNumKo + + + @if ((GrandTotMaxTime - GrandTotMinTime) > 1) + { + @($"{GrandTotMaxTime:N2} - {GrandTotMinTime:N2}") + } + else + { + + @($"{GrandTotMaxTime:N2}") + } - @($"{GrandTotMargin:P2}") @if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit) { diff --git a/Lux.UI/Components/Compo/OrderRowMan.razor.cs b/Lux.UI/Components/Compo/OrderRowMan.razor.cs index 7d27d74c..330fb64a 100644 --- a/Lux.UI/Components/Compo/OrderRowMan.razor.cs +++ b/Lux.UI/Components/Compo/OrderRowMan.razor.cs @@ -19,7 +19,14 @@ namespace Lux.UI.Components.Compo public partial class OrderRowMan : IDisposable { #region Public Enums - + /// + /// Oggetto merged tra riga d'ordine e carico di lavoro associato + /// + public class MergedOrderRow + { + public OrderRowModel Original { get; set; } + public WorkLoadDetailDTO Derived { get; set; } + } /// /// modalit� modifica riga offerta /// @@ -165,6 +172,19 @@ namespace Lux.UI.Components.Compo } } + protected int GrandTotNumKo + { + get => -1; + } + protected decimal GrandTotMinTime + { + get => -1; + } + protected decimal GrandTotMaxTime + { + get => -1; + } + /// /// Num totale obj calcolato x offerta /// @@ -706,6 +726,25 @@ namespace Lux.UI.Components.Compo private List ListRecords = new List(); + /// + /// Conversione record originali/merged + /// + /// + /// + protected List MergeRecord(List origList) + { + var mergedList = AllRecords + .Select(item => new MergedOrderRow + { + Original = item, + Derived = WorkLoadDetail(item.OrderRowUID, item.ProdEstimate) + }) + .ToList(); + return mergedList; + } + + + private int numRecord = 10; /// @@ -1526,5 +1565,6 @@ namespace Lux.UI.Components.Compo } #endregion Private Methods - } -} \ No newline at end of file + + + } \ No newline at end of file diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index b559b34e..86c6284b 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -5,7 +5,7 @@ enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 0.9.2512.0518 + 0.9.2512.0519 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 0f8bdbad..0ca32af6 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 0.9.2512.0518

+

Versione: 0.9.2512.0519


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index d7dc2b74..f4c379b1 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -0.9.2512.0518 +0.9.2512.0519 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 170a0dbb..39f2821e 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 0.9.2512.0518 + 0.9.2512.0519 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false