Update parziale oggetto merged x fare meglio gestione ordini (da rivedere)
This commit is contained in:
@@ -31,46 +31,73 @@ namespace EgwCoreLib.Lux.Core.RestPayload
|
||||
if (!workable)
|
||||
{
|
||||
var listKo = new List<PartCalcDTO>();
|
||||
// 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);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dettaglio combinazioni carico di lavoro
|
||||
/// </summary>
|
||||
public List<MachineTagDTO> LoadDetail { get; set; } = new List<MachineTagDTO>();
|
||||
|
||||
/// <summary>
|
||||
/// Tempo minimo complessivo
|
||||
/// </summary>
|
||||
public decimal TotMinTime
|
||||
{
|
||||
get => LoadDetail.Sum(x => x.MinTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tempo massimo complessivo
|
||||
/// </summary>
|
||||
public decimal TotMaxTime
|
||||
{
|
||||
get => LoadDetail.Sum(x => x.MaxTime);
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Macchine
|
||||
/// </summary>
|
||||
public string ListMachines
|
||||
{
|
||||
get => string.Join(", ", machineCalcResults.Select(x => x.Name).OrderBy(x => x).ToList());
|
||||
}
|
||||
/// <summary>
|
||||
/// Num Macchine
|
||||
/// </summary>
|
||||
public int NumMachines
|
||||
{
|
||||
get => machineCalcResults.Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco delle etichette parts non OK
|
||||
/// </summary>
|
||||
public List<string> ListUnWorkable
|
||||
{
|
||||
get => listUnWorkable ?? new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dettaglio combinazioni carico di lavoro
|
||||
/// </summary>
|
||||
public List<MachineTagDTO> LoadDetail { get; set; } = new List<MachineTagDTO>();
|
||||
|
||||
public List<MachineCalcResultDTO> MachineCalcResults
|
||||
{
|
||||
get => machineCalcResults;
|
||||
}
|
||||
|
||||
public int NumKo
|
||||
{
|
||||
get => numKo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tempo massimo complessivo in ORE
|
||||
/// </summary>
|
||||
public decimal TotMaxTime
|
||||
{
|
||||
get => LoadDetail.Sum(x => x.MaxTime) / 3600;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tempo minimo complessivo in ORE
|
||||
/// </summary>
|
||||
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<string>? listUnWorkable = null;
|
||||
private List<MachineCalcResultDTO> machineCalcResults = new List<MachineCalcResultDTO>();
|
||||
private string uID = "";
|
||||
private int numKo = 0;
|
||||
private string uID = "";
|
||||
private bool workable = false;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>0.9.2512.0518</Version>
|
||||
<Version>0.9.2512.0519</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -84,6 +84,7 @@ else
|
||||
<th>Descrizione</th>
|
||||
<th class="text-end" title="Quantità Articoli">Qty <i class="fa-regular fa-file-lines"></i></th>
|
||||
@* <th class="text-end">Importo</th> *@
|
||||
<th class="text-end" title="Macchine"># Macc</th>
|
||||
<th class="text-end" title="Quantità Prodotti"># Prod</th>
|
||||
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
|
||||
{
|
||||
@@ -232,6 +233,8 @@ else
|
||||
</div>
|
||||
<div class="small text-secondary" title="RockBottom Price">(@item.UnitCost.ToString("C2"))</div>
|
||||
</td> *@
|
||||
|
||||
<td class="text-end fs-4" title="@itemWLD.ListMachines">@itemWLD.NumMachines</td>
|
||||
<td class="text-end text-nowrap">
|
||||
<div class="fw-bold" title="# Totale Prodotti">
|
||||
@($"{item.ProdItemQtyTot:N0}")
|
||||
@@ -287,7 +290,16 @@ else
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-end text-nowrap" title="Tempi Stimati">
|
||||
@($"{itemWLD.TotMinTime} - {itemWLD.TotMaxTime}")
|
||||
@if ((itemWLD.TotMaxTime - itemWLD.TotMinTime) > 1)
|
||||
{
|
||||
@($"{itemWLD.TotMinTime:N2} - {itemWLD.TotMaxTime:N2}")
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@($"{itemWLD.TotMaxTime:N2}")
|
||||
}
|
||||
|
||||
</td>
|
||||
}
|
||||
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
|
||||
@@ -326,11 +338,21 @@ else
|
||||
{
|
||||
<td colspan="1"></td>
|
||||
}
|
||||
<td class="text-end">@($"{GrandTotNumItems:N0}")</td>
|
||||
<th class="text-end">
|
||||
@($"{GrandTotPrice:C2}")
|
||||
<div class="small text-secondary" title="RockBottom Price">(@($"{GrandTotCost:C2}"))</div>
|
||||
@GrandTotNumKo
|
||||
</th>
|
||||
<th class="text-end">
|
||||
@if ((GrandTotMaxTime - GrandTotMinTime) > 1)
|
||||
{
|
||||
@($"{GrandTotMaxTime:N2} - {GrandTotMinTime:N2}")
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@($"{GrandTotMaxTime:N2}")
|
||||
}
|
||||
</th>
|
||||
<th class="text-end">@($"{GrandTotMargin:P2}")</th>
|
||||
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
|
||||
{
|
||||
<th></th>
|
||||
|
||||
@@ -19,7 +19,14 @@ namespace Lux.UI.Components.Compo
|
||||
public partial class OrderRowMan : IDisposable
|
||||
{
|
||||
#region Public Enums
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto merged tra riga d'ordine e carico di lavoro associato
|
||||
/// </summary>
|
||||
public class MergedOrderRow
|
||||
{
|
||||
public OrderRowModel Original { get; set; }
|
||||
public WorkLoadDetailDTO Derived { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// modalit� modifica riga offerta
|
||||
/// </summary>
|
||||
@@ -165,6 +172,19 @@ namespace Lux.UI.Components.Compo
|
||||
}
|
||||
}
|
||||
|
||||
protected int GrandTotNumKo
|
||||
{
|
||||
get => -1;
|
||||
}
|
||||
protected decimal GrandTotMinTime
|
||||
{
|
||||
get => -1;
|
||||
}
|
||||
protected decimal GrandTotMaxTime
|
||||
{
|
||||
get => -1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Num totale obj calcolato x offerta
|
||||
/// </summary>
|
||||
@@ -706,6 +726,25 @@ namespace Lux.UI.Components.Compo
|
||||
|
||||
private List<OrderRowModel> ListRecords = new List<OrderRowModel>();
|
||||
|
||||
/// <summary>
|
||||
/// Conversione record originali/merged
|
||||
/// </summary>
|
||||
/// <param name="origList"></param>
|
||||
/// <returns></returns>
|
||||
protected List<MergedOrderRow> MergeRecord(List<OrderRowModel> origList)
|
||||
{
|
||||
var mergedList = AllRecords
|
||||
.Select(item => new MergedOrderRow
|
||||
{
|
||||
Original = item,
|
||||
Derived = WorkLoadDetail(item.OrderRowUID, item.ProdEstimate)
|
||||
})
|
||||
.ToList();
|
||||
return mergedList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private int numRecord = 10;
|
||||
|
||||
/// <summary>
|
||||
@@ -1526,5 +1565,6 @@ namespace Lux.UI.Components.Compo
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
|
||||
<Version>0.9.2512.0518</Version>
|
||||
<Version>0.9.2512.0519</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>LUX - Web Windows MES</i>
|
||||
<h4>Versione: 0.9.2512.0518</h4>
|
||||
<h4>Versione: 0.9.2512.0519</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.9.2512.0518
|
||||
0.9.2512.0519
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>0.9.2512.0518</version>
|
||||
<version>0.9.2512.0519</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user