diff --git a/MP-TAB-SERV/Components/MachSel.razor.cs b/MP-TAB-SERV/Components/MachSel.razor.cs
index 755f933f..b328ed09 100644
--- a/MP-TAB-SERV/Components/MachSel.razor.cs
+++ b/MP-TAB-SERV/Components/MachSel.razor.cs
@@ -57,7 +57,9 @@ namespace MP_TAB_SERV.Components
{
var listMulti = await TDataService.VMSFDGetAll();
- ListMacchine = listMulti.Where(x => x.IdxMacchina.Contains($"{RecMSE?.IdxMacchina}#")).ToDictionary(x => x.IdxMacchina, x => $"{x.IdxMacchina.Replace($"{RecMSE?.IdxMacchina}#", "")}");
+ ListMacchine = listMulti
+ .Where(x => x.IdxMacchina.Contains($"{RecMSE?.IdxMacchina}#"))
+ .ToDictionary(x => x.IdxMacchina, x => x.CodMaccArticolo);
if (ListMacchine.Count > 0 && string.IsNullOrEmpty(idxMaccSel))
{
diff --git a/MP-TAB-SERV/Components/OdlMan.razor b/MP-TAB-SERV/Components/OdlMan.razor
new file mode 100644
index 00000000..4aeb60be
--- /dev/null
+++ b/MP-TAB-SERV/Components/OdlMan.razor
@@ -0,0 +1,28 @@
+
+
+
+
+
+ @if (needConfProd)
+ {
+
+
@lblWarnHead
+
@lblWarnBody @numPz2Conf
+
+ @if (!odlOk)
+ {
+
+
+
+ }
+ }
+
+ Slave machine man
+
+ @if (!needConfProd)
+ {
+
+ ODL setup (full)
+
+ }
+
\ No newline at end of file
diff --git a/MP-TAB-SERV/Components/OdlMan.razor.cs b/MP-TAB-SERV/Components/OdlMan.razor.cs
new file mode 100644
index 00000000..8e51ff3f
--- /dev/null
+++ b/MP-TAB-SERV/Components/OdlMan.razor.cs
@@ -0,0 +1,138 @@
+using global::Microsoft.AspNetCore.Components;
+using MP.Data.DatabaseModels;
+
+namespace MP_TAB_SERV.Components
+{
+ public partial class OdlMan
+ {
+ #region Public Properties
+
+ ///
+ /// Post update restituisco nuova lista dati
+ ///
+ [Parameter]
+ public EventCallback> E_Updated { get; set; }
+
+ ///
+ /// Verifica ODL OK (ovvero caricato x macchina...)
+ ///
+ public bool odlOk
+ {
+ get => (RecMSE != null && RecMSE.IdxOdl > 0);
+ }
+
+ [Parameter]
+ public MappaStatoExpl? RecMSE { get; set; } = null;
+
+ #endregion Public Properties
+
+ #region Protected Methods
+
+ ///
+ /// Aggiorno...
+ ///
+ ///
+ protected async Task DoUpdate()
+ {
+ isProcessing = true;
+ await Task.Delay(1);
+ isProcessing = false;
+ await Task.Delay(1);
+ }
+
+ protected override async Task OnParametersSetAsync()
+ {
+ await Task.Delay(1);
+ checkAll();
+ }
+
+ protected async Task SetMacc(string selIdxMacc)
+ {
+ isProcessing = true;
+ await Task.Delay(10);
+ IdxMaccSel = selIdxMacc;
+ await DoUpdate();
+ isProcessing = false;
+ await Task.Delay(10);
+ }
+
+ #endregion Protected Methods
+
+ #region Private Fields
+
+ private string lblWarnBody = "Pezzi da confermare: ";
+
+ private string lblWarnHead = "Attenzione";
+
+ private int numPz2Conf = 0;
+
+
+ #endregion Private Fields
+
+ #region Private Properties
+
+ private string IdxMaccSel { get; set; } = "";
+
+ private int IdxOdl
+ {
+ get => RecMSE != null ? RecMSE.IdxOdl ?? 0 : 0;
+ }
+
+ private bool isProcessing { get; set; } = false;
+
+ #endregion Private Properties
+
+ #region Private Methods
+
+ private void checkAll()
+ {
+ checkConfProd();
+ }
+
+ private bool needConfProd = true;
+ ///
+ /// verifica se sia necessario confermare la produzione PRIMA di operare sull'ODL
+ ///
+ private void checkConfProd()
+ {
+ // verifica se sia necessario confermare produzione
+ int pz2conf = 0;
+#if false
+ DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd;
+ try
+ {
+ rigaProd = DataLayerObj.taPzProd2conf.GetData(idxMacchinaFix)[0];
+ pz2conf = rigaProd.pezziNonConfermati;
+ needConfProd = (pz2conf > 0 && !isSlave);
+ }
+ catch (Exception exc)
+ {
+ logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}{1}{2}", idxMacchinaFix, Environment.NewLine, exc), tipoLog.ERROR);
+ }
+ // se necessario mostro warning...
+ if (needConfProd)
+ {
+ // SE mancasse ODL mostro info x poter caricare ODL retrodatato
+ if (odlOk)
+ {
+ lblWarningHead.Text = traduci("ConfProdBeforeContinueHead");
+ lblWarningBody.Text = traduci("ConfProdBeforeContinueBody");
+ lblNumPz2Conf.Text = string.Format("{0} pz NC", pz2conf);
+ }
+ else
+ {
+ lblWarningHead.Text = traduci("setOdlBeforeContinueHead");
+ lblWarningBody.Text = traduci("setOdlBeforeContinueBody");
+ lblNumPz2Conf.Text = string.Format("{0} pz NC", pz2conf);
+ }
+ }
+ divPz2Conf.Visible = needConfProd;
+ divWarn.Visible = needConfProd;
+ lbtFixOdl.Visible = !odlOk;
+ mod_ODL1.isEnabled = !needConfProd;
+#endif
+ }
+
+ #endregion Private Methods
+ }
+}
\ No newline at end of file
diff --git a/MP-TAB-SERV/Components/OdlProdFix.razor b/MP-TAB-SERV/Components/OdlProdFix.razor
deleted file mode 100644
index 68d8acf5..00000000
--- a/MP-TAB-SERV/Components/OdlProdFix.razor
+++ /dev/null
@@ -1,5 +0,0 @@
-OdlProdFix
-
-@code {
-
-}
diff --git a/MP-TAB-SERV/Components/OdlSetup.razor b/MP-TAB-SERV/Components/OdlSetup.razor
deleted file mode 100644
index 1bcfd3cf..00000000
--- a/MP-TAB-SERV/Components/OdlSetup.razor
+++ /dev/null
@@ -1,5 +0,0 @@
-OdlSetup
-
-@code {
-
-}
diff --git a/MP-TAB-SERV/Components/ProdConfirm.razor.cs b/MP-TAB-SERV/Components/ProdConfirm.razor.cs
index 50887bfa..0206570d 100644
--- a/MP-TAB-SERV/Components/ProdConfirm.razor.cs
+++ b/MP-TAB-SERV/Components/ProdConfirm.razor.cs
@@ -18,13 +18,13 @@ namespace MP_TAB_SERV.Components
/// registrato nuovo valore
///
[Parameter]
- public EventCallback E_newVal { get; set; }
+ public EventCallback E_reset { get; set; }
///
- /// registrato nuovo valore
+ /// Post update restituisco nuova lista dati
///
[Parameter]
- public EventCallback E_reset { get; set; }
+ public EventCallback> E_Updated { get; set; }
///
/// Verifica ODL OK (ovvero caricato x macchina...)
@@ -39,42 +39,17 @@ namespace MP_TAB_SERV.Components
#endregion Public Properties
- #region Public Methods
-
- ///
- /// Aggiorno valori produzione alla data richiesta...
- ///
- ///
- public async Task doUpdate()
- {
- isProcessing = true;
- await Task.Delay(1);
- datiProdAct = await TabDServ.StatoProdMacchina(IdxMaccSel, dtReqUpdate);
- // aggiorno visualizzazione...
- numPzProdotti = datiProdAct.PzTotODL;
- numPz2Rec = datiProdAct.Pz2RecTot;
- numPzScaConf = datiProdAct.PzConfScarto;
- numPzBuoniConf = datiProdAct.PzConfBuoni;
- numPzProdotti2Rec = datiProdAct.Pz2RecTot;
- numPzScarto2Rec = datiProdAct.Pz2RecScarto;
- dtInizio = RecMSE?.DataInizioOdl ?? DateTime.Today.AddMonths(-2);
- dtFine = dtReqUpdate;
- isProcessing = false;
- await Task.Delay(1);
- }
-
- #endregion Public Methods
-
#region Protected Properties
+ protected string ConfBg
+ {
+ get => showInnov ? "bg-warning text-dark" : "bg-success text-light";
+ }
+
protected string ConfTitle
{
get => showInnov ? "Nascondi conferma" : "Mostra conferma";
}
- protected string ConfBg
- {
- get => showInnov ? "bg-warning text-dark" : "bg-success text-light";
- }
///
/// Dati produzioen rilevati
@@ -130,8 +105,11 @@ namespace MP_TAB_SERV.Components
}
protected int numPzProdotti { get; set; } = 0;
+
protected int numPzProdotti2Rec { get; set; } = 0;
+
protected int numPzScaConf { get; set; } = 0;
+
protected int numPzScarto2Rec { get; set; } = 0;
[Inject]
@@ -144,6 +122,28 @@ namespace MP_TAB_SERV.Components
#region Protected Methods
+ ///
+ /// Aggiorno valori produzione alla data richiesta...
+ ///
+ ///
+ protected async Task DoUpdate()
+ {
+ isProcessing = true;
+ await Task.Delay(1);
+ datiProdAct = await TabDServ.StatoProdMacchina(IdxMaccSel, dtReqUpdate);
+ // aggiorno visualizzazione...
+ numPzProdotti = datiProdAct.PzTotODL;
+ numPz2Rec = datiProdAct.Pz2RecTot;
+ numPzScaConf = datiProdAct.PzConfScarto;
+ numPzBuoniConf = datiProdAct.PzConfBuoni;
+ numPzProdotti2Rec = datiProdAct.Pz2RecTot;
+ numPzScarto2Rec = datiProdAct.Pz2RecScarto;
+ dtInizio = RecMSE?.DataInizioOdl ?? DateTime.Today.AddMonths(-2);
+ dtFine = dtReqUpdate;
+ isProcessing = false;
+ await Task.Delay(1);
+ }
+
protected override async Task OnInitializedAsync()
{
lblOut = "";
@@ -154,7 +154,7 @@ namespace MP_TAB_SERV.Components
enablePzProdLasciati = SMServ.GetConfBool("enablePzProdLasciati");
confRett = SMServ.GetConfBool("confRett");
modoConfProd = SMServ.GetConfInt("modoConfProd");
- await doUpdate();
+ await DoUpdate();
}
}
@@ -182,10 +182,10 @@ namespace MP_TAB_SERV.Components
// sollevo evento!
dtReqUpdate = DateTime.Now;
numPzLasciati = 0;
- await doUpdate();
- isProcessing = false;
+ await DoUpdate();
await Task.Delay(1);
- await E_newVal.InvokeAsync(true);
+ await RefreshData();
+ isProcessing = false;
}
protected void setConfirmBtn(bool newVal)
@@ -198,7 +198,7 @@ namespace MP_TAB_SERV.Components
isProcessing = true;
await Task.Delay(10);
IdxMaccSel = selIdxMacc;
- await doUpdate();
+ await DoUpdate();
isProcessing = false;
await Task.Delay(10);
}
@@ -217,8 +217,11 @@ namespace MP_TAB_SERV.Components
#region Private Fields
private bool confRett = false;
+
private bool enablePzProdLasciati = false;
+
private string lblOut = "";
+
private int modoConfProd = 0;
#endregion Private Fields
@@ -226,7 +229,9 @@ namespace MP_TAB_SERV.Components
#region Private Properties
private DateTime dtReqUpdate { get; set; } = DateTime.Now;
+
private string IdxMaccSel { get; set; } = "";
+
private bool isProcessing { get; set; } = false;
private int MatrOpr
@@ -235,6 +240,7 @@ namespace MP_TAB_SERV.Components
}
private int numPzLasc { get; set; } = 0;
+
private bool showConfirm { get; set; } = true;
private bool showInnov { get; set; } = false;
@@ -262,6 +268,13 @@ namespace MP_TAB_SERV.Components
return fatto;
}
+ private async Task RefreshData()
+ {
+ List ListMSE = await MDataService.MseGetAll(true);
+ await MServ.SaveMse(ListMSE);
+ await E_Updated.InvokeAsync(ListMSE);
+ }
+
#endregion Private Methods
#if false
diff --git a/MP-TAB-SERV/Components/SlideMenu.razor b/MP-TAB-SERV/Components/SlideMenu.razor
index c96b7335..356d9208 100644
--- a/MP-TAB-SERV/Components/SlideMenu.razor
+++ b/MP-TAB-SERV/Components/SlideMenu.razor
@@ -4,15 +4,15 @@
-@code {
-
- [Parameter]
- public List MenuItems { get; set; } = new List();
-
- [Inject]
- protected NavigationManager navManager { get; set; } = null!;
-
- protected string isActive(string currUri)
- {
- string answ = "";
- if (navManager.Uri.Contains(currUri))
- {
- answ = "background-color: #212427; color: #fff";
- }
- return answ;
-
- }
-
-}
diff --git a/MP-TAB-SERV/Components/SlideMenu.razor.cs b/MP-TAB-SERV/Components/SlideMenu.razor.cs
new file mode 100644
index 00000000..b6b3766f
--- /dev/null
+++ b/MP-TAB-SERV/Components/SlideMenu.razor.cs
@@ -0,0 +1,37 @@
+using global::Microsoft.AspNetCore.Components;
+using MP.Data.DatabaseModels;
+
+namespace MP_TAB_SERV.Components
+{
+ public partial class SlideMenu
+ {
+ #region Public Properties
+
+ [Parameter]
+ public List MenuItems { get; set; } = new List();
+
+ #endregion Public Properties
+
+ #region Protected Properties
+
+ [Inject]
+ protected NavigationManager navManager { get; set; } = null!;
+
+ #endregion Protected Properties
+
+ #region Protected Methods
+
+ protected string cssActive(string currUri)
+ {
+ return navManager.Uri.Contains(currUri) ? "bg-dark text-light" : "";
+ }
+
+ protected async Task SetPage(string tgtUrl)
+ {
+ await Task.Delay(1);
+ navManager.NavigateTo(tgtUrl);
+ }
+
+ #endregion Protected Methods
+ }
+}
\ No newline at end of file
diff --git a/MP-TAB-SERV/Pages/MachineDetail.razor b/MP-TAB-SERV/Pages/MachineDetail.razor
index 804c9d54..ecda23b2 100644
--- a/MP-TAB-SERV/Pages/MachineDetail.razor
+++ b/MP-TAB-SERV/Pages/MachineDetail.razor
@@ -9,6 +9,6 @@
else
{
-
+
}
diff --git a/MP-TAB-SERV/Pages/ODL.razor b/MP-TAB-SERV/Pages/ODL.razor
index a54dd156..d3b5fa95 100644
--- a/MP-TAB-SERV/Pages/ODL.razor
+++ b/MP-TAB-SERV/Pages/ODL.razor
@@ -1,15 +1,12 @@
@page "/odl"
+
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
}
else
{
-
-
-
-
-
-
+
+
}
diff --git a/MP-TAB-SERV/Pages/ODL.razor.cs b/MP-TAB-SERV/Pages/ODL.razor.cs
index 432a144f..6e382c7d 100644
--- a/MP-TAB-SERV/Pages/ODL.razor.cs
+++ b/MP-TAB-SERV/Pages/ODL.razor.cs
@@ -40,6 +40,35 @@ namespace MP_TAB_SERV.Pages
}
}
+
+
+ protected async Task RefreshData(List newList)
+ {
+ var ListMSE = newList;
+ if (!string.IsNullOrEmpty(IdxMacc))
+ {
+ var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
+ if (rawData != null)
+ {
+ CurrMSE = rawData;
+ }
+ else
+ {
+ await RefreshMBlock();
+ }
+ }
+ await InvokeAsync(StateHasChanged);
+ }
+
+ protected async Task RefreshMBlock()
+ {
+ // recupero MSE macchina....
+ if (!string.IsNullOrEmpty(IdxMacc))
+ {
+ CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
+ }
+ }
+
#endregion Private Methods
}
}
\ No newline at end of file
diff --git a/MP.Data/Services/StatusData.cs b/MP.Data/Services/StatusData.cs
index 30696304..fe431533 100644
--- a/MP.Data/Services/StatusData.cs
+++ b/MP.Data/Services/StatusData.cs
@@ -102,7 +102,7 @@ namespace MP.Data.Services
return Task.FromResult(dbController.MacchineGetAll());
}
- public async Task> MseGetAll()
+ public async Task> MseGetAll(bool forceDb = false)
{
int maxAge = 2000;
int.TryParse(_configuration.GetValue("ServerConf:maxAge"), out maxAge);
@@ -111,7 +111,7 @@ namespace MP.Data.Services
List? result = new List();
// cerco in redis...
RedisValue rawData = redisDb.StringGet(redisMseKey);
- if (rawData.HasValue)
+ if (rawData.HasValue && !forceDb)
{
result = JsonConvert.DeserializeObject>($"{rawData}");
stopWatch.Stop();