Update gestione refresh ODL

This commit is contained in:
Samuele Locatelli
2023-11-09 10:03:06 +01:00
parent 14266feb5c
commit e61a512647
7 changed files with 318 additions and 226 deletions
+80 -73
View File
@@ -38,12 +38,27 @@
</div>
}
@if (showOdlDetail)
@if (!inAttr && !showOdlDetail)
{
<div class="col-12 my-1">
<button class="btn btn-lg btn-outline-warning w-100" disabled="@inAttr" @onclick="ToggleOdlDetail"><i class="fa-solid fa-chevron-down"></i> @txtBtnOdlDetail</button>
</div>
}
@if (showOdlDetail || inAttr)
{
<div class="col-12 my-1">
<div class="card">
<div class="card-header bg-warning text-light">
<h4>Verifica parametri attrezzaggio</h4>
<div class="card-header @cssDetailOdl d-flex justify-content-between">
<div>
<h4>@titleOdlDetail</h4>
</div>
<div>
@if (idxPOdlSel == 0)
{
<button class="btn btn-lg btn-dark w-100" disabled="@inAttr" @onclick="ToggleOdlDetail"><i class="fa-solid fa-chevron-up"></i> @txtBtnOdlDetail</button>
}
</div>
</div>
<div class="card-body">
<div class="row">
@@ -136,34 +151,36 @@
</div>
}
<div class="col-12 col-md-6 mb-2">
<div class="input-group input-group-lg">
<input type="text" class="form-control w-25" placeholder="Cerca" aria-label="Cerca">
<select class="form-select w-50" @bind="IdxPOdlSel">
@foreach (var item in ListODL)
{
<option value="@item.value">@item.label</option>
}
</select>
<div class="input-group-text">
<input class="form-check-input mt-0 me-1" id="chk_all" type="checkbox" @bind="ShowAll">
<label class="form-check-label" for="" chk_all">
Tutti
</label>
@if (!inAttr)
{
<div class="col-12 col-md-6 mb-2">
<div class="input-group input-group-lg">
<input type="text" class="form-control w-25" placeholder="Cerca" aria-label="Cerca">
<select class="form-select w-50" @bind="IdxPOdlSel">
@foreach (var item in ListODL)
{
<option value="@item.value">@item.label</option>
}
</select>
<div class="input-group-text">
<input class="form-check-input mt-0 me-1" id="chk_all" type="checkbox" @bind="ShowAll">
<label class="form-check-label" for="" chk_all">
Tutti
</label>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-6">
@if (idxPOdlSel > 0)
{
<button class="btn btn-lg btn-primary w-100" @onclick="OdlSetupStart"><i class="fa-solid fa-check me-1"></i> INIZIO Attrezzaggio</button>
}
else
{
<button class="btn btn-lg btn-outline-warning w-100" disabled="@isInAttr" @onclick="togOdlDetail"><i class="fa-solid fa-star me-1"></i> Dettaglio ODL</button>
}
</div>
@if (idxPOdlSel > 0)
<div class="col-12 col-md-6">
@if (idxPOdlSel > 0)
{
<button class="btn btn-lg btn-primary w-100" @onclick="OdlSetupStart"><i class="fa-solid fa-check me-1"></i> INIZIO Attrezzaggio</button>
}
else
{
}
</div>
}
@if (idxPOdlSel > 0 || inAttr)
{
<div class="col-12 col-sm-6">
<label class="form-label">note Attrezzaggio</label>
@@ -185,53 +202,43 @@
</div>
}
<div class="col-12">
<div class="d-flex justify-content-between flex-wrap">
<div class="col-12 col-sm-12 col-md-6 p-2">
<button class="btn btn-lg btn-warning w-100" disabled="@needConfProd" @onclick="OdlSetupEnd"><i class="fa-solid fa-check me-1"></i> FINE Attr / INIZIO Prod.</button>
</div>
<div class="col-12 col-sm-12 col-md-6 p-2">
<button class="btn btn-lg btn-primary w-100" disabled="@needConfProd" @onclick="ProdEnd"><i class="fa-solid fa-ban me-1"></i>FINE Produzione</button>
</div>
@if (inAttr)
{
<div class="col-12 col-sm-12 col-md-6 p-2">
<button class="btn btn-lg btn-warning w-100" disabled="@needConfProd" @onclick="OdlSetupEnd"><i class="fa-solid fa-check me-1"></i> FINE Attr / INIZIO Prod.</button>
</div>
}
<div class="col-12 col-sm-12 col-md-6 p-2">
<button class="btn btn-lg btn-primary w-100" disabled="@needConfProd" @onclick="ProdEnd"><i class="fa-solid fa-ban me-1"></i>FINE Produzione</button>
</div>
<div class="col-12 col-sm-12 col-md-6 p-2">
<div class="form-check form-switch fs-3">
<input class="form-check-input" type="checkbox" @bind="@forceCloseOdl">
<label class="form-check-label">@Traduci("ForceCloseODL")</label>
</div>
</div>
<div class="col-12">
<div class="d-flex justify-content-between flex-wrap">
<div class="col-12 col-sm-12 col-md-6 p-2">
<button class="btn btn-lg btn-info w-100" disabled="@needConfProd"><i class="fa-solid fa-triangle-exclamation me-1"></i> Mostra Riattrezzaggio</button>
</div>
<div class="col-12 col-sm-12 col-md-6 p-2">
<div class="form-check form-switch fs-3">
<input class="form-check-input" type="checkbox" @bind="@forceCloseOdl">
<label class="form-check-label">@Traduci("ForceCloseODL")</label>
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-6 p-2">
<button class="btn btn-lg btn-info w-100" disabled="@needConfProd"><i class="fa-solid fa-triangle-exclamation me-1"></i> Mostra Riattrezzaggio</button>
</div>
<div class="col-12">
<div class="d-flex justify-content-between flex-wrap">
<div class="col-12 col-sm-12 col-md-6 p-2">
<button class="btn btn-lg btn-success w-100" disabled="@needConfProd"><i class="fa-solid fa-wrench me-1"></i> Fix Chiusura Arttrezzaggio (PLC)</button>
</div>
<div class="col-12 col-sm-12 col-md-6 p-2">
<button class="btn btn-lg btn-danger w-100" disabled="@needConfProd"><i class="fa-solid fa-circle-exclamation me-1"></i> Creazione ODL Provvisorio</button>
@* <div class="col-sm-12" runat="server" id="divOdlProvv">
<div class="card">
<div class="card-header p-0">
<div class="row">
<div class="col-12">
<asp:LinkButton runat="server" ID="lbtShowCreaOdlProvv" CssClass="btn w-100 btn-danger" OnClick="lbtShowCreaOdlProvv_Click"><i class="fa fa-exclamation-circle"></i> <%: lblCreaOdl %></asp:LinkButton>
</div>
</div>
</div>
<div class="card-body p-1 table-info text-dark table-secondary">
<uc1:cmp_newODL runat="server" ID="cmp_newODL" Visible="false" />
</div>
</div>
</div> *@
</div>
</div>
<div class="col-12 col-sm-12 col-md-6 p-2">
<button class="btn btn-lg btn-success w-100" disabled="@needConfProd"><i class="fa-solid fa-wrench me-1"></i> Fix Chiusura Arttrezzaggio (PLC)</button>
</div>
<div class="col-12 col-sm-12 col-md-6 p-2">
<button class="btn btn-lg btn-danger w-100" disabled="@needConfProd"><i class="fa-solid fa-circle-exclamation me-1"></i> Creazione ODL Provvisorio</button>
@* <div class="col-sm-12" runat="server" id="divOdlProvv">
<div class="card">
<div class="card-header p-0">
<div class="row">
<div class="col-12">
<asp:LinkButton runat="server" ID="lbtShowCreaOdlProvv" CssClass="btn w-100 btn-danger" OnClick="lbtShowCreaOdlProvv_Click"><i class="fa fa-exclamation-circle"></i> <%: lblCreaOdl %></asp:LinkButton>
</div>
</div>
</div>
<div class="card-body p-1 table-info text-dark table-secondary">
<uc1:cmp_newODL runat="server" ID="cmp_newODL" Visible="false" />
</div>
</div>
</div> *@
</div>
<div class="col-12 text-center text-danger">
@lblOut
+224 -149
View File
@@ -1,12 +1,11 @@
using global::Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data;
using MP.Data.DatabaseModels;
using MP.Data.Objects;
using MP.Data.Services;
using MP_TAB_SERV.Shared;
using NLog;
using System.Text;
using System.Threading.Tasks;
using static MP.Data.Objects.Enums;
namespace MP_TAB_SERV.Components
@@ -80,6 +79,9 @@ namespace MP_TAB_SERV.Components
}
}
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
protected List<vSelOdlModel> ListODL { get; set; } = new List<vSelOdlModel>();
[Inject]
@@ -91,6 +93,9 @@ namespace MP_TAB_SERV.Components
[Inject]
protected MessageService MServ { get; set; } = null!;
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
/// <summary>
/// Verifica ODL OK (ovvero caricato x macchina...)
/// </summary>
@@ -126,6 +131,32 @@ namespace MP_TAB_SERV.Components
#region Protected Methods
/// <summary>
/// Gestione display avanzamento step
/// </summary>
/// <param name="currStep"></param>
protected async Task advStep(int currStep)
{
currVal = currStep;
nextVal = currVal + 1;
await InvokeAsync(StateHasChanged);
}
protected async Task CheckAttr()
{
// verifico attrezzaggio su macchina corrente o se multi su parent
string idxMacc2check = isMulti ? IdxMaccParent : IdxMaccSel;
StatoMacchineModel rigaStato = TabDServ.StatoMacchina(idxMacc2check);
//calcolo stato attrezzaggio, hard coded!!!
inAttr = (rigaStato.IdxStato == 2);
// se in attr --> carico podlCurr...
if (inAttr && RecMSE != null)
{
int currIdxPOdl = RecMSE != null ? RecMSE.IdxPOdl ?? 0 : 0;
currPodl = await TabDServ.PODLExp_getByKey(currIdxPOdl);
}
}
/// <summary>
/// Aggiorno...
/// </summary>
@@ -158,129 +189,6 @@ namespace MP_TAB_SERV.Components
return answ;
}
/// <summary>
/// Gestione display avanzamento step
/// </summary>
/// <param name="currStep"></param>
protected void advStep(int currStep)
{
currVal = currStep;
nextVal = currVal + 1;
}
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
protected async Task ProdEnd()
{
// preparo gestione progress display
MaxVal = 6;
int currStep = 0;
advStep(currStep);
isProcessing = true;
// leggo idxOdl da ultimo odl attivo x macchina
var currOdl = await TabDServ.OdlCurrByMacc(IdxMaccSel, false);
int idxODLCurr = currOdl.IdxOdl;
int idxEvento = 7; // !!!HARD CODED
// confermo prod vecchio ODL
await confermaProdOdl(false);
advStep(currStep++);
// se chk flaggato ovvero richiesta di chiudere ODL procedo come prima (chiudendo ODL senza averne altri...)
if (forceCloseOdl)
{
// aggiungo try/catch x capire se sia qui che si "impasta" in chiusura ODL
try
{
// processo x macchina selezionata
await TabDServ.OdlFineProd(idxODLCurr, IdxMaccSel);
string evText = "Registrata fine produzione per ODL {0}";
StringBuilder sb = new StringBuilder();
sb.AppendLine(String.Format(evText, idxODLCurr));
await processaEvento(IdxMaccSel, idxEvento, sb.ToString(), idxODLCurr);
advStep(currStep++);
// se è multi processo ANCHE x altra tavola...
if (isMulti)
{
sb.AppendLine("---");
var tabOdlAltra = await TabDServ.OdlCurrByMacc(idxMaccAltraTav, true);
int idxOdlAltra = tabOdlAltra.IdxOdl;
await TabDServ.OdlFineProd(idxOdlAltra, idxMaccAltraTav);
sb.AppendLine(String.Format(evText, idxOdlAltra));
await processaEvento(idxMaccAltraTav, idxEvento, String.Format(evText, idxOdlAltra), idxOdlAltra);
}
advStep(currStep++);
// se è master --> chiamo update child!
if (isMaster)
{
// hard coded 60gg last
await TabDServ.OdlFixMachineSlave(IdxMaccSel, 60, 1);
}
advStep(currStep++);
// riporto stringa
lblOut = sb.ToString().Replace("---", "<br/>");
}
catch (Exception exc)
{
Log.Error($"Eccezione in operazione chiusura ODL!{Environment.NewLine}{exc}");
// navigo!
NavMan.NavigateTo($"machine-detail");
}
}
// altrimenti split ODL x completare IN FUTURO la produzione...
else
{
try
{
// effettuo split su nuovo ODL
await TabDServ.OdlSplit(idxODLCurr, MatrOpr, IdxMaccSel, currOdl.Tcassegnato, PzPallet, $"Fine Produzione, Sospensione ODL {idxODLCurr}, generato residuo con pari TCiclo: {currOdl.Tcassegnato}", false, 0);
// processo chiusura setup
await processaEvento(IdxMaccSel, idxEvento, $"Registrata fine produzione per ODL {idxODLCurr}, nuovo ODL per quantità residua", idxODLCurr);
advStep(currStep++);
// se è multi processo ANCHE x altra tavola...
if (isMulti)
{
var tabOdlAltra = await TabDServ.OdlCurrByMacc(idxMaccAltraTav, true);
int idxOdlAltra = tabOdlAltra.IdxOdl;
// effettuo split su nuovo ODL
await TabDServ.OdlSplit(idxOdlAltra, MatrOpr, idxMaccAltraTav, tabOdlAltra.Tcassegnato, PzPallet, $"Fine Produzione, Sospensione ODL {idxOdlAltra}, generato residuo con pari TCiclo: {tabOdlAltra.Tcassegnato}", false, 0);
// processo chiusura setup
await processaEvento(idxMaccAltraTav, idxEvento, $"Registrata fine produzione per ODL {idxOdlAltra}, nuovo ODL per quantità residua", idxOdlAltra);
}
advStep(currStep++);
// se è master --> chiamo update child!
if (isMaster)
{
// hard coded 60gg last
await TabDServ.OdlFixMachineSlave(IdxMaccSel, 60, 1);
}
// sistemo buttons!
fixSplitBtn(false);
advStep(currStep++);
}
catch (Exception exc)
{
Log.Error($"Eccezione in operazione Chiusura + Split ODL su nuovo! {Environment.NewLine}{exc}");
// navigo!
NavMan.NavigateTo($"machine-detail");
}
}
#if false
doRemoveCurrOdlData();
// refresh finale
checkAll();
// sollevo evento!
if (eh_reqUpdate != null)
{
eh_reqUpdate(this, new EventArgs());
}
await Task.Delay(1500);
#endif
isProcessing = false;
}
/// <summary>
/// Registrazione Fine Setup / Inizio Produzione
/// </summary>
@@ -288,13 +196,18 @@ namespace MP_TAB_SERV.Components
/// <param name="e"></param>
protected async Task OdlSetupEnd()
{
TimeSpan estDur = TimeSpan.FromMinutes((double)tcRichAttr * currPodl.NumPezzi);
string stima = estDur.TotalHours > 1 ? $"{estDur.TotalHours:N1} ore" : $"{estDur.TotalMinutes:N1} min";
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"PODL: {currPodl.IdxPromessa}{Environment.NewLine}Art: [{currPodl.CodArticolo}] {currPodl.DescArticolo}{Environment.NewLine}Pezzi: {currPodl.NumPezzi:N0} * TCiclo: {tcRichAttr:N3}min{Environment.NewLine}Tempo stimato: {stima}{Environment.NewLine}{Environment.NewLine}Confermi la chiusura della fase di attrezzaggio?"))
return;
// preparo gestione progress display
MaxVal = 8;
int currStep = 0;
advStep(currStep);
await advStep(currStep);
isProcessing = true;
await confermaProdOdl(true);
advStep(currStep++);
await advStep(currStep++);
// se vedesse TCRich a zero lo reimposta a quello assegnato...
if (tcRichAttr == 0)
{
@@ -313,7 +226,7 @@ namespace MP_TAB_SERV.Components
// invio email!
await SendWarnTcChangeReq(idxODLStart, currOdl.Tcassegnato, tcRichAttr);
}
advStep(currStep++);
await advStep(currStep++);
// processo chiusura setup
string evText = "Registrata inizio produzione per ODL {0}";
@@ -323,7 +236,7 @@ namespace MP_TAB_SERV.Components
// indico INIZIO SETUP su REDIS come EXE della macchina...
string ts = string.Format("{0:yyMMdd}T{0:HHmmss.fff}Z", DateTime.Now);
TabDServ.addTask4Machine(IdxMaccSel, taskType.stopSetup, $"TS:{ts}|MATR:{MatrOpr}|ODL:{idxODLStart}");
advStep(currStep++);
await advStep(currStep++);
// se è multi processo chiusura setup x altra tavola...
if (isMulti)
{
@@ -335,7 +248,7 @@ namespace MP_TAB_SERV.Components
// invio su seconda tavola
TabDServ.addTask4Machine(idxMaccAltraTav, taskType.stopSetup, $"TS:{ts}|MATR: {MatrOpr}| Master Machine: {IdxMaccSel}");
}
advStep(currStep++);
await advStep(currStep++);
// se è master --> chiamo update child!
if (isMaster)
{
@@ -355,13 +268,13 @@ namespace MP_TAB_SERV.Components
// hard coded 60gg last
await TabDServ.OdlFixMachineSlave(IdxMaccSel, 60, 1);
}
advStep(currStep++);
await advStep(currStep++);
// se c'è gestione SchedaTecnica --> chiamo procedura update x lotti
if (enableSchedaTecnica)
{
await TabDServ.ElencoLottiUpsertByOdl(idxODLStart, true);
}
advStep(currStep++);
await advStep(currStep++);
// riporto stringa
lblOut = sb.ToString().Replace("---", "<br/>");
@@ -369,9 +282,10 @@ namespace MP_TAB_SERV.Components
checkAll();
// imposto odl...
idxOdl = idxODLStart;
advStep(currStep++);
await advStep(currStep++);
// faccio refresh e riporto
await refreshData();
await CheckAttr();
// chiudo update...
isProcessing = false;
}
@@ -382,6 +296,8 @@ namespace MP_TAB_SERV.Components
/// <returns></returns>
protected async Task OdlSetupStart()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi inizio della fase di attrezzaggio per l'articolo [{currPodl.CodArticolo}] {currPodl.DescArticolo}?"))
return;
/***************************************************
* comprende gestione machineSlave x fix ODL master --> slave
*
@@ -390,28 +306,29 @@ namespace MP_TAB_SERV.Components
// preparo gestione progress display
MaxVal = 11;
int currStep = 0;
advStep(currStep);
await advStep(currStep);
isProcessing = true;
bool inAttr = false;
DateTime adesso = DateTime.Now;
#if false
// se fosse multi mi chiedo se sia DAVVERO in attrezzaggio...
if (isMulti)
{
try
{
// controllo se NON SONO gi in attrezzaggio...
// controllo se NON SONO gia in attrezzaggio...
var rigaStato = TabDServ.StatoMacchina(IdxMaccParent);
inAttr = (rigaStato.IdxStato == 2);
}
catch
{ }
}
advStep(currStep++);
#endif
await advStep(currStep++);
// proseguo
int idxODL_curr = 0;
await confermaProdOdl(false);
advStep(currStep++);
await advStep(currStep++);
if (IdxPOdlSel > 0)
{
// se vedesse TCRich a zero lo reimposta a quello assegnato...
@@ -442,7 +359,7 @@ namespace MP_TAB_SERV.Components
Log.Error($"Error StartSetup.01{Environment.NewLine}{exc}");
}
}
advStep(currStep++);
await advStep(currStep++);
// 2018.07.24 verifico se devo lavorare come ODL classico o come RPO (Richiesta /
// Promessa / ODL)
if (enableRPO)
@@ -461,14 +378,14 @@ namespace MP_TAB_SERV.Components
// salvo ODL Current
idxODL_curr = IdxPOdlSel;
}
advStep(currStep++);
await advStep(currStep++);
// process evento
int idxEvento = 2; // !!!HARD CODED
string evText = "Registrato inizio attrezzaggio per ODL {0}";
StringBuilder sb = new StringBuilder();
sb.AppendLine(String.Format(evText, idxODL_curr));
await processaEvento(IdxMaccSel, idxEvento, sb.ToString(), idxODL_curr);
advStep(currStep++);
await advStep(currStep++);
// indico INIZIO SETUP su REDIS come EXE della macchina...
string ts = string.Format("{0:yyMMdd}T{0:HHmmss.fff}Z", DateTime.Now);
string outData = $"TS:{ts}|MATR:{MatrOpr}|ODL:{idxODL_curr}";
@@ -488,7 +405,7 @@ namespace MP_TAB_SERV.Components
TabDServ.MachineParamUpdate(IdxMaccSel, "setComm", setCommVal);
TabDServ.MachineParamUpdate(IdxMaccSel, "setPzComm", setPzCommVal);
TabDServ.addTask4Machine(IdxMaccSel, taskType.setParameter, "ForceUpdate");
advStep(currStep++);
await advStep(currStep++);
// li aggiungo ANCHE sui PLC slave se ci sono...
if (isMaster)
{
@@ -510,7 +427,7 @@ namespace MP_TAB_SERV.Components
TabDServ.addTask4Machine(machine.IdxMacchinaSlave, taskType.setParameter, "ForceUpdate");
}
}
advStep(currStep++);
await advStep(currStep++);
}
catch (Exception exc)
{
@@ -547,21 +464,21 @@ namespace MP_TAB_SERV.Components
// update buttons...
checkAll();
}
advStep(currStep++);
await advStep(currStep++);
// se fosse master --> chiamo update child!
if (isMaster)
{
// hard coded 60gg last
await TabDServ.OdlFixMachineSlave(IdxMaccSel, 60, 1);
}
advStep(currStep++);
await advStep(currStep++);
// resetto contapezzi redis...
await TabDServ.saveCounter(IdxMaccSel, "0");
// imposto ODL su redis...
TabDServ.saveCurrODL(IdxMaccSel, idxODL_curr);
// salvo odl selezionato
idxOdl = idxODL_curr;
advStep(currStep++);
await advStep(currStep++);
}
else
{
@@ -573,6 +490,7 @@ namespace MP_TAB_SERV.Components
fixSplitBtn(false);
// faccio refresh e riporto
await refreshData();
await CheckAttr();
isProcessing = false;
}
@@ -591,6 +509,8 @@ namespace MP_TAB_SERV.Components
{
IdxMaccSel = RecMSE.IdxMacchina;
IdxMaccParent = getIdxMaccParent();
// verifica stato inAttr
await CheckAttr();
await ReloadData(true);
}
checkAll();
@@ -602,6 +522,112 @@ namespace MP_TAB_SERV.Components
await ReloadData(false);
}
protected async Task ProdEnd()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi fine produzione?"))
return;
// preparo gestione progress display
MaxVal = 7;
isProcessing = true;
int currStep = 0;
await advStep(currStep);
// leggo idxOdl da ultimo odl attivo x macchina
var currOdl = await TabDServ.OdlCurrByMacc(IdxMaccSel, false);
int idxODLCurr = currOdl.IdxOdl;
int idxEvento = 7; // !!!HARD CODED
// confermo prod vecchio ODL
await confermaProdOdl(false);
await advStep(currStep++);
// se chk flaggato ovvero richiesta di chiudere ODL procedo come prima (chiudendo ODL
// senza averne altri...)
if (forceCloseOdl)
{
// aggiungo try/catch x capire se sia qui che si "impasta" in chiusura ODL
try
{
// processo x macchina selezionata
await TabDServ.OdlFineProd(idxODLCurr, IdxMaccSel);
string evText = "Registrata fine produzione per ODL {0}";
StringBuilder sb = new StringBuilder();
sb.AppendLine(String.Format(evText, idxODLCurr));
await processaEvento(IdxMaccSel, idxEvento, sb.ToString(), idxODLCurr);
await advStep(currStep++);
// se è multi processo ANCHE x altra tavola...
if (isMulti)
{
sb.AppendLine("---");
var tabOdlAltra = await TabDServ.OdlCurrByMacc(idxMaccAltraTav, true);
int idxOdlAltra = tabOdlAltra.IdxOdl;
await TabDServ.OdlFineProd(idxOdlAltra, idxMaccAltraTav);
sb.AppendLine(String.Format(evText, idxOdlAltra));
await processaEvento(idxMaccAltraTav, idxEvento, String.Format(evText, idxOdlAltra), idxOdlAltra);
}
await advStep(currStep++);
// se è master --> chiamo update child!
if (isMaster)
{
// hard coded 60gg last
await TabDServ.OdlFixMachineSlave(IdxMaccSel, 60, 1);
}
await advStep(currStep++);
// riporto stringa
lblOut = sb.ToString().Replace("---", "<br/>");
}
catch (Exception exc)
{
Log.Error($"Eccezione in operazione chiusura ODL!{Environment.NewLine}{exc}");
// navigo!
NavMan.NavigateTo($"machine-detail");
}
}
// altrimenti split ODL x completare IN FUTURO la produzione...
else
{
try
{
// effettuo split su nuovo ODL
await TabDServ.OdlSplit(idxODLCurr, MatrOpr, IdxMaccSel, currOdl.Tcassegnato, PzPallet, $"Fine Produzione, Sospensione ODL {idxODLCurr}, generato residuo con pari TCiclo: {currOdl.Tcassegnato}", false, 0);
// processo chiusura setup
await processaEvento(IdxMaccSel, idxEvento, $"Registrata fine produzione per ODL {idxODLCurr}, nuovo ODL per quantità residua", idxODLCurr);
await advStep(currStep++);
// se è multi processo ANCHE x altra tavola...
if (isMulti)
{
var tabOdlAltra = await TabDServ.OdlCurrByMacc(idxMaccAltraTav, true);
int idxOdlAltra = tabOdlAltra.IdxOdl;
// effettuo split su nuovo ODL
await TabDServ.OdlSplit(idxOdlAltra, MatrOpr, idxMaccAltraTav, tabOdlAltra.Tcassegnato, PzPallet, $"Fine Produzione, Sospensione ODL {idxOdlAltra}, generato residuo con pari TCiclo: {tabOdlAltra.Tcassegnato}", false, 0);
// processo chiusura setup
await processaEvento(idxMaccAltraTav, idxEvento, $"Registrata fine produzione per ODL {idxOdlAltra}, nuovo ODL per quantità residua", idxOdlAltra);
}
await advStep(currStep++);
// se è master --> chiamo update child!
if (isMaster)
{
// hard coded 60gg last
await TabDServ.OdlFixMachineSlave(IdxMaccSel, 60, 1);
}
// sistemo buttons!
fixSplitBtn(false);
await advStep(currStep++);
}
catch (Exception exc)
{
Log.Error($"Eccezione in operazione Chiusura + Split ODL su nuovo! {Environment.NewLine}{exc}");
// navigo!
NavMan.NavigateTo($"machine-detail");
}
}
await advStep(currStep++);
// faccio refresh e riporto
await refreshData();
await CheckAttr();
await advStep(currStep++);
isProcessing = false;
}
protected async Task refreshData()
{
// refresh tabella dati tablet...
@@ -618,6 +644,8 @@ namespace MP_TAB_SERV.Components
#endif
await E_Updated.InvokeAsync(ListMSE);
}
// update dati liste ODL
await ReloadData(true);
}
protected void SaveTCRich(decimal newTCRich)
@@ -665,9 +693,15 @@ namespace MP_TAB_SERV.Components
await Task.Delay(10);
}
protected void togOdlDetail()
protected async Task ToggleOdlDetail()
{
showOdlDetail = !showOdlDetail;
// se devo mostrare, carico dati ODL!
if (showOdlDetail && RecMSE != null)
{
int currIdxPOdl = RecMSE != null ? RecMSE.IdxPOdl ?? 0 : 0;
currPodl = await TabDServ.PODLExp_getByKey(currIdxPOdl);
}
}
protected string Traduci(string lemma)
@@ -680,32 +714,59 @@ namespace MP_TAB_SERV.Components
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private bool cancelSetupEnabled = false;
private bool confRett = true;
private double currVal = 0;
private List<string> emailAdmDest = new List<string>();
private bool enableRPO = true;
private bool enableSchedaTecnica = false;
private bool enableSplitODL = false;
private int expTimeMsec = 2000;
private int expTimeMsec = 500;
private bool forceCloseOdl = true;
private string IdxMaccSel = "";
private int idxOdl = 0;
private int idxPOdlSel = 0;
private bool isInAttr = false;
private bool inAttr = false;
private bool isInProd = false;
private bool isMaster = false;
private bool isMulti = false;
private bool isProcessing = false;
private bool isSlave = false;
private int lastIdxPOdl = 0;
private string lblOut = "";
private int MaxVal = 10;
private int modoConfProd = 0;
private double nextVal = 0;
private string noteAttr = "";
private int numDayOdl = 5;
private int PzPallet = 1;
private bool showAll = false;
private bool showOdlDetail = false;
@@ -781,6 +842,20 @@ namespace MP_TAB_SERV.Components
}
}
private string txtBtnOdlDetail
{
get => showOdlDetail ? "Nascondi Dettaglio ODL" : "MOSTRA Dettaglio ODL Corrente";
}
private string titleOdlDetail
{
get => IdxPOdlSel > 0 ? "Verifica parametri attrezzaggio NUOVO PODL" : "Parametri ODL Corrente";
}
private string cssDetailOdl
{
get => IdxPOdlSel > 0 ? "bg-primary text-light" : "bg-warning";
}
#endregion Private Properties
#region Private Methods
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2311.818</Version>
<Version>6.16.2311.909</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB_SERV</RootNamespace>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2311.818</h4>
<h4>Versione: 6.16.2311.909</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2311.818
6.16.2311.909
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2311.818</version>
<version>6.16.2311.909</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+10
View File
@@ -1144,6 +1144,7 @@ namespace MP.Data.Services
answ = dbTabController.OdlFineProd(idxODL, idxMacchina);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
}
catch (Exception exc)
{
@@ -1169,6 +1170,7 @@ namespace MP.Data.Services
answ = dbTabController.OdlFixMachineSlave(idxMacchina, numDayPrev, doInsert);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
}
catch (Exception exc)
{
@@ -1197,6 +1199,7 @@ namespace MP.Data.Services
answ = dbTabController.OdlInizioSetup(idxODL, matrOpr, idxMacchina, tcRich, pzPallet, note);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
}
catch (Exception exc)
{
@@ -1259,6 +1262,8 @@ namespace MP.Data.Services
// inserisco evento
answ = dbTabController.OdlSetupPostumo(idxODL, idxMacchina);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
}
catch (Exception exc)
{
@@ -1283,6 +1288,8 @@ namespace MP.Data.Services
// inserisco evento
answ = dbTabController.OdlSetupPromPostuma(idxPromOdl, matrOpr, idxMacchina);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
}
catch (Exception exc)
{
@@ -1312,6 +1319,8 @@ namespace MP.Data.Services
// inserisco evento
answ = dbTabController.OdlSplit(idxODL, matrOpr, idxMacchina, TCRich, pzPallet, note, startNewOdl, qtyRich);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
}
catch (Exception exc)
{
@@ -1336,6 +1345,7 @@ namespace MP.Data.Services
answ = dbTabController.OdlUpdate(idxODL, matrOpr, tCRichAttr, pzPallet, note);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
}
catch (Exception exc)
{