Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop
This commit is contained in:
@@ -4,7 +4,6 @@ using Microsoft.JSInterop;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using NLog;
|
||||
using static Org.BouncyCastle.Math.EC.ECCurve;
|
||||
|
||||
namespace MP_TAB_SERV.Components
|
||||
{
|
||||
@@ -17,6 +16,11 @@ namespace MP_TAB_SERV.Components
|
||||
[Parameter]
|
||||
public bool FullMode { get; set; } = true;
|
||||
|
||||
[Parameter]
|
||||
public int Height { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public string IdxMacchSub { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public int keepAliveMin { get; set; } = 5;
|
||||
@@ -30,9 +34,6 @@ namespace MP_TAB_SERV.Components
|
||||
[Parameter]
|
||||
public int Width { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public int Height { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
@@ -96,6 +97,9 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected IConfiguration config { get; set; } = null!;
|
||||
|
||||
protected ProdAdvDispl.ProdCounter CurrCount
|
||||
{
|
||||
get
|
||||
@@ -123,14 +127,13 @@ namespace MP_TAB_SERV.Components
|
||||
[Inject]
|
||||
protected NavigationManager NavMan { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TabDServ { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
|
||||
[Inject]
|
||||
protected IConfiguration config { get; set; } = null!;
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{//await Task.Delay(500);
|
||||
if (firstRender)
|
||||
@@ -158,20 +161,21 @@ namespace MP_TAB_SERV.Components
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
isLoading = RecMSE == null;
|
||||
await setGaugeVals();
|
||||
await Task.Delay(1);
|
||||
// controllo SE avessi idxMacchSub --> rileggo!
|
||||
if (!string.IsNullOrEmpty(IdxMacchSub) && RecMSE != null)
|
||||
{
|
||||
RecMSE = TabDServ.MseGetSub(RecMSE.IdxMacchina, IdxMacchSub, true);
|
||||
}
|
||||
setGaugeVals();
|
||||
}
|
||||
|
||||
protected async Task setGaugeVals()
|
||||
protected void setGaugeVals()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
Log.Info("MBlock 01");
|
||||
if (RecMSE != null)
|
||||
{
|
||||
Log.Info("MBlock 02");
|
||||
innerCircleVals.Clear();
|
||||
outerCircleVals.Clear();
|
||||
currMaxVal = int.Parse(RecMSE.NumPezzi.ToString()!);
|
||||
@@ -184,7 +188,7 @@ namespace MP_TAB_SERV.Components
|
||||
{
|
||||
outerCircleVals.Add(new CircleGaugeMulti.CircSegm() { Color = "#1367FD", Value = RecMSE.extraVal });
|
||||
}
|
||||
Log.Info("MBlock 03");
|
||||
//Log.Trace($"MBlock | {RecMSE.IdxMacchina} | 03");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+262
-201
@@ -3,231 +3,292 @@
|
||||
<div class="col-12">
|
||||
<MachSel RecMSE="RecMSE" E_MachSel="SetMacc"></MachSel>
|
||||
</div>
|
||||
@if (needConfProd)
|
||||
@if (isProcessing)
|
||||
{
|
||||
<div class="col-12 text-danger">
|
||||
<div class="fs-3">@lblWarnHead</div>
|
||||
<div class="small">@lblWarnBody <b>@numPz2Conf.ToString("N0")</b> pz NC</div>
|
||||
</div>
|
||||
@if (!odlOk)
|
||||
{
|
||||
<div class="col-12">
|
||||
<FixOdl IdxMaccCurr="@IdxMaccParent"></FixOdl>
|
||||
</div>
|
||||
}
|
||||
<ProgressDisplay RefreshInterval="200" Title="ODL Processing" MaxVal="@MaxVal" CurrVal="@currVal" NextVal="@nextVal" ExpTimeMSec="@expTimeMsec"></ProgressDisplay>
|
||||
<LoadingData Title="Elaborazione..." DisplaySize="LoadingData.CtrlSize.Large" DisplayMode="LoadingData.SpinMode.Growl"></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-12">
|
||||
Slave machine man
|
||||
</div>
|
||||
<div class="col-12">
|
||||
Check articolo in revisione
|
||||
</div>
|
||||
@if (cancelSetupEnabled)
|
||||
@if (isSlave)
|
||||
{
|
||||
<div class="col-12 col-sm-12 col-md-6 p-2">
|
||||
<button class="btn btn-lg btn-danger w-100">Annulla Setup ODL <i class="fa-solid fa-ban me-1"></i></button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (showOdlDetail)
|
||||
{
|
||||
<div class="col-12 my-1">
|
||||
<div class="card">
|
||||
<div class="card-header bg-warning text-light">
|
||||
<h4>Verifica parametri attrezzaggio</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
P.ODL:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.IdxPromessa.ToString("N0")
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Rif:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.KeyRichiesta
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Cod:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.CodArticolo
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row border-top border-bottom border-secondary">
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Articolo:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.DescArticolo
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Pezzi:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.NumPezzi.ToString("N0")
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
TCiclo:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.Tcassegnato.ToString("N2")
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Pz/pallet:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.PzPallet
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col text-start fw-bold">
|
||||
@currPodl.Nome
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Priorita:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.Priorita
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Data:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@($"{currPodl.DueDate:yyyy.MM.dd}")
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 my-2">
|
||||
<div class="btn btn-warning w-100">
|
||||
<div class="fs-1">@(Traduci("lblWarnHeadSlave"))</div>
|
||||
<div class="fs-4">@(Traduci("lblWarnBodySlave"))</div>
|
||||
</div>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
@if (idxPOdlSel > 0)
|
||||
else
|
||||
{
|
||||
@if (needConfProd)
|
||||
{
|
||||
<button class="btn btn-lg btn-primary w-100" @onclick="StartSetup"><i class="fa-solid fa-check me-1"></i> INIZIO Attrezzaggio</button>
|
||||
<div class="col-12 my-2">
|
||||
<div class="btn btn-danger w-100">
|
||||
<div class="fs-1">@lblWarnHead</div>
|
||||
<div class="fs-4">@lblWarnBody <b>@numPz2Conf.ToString("N0")</b> pz NC</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (!odlOk)
|
||||
{
|
||||
<div class="col-12">
|
||||
<FixOdl IdxMaccCurr="@IdxMaccParent"></FixOdl>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
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-sm-6">
|
||||
<label class="form-label">note Attrezzaggio</label>
|
||||
<textarea class="form-control" rows="3" @bind="@noteAttr"></textarea>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6">
|
||||
<SelTempoMSMC TempoMC="@tcRichAttr" modoControllo="SelTempoMSMC.timeControlMode.selettori" E_TCRich="SaveTCRich"></SelTempoMSMC>
|
||||
<div class="input-group">
|
||||
<div class="input-group-text">
|
||||
Pz Pallet
|
||||
@if (showSplitOdlOnTavVal || showReopOdlTav)
|
||||
{
|
||||
<div class="col-12 bg-danger py-3">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
@if (showSplitOdlOnTavVal)
|
||||
{
|
||||
<button class="btn btn-lg btn-warning w-100" @onclick="OdlSetSameAsOtherTav"><i class="fa fa-check"></i> Attrezza stesso ODL da altra tavola <i class="fa fa-check"></i></button>
|
||||
}
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
@if (showReopOdlTav)
|
||||
{
|
||||
<button class="btn btn-lg btn-info w-100" @onclick="OdlReopenTav"><i class="fa fa-exclamation-triangle"></i> Riprendi ODL chiuso su tavola <i class="fa-solid fa-check me-1"></i></button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<select class="form-select" @bind="PzPallet">
|
||||
@for (int i = 1; i <= 20; i++)
|
||||
{
|
||||
<option value="@i">@i</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
<div class="col-12">
|
||||
Check articolo in revisione
|
||||
</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-warning w-100" disabled="@needConfProd"><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"><i class="fa-solid fa-ban me-1"></i>FINE Produzione</button>
|
||||
</div>
|
||||
</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>
|
||||
@if (cancelSetupEnabled)
|
||||
{
|
||||
<div class="col-12 col-md-6 p-2">
|
||||
<button class="btn btn-lg btn-danger w-100">Annulla Setup ODL <i class="fa-solid fa-ban me-1"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</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-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">
|
||||
}
|
||||
|
||||
@if (!inAttr && !showOdlDetail)
|
||||
{
|
||||
<div class="col-12 my-1">
|
||||
<button class="btn btn-lg btn-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 p-0">
|
||||
<div class="card-header @cssDetailOdl d-flex justify-content-between">
|
||||
<div>
|
||||
<h4>@titleOdlDetail</h4>
|
||||
</div>
|
||||
<div>
|
||||
@if (idxPOdlSel == 0 && !inAttr)
|
||||
{
|
||||
<button class="btn btn-dark w-100" @onclick="ToggleOdlDetail"><i class="fa-solid fa-chevron-up"></i> @txtBtnOdlDetail</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<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 d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
P.ODL:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.IdxPromessa.ToString("N0")
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Rif:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.KeyRichiesta
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Cod:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.CodArticolo
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row border-top border-bottom border-secondary">
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Articolo:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.DescArticolo
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Pezzi:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.NumPezzi.ToString("N0")
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
TCiclo:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@if (currOdl != null && currOdl.Tcassegnato > 0)
|
||||
{
|
||||
@currOdl.Tcassegnato.ToString("N2")
|
||||
}
|
||||
else
|
||||
{
|
||||
@currPodl.Tcassegnato.ToString("N2")
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Pz/pallet:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.PzPallet
|
||||
</div>
|
||||
</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 class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col text-start fw-bold">
|
||||
@currPodl.Nome
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Priorita:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@currPodl.Priorita
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
<div class="px-0 small">
|
||||
Data:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
@($"{currPodl.DueDate:yyyy.MM.dd}")
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> *@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!inAttr)
|
||||
{
|
||||
<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-primary w-100" disabled="@endProdDisabled" @onclick="ProdEnd"><i class="fa-solid fa-ban me-1"></i>FINE Produzione</button>
|
||||
}
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (idxPOdlSel > 0 || inAttr)
|
||||
{
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-floating">
|
||||
<textarea type="text" class="form-control" style="height: 7rem;" @bind="@noteAttr"></textarea>
|
||||
<label for="floatingComm">Note Attrezzaggio (opzionale)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6">
|
||||
<SelTempoMSMC TempoMC="@tcRichAttr" modoControllo="SelTempoMSMC.timeControlMode.selettori" E_TCRich="SaveTCRich"></SelTempoMSMC>
|
||||
<div class="input-group">
|
||||
<div class="input-group-text">
|
||||
Pz Pallet
|
||||
</div>
|
||||
<select class="form-select" @bind="PzPallet">
|
||||
@for (int i = 1; i <= 20; i++)
|
||||
{
|
||||
<option value="@i">@i</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (inAttr)
|
||||
{
|
||||
<div class="col-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>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (odlOk)
|
||||
{
|
||||
<div class="col-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">@txtForceCloseOdl</label>
|
||||
</div>
|
||||
</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>
|
||||
}
|
||||
<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>
|
||||
</div>
|
||||
<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 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 class="col-12 text-center text-danger">
|
||||
@lblOut
|
||||
</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
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@@ -1,4 +1,6 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Objects;
|
||||
using MP.Data.Services;
|
||||
@@ -25,13 +27,8 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected bool enableRPO = true;
|
||||
protected bool forceCloseOdl = true;
|
||||
|
||||
protected PzProdModel? prodMacchina = null;
|
||||
|
||||
protected int PzPallet = 1;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
@@ -82,17 +79,29 @@ namespace MP_TAB_SERV.Components
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
protected List<vSelOdlModel> ListODL { get; set; } = new List<vSelOdlModel>();
|
||||
|
||||
[Inject]
|
||||
protected MailService MailServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected StatusData MDataService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected MessageService MServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavMan { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Verifica ODL OK (ovvero caricato x macchina...)
|
||||
/// </summary>
|
||||
protected bool odlOk
|
||||
{
|
||||
get => (RecMSE != null && RecMSE.IdxOdl > 0);
|
||||
get => IdxOdl > 0;
|
||||
}
|
||||
|
||||
protected bool ShowAll
|
||||
@@ -122,6 +131,31 @@ 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)
|
||||
{
|
||||
await ReloadXDL(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorno...
|
||||
/// </summary>
|
||||
@@ -140,7 +174,7 @@ namespace MP_TAB_SERV.Components
|
||||
protected string getIdxMaccParent()
|
||||
{
|
||||
string answ = IdxMaccSel;
|
||||
// se � multi controllo
|
||||
// se fosse multi controllo
|
||||
if (isMulti)
|
||||
{
|
||||
// verifico se SIA una tavola (ha char "#")
|
||||
@@ -154,72 +188,206 @@ namespace MP_TAB_SERV.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
//baseLang = SMServ.GetConf("baseLang");
|
||||
numDayOdl = SMServ.GetConfInt("numDaySelOdl");
|
||||
confRett = SMServ.GetConfBool("confRett");
|
||||
enableSplitODL = SMServ.GetConfBool("enableSplitODL");
|
||||
modoConfProd = SMServ.GetConfInt("modoConfProd");
|
||||
enableRPO = SMServ.GetConfBool("enableRPO");
|
||||
if (RecMSE != null)
|
||||
{
|
||||
IdxMaccSel = RecMSE.IdxMacchina;
|
||||
IdxMaccParent = getIdxMaccParent();
|
||||
await ReloadData(true);
|
||||
}
|
||||
checkAll();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
isMulti = SMServ.DictMacchMulti[RecMSE?.IdxMacchina] == 1;
|
||||
await ReloadData(false);
|
||||
}
|
||||
|
||||
protected void SaveTCRich(decimal newTCRich)
|
||||
{
|
||||
tcRichAttr = newTCRich;
|
||||
}
|
||||
|
||||
protected async Task SetMacc(string selIdxMacc)
|
||||
/// <summary>
|
||||
/// Effettua ripresa ODL su tavola
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected async Task OdlReopenTav()
|
||||
{
|
||||
MaxVal = 3;
|
||||
int currStep = 0;
|
||||
await advStep(currStep);
|
||||
isProcessing = true;
|
||||
await Task.Delay(10);
|
||||
IdxMaccSel = selIdxMacc;
|
||||
await DoUpdate();
|
||||
// chiamo stored x riprendere ODL (toglie data chiusura...)
|
||||
var rowRes = TabDServ.OdlReopenOdlMacc(IdxMaccSel);
|
||||
if (rowRes != null && rowRes.IdxOdl > 0)
|
||||
{
|
||||
// messaggio utente
|
||||
string evText = "Registrato riapertura ODL {0} | art {1}";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine(String.Format(evText, rowRes.IdxOdl, rowRes.CodArticolo));
|
||||
lblOut = sb.ToString();
|
||||
}
|
||||
await advStep(currStep++);
|
||||
// update button x setup da altra tavola...
|
||||
checkAll();
|
||||
// faccio refresh e riporto
|
||||
await RefreshData();
|
||||
await CheckAttr();
|
||||
await advStep(currStep++);
|
||||
// chiudo update...
|
||||
isProcessing = false;
|
||||
await Task.Delay(10);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua split ODL da ALTRA tavola su tav corrente
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected async Task OdlSetSameAsOtherTav()
|
||||
{
|
||||
MaxVal = 3;
|
||||
int currStep = 0;
|
||||
await advStep(currStep);
|
||||
isProcessing = true;
|
||||
// se ho ODL su altra macchina...
|
||||
if (IdxOdlAltra > 0)
|
||||
{
|
||||
await TabDServ.OdlDividiDaAltraTavola(IdxOdlAltra, MatrOpr, IdxMaccSel);
|
||||
// messaggio utente
|
||||
string evText = "Registrata inizio attrezzaggio da split ODL {0} (come da altra tavola)";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine(String.Format(evText, IdxOdlAltra));
|
||||
lblOut = sb.ToString();
|
||||
}
|
||||
await advStep(currStep++);
|
||||
// update button x setup da altra tavola...
|
||||
checkAll();
|
||||
// faccio refresh e riporto
|
||||
await RefreshData();
|
||||
await CheckAttr();
|
||||
await advStep(currStep++);
|
||||
// chiudo update...
|
||||
isProcessing = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registrazione Fine Setup / Inizio Produzione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <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;
|
||||
await advStep(currStep);
|
||||
isProcessing = true;
|
||||
await confermaProdOdl(true);
|
||||
await advStep(currStep++);
|
||||
// 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 idxODLStart = currOdl.IdxOdl;
|
||||
int idxEvento = 1; // !!!HARD CODED
|
||||
|
||||
// aggiorno note e tempo setup
|
||||
await TabDServ.OdlUpdate(idxODLStart, MatrOpr, tcRichAttr, PzPallet, noteAttr);
|
||||
// controllo se TC Assegnato != TCRichiesto allora invio email x verifiche...
|
||||
if (currOdl.Tcassegnato != tcRichAttr)
|
||||
{
|
||||
// invio email!
|
||||
await SendWarnTcChangeReq(idxODLStart, currOdl.Tcassegnato, tcRichAttr);
|
||||
}
|
||||
await advStep(currStep++);
|
||||
|
||||
// processo chiusura setup
|
||||
string evText = "Registrata inizio produzione per ODL {0}";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine(String.Format(evText, idxODLStart));
|
||||
await processaEvento(IdxMaccSel, idxEvento, sb.ToString(), idxODLStart);
|
||||
// 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}");
|
||||
await advStep(currStep++);
|
||||
// se è multi processo chiusura setup x altra tavola...
|
||||
if (isMulti)
|
||||
{
|
||||
sb.AppendLine("---");
|
||||
var tabOdlAltra = await TabDServ.OdlCurrByMacc(idxMaccAltraTav, true);
|
||||
int idxOdlAltra = tabOdlAltra.IdxOdl;
|
||||
sb.AppendLine(String.Format(evText, idxOdlAltra));
|
||||
await processaEvento(idxMaccAltraTav, idxEvento, String.Format(evText, idxOdlAltra), idxOdlAltra);
|
||||
// invio su seconda tavola
|
||||
TabDServ.addTask4Machine(idxMaccAltraTav, taskType.stopSetup, $"TS:{ts}|MATR: {MatrOpr}| Master Machine: {IdxMaccSel}");
|
||||
}
|
||||
await advStep(currStep++);
|
||||
// se è master --> chiamo update child!
|
||||
if (isMaster)
|
||||
{
|
||||
// invio eventi ad IOB slave...
|
||||
var slaveList = SMServ.ListM2S
|
||||
.Where(x => x.IdxMacchina.Equals(IdxMaccSel, StringComparison.InvariantCultureIgnoreCase))
|
||||
.ToList();
|
||||
foreach (var machine in slaveList)
|
||||
{
|
||||
// invio chiusura attrezzaggio
|
||||
ts = string.Format("{0:yyMMdd}T{0:HHmmss.fff}Z", DateTime.Now);
|
||||
string outData = $"TS:{ts}|MATR:{MatrOpr}|ODL:{idxODLStart}";
|
||||
await processaEvento(machine.IdxMacchinaSlave, idxEvento, sb.ToString(), idxODLStart);
|
||||
TabDServ.addTask4Machine(machine.IdxMacchinaSlave, taskType.fixStopSetup, outData);
|
||||
}
|
||||
|
||||
// hard coded 60gg last
|
||||
await TabDServ.OdlFixMachineSlave(IdxMaccSel, 60, 1);
|
||||
}
|
||||
await advStep(currStep++);
|
||||
// se c'è gestione SchedaTecnica --> chiamo procedura update x lotti
|
||||
if (enableSchedaTecnica)
|
||||
{
|
||||
await TabDServ.ElencoLottiUpsertByOdl(idxODLStart, true);
|
||||
}
|
||||
await advStep(currStep++);
|
||||
|
||||
// riporto stringa
|
||||
lblOut = sb.ToString().Replace("---", "<br/>");
|
||||
// update buttons...
|
||||
checkAll();
|
||||
// reset vari
|
||||
IdxPOdlSel = 0;
|
||||
inAttr = false;
|
||||
IdxPOdlSel = 0;
|
||||
RecMSE = null;
|
||||
await advStep(currStep++);
|
||||
// faccio refresh e riporto
|
||||
await RefreshData();
|
||||
await CheckAttr();
|
||||
// chiudo update...
|
||||
isProcessing = false;
|
||||
//await InvokeAsync(StateHasChanged);
|
||||
// qui rimando a pag principale...
|
||||
NavMan.NavigateTo("status-map", true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dichiarazione inizio attrezzaggio PODL indicato
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task StartSetup()
|
||||
protected async Task OdlSetupStart()
|
||||
{
|
||||
/***************************************************
|
||||
* comprende gestione machineSlave x fix ODL master --> slave
|
||||
*
|
||||
***************************************************/
|
||||
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 inizio della fase di attrezzaggio?"))
|
||||
return;
|
||||
|
||||
bool inAttr = false;
|
||||
//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
|
||||
*
|
||||
***************************************************/
|
||||
|
||||
// preparo gestione progress display
|
||||
MaxVal = 11;
|
||||
int currStep = 0;
|
||||
await advStep(currStep);
|
||||
isProcessing = true;
|
||||
DateTime adesso = DateTime.Now;
|
||||
// se fosse multi mi chiedo se sia DAVVERO in attrezzaggio...
|
||||
if (isMulti)
|
||||
{
|
||||
try
|
||||
{
|
||||
// controllo se NON SONO gi� in attrezzaggio...
|
||||
var rigaStato = TabDServ.StatoMacchina(IdxMaccParent);
|
||||
inAttr = (rigaStato.IdxStato == 2);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
await advStep(currStep++);
|
||||
// proseguo
|
||||
int idxODL_curr = 0;
|
||||
await confermaProdOdl(false);
|
||||
await advStep(currStep++);
|
||||
if (IdxPOdlSel > 0)
|
||||
{
|
||||
// se vedesse TCRich a zero lo reimposta a quello assegnato...
|
||||
@@ -227,7 +395,7 @@ namespace MP_TAB_SERV.Components
|
||||
{
|
||||
tcRichAttr = currPodl.Tcassegnato;
|
||||
}
|
||||
if (enableSplitODL)
|
||||
if (enableSplitODL && !forceCloseOdl)
|
||||
{
|
||||
// splitto VECCHIO ODL (se fosse rimasto qualcosa da produrre e ne sia rimasto uno.......)
|
||||
try
|
||||
@@ -250,6 +418,7 @@ namespace MP_TAB_SERV.Components
|
||||
Log.Error($"Error StartSetup.01{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
await advStep(currStep++);
|
||||
// 2018.07.24 verifico se devo lavorare come ODL classico o come RPO (Richiesta /
|
||||
// Promessa / ODL)
|
||||
if (enableRPO)
|
||||
@@ -268,12 +437,14 @@ namespace MP_TAB_SERV.Components
|
||||
// salvo ODL Current
|
||||
idxODL_curr = IdxPOdlSel;
|
||||
}
|
||||
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));
|
||||
processaEvento(IdxMaccSel, idxEvento, sb.ToString(), idxODL_curr);
|
||||
await processaEvento(IdxMaccSel, idxEvento, sb.ToString(), idxODL_curr);
|
||||
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}";
|
||||
@@ -293,12 +464,13 @@ namespace MP_TAB_SERV.Components
|
||||
TabDServ.MachineParamUpdate(IdxMaccSel, "setComm", setCommVal);
|
||||
TabDServ.MachineParamUpdate(IdxMaccSel, "setPzComm", setPzCommVal);
|
||||
TabDServ.addTask4Machine(IdxMaccSel, taskType.setParameter, "ForceUpdate");
|
||||
await advStep(currStep++);
|
||||
// li aggiungo ANCHE sui PLC slave se ci sono...
|
||||
if (isMaster)
|
||||
{
|
||||
// calcolo gli slave...
|
||||
var slaveList = SMServ.ListM2S
|
||||
.Where(x => x.IdxMacchina.Equals(RecMSE?.IdxMacchina, StringComparison.InvariantCultureIgnoreCase))
|
||||
.Where(x => x.IdxMacchina.Equals(IdxMaccSel, StringComparison.InvariantCultureIgnoreCase))
|
||||
.ToList();
|
||||
foreach (var machine in slaveList)
|
||||
{
|
||||
@@ -314,6 +486,7 @@ namespace MP_TAB_SERV.Components
|
||||
TabDServ.addTask4Machine(machine.IdxMacchinaSlave, taskType.setParameter, "ForceUpdate");
|
||||
}
|
||||
}
|
||||
await advStep(currStep++);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -350,18 +523,19 @@ namespace MP_TAB_SERV.Components
|
||||
// update buttons...
|
||||
checkAll();
|
||||
}
|
||||
await advStep(currStep++);
|
||||
// se fosse master --> chiamo update child!
|
||||
if (isMaster)
|
||||
{
|
||||
// hard coded 60gg last
|
||||
await TabDServ.OdlFixMachineSlave(IdxMaccSel, 60, 1);
|
||||
}
|
||||
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;
|
||||
await advStep(currStep++);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -369,20 +543,266 @@ namespace MP_TAB_SERV.Components
|
||||
}
|
||||
|
||||
// refresh finale
|
||||
var tmpTCR = tcRichAttr;
|
||||
checkBtnStatus();
|
||||
fixSplitBtn(false);
|
||||
#if false
|
||||
// sollevo evento!
|
||||
if (eh_reqUpdate != null)
|
||||
{
|
||||
eh_reqUpdate(this, new EventArgs());
|
||||
}
|
||||
#endif
|
||||
// faccio refresh e riporto
|
||||
await TabDServ.FlushCache("ODL");
|
||||
IdxPOdlSel = 0;
|
||||
RecMSE = null;
|
||||
await RefreshData();
|
||||
await CheckAttr();
|
||||
inAttr = true;
|
||||
tcRichAttr = tmpTCR;
|
||||
isProcessing = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
protected void togOdlDetail()
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
//baseLang = SMServ.GetConf("baseLang");
|
||||
numDayOdl = SMServ.GetConfInt("numDaySelOdl");
|
||||
confRett = SMServ.GetConfBool("confRett");
|
||||
enableSplitODL = SMServ.GetConfBool("enableSplitODL");
|
||||
modoConfProd = SMServ.GetConfInt("modoConfProd");
|
||||
enableRPO = SMServ.GetConfBool("enableRPO");
|
||||
enableSchedaTecnica = SMServ.GetConfBool("enableSchedaTecnica");
|
||||
enableFixSetup = SMServ.GetConfBool("OptEnableFixSetup");
|
||||
showSplitOdlOnTav = SMServ.GetConfBool("showSplitOdlOnTav");
|
||||
showReopenOdlTav = SMServ.GetConfBool("showReopenOdlTav");
|
||||
gPeriodReopenOdlTav = SMServ.GetConfInt("gPeriodReopenOdlTav");
|
||||
string rawEmailDest = SMServ.GetConf("_adminEmail");
|
||||
emailAdmDest = rawEmailDest.Split(',').ToList();
|
||||
if (RecMSE != null)
|
||||
{
|
||||
IdxMaccSel = RecMSE.IdxMacchina;
|
||||
IdxMaccParent = getIdxMaccParent();
|
||||
// verifica stato inAttr
|
||||
await CheckAttr();
|
||||
await ReloadData(true);
|
||||
}
|
||||
checkAll();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
isMulti = SMServ.DictMacchMulti[RecMSE?.IdxMacchina] == 1;
|
||||
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
|
||||
IdxPOdlSel = 0;
|
||||
RecMSE = null;
|
||||
currOdl = new ODLExpModel();
|
||||
inAttr = false;
|
||||
IdxPOdlSel = 0;
|
||||
forceCloseOdl = true;
|
||||
//await Task.Delay(250);
|
||||
await RefreshData();
|
||||
await CheckAttr();
|
||||
await advStep(currStep++);
|
||||
isProcessing = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
//NavMan.NavigateTo(NavMan.Uri, true);
|
||||
}
|
||||
|
||||
protected async Task RefreshData()
|
||||
{
|
||||
// refresh tabella dati tablet...
|
||||
RecMSE = null;
|
||||
// rileggo e salvo..
|
||||
var ListMSE = await MDataService.MseGetAll(true);
|
||||
if (ListMSE != null)
|
||||
{
|
||||
// salvo in LocalStorage...
|
||||
await MServ.SaveMse(ListMSE);
|
||||
// aggiorno MSE attuale
|
||||
RecMSE = ListMSE.Find(x => x.IdxMacchina == IdxMaccSel);
|
||||
await E_Updated.InvokeAsync(ListMSE);
|
||||
}
|
||||
// update dati liste ODL
|
||||
await ReloadData(true);
|
||||
}
|
||||
|
||||
protected void SaveTCRich(decimal newTCRich)
|
||||
{
|
||||
tcRichAttr = newTCRich;
|
||||
}
|
||||
|
||||
protected async Task SendFixEndSetup()
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi invio FIX chiusura atrtezzaggio ad impianto?"))
|
||||
return;
|
||||
|
||||
string ts = string.Format("{0:yyMMdd}T{0:HHmmss.fff}Z", DateTime.Now);
|
||||
string outData = $"TS:{ts}|MATR:{MatrOpr}|ODL:{IdxOdl}";
|
||||
TabDServ.addTask4Machine(IdxMaccSel, taskType.fixStopSetup, outData);
|
||||
outData = "Inserita richiesta invio Fix chiusura attrezzaggio " + outData;
|
||||
lblOut = outData;
|
||||
// se è master --> chiamo update child!
|
||||
if (isMaster)
|
||||
{
|
||||
// invio eventi ad IOB slave...
|
||||
var slaveList = SMServ.ListM2S
|
||||
.Where(x => x.IdxMacchina.Equals(IdxMaccSel, StringComparison.InvariantCultureIgnoreCase))
|
||||
.ToList();
|
||||
foreach (var machine in slaveList)
|
||||
{
|
||||
// invio chiusura attrezzaggio
|
||||
outData = $"TS:{ts}|MATR:{MatrOpr}|ODL:{IdxOdl}|master machine:{IdxMaccSel}";
|
||||
TabDServ.addTask4Machine(machine.IdxMacchinaSlave, taskType.fixStopSetup, outData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> E_MachSel { get; set; }
|
||||
|
||||
protected async Task SendWarnTcChangeReq(int idxOdl, decimal tcAss, decimal tcRich)
|
||||
{
|
||||
// carico altri parametri email...
|
||||
string oggetto = SMServ.GetConf("oggettoChgTc");
|
||||
string corpoChgTc = SMServ.GetConf("corpoChgTc");
|
||||
string mittente = SMServ.GetConf("_fromEmail");
|
||||
string baseUrlAdmin = SMServ.GetConf("baseUrlAdmin");
|
||||
string pageUrlApprODL = SMServ.GetConf("pageUrlApprODL");
|
||||
string pageUrl = $"{baseUrlAdmin}{pageUrlApprODL}";
|
||||
string corpo = $"<b>ODL: {idxOdl} | TC Assegnato: {tcAss:N3} | TC Rich: {tcRich}</b>{Environment.NewLine}{Environment.NewLine}";
|
||||
corpo += string.Format(corpoChgTc, Environment.NewLine, pageUrl);
|
||||
corpo = corpo.Replace($"{Environment.NewLine}", "<br/>");
|
||||
MailKitMailData mData = new MailKitMailData()
|
||||
{
|
||||
From = mittente,
|
||||
To = emailAdmDest,
|
||||
Subject = oggetto,
|
||||
Body = corpo
|
||||
};
|
||||
bool done = await MailServ.SendAsync(mData);
|
||||
if (done)
|
||||
{
|
||||
Log.Info($"Inviata email notifica TC da approvare per ODL {idxOdl} inviato a {string.Join(",", emailAdmDest)}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error($"Errore in invio email notifica TC da approvare per ODL {idxOdl} | tentato invio a {string.Join(",", emailAdmDest)}");
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task SetMacc(string selIdxMacc)
|
||||
{
|
||||
IdxMaccSel = selIdxMacc;
|
||||
await DoUpdate();
|
||||
await E_MachSel.InvokeAsync(selIdxMacc);
|
||||
}
|
||||
|
||||
protected async Task ToggleOdlDetail()
|
||||
{
|
||||
showOdlDetail = !showOdlDetail;
|
||||
// se devo mostrare, carico dati ODL!
|
||||
if (showOdlDetail)
|
||||
{
|
||||
await ReloadXDL(true);
|
||||
}
|
||||
}
|
||||
|
||||
protected string Traduci(string lemma)
|
||||
@@ -400,15 +820,29 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
private bool confRett = true;
|
||||
|
||||
private double currVal = 0;
|
||||
|
||||
private List<string> emailAdmDest = new List<string>();
|
||||
|
||||
private bool enableFixSetup = false;
|
||||
|
||||
private bool enableRPO = true;
|
||||
|
||||
private bool enableSchedaTecnica = false;
|
||||
|
||||
private bool enableSplitODL = false;
|
||||
|
||||
private int expTimeMsec = 500;
|
||||
|
||||
private bool forceCloseOdl = true;
|
||||
|
||||
private int gPeriodReopenOdlTav = 1;
|
||||
|
||||
private string IdxMaccSel = "";
|
||||
|
||||
private int idxOdl = 0;
|
||||
|
||||
private int idxPOdlSel = 0;
|
||||
|
||||
private bool isInAttr = false;
|
||||
private bool inAttr = false;
|
||||
|
||||
private bool isInProd = false;
|
||||
|
||||
@@ -424,16 +858,26 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
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;
|
||||
|
||||
private bool showReopenOdlTav = false;
|
||||
|
||||
private bool showSplitOdlOnTav = false;
|
||||
|
||||
private decimal tcRichAttr = 1;
|
||||
|
||||
#endregion Private Fields
|
||||
@@ -448,18 +892,67 @@ namespace MP_TAB_SERV.Components
|
||||
set { MServ.UserPrefGet("Lang"); }
|
||||
}
|
||||
|
||||
private string cssDetailOdl
|
||||
{
|
||||
get => IdxPOdlSel > 0 ? "bg-primary text-light" : "bg-warning";
|
||||
}
|
||||
|
||||
private ODLExpModel currOdl { get; set; } = new ODLExpModel();
|
||||
|
||||
private PODLExpModel currPodl { get; set; } = new PODLExpModel();
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se l'ALTRA macchina NON abbia ODL valido (== 0)
|
||||
/// </summary>
|
||||
private bool emptyOdlAltraMacc
|
||||
{
|
||||
get => IdxOdlAltra == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se la macchina NON abbia ODL valido (== 0)
|
||||
/// </summary>
|
||||
private bool emptyOdlMacc
|
||||
{
|
||||
get => IdxOdl == 0;
|
||||
}
|
||||
|
||||
private bool endProdDisabled
|
||||
{
|
||||
get => !odlOk || needConfProd;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Variabile idxMacc parent x selezione ODL
|
||||
/// </summary>
|
||||
private string IdxMaccParent { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Valore calcolato key ODL corrente...
|
||||
/// </summary>
|
||||
private int IdxOdl
|
||||
{
|
||||
get => RecMSE != null ? RecMSE.IdxOdl ?? 0 : 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Valore calcolato key ODL altra tavola attivo...
|
||||
/// </summary>
|
||||
private int IdxOdlAltra
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
var tabOdlAltra = await TabDServ.OdlCurrByMacc(idxMaccAltraTav, false);
|
||||
answ = tabOdlAltra.IdxOdl;
|
||||
});
|
||||
pUpd.Wait();
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private string lblWarnBody
|
||||
{
|
||||
get => odlOk ? Traduci("ConfProdBeforeContinueBody") : Traduci("setOdlBeforeContinueBody");
|
||||
@@ -505,6 +998,102 @@ namespace MP_TAB_SERV.Components
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica visibilità btn riprendi ODL su 2° tavola SE:
|
||||
/// - sia un impianto MULTI (= con + tavole)
|
||||
/// - sia disattrezzata la tavola
|
||||
/// - in tab congif: se sia abilitato la ripresa ODL sulla seconda tavola
|
||||
/// - in tab config: sia il grace period
|
||||
/// - NON SIANO passati i minuti indicati dalla chiusura
|
||||
/// </summary>
|
||||
private bool showReopOdlTav
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
// se è multi controllo
|
||||
if (isMulti)
|
||||
{
|
||||
// verifico se NON HA ODL...
|
||||
if (emptyOdlMacc)
|
||||
{
|
||||
// verifico SE siamo nel gracePeriod... chiuso da meno di 1h
|
||||
DateTime adesso = DateTime.Now;
|
||||
DateTime dtChiusura = DateTime.Now.AddHours(-1);
|
||||
try
|
||||
{
|
||||
var lastOdl = TabDServ.OdlLastByMacc(IdxMaccSel, true);
|
||||
if (lastOdl != null)
|
||||
{
|
||||
dtChiusura = lastOdl.DataFine ?? DateTime.Now.AddHours(-1);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
// ora verifico SE E SOLO SE è ANCORA in attrezzaggio
|
||||
if (inAttr)
|
||||
{
|
||||
// ora verifico SE ALTRA TAVOLA ha ODL...
|
||||
if (dtChiusura.AddMinutes(gPeriodReopenOdlTav) > adesso)
|
||||
{
|
||||
answ = showReopenOdlTav;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica visibilità btn split ODL su 2° tavola SE:
|
||||
/// - sia un impianto MULTI (= con + tavole)
|
||||
/// - sia già attrezzata la prima tavola
|
||||
/// - in tab Congif: se sia abilitato lo split ODL sulla seconda tavola
|
||||
/// - la macchina SIA ANCORA in attrezzaggio (2019.07.08) = 2
|
||||
/// </summary>
|
||||
private bool showSplitOdlOnTavVal
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
// se è multi controllo
|
||||
if (isMulti)
|
||||
{
|
||||
// verifico se NON HA ODL ma ce l'ha altra tavola...
|
||||
if (emptyOdlMacc)
|
||||
{
|
||||
// ora verifico SE ALTRA TAVOLA ha ODL...
|
||||
if (!emptyOdlAltraMacc)
|
||||
{
|
||||
// ora verifico SE E SOLO SE è ANCORA in attrezzaggio
|
||||
if (inAttr)
|
||||
{
|
||||
answ = showSplitOdlOnTav;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private string titleOdlDetail
|
||||
{
|
||||
get => IdxPOdlSel > 0 ? "Verifica parametri attrezzaggio NUOVO PODL" : inAttr ? "Parametri PODL in Attrezzaggio" : "Parametri ODL Corrente";
|
||||
}
|
||||
|
||||
private string txtBtnOdlDetail
|
||||
{
|
||||
get => showOdlDetail ? "Nascondi Dettaglio ODL" : "MOSTRA Dettaglio ODL Corrente";
|
||||
}
|
||||
|
||||
private string txtForceCloseOdl
|
||||
{
|
||||
get => forceCloseOdl ? Traduci("ForceCloseODL") : Traduci("SplitCurrODL");
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
@@ -794,7 +1383,7 @@ namespace MP_TAB_SERV.Components
|
||||
inCmd2 = await TabDServ.EvListInsert(newRecParent, Enums.tipoInputEvento.barcode);
|
||||
}
|
||||
// chiamo refresh MSE
|
||||
TabDServ.RicalcMse(idxMaccCurr, 0);
|
||||
await TabDServ.RicalcMse(idxMaccCurr, 0);
|
||||
lblOut = userMsg;
|
||||
// loggo USR MSG
|
||||
Log.Info(userMsg);
|
||||
@@ -823,13 +1412,26 @@ namespace MP_TAB_SERV.Components
|
||||
prodMacchina = rawData.FirstOrDefault() ?? new PzProdModel();
|
||||
}
|
||||
}
|
||||
// imposto tcRichAttr in base allo stato...
|
||||
if (odlOk)
|
||||
{
|
||||
// prendo TCRich da ODL...
|
||||
if (IdxOdl > 0)
|
||||
{
|
||||
tcRichAttr = currOdl.TCRichAttr;
|
||||
}
|
||||
else
|
||||
{
|
||||
tcRichAttr = currPodl.Tcassegnato;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ReloadPOdlDetailData()
|
||||
{
|
||||
if (IdxPOdlSel > 0)
|
||||
{
|
||||
currPodl = await TabDServ.PODLExp_getByKey(IdxPOdlSel);
|
||||
await ReloadXDL(false);
|
||||
// controllo se � cambiato PODL
|
||||
if (IdxPOdlSel != lastIdxPOdl)
|
||||
{
|
||||
@@ -839,6 +1441,40 @@ namespace MP_TAB_SERV.Components
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ReloadXDL(bool reloadFromOdl)
|
||||
{
|
||||
int currIdxPOdl = IdxPOdlSel;
|
||||
if (RecMSE != null)
|
||||
{
|
||||
if (reloadFromOdl)
|
||||
{
|
||||
currIdxPOdl = RecMSE.IdxPOdl ?? 0;
|
||||
}
|
||||
// se ho PODL valido...
|
||||
if (currIdxPOdl > 0)
|
||||
{
|
||||
currPodl = await TabDServ.PODLExp_getByKey(currIdxPOdl);
|
||||
}
|
||||
else
|
||||
{
|
||||
currPodl = new PODLExpModel()
|
||||
{
|
||||
IdxOdl = RecMSE.IdxOdl ?? 0,
|
||||
KeyRichiesta = "-",
|
||||
CodArticolo = RecMSE.CodArticolo,
|
||||
DescArticolo = RecMSE.CodArticolo,
|
||||
NumPezzi = RecMSE.NumPezzi,
|
||||
Tcassegnato = RecMSE.TCAssegnato
|
||||
};
|
||||
}
|
||||
}
|
||||
// update a runtime dati ODL se assegnato
|
||||
if (currPodl.IdxOdl > 0)
|
||||
{
|
||||
currOdl = await TabDServ.OdlByIdx(currPodl.IdxOdl, false);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -165,9 +165,9 @@ namespace MP_TAB_SERV.Components
|
||||
// effettua conferma con conf da DB del tipo (giorni / turni / periodo
|
||||
bool fatto = effettuaConfermaProd();
|
||||
// refresh tabella dati tablet...
|
||||
TabDServ.RicalcMse(IdxMaccSel, 0);
|
||||
await TabDServ.RicalcMse(IdxMaccSel, 0);
|
||||
// rileggo e salvo..
|
||||
var ListMSE = await MDataService.MseGetAll();
|
||||
var ListMSE = await MDataService.MseGetAll(true);
|
||||
if (ListMSE != null)
|
||||
{
|
||||
// salvo in LocalStorage...
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
}
|
||||
</div>
|
||||
<div class="col-4">
|
||||
@lblTempo
|
||||
→ @lblTempo
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace MP_TAB_SERV.Components
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = tcMode == "mc" ? $"--> {TempoMS.TotalMinutes:N0}:{TempoMS:ss} (min:sec)" : $"--> {TempoMC:0.000} (min.cent)";
|
||||
string answ = tcMode == "mc" ? $"{TempoMS.TotalMinutes:N0}:{TempoMS:ss} (min:sec)" : $"{TempoMC:0.000} (min.cent)";
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2311.810</Version>
|
||||
<Version>6.16.2311.1019</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB_SERV</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
|
||||
<OdlMan RecMSE="CurrMSE" E_Updated="RefreshData"></OdlMan>
|
||||
<MachineBlock RecMSE="CurrMSE" FullMode="false" IdxMacchSub="@IdxMaccSubSel"></MachineBlock>
|
||||
<OdlMan RecMSE="CurrMSE" E_Updated="RefreshData" E_MachSel="SetMacc"></OdlMan>
|
||||
}
|
||||
|
||||
@@ -23,25 +23,6 @@ namespace MP_TAB_SERV.Pages
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
if (string.IsNullOrEmpty(IdxMacc))
|
||||
{
|
||||
IdxMacc = await MsgServ.IdxMaccGet();
|
||||
// recupero MSE macchina....
|
||||
if (!string.IsNullOrEmpty(IdxMacc))
|
||||
{
|
||||
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected async Task RefreshData(List<MappaStatoExpl> newList)
|
||||
{
|
||||
var ListMSE = newList;
|
||||
@@ -69,6 +50,30 @@ namespace MP_TAB_SERV.Pages
|
||||
}
|
||||
}
|
||||
|
||||
private string IdxMaccSubSel = "";
|
||||
|
||||
protected void SetMacc(string selIdxMacc)
|
||||
{
|
||||
IdxMaccSubSel = selIdxMacc;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
if (string.IsNullOrEmpty(IdxMacc))
|
||||
{
|
||||
IdxMacc = await MsgServ.IdxMaccGet();
|
||||
// recupero MSE macchina....
|
||||
if (!string.IsNullOrEmpty(IdxMacc))
|
||||
{
|
||||
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ namespace MP_TAB_SERV.Pages
|
||||
protected SharedMemService SMServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TabServ { get; set; } = null!;
|
||||
protected TabDataService TabDServ { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace MP_TAB_SERV.Pages
|
||||
var rigaEvento = SMServ.GetEventRow(IdxEv);
|
||||
if (rigaEvento != null)
|
||||
{
|
||||
var rigaStato = TabServ.StatoMacchina(IdxMacc);
|
||||
var rigaStato = TabDServ.StatoMacchina(IdxMacc);
|
||||
// processo evento...
|
||||
if (insRealtime)
|
||||
{
|
||||
@@ -103,14 +103,14 @@ namespace MP_TAB_SERV.Pages
|
||||
pallet = rigaStato.pallet
|
||||
};
|
||||
// se realtime
|
||||
await TabServ.EvListInsert(newRec, MP.Data.Objects.Enums.tipoInputEvento.barcode);
|
||||
await TabDServ.EvListInsert(newRec, MP.Data.Objects.Enums.tipoInputEvento.barcode);
|
||||
// resetta il microstato in modo da ricevere successive info HW
|
||||
TabServ.resetMicrostatoMacchina(IdxMacc);
|
||||
TabDServ.resetMicrostatoMacchina(IdxMacc);
|
||||
}
|
||||
else
|
||||
{
|
||||
// in primis disabilito insert...
|
||||
TabServ.MacchinaSetInsEnab(IdxMacc, false);
|
||||
TabDServ.MacchinaSetInsEnab(IdxMacc, false);
|
||||
|
||||
// calcolo evento
|
||||
string evento = $"{IdxEv}";
|
||||
@@ -128,7 +128,7 @@ namespace MP_TAB_SERV.Pages
|
||||
try
|
||||
{
|
||||
// cerco da 1 sec DOPO evento...
|
||||
var tabNext = TabServ.DDB_getNext(IdxMacc, DtRif.AddSeconds(1));
|
||||
var tabNext = TabDServ.DDB_getNext(IdxMacc, DtRif.AddSeconds(1));
|
||||
|
||||
DateTime nextEvDT = tabNext != null ? tabNext.InizioStato : DateTime.Now.AddMinutes(-1);
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace MP_TAB_SERV.Pages
|
||||
MatrOpr = MatrOpr,
|
||||
pallet = rigaStato.pallet
|
||||
};
|
||||
await TabServ.EvListInsert(newRec, MP.Data.Objects.Enums.tipoInputEvento.barcode);
|
||||
await TabDServ.EvListInsert(newRec, MP.Data.Objects.Enums.tipoInputEvento.barcode);
|
||||
|
||||
// update commento apertura!
|
||||
commento = $"999 - Dich StartEvt: {evento} [{codRich}]";
|
||||
@@ -159,11 +159,11 @@ namespace MP_TAB_SERV.Pages
|
||||
MatrOpr = MatrOpr,
|
||||
pallet = rigaStato.pallet
|
||||
};
|
||||
await TabServ.EvListInsert(newRec, MP.Data.Objects.Enums.tipoInputEvento.barcode);
|
||||
await TabDServ.EvListInsert(newRec, MP.Data.Objects.Enums.tipoInputEvento.barcode);
|
||||
// eseguo ricalcolo!
|
||||
DateTime startRicalcolo = DtRif.AddMinutes(minAnticipoRicalcolo);
|
||||
// eseguo ricalcolo periodo..
|
||||
await TabServ.DDB_DoRecalc(IdxMacc, startRicalcolo, 1, rdm_nEvStep, rdm_nEvCheck, rdm_ChkOnly);
|
||||
await TabDServ.DDB_DoRecalc(IdxMacc, startRicalcolo, 1, rdm_nEvStep, rdm_nEvCheck, rdm_ChkOnly);
|
||||
// chiamo registrazione commento...
|
||||
if (noteEdit != null)
|
||||
{
|
||||
@@ -177,7 +177,7 @@ namespace MP_TAB_SERV.Pages
|
||||
}
|
||||
|
||||
// riabilito insert... anche se non dovrebbe servire x stored ricalcolo precedente...
|
||||
TabServ.MacchinaSetInsEnab(IdxMacc, true);
|
||||
TabDServ.MacchinaSetInsEnab(IdxMacc, true);
|
||||
}
|
||||
// mostro esito
|
||||
alertCss = "alert-succes";
|
||||
@@ -190,9 +190,9 @@ namespace MP_TAB_SERV.Pages
|
||||
}
|
||||
}
|
||||
// faccio refresh x singola macchina 2019.03.26
|
||||
TabServ.RicalcMse(IdxMacc, 0);
|
||||
await TabDServ.RicalcMse(IdxMacc, 0);
|
||||
// rileggo e salvo..
|
||||
var ListMSE = await MDataService.MseGetAll();
|
||||
var ListMSE = await MDataService.MseGetAll(true);
|
||||
if (ListMSE != null)
|
||||
{
|
||||
// salvo in LocalStorage...
|
||||
@@ -268,7 +268,7 @@ namespace MP_TAB_SERV.Pages
|
||||
{
|
||||
CurrMSE = await MServ.GetMachineMse(IdxMacc);
|
||||
}
|
||||
var eventsAll = await TabServ.AnagEventiGetByMacch(IdxMacc);
|
||||
var eventsAll = await TabDServ.AnagEventiGetByMacch(IdxMacc);
|
||||
if (eventsAll != null)
|
||||
{
|
||||
events2show = eventsAll.Where(x => x.EventoTablet).OrderBy(x => x.Label).ToList();
|
||||
|
||||
@@ -2,17 +2,11 @@
|
||||
@page "/home"
|
||||
@page "/status-map"
|
||||
|
||||
<MseSampler SampleMult="2" E_Updated="RefreshData"></MseSampler>
|
||||
<MseSampler SampleMult="1.5" E_Updated="SaveData"></MseSampler>
|
||||
<div class="row">
|
||||
@if (ListMSE == null || ListMSE.Count == 0 || isCalcSize)
|
||||
{
|
||||
@*@for (int i = 0; i < 10; i++)
|
||||
{
|
||||
<div class="col-6 col-sm-6 col-md-4 col-lg-3 col-xl-2 mb-2 px-1 bloccoMacc">
|
||||
@*<MachineBlock></MachineBlock>
|
||||
</div>
|
||||
}*@
|
||||
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
||||
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -96,6 +96,8 @@ namespace MP_TAB_SERV.Pages
|
||||
{
|
||||
await getWDim();
|
||||
isCalcSize = false;
|
||||
ListMSE = await MDataService.MseGetAll(true);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
if (ListMSE != null)
|
||||
{
|
||||
@@ -104,21 +106,20 @@ namespace MP_TAB_SERV.Pages
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var df = MServ.UserPrefGet("DefCardMode");
|
||||
ShowCard = df == "shrink" ? false : true;
|
||||
isCalcSize = true;
|
||||
ListMSE = null;
|
||||
SetupConf();
|
||||
ListMSE = await MDataService.MseGetAll();
|
||||
}
|
||||
|
||||
protected async Task RefreshData(List<MappaStatoExpl> newList)
|
||||
protected void SaveData(List<MappaStatoExpl> newList)
|
||||
{
|
||||
//await Task.Delay(1);
|
||||
ListMSE = newList;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
//Log.Trace("StatusMap | RefreshData");
|
||||
//await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
@@ -7,19 +7,20 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
@* <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> *@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="description" content="MP TAB" />
|
||||
<meta name="author" content="EgalWare" />
|
||||
<link rel="shortcut icon" href="images/favicon.ico" />
|
||||
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
|
||||
<base href="~/" />
|
||||
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="lib/font-awesome/css/all.min.css" />
|
||||
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="css/font.min.css" />
|
||||
<link rel="stylesheet" href="css/site.css" />
|
||||
@* <link rel="shortcut icon" href="images/favicon.ico" /> *@
|
||||
<link type="image/x-icon" href="images/favicon.ico" rel="shortcut icon" />
|
||||
<link href="MP-TAB-SERV.styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="MP-TAB-SERV.styles.css" />
|
||||
<component type="typeof(HeadOutlet)" render-mode="Server" />
|
||||
@* <component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" /> *@
|
||||
</head>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2311.810</h4>
|
||||
<h4>Versione: 6.16.2311.1019</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2311.810
|
||||
6.16.2311.1019
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2311.810</version>
|
||||
<version>6.16.2311.1019</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>
|
||||
|
||||
@@ -15,3 +15,4 @@
|
||||
@using MP.Data.Services
|
||||
@using Newtonsoft.Json
|
||||
@using NLog
|
||||
@using EgwCoreLib.Razor
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
"ConnectionStrings": {
|
||||
"Redis": "iis01.egalware.com:6379,DefaultDatabase=1,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false",
|
||||
//"Redis": "localhost:6379,DefaultDatabase=1,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false",
|
||||
"MP.All": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
|
||||
"MP.Mon": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
|
||||
"MP.All": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.TAB3;",
|
||||
"MP.Mon": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.TAB3;",
|
||||
"Mp.IS": "Server=SQL2016DEV;Database=MoonPro_IS_EdilChim; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.INVE;",
|
||||
"MP.Tab": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;"
|
||||
"MP.Tab": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.TAB3;",
|
||||
"MP.Mag": "Server=SQL2016DEV;Database=MoonPro_MAG; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.TAB3;"
|
||||
},
|
||||
"OptConf": {
|
||||
"msRefresh": "2000",
|
||||
|
||||
@@ -17,6 +17,11 @@
|
||||
// REDIS KEY Dati correnti
|
||||
public static readonly string CONF_MON_KEY = $"{BASE_HASH}:Conf:MonDispData";
|
||||
|
||||
|
||||
|
||||
public static string redisMseKey = "MP:MON:Cache:MSE";
|
||||
public static string redisMseKeySingle = "MP:MON:Cache:MseSingle";
|
||||
|
||||
#endregion Public Fields
|
||||
}
|
||||
}
|
||||
@@ -555,7 +555,7 @@ namespace MP.Data.Controllers
|
||||
public async Task<List<StatDedupDTO>> FluxLogDataRedux(string idxMaccSel, List<string> fluxList, Periodo currPeriodo, Enums.ValSelection valMode, Enums.DataInterval intReq, int maxItem)
|
||||
{
|
||||
List<StatDedupDTO> procStats = new List<StatDedupDTO>();
|
||||
Log.Info($"Inizio FluxLogDataRedux | idxMaccSel: {idxMaccSel} | periodo: {currPeriodo.Inizio} --> {currPeriodo.Fine}");
|
||||
Log.Info($"Inizio FluxLogDataRedux | idxMaccSel: {idxMaccSel} | periodo: {currPeriodo.Inizio:yyyy-MM-dd} --> {currPeriodo.Fine:yyyy-MM-dd}");
|
||||
TimeSpan step = TimeSpan.FromHours(1);
|
||||
switch (intReq)
|
||||
{
|
||||
@@ -595,6 +595,8 @@ namespace MP.Data.Controllers
|
||||
// dbContext x ogni singolo flusso
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
// opzionalmente timeout comandi a 2 minuti... NON usato x ora e da testare
|
||||
//dbCtx.Database.SetCommandTimeout(TimeSpan.FromMinutes(2));
|
||||
// li processo per intervallo richiesto, cercando dati nel periodo e
|
||||
// selezionando VC
|
||||
while (!setCompleted)
|
||||
@@ -609,10 +611,7 @@ namespace MP.Data.Controllers
|
||||
numRecProc += numRec;
|
||||
if (numRec > maxItem)
|
||||
{
|
||||
if (dtCursStart > currPeriodo.Fine)
|
||||
{
|
||||
setCompleted = true;
|
||||
}
|
||||
|
||||
List<Periodo> listPeriodi = new List<Periodo>();
|
||||
|
||||
switch (valMode)
|
||||
@@ -669,6 +668,7 @@ namespace MP.Data.Controllers
|
||||
// incremento dt fine periodo
|
||||
dtCursStart = dtCursEnd;
|
||||
dtCursEnd = dtCursStart.Add(step);
|
||||
setCompleted = dtCursStart >= currPeriodo.Fine;
|
||||
}
|
||||
}
|
||||
// fermo cronometro e salvo su DB...
|
||||
@@ -684,7 +684,7 @@ namespace MP.Data.Controllers
|
||||
};
|
||||
procStats.Add(currStat);
|
||||
}
|
||||
Log.Info($"FINE FluxLogDataRedux | idxMaccSel: {idxMaccSel} | periodo: {currPeriodo.Inizio} --> {currPeriodo.Fine}");
|
||||
Log.Info($"FINE FluxLogDataRedux | idxMaccSel: {idxMaccSel} | periodo: {currPeriodo.Inizio:yyyy-MM-dd} --> {currPeriodo.Fine:yyyy-MM-dd}");
|
||||
return procStats;
|
||||
}
|
||||
|
||||
|
||||
@@ -487,6 +487,34 @@ namespace MP.Data.Controllers
|
||||
_configuration = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fix ODL per Elenco Lotti
|
||||
/// </summary>
|
||||
/// <param name="idxOdl"></param>
|
||||
/// <param name="flgStorico"></param>
|
||||
/// <returns></returns>
|
||||
public bool ElencoLottiUpsertByOdl(int idxOdl, bool flgStorico)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonPro_MagContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var IdxOdl = new SqlParameter("@IdxOdl", idxOdl);
|
||||
var FlgStorico = new SqlParameter("@flgStorico", flgStorico);
|
||||
var result = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("EXEC stp_EL_UpsertByOdl @IdxODL, @flgStorico", IdxOdl, FlgStorico);
|
||||
fatto = result != 0;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante ElLottiUpsertByOdl{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
//stp_DDB_getNextByMacchinaFrom
|
||||
/// <summary>
|
||||
/// Eliminazione record EventList (SE trovato)
|
||||
@@ -737,6 +765,35 @@ namespace MP.Data.Controllers
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dati MSE x singola macchina SUB (tipicamente TAV)
|
||||
/// </summary>
|
||||
/// <param name="idxMacc"></param>
|
||||
/// <param name="idxMacchSub"></param>
|
||||
/// <returns></returns>
|
||||
public List<MappaStatoExpl> MseGetSub(string idxMacc, string idxMacchSub)
|
||||
{
|
||||
List<MappaStatoExpl> dbResult = new List<MappaStatoExpl>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var IdxMacc = new SqlParameter("@IdxMacchina", idxMacc);
|
||||
var IdxMacchSub = new SqlParameter("@IdxMacchSub", idxMacchSub);
|
||||
dbResult = dbCtx
|
||||
.DbSetMSE
|
||||
.FromSqlRaw("EXEC stp_MSE_getByIdxMacchAndSub @IdxMacchina, @IdxMacchSub", IdxMacc, IdxMacchSub)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante MseGetSub{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ODL da key
|
||||
/// </summary>
|
||||
@@ -754,7 +811,7 @@ namespace MP.Data.Controllers
|
||||
var OnlyUnused = new SqlParameter("@onlyUnused", onlyUnused);
|
||||
dbResult = dbCtx
|
||||
.DbSetODLExp
|
||||
.FromSqlRaw("EXEC stp_ODL_getByIdx @IdxOdl, @onlyUnused", IdxOdl, onlyUnused)
|
||||
.FromSqlRaw("EXEC stp_ODL_getByIdx @IdxOdl, @onlyUnused", IdxOdl, OnlyUnused)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
@@ -793,6 +850,36 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attrezzo stesso ODL dell'altra tavola
|
||||
/// </summary>
|
||||
/// <param name="idxODL"></param>
|
||||
/// <param name="matrOpr"></param>
|
||||
/// <param name="idxMacchinaTo"></param>
|
||||
/// <returns></returns>
|
||||
public bool OdlDividiDaAltraTavola(int idxODL, int matrOpr, string idxMacchinaTo)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var IdxODL = new SqlParameter("@idxODL", idxODL);
|
||||
var MatrOpr = new SqlParameter("@MatrOpr", matrOpr);
|
||||
var IdxMaccTo = new SqlParameter("@IdxMacchinaTo", idxMacchinaTo);
|
||||
var result = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("EXEC stp_ODL_dividiDaAltraTav @idxODL, @MatrOpr, @IdxMacchinaTo", IdxODL, MatrOpr, IdxMaccTo);
|
||||
fatto = result != 0;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante OdlDividiDaAltraTavola{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registro fine prod ODL
|
||||
/// </summary>
|
||||
@@ -887,6 +974,33 @@ namespace MP.Data.Controllers
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ultimo ODL data macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public List<ODLModel> OdlLastByMacc(string idxMacchina)
|
||||
{
|
||||
List<ODLModel> dbResult = new List<ODLModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
dbResult = dbCtx
|
||||
.DbSetODL
|
||||
.FromSqlRaw("EXEC stp_ODL_getLastByMacchina @IdxMacchina", IdxMacchina)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante OdlLastByMacc{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ODL data macchina e periodo
|
||||
/// </summary>
|
||||
@@ -918,6 +1032,33 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Riapertura ULTIMO ODL data macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public List<ODLModel> OdlReopenOdlMacc(string idxMacchina)
|
||||
{
|
||||
List<ODLModel> dbResult = new List<ODLModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
dbResult = dbCtx
|
||||
.DbSetODL
|
||||
.FromSqlRaw("EXEC stp_ODL_reopenOdlMacc @IdxMacchina", IdxMacchina)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante OdlReopenOdlMacc{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup ODL Postumo
|
||||
/// </summary>
|
||||
@@ -1016,6 +1157,37 @@ namespace MP.Data.Controllers
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update ODL (es: in setup x chiusura attrezzaggio)
|
||||
/// </summary>
|
||||
/// <param name="idxODL"></param>
|
||||
/// <param name="matrOpr"></param>
|
||||
/// <returns></returns>
|
||||
public bool OdlUpdate(int idxODL, int matrOpr, decimal tCRichAttr, int pzPallet, string note)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var IdxODL = new SqlParameter("@idxODL", idxODL);
|
||||
var MatrOpr = new SqlParameter("@MatrOpr", matrOpr);
|
||||
var TCRichAttr = new SqlParameter("@TCRichAttr", tCRichAttr);
|
||||
var PzPallet = new SqlParameter("@PzPallet", pzPallet);
|
||||
var Note = new SqlParameter("@Note", note);
|
||||
var result = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("EXEC stp_ODL_updateSetup @IdxODL, @MatrOpr, @TCRichAttr, @PzPallet, @Note", IdxODL, MatrOpr, TCRichAttr, PzPallet, Note);
|
||||
answ = result != 0;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante OdlUpdate{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stato prod macchina
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("ElencoLotti")]
|
||||
public partial class ElencoLottiModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key]
|
||||
public string Lotto { get; set; } = "";
|
||||
public int IdxODL { get; set; } = 0;
|
||||
[MaxLength(50)]
|
||||
public string RifExt { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string TipoLotto { get; set; } = "";
|
||||
[MaxLength(50), Column("CodArt")]
|
||||
public string CodArticolo { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string CodStato { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string Origine { get; set; } = "";
|
||||
public DateTime? DtCrea { get; set; }
|
||||
[MaxLength(250)]
|
||||
public string Note { get; set; } = "";
|
||||
public decimal QtaOrig { get; set; } = 0;
|
||||
public int NumUdc { get; set; } = 1;
|
||||
public decimal QtaCurr { get; set; } = 0;
|
||||
public DateTime? DtMod { get; set; }
|
||||
public bool Attivo { get; set; } = false;
|
||||
[MaxLength(250)]
|
||||
public string DescrArt { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string CodArtExt { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string DescStato { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ namespace MP.Data.DatabaseModels
|
||||
public string IdxMacchina { get; set; }
|
||||
public int NumPezzi { get; set; }
|
||||
public decimal Tcassegnato { get; set; }
|
||||
public decimal TCRichAttr { get; set; }
|
||||
public DateTime? DataInizio { get; set; }
|
||||
public DateTime? DataFine { get; set; }
|
||||
[MaxLength(2500)]
|
||||
|
||||
@@ -47,10 +47,18 @@ namespace MP.Data.DatabaseModels
|
||||
get
|
||||
{
|
||||
string answ = "*";
|
||||
var allData = KeyRichiesta.Split('_');
|
||||
if (allData.Length > 0)
|
||||
if (!string.IsNullOrEmpty(KeyRichiesta))
|
||||
{
|
||||
answ = allData[0];
|
||||
try
|
||||
{
|
||||
var allData = KeyRichiesta.Split('_');
|
||||
if (allData.Length > 0)
|
||||
{
|
||||
answ = allData[0];
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DatabaseModels;
|
||||
using NLog;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data
|
||||
{
|
||||
public partial class MoonPro_MagContext : DbContext
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private IConfiguration _configuration;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Indispensabile x prima generazione migrations EFCore
|
||||
/// </summary>
|
||||
|
||||
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
|
||||
public MoonPro_MagContext()
|
||||
{
|
||||
}
|
||||
|
||||
public MoonPro_MagContext(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public MoonPro_MagContext(DbContextOptions<MoonPro_MagContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
|
||||
public virtual DbSet<ElencoLottiModel> DbSetElLotti { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
string connString = _configuration.GetConnectionString("Mp.Mag");
|
||||
if (!string.IsNullOrEmpty(connString))
|
||||
{
|
||||
optionsBuilder.UseSqlServer(connString);
|
||||
}
|
||||
else
|
||||
{
|
||||
optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro_MAG;Trusted_Connection=True;");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ namespace MP.Data.Services
|
||||
stopWatch.Start();
|
||||
List<MappaStatoExpl>? result = new List<MappaStatoExpl>();
|
||||
// cerco in redis...
|
||||
RedisValue rawData = redisDb.StringGet(redisMseKey);
|
||||
RedisValue rawData = redisDb.StringGet(Constants.redisMseKey);
|
||||
if (rawData.HasValue && !forceDb)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<MappaStatoExpl>>($"{rawData}");
|
||||
@@ -131,7 +131,7 @@ namespace MP.Data.Services
|
||||
result = await Task.FromResult(dbController.MseGetAll(maxAge));
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(redisMseKey, rawData, TimeSpan.FromMilliseconds(maxAge));
|
||||
await redisDb.StringSetAsync(Constants.redisMseKey, rawData, TimeSpan.FromMilliseconds(maxAge));
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"Read from DB: {ts.TotalMilliseconds}ms");
|
||||
@@ -165,7 +165,9 @@ namespace MP.Data.Services
|
||||
private static IConfiguration _configuration = null!;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private int maxAge = 2000;
|
||||
private string redisMseKey = "MP:MON:Cache:MSE";
|
||||
#if false
|
||||
private string redisMseKey = "MP:MON:Cache:MSE";
|
||||
#endif
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -574,6 +575,29 @@ namespace MP.Data.Services
|
||||
dbInveController.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fix ODL per Elenco Lotti
|
||||
/// </summary>
|
||||
/// <param name="idxOdl"></param>
|
||||
/// <param name="flgStorico"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ElencoLottiUpsertByOdl(int idxOdl, bool flgStorico)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
// inserisco evento
|
||||
answ = dbTabController.ElencoLottiUpsertByOdl(idxOdl, flgStorico);
|
||||
await FlushCache("EL");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string logMsg = $"Eccezione in ElencoLottiUpsertByOdl | idxOdl: {idxOdl} | flgStorico: {flgStorico}{Environment.NewLine}{exc}";
|
||||
Log.Error(logMsg);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elimina una riga in EventList se trovata
|
||||
/// </summary>
|
||||
@@ -1121,6 +1145,7 @@ namespace MP.Data.Services
|
||||
answ = dbTabController.OdlFineProd(idxODL, idxMacchina);
|
||||
await FlushCache("ODL");
|
||||
await FlushCache("PODL");
|
||||
await FlushCache("VSODL");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -1130,6 +1155,33 @@ namespace MP.Data.Services
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Attrezzo stesso ODL dell'altra tavola
|
||||
/// </summary>
|
||||
/// <param name="idxODL"></param>
|
||||
/// <param name="matrOpr"></param>
|
||||
/// <param name="idxMacchinaTo"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> OdlDividiDaAltraTavola(int idxODL, int matrOpr, string idxMacchinaTo)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
// inserisco evento
|
||||
answ = dbTabController.OdlDividiDaAltraTavola(idxODL, matrOpr, idxMacchinaTo);
|
||||
await FlushCache("ODL");
|
||||
await FlushCache("PODL");
|
||||
await FlushCache("VSODL");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string logMsg = $"Eccezione in OdlDividiDaAltraTavola | idxODL: {idxODL} | matrOpr: {matrOpr} | idxMacchinaTo: {idxMacchinaTo}{Environment.NewLine}{exc}";
|
||||
Log.Error(logMsg);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fix ODL per macchine SLAVE
|
||||
/// </summary>
|
||||
@@ -1146,6 +1198,7 @@ namespace MP.Data.Services
|
||||
answ = dbTabController.OdlFixMachineSlave(idxMacchina, numDayPrev, doInsert);
|
||||
await FlushCache("ODL");
|
||||
await FlushCache("PODL");
|
||||
await FlushCache("VSODL");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -1174,6 +1227,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)
|
||||
{
|
||||
@@ -1183,6 +1237,72 @@ namespace MP.Data.Services
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ultimo ODL data macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <param name="forceDb"></param>
|
||||
/// <returns></returns>
|
||||
public ODLModel OdlLastByMacc(string idxMacchina, bool forceDb)
|
||||
{
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
ODLModel result = new ODLModel();
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:ODL:{idxMacchina}:LAST";
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue && !forceDb)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<ODLModel>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
var results = dbTabController.OdlLastByMacc(idxMacchina);
|
||||
// riordino
|
||||
result = results.FirstOrDefault();
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, UltraLongCache);
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new ODLModel();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"OdlLastByMacc | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Riapertura ULTIMO ODL data macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public ODLModel OdlReopenOdlMacc(string idxMacchina)
|
||||
{
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
ODLModel result = new ODLModel();
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:ODL:{idxMacchina}:LAST";
|
||||
var results = dbTabController.OdlReopenOdlMacc(idxMacchina);
|
||||
// riordino
|
||||
result = results.FirstOrDefault();
|
||||
// serializzp e salvo...
|
||||
var rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, UltraLongCache);
|
||||
if (result == null)
|
||||
{
|
||||
result = new ODLModel();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"OdlReopenOdlMacc | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ODL data macchina e periodo
|
||||
/// </summary>
|
||||
@@ -1236,6 +1356,8 @@ namespace MP.Data.Services
|
||||
// inserisco evento
|
||||
answ = dbTabController.OdlSetupPostumo(idxODL, idxMacchina);
|
||||
await FlushCache("ODL");
|
||||
await FlushCache("PODL");
|
||||
await FlushCache("VSODL");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -1260,6 +1382,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)
|
||||
{
|
||||
@@ -1289,6 +1413,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)
|
||||
{
|
||||
@@ -1298,6 +1424,31 @@ namespace MP.Data.Services
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update ODL (es: in setup x chiusura attrezzaggio)
|
||||
/// </summary>
|
||||
/// <param name="idxODL"></param>
|
||||
/// <param name="matrOpr"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> OdlUpdate(int idxODL, int matrOpr, decimal tCRichAttr, int pzPallet, string note)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
// inserisco evento
|
||||
answ = dbTabController.OdlUpdate(idxODL, matrOpr, tCRichAttr, pzPallet, note);
|
||||
await FlushCache("ODL");
|
||||
await FlushCache("PODL");
|
||||
await FlushCache("VSODL");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string logMsg = $"Eccezione in OdlUpdate | idxODL: {idxODL} | matrOpr: {matrOpr} | tCRichAttr: {tCRichAttr} | pzPallet: {pzPallet} | note: {note}{Environment.NewLine}{exc}";
|
||||
Log.Error(logMsg);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stato prod macchina
|
||||
/// </summary>
|
||||
@@ -1836,12 +1987,56 @@ namespace MP.Data.Services
|
||||
/// <param name="idxMacchina">idx macchina da confermare</param>
|
||||
/// <param name="maxAgeSec">Num massimo secondi di "vecchiaia" del dato</param>
|
||||
/// <returns></returns>
|
||||
public bool RicalcMse(string idxMacchina, int maxAgeSec)
|
||||
public async Task<bool> RicalcMse(string idxMacchina, int maxAgeSec)
|
||||
{
|
||||
bool answ = false;
|
||||
answ = dbTabController.RicalcMse(idxMacchina, maxAgeSec);
|
||||
await FlushCache(Constants.redisMseKey);
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupera un valore MSE x una macchina sub specifica
|
||||
/// </summary>
|
||||
/// <param name="idxMacc"></param>
|
||||
/// <param name="idxMacchSub"></param>
|
||||
/// <param name="forceDb"></param>
|
||||
/// <returns></returns>
|
||||
public MappaStatoExpl MseGetSub(string idxMacc, string idxMacchSub, bool forceDb)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
MappaStatoExpl result = new MappaStatoExpl();
|
||||
// cerco in redis...
|
||||
string currKey = $"{Constants.redisMseKeySingle}:{idxMacchSub}";
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue && !forceDb)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<MappaStatoExpl>($"{rawData}");
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"Read from REDIS: {ts.TotalMilliseconds}ms");
|
||||
}
|
||||
else
|
||||
{
|
||||
var rawResult = dbTabController.MseGetSub(idxMacc, idxMacchSub);
|
||||
if (rawResult != null && rawResult.Count > 0)
|
||||
{
|
||||
result = rawResult.FirstOrDefault();
|
||||
}
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, UltraLongCache);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"Read from DB: {ts.TotalMilliseconds}ms");
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new MappaStatoExpl();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Processa registrazione di un counter x una data macchina IOB
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.INVE</RootNamespace>
|
||||
<Version>6.16.2310.308</Version>
|
||||
<Version>6.16.2311.1009</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOINVE </i>
|
||||
<h4>Versione: 6.16.2310.308</h4>
|
||||
<h4>Versione: 6.16.2311.1009</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2310.308
|
||||
6.16.2311.1009
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2310.308</version>
|
||||
<version>6.16.2311.1009</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Land</RootNamespace>
|
||||
<Version>6.16.2310.1615</Version>
|
||||
<Version>6.16.2311.1009</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo gestione Programmi MAPO</i>
|
||||
<h4>Versione: 6.16.2310.1615</h4>
|
||||
<h4>Versione: 6.16.2311.1009</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2310.1615
|
||||
6.16.2311.1009
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2310.1615</version>
|
||||
<version>6.16.2311.1009</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>6.16.2309.2613</Version>
|
||||
<Version>6.16.2311.1009</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MON MAPO</i>
|
||||
<h4>Versione: 6.16.2309.2613</h4>
|
||||
<h4>Versione: 6.16.2311.1009</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2309.2613
|
||||
6.16.2311.1009
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2309.2613</version>
|
||||
<version>6.16.2311.1009</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Prog</RootNamespace>
|
||||
<Version>6.16.2304.0419</Version>
|
||||
<Version>6.16.2311.1009</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo gestione Programmi MAPO</i>
|
||||
<h4>Versione: 6.16.2304.0419</h4>
|
||||
<h4>Versione: 6.16.2311.1009</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2306.0612
|
||||
6.16.2311.1009
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2304.0419</version>
|
||||
<version>6.16.2311.1009</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/MP.Prog.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.SPEC</RootNamespace>
|
||||
<Version>6.16.2310.2609</Version>
|
||||
<Version>6.16.2311.1016</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -85,6 +85,11 @@ namespace MP.SPEC.Pages
|
||||
currVal = (currStep - 1) * stepVal;
|
||||
nextVal = currStep * stepVal;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
// periodo: fix per imporre fine alla mezzanotte di oggi (= processo tutto ieri)
|
||||
if (CurrPeriodo.Fine > DateTime.Today)
|
||||
{
|
||||
CurrPeriodo.Fine = DateTime.Today;
|
||||
}
|
||||
// processo i flussi 1:1 x mandare update ad avanzamento
|
||||
await MDataServ.FluxLogDataRedux(idxMaccSel, new List<string> { item }, CurrPeriodo, ValMode, IntReq, NumItem);
|
||||
currStep++;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2310.2609</h4>
|
||||
<h4>Versione: 6.16.2311.1016</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2310.2609
|
||||
6.16.2311.1016
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2310.2609</version>
|
||||
<version>6.16.2311.1016</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Stats</RootNamespace>
|
||||
<UserSecretsId>826e877c-ba70-4253-84cb-d0b1cafd4440</UserSecretsId>
|
||||
<Version>6.16.2307.0515</Version>
|
||||
<Version>6.16.2307.0515</Version>
|
||||
<Version>6.16.2311.1009</Version>
|
||||
<Version>6.16.2311.1009</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo statistiche MAPO</i>
|
||||
<h4>Versione: 6.16.2307.0515</h4>
|
||||
<h4>Versione: 6.16.2311.1009</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2307.0515
|
||||
6.16.2311.1009
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2307.0515</version>
|
||||
<version>6.16.2311.1009</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/MP.Stats.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user