Fix aggiunta riattrezzaggio/split

This commit is contained in:
Samuele Locatelli
2023-12-22 10:21:44 +01:00
parent 07a0c6ea0a
commit 4ffe8e3c44
6 changed files with 103 additions and 166 deletions
+22 -30
View File
@@ -211,7 +211,7 @@
</div>
}
@if (!inAttr)
@if (!inAttr && !showSplitOdlRiattr)
{
<div class="col-12 col-md-6">
@if (idxPOdlSel > 0)
@@ -242,7 +242,7 @@
</div>
</div>
}
@if (idxPOdlSel > 0 || inAttr)
@if (idxPOdlSel > 0 || inAttr || showSplitOdlRiattr)
{
<div class="col-12 col-sm-6">
<div class="form-floating">
@@ -274,7 +274,7 @@
}
else
{
if (odlOk && showChkCloseOdlVal)
if (odlOk && showChkCloseOdlVal && !showSplitOdlRiattr)
{
<div class="col-12 col-md-6 p-2">
<div class="form-check form-switch fs-3">
@@ -284,42 +284,34 @@
</div>
}
}
@if (enableRiattrezzaggio)
{
<div class="col-12 col-md-6 p-2">
@if (showSplitOdlRiattr)
{
<button class="btn btn-lg btn-info w-100" @onclick="() => SplitOdl()"><i class="fa-solid fa-triangle-exclamation me-1"></i> Effettua Riattrezzaggio</button>
}
else
{
<button class="btn btn-lg btn-info w-100" disabled="@needConfProd" @onclick="() => ShowRiattrezzaggio()"><i class="fa-solid fa-triangle-exclamation me-1"></i> Mostra Riattrezzaggio</button>
}
</div>
}
@if (!inAttr && enableFixSetup)
{
<div class="col-12 col-md-6 p-2">
<button class="btn btn-lg btn-success w-100" @onclick="() => SendFixEndSetup()"><i class="fa-solid fa-wrench me-1"></i> Fix Chiusura Attrezzaggio (PLC)</button>
</div>
}
@if (enableRiattrezzaggio)
{
@* @if (showOdlProvv)
{
<div class="col-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>
}
@if (showOdlProvv)
{
<div class="col-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>
}
@* <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 class="col-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>
</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 class="col-12 text-center text-danger">
@lblOut
@((MarkupString)lblOut)
</div>
}
}
+77 -132
View File
@@ -465,7 +465,6 @@ namespace MP_TAB3.Components
// reset vari
IdxPOdlSel = 0;
inAttr = false;
IdxPOdlSel = 0;
RecMSE = null;
// faccio refresh e riporto
await RefreshData();
@@ -474,8 +473,6 @@ namespace MP_TAB3.Components
// chiudo update...
isProcessing = false;
await InvokeAsync(StateHasChanged);
// qui rimando a pag principale...
//NavMan.NavigateTo("status-map", true);
}
/// <summary>
@@ -676,7 +673,6 @@ namespace MP_TAB3.Components
// refresh finale
var tmpTCR = tcRichAttr;
checkBtnStatus();
// faccio refresh e riporto
await TabDServ.FlushOdlCache();
IdxPOdlSel = 0;
@@ -916,6 +912,82 @@ namespace MP_TAB3.Components
}
}
protected async Task ShowRiattrezzaggio()
{
showSplitOdlRiattr = !showSplitOdlRiattr;
await ReloadXDL(true);
if (tcRichAttr == 0)
{
tcRichAttr = currPodl.Tcassegnato;
}
if(string.IsNullOrEmpty(noteAttr))
{
noteAttr = currOdl.Note;
}
}
protected async Task SplitOdl()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi richiesta riattrezzaggio ODL, con conseguente chiusura ODL corrente + split nuovo ODL con TC {tcRichAttr:N3}?"))
return;
// preparo gestione progress display
MaxVal = 9;
int currStep = 0;
await advStep(currStep);
isProcessing = true;
// se vedesse TCRich a zero lo reimposta a quello assegnato...
if (tcRichAttr == 0)
{
tcRichAttr = currPodl.Tcassegnato;
}
// leggo idxOdl da ultimo odl attivo x macchina
var currOdl = await TabDServ.OdlCurrByMacc(IdxMaccSel, false);
int idxODLSplit = currOdl.IdxOdl;
int idxEvento = 1; // !!!HARD CODED
await advStep(currStep++);
// confermo prod vecchio ODL
await confermaProdOdl(false);
await advStep(currStep++);
// effettuo split su nuovo ODL
await TabDServ.OdlSplit(idxODLSplit, MatrOpr, IdxMaccSel, tcRichAttr, PzPallet, noteAttr, true, 0);
await advStep(currStep++);
// se c'è gestione SchedaTecnica --> chiamo procedura update x lotti
if (enableSchedaTecnica)
{
await TabDServ.ElencoLottiUpsertByOdl(idxODLSplit, true);
}
await advStep(currStep++);
// invio email!
await advStep(currStep++);
// processo chiusura setup
string evText = "Registrato Riattrezzaggio ODL (old :{0})";
StringBuilder sb = new StringBuilder();
sb.AppendLine(String.Format(evText, idxODLSplit));
await processaEvento(IdxMaccSel, idxEvento, sb.ToString(), idxODLSplit);
await advStep(currStep++);
// update buttons...
checkAll();
// reset vari
IdxPOdlSel = 0;
inAttr = false;
RecMSE = null;
await advStep(currStep++);
// faccio refresh e riporto
await RefreshData();
await CheckAttr();
await advStep(currStep++);
// chiudo update...
isProcessing = false;
await InvokeAsync(StateHasChanged);
}
protected async Task SendWarnTcChangeReq(int idxOdl, decimal tcAss, decimal tcRich)
{
// carico altri parametri email...
@@ -1050,6 +1122,7 @@ namespace MP_TAB3.Components
private bool showOdlProvv = false;
private bool showReopenOdlTav = false;
private bool showSplitOdlOnTav = false;
private bool showSplitOdlRiattr = false;
#endregion Private Fields
@@ -1295,133 +1368,6 @@ namespace MP_TAB3.Components
}
}
/// <summary>
/// controlla stato bottoni abilitato
/// </summary>
private void checkBtnStatus()
{
#if false
// di default rendo abilitato / disabilitato tutto in base al valore "isEnabled"
lbtShowSplitODL.Enabled = isEnabled && enableRiattrezzaggio;
lbtSplitODL.Enabled = isEnabled;
fixWCtrStatus(lbtShowSplitODL);
fixWCtrStatus(lbtSplitODL);
// condizioni booleane
bool inAttr = false;
bool currHasOdl = false;
// controllo se la macchina è in attrezzaggio...
DS_applicazione.StatoMacchineRow rigaStato = null;
try
{
// se è multi controllo parent...
if (isMulti)
{
rigaStato = selData.mng.rigaStato(idxMaccParent);
inAttr = (rigaStato.IdxStato == 2 && tavHasOdl);
}
else
{
rigaStato = selData.mng.rigaStato(idxMacchinaFix);
if (rigaStato != null)
{
inAttr = (rigaStato.IdxStato == 2);
}
}
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Eccezione in recupero dati rigaStato! {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
try
{
currHasOdl = DataLayerObj.taODL.getByMacchina(idxMacchinaFix)[0].IdxODL != 0;
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Eccezione in recupero dati currHasOdl! {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
// deve controllare abbia ODL o PROMESSE odl...
bool hasNewOdl = DataLayerObj.taSelOdlFree.getUnused(idxMacchinaFix, cmp_selPODL.checkAll, numDaySelOdl).Rows.Count > 1;
// sistemo buttons!
lbtStartAttr.Enabled = (isEnabled && (!inAttr && hasNewOdl));
lbtEndProd.Enabled = (isEnabled && (!inAttr && currHasOdl));
// verifico condizioni annullamento setup
lbtAnnullaSetup.Visible = false;
if (isEnabled && enableAnnullaSetup && inAttr && enableSchedaTecnica)
{
// verifico condizione pz da confermare
var tabProd = DataLayerObj.taStatoProd.GetData(idxMacchinaSel, DateTime.Now);
if (tabProd != null && tabProd.Rows.Count > 0)
{
var rigaProd = tabProd[0];
lbtAnnullaSetup.Visible = rigaProd.PzTotODL == 0;
}
}
// controllo se ci sia da verificare scheda tecnica
if (enableSchedaTecnica)
{
var tabRichieste = DataLayerObj.taSTAR.getPendingByOdl(idxOdl);
bool okCheckST = tabRichieste.Count == 0;
if (okCheckST)
{
hlNeedStar.Visible = false;
lbtStartProd.Enabled = (isEnabled && inAttr);
}
else
{
hlNeedStar.Visible = (isEnabled && inAttr);
lbtStartProd.Enabled = false;
}
}
else
{
lbtStartProd.Enabled = (isEnabled && inAttr);
}
cmp_selPODL.Enabled = (isEnabled && (!inAttr && hasNewOdl));
// sistemo anche come css..
fixWCtrStatus(lbtStartAttr);
fixWCtrStatus(lbtStartProd);
fixWCtrStatus(lbtEndProd);
// sistemo show tempo/note attrezzaggio..
if (inAttr)
{
showNoteTC(true);
int idxOdl = 0;
try
{
idxOdl = DataLayerObj.taODL.getByMacchina(idxMacchinaFix)[0].IdxODL;
updateTempoTc(idxOdl, inAttr);
updateNoteTC(idxOdl);
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Eccezione in recupero dati ODL! {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
}
// verifico se l'articolo corrente sia in revisione x mostrare conferma modifica revisione...
if (CodArtSel != "")
{
bool showWarn = false;
try
{
showWarn = DataLayerObj.taAnagArt.getByCod(CodArtSel)[0].FlagIsNew;
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Eccezione in recupero dati showWarn! {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
divWarningArt.Visible = showWarn;
}
#endif
}
/// <summary>
/// verifica se sia necessario confermare la prod dell'ODL precedente prima di chiudere e lo
/// fa in automatico...
@@ -1554,7 +1500,6 @@ namespace MP_TAB3.Components
lblOut = userMsg;
// loggo USR MSG
Log.Info(userMsg);
checkBtnStatus();
}
private async Task ReloadData(bool forceReload)
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2312.2117</Version>
<Version>6.16.2312.2210</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB3</RootNamespace>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2312.2117</h4>
<h4>Versione: 6.16.2312.2210</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2312.2117
6.16.2312.2210
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2312.2117</version>
<version>6.16.2312.2210</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>