Update gestione display errori rebalance...
This commit is contained in:
@@ -18,6 +18,15 @@
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-4"></div>
|
||||
<div id="divError" runat="server" class="col-12 alert alert-warning" visible="false">
|
||||
<div class="fs-2 text-danger">
|
||||
<asp:Label ID="lblError" runat="server" CssClass="font-weight-bold" />
|
||||
</div>
|
||||
<div class="small text-danger">
|
||||
<asp:Label ID="lblErrorDetail" runat="server" CssClass="font-weight-bold" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-1">
|
||||
|
||||
@@ -331,6 +331,7 @@ namespace NKC_WF.WebUserControls
|
||||
|
||||
protected void lbtBalance_Click(object sender, EventArgs e)
|
||||
{
|
||||
divError.Visible = false;
|
||||
// imposto la % secondo numero di abilitati...
|
||||
Ratio01 = enable01 ? (double)(100 / numEnabled) / 100 : 0;
|
||||
Ratio02 = enable02 ? (double)(100 / numEnabled) / 100 : 0;
|
||||
@@ -421,6 +422,7 @@ namespace NKC_WF.WebUserControls
|
||||
fixRatio();
|
||||
checkDisplayMode();
|
||||
fixEnabled();
|
||||
divError.Visible = false;
|
||||
}
|
||||
cmp_orderExtListNE01.eh_doRefresh += Cmp_orderExtListNE01_eh_doRefresh;
|
||||
cmp_orderExtListNE02.eh_doRefresh += Cmp_orderExtListNE02_eh_doRefresh;
|
||||
@@ -830,7 +832,8 @@ namespace NKC_WF.WebUserControls
|
||||
{
|
||||
RawList.Add(item.OrdID, item.EstProcTime);
|
||||
}
|
||||
Log.Instance.Trace($"Rebalance | S02 | listOrders.count: {listOrders.Count}");
|
||||
int numOrdOrig = listOrders.Count;
|
||||
Log.Instance.Trace($"Rebalance | S02 | listOrders.count: {numOrdOrig}");
|
||||
// ordino la lista x processing successivo
|
||||
OrderedList = RawList.OrderBy(x => x.Value).ToDictionary(t => t.Key, t => t.Value);
|
||||
// inizio immaginando di usare TUTTI gli ordini
|
||||
@@ -956,65 +959,78 @@ namespace NKC_WF.WebUserControls
|
||||
{
|
||||
Log.Instance.Error($"Exception durante rebalance 01:{Environment.NewLine}{exc}");
|
||||
}
|
||||
// check sul num di spostamenti1
|
||||
int numMove = 0;
|
||||
int numOk = 0;
|
||||
Log.Instance.Trace("Rebalance | Starting final stage (DB modifications)");
|
||||
try
|
||||
// 2024.09.20: controllo che il numero ordini torni o LO SEGNALO come errore...
|
||||
int numAssigned = SetNe01.OrderSet.Count + SetNe02.OrderSet.Count + SetNe03.OrderSet.Count;
|
||||
if (numAssigned != numOrdOrig)
|
||||
{
|
||||
// riorganizzo tabOrders...
|
||||
foreach (var orderItem in TabOrders)
|
||||
divError.Visible = true;
|
||||
Log.Instance.Error($"Error during rebalance | numOrdOrig: {numOrdOrig} | numAssigned: {numAssigned}");
|
||||
lblError.Text = traduci("ERR_Rebalance01");
|
||||
lblErrorDetail.Text = $"{traduci("ERR_Rebalance02")} | # Orig: {numOrdOrig} | # Assigned: {numAssigned}";
|
||||
}
|
||||
else
|
||||
{
|
||||
divError.Visible = false;
|
||||
// check sul num di spostamenti1
|
||||
int numMove = 0;
|
||||
int numOk = 0;
|
||||
Log.Instance.Trace("Rebalance | Starting final stage (DB modifications)");
|
||||
try
|
||||
{
|
||||
if (SetNe01.OrderSet.ContainsKey(orderItem.OrdID))
|
||||
// riorganizzo tabOrders...
|
||||
foreach (var orderItem in TabOrders)
|
||||
{
|
||||
if (orderItem.BatchID != cmp_orderExtListNE01.BatchId)
|
||||
if (SetNe01.OrderSet.ContainsKey(orderItem.OrdID))
|
||||
{
|
||||
DLMan.taOLT.updateBatch(orderItem.BatchID, orderItem.OrdID, cmp_orderExtListNE01.BatchId);
|
||||
numMove++;
|
||||
if (orderItem.BatchID != cmp_orderExtListNE01.BatchId)
|
||||
{
|
||||
DLMan.taOLT.updateBatch(orderItem.BatchID, orderItem.OrdID, cmp_orderExtListNE01.BatchId);
|
||||
numMove++;
|
||||
}
|
||||
else
|
||||
{
|
||||
numOk++;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (SetNe02.OrderSet.ContainsKey(orderItem.OrdID))
|
||||
{
|
||||
numOk++;
|
||||
if (orderItem.BatchID != cmp_orderExtListNE02.BatchId)
|
||||
{
|
||||
DLMan.taOLT.updateBatch(orderItem.BatchID, orderItem.OrdID, cmp_orderExtListNE02.BatchId);
|
||||
numMove++;
|
||||
}
|
||||
else
|
||||
{
|
||||
numOk++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SetNe02.OrderSet.ContainsKey(orderItem.OrdID))
|
||||
{
|
||||
if (orderItem.BatchID != cmp_orderExtListNE02.BatchId)
|
||||
if (SetNe03.OrderSet.ContainsKey(orderItem.OrdID))
|
||||
{
|
||||
DLMan.taOLT.updateBatch(orderItem.BatchID, orderItem.OrdID, cmp_orderExtListNE02.BatchId);
|
||||
numMove++;
|
||||
}
|
||||
else
|
||||
{
|
||||
numOk++;
|
||||
}
|
||||
}
|
||||
if (SetNe03.OrderSet.ContainsKey(orderItem.OrdID))
|
||||
{
|
||||
if (orderItem.BatchID != cmp_orderExtListNE03.BatchId)
|
||||
{
|
||||
DLMan.taOLT.updateBatch(orderItem.BatchID, orderItem.OrdID, cmp_orderExtListNE03.BatchId);
|
||||
numMove++;
|
||||
}
|
||||
else
|
||||
{
|
||||
numOk++;
|
||||
if (orderItem.BatchID != cmp_orderExtListNE03.BatchId)
|
||||
{
|
||||
DLMan.taOLT.updateBatch(orderItem.BatchID, orderItem.OrdID, cmp_orderExtListNE03.BatchId);
|
||||
numMove++;
|
||||
}
|
||||
else
|
||||
{
|
||||
numOk++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Instance.Error($"Exception durante rebalance 02:{Environment.NewLine}{exc}");
|
||||
}
|
||||
answ = listOrders.Count > 0;
|
||||
Log.Instance.Trace($"Final check | S14 | answ: {answ} | listOrders.Count: {listOrders.Count} | numMove: {numMove} | numOk: {numOk}");
|
||||
// salvo tempo calcolo
|
||||
stopWatch.Stop();
|
||||
var elapsTime = stopWatch.Elapsed;
|
||||
Log.Instance.Info($"Rebalance executed | R01: {Ratio01:P1}/{SetNe01.ActualValue / FullSet.ActualValue:P1} | R02: {Ratio02:P1}/{SetNe02.ActualValue / FullSet.ActualValue:P1} | R03: {Ratio03:P1}/{SetNe03.ActualValue / FullSet.ActualValue:P1} | maxDepth: {maxDepth} | elapsed ms: {elapsTime.TotalMilliseconds:N1}");
|
||||
// resetto batch ordini...
|
||||
ComLib.OrdersExtResetCache();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Instance.Error($"Exception durante rebalance 02:{Environment.NewLine}{exc}");
|
||||
}
|
||||
answ = listOrders.Count > 0;
|
||||
Log.Instance.Trace($"Final check | S14 | answ: {answ} | listOrders.Count: {listOrders.Count} | numMove: {numMove} | numOk: {numOk}");
|
||||
// salvo tempo calcolo
|
||||
stopWatch.Stop();
|
||||
var elapsTime = stopWatch.Elapsed;
|
||||
Log.Instance.Info($"Rebalance executed | R01: {Ratio01:P1}/{SetNe01.ActualValue / FullSet.ActualValue:P1} | R02: {Ratio02:P1}/{SetNe02.ActualValue / FullSet.ActualValue:P1} | R03: {Ratio03:P1}/{SetNe03.ActualValue / FullSet.ActualValue:P1} | maxDepth: {maxDepth} | elapsed ms: {elapsTime.TotalMilliseconds:N1}");
|
||||
// resetto batch ordini...
|
||||
ComLib.OrdersExtResetCache();
|
||||
cmp_orderExtListNE01.doUpdate();
|
||||
cmp_orderExtListNE02.doUpdate();
|
||||
cmp_orderExtListNE03.doUpdate();
|
||||
|
||||
@@ -77,6 +77,33 @@ namespace NKC_WF.WebUserControls
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtBalance;
|
||||
|
||||
/// <summary>
|
||||
/// divError control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divError;
|
||||
|
||||
/// <summary>
|
||||
/// lblError control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblError;
|
||||
|
||||
/// <summary>
|
||||
/// lblErrorDetail control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblErrorDetail;
|
||||
|
||||
/// <summary>
|
||||
/// divHeadNe01 control.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user