Merge branch 'Release/Tab3_FixOdl04'

This commit is contained in:
Samuele Locatelli
2024-01-05 11:53:22 +01:00
19 changed files with 257 additions and 265 deletions
+4 -5
View File
@@ -1,23 +1,22 @@
<div class="row bg-dark text-light px-2 small">
<div class="col-4 text-left text-nowrap pe-0">
<b>MP-TAB3 @(DateTime.Today.Year)</b> <span class="small" style="font-size:0.6rem;">v.@version</span>
<b>MP-TAB3 @(adesso.Year)</b> <span class="small" style="font-size:0.6rem;">v.@version</span>
</div>
<div class="col-4 d-flex flex-column justify-content-center">
@if (typeScadLogin > 0)
@if (TypeScadLogin > 0)
{
@if (CurrExpVal < 0)
{
<div class="text-danger">TIMER SCADUTO!</div>
<div class="alert alert-danger text-center p-0">TIMER SCADUTO!</div>
}
else
{
<ProgBar currVal="@CurrExpVal" maxVal="@MaxExpVal" singleLine="true" baseUM="m" yelLim="@yLimit" redLim="@rLimit"></ProgBar>
}
}
</div>
<div class="col-4 text-end d-flex align-items-center justify-content-end">
<span class="small">@($"{DateTime.Now:HH:mm:ss}")</span> | <a class="text-light text-decoration-none" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="images/LogoEgw.png" /> Egalware </a>
<span class="small">@($"{adesso:HH:mm:ss}")</span> | <a class="text-light text-decoration-none" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="images/LogoEgw.png" /> Egalware </a>
</div>
</div>
+83 -76
View File
@@ -6,6 +6,16 @@ namespace MP_TAB3.Components
{
public partial class CmpFooter : IDisposable
{
#region Public Properties
[Parameter]
public int DtScadLogin { get; set; } = 0;
[Parameter]
public int TypeScadLogin { get; set; } = -1;
#endregion Public Properties
#region Public Methods
public void Dispose()
@@ -18,12 +28,79 @@ namespace MP_TAB3.Components
}
}
public double CurrExpVal { get; set; } = 50;
public double MaxExpVal { get; set; } = 100;
public double yLimit { get; set; } = 30;
public double rLimit { get; set; } = 10;
#endregion Public Methods
public string timeUm
#region Protected Properties
[Inject]
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
if (TypeScadLogin > 0)
{
var diffOfTime = DateTime.Now.Subtract(MsgServ.dtLastAction);
CurrExpVal = MaxExpVal - diffOfTime.TotalMinutes;
}
else
{
}
adesso = DateTime.Now;
await InvokeAsync(() => StateHasChanged());
});
pUpd.Wait();
}
protected override void OnParametersSet()
{
var rawVers = typeof(Program).Assembly.GetName().Version;
version = rawVers != null ? rawVers : new Version("0.0.0.0");
DtScadLogin = SMServ.GetConfInt("TAB_dtTimerScadLogin");
MaxExpVal = DtScadLogin;
yLimit = MaxExpVal * 0.3;
rLimit = MaxExpVal * 0.1;
StartTimer();
}
protected void StartTimer()
{
int tOutPeriod = 1000;
aTimer = new System.Timers.Timer(tOutPeriod);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
aTimer.Start();
}
#endregion Protected Methods
#region Private Fields
private DateTime adesso = DateTime.Now;
private System.Timers.Timer aTimer = null!;
private Version version = null!;
#endregion Private Fields
#region Private Properties
private double CurrExpVal { get; set; } = 50;
private double MaxExpVal { get; set; } = 100;
private double rLimit { get; set; } = 10;
private string timeUm
{
get
{
@@ -40,77 +117,7 @@ namespace MP_TAB3.Components
}
}
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
if (typeScadLogin > 0)
{
var diffOfTime = DateTime.Now.Subtract(MsgServ.dtLastAction);
CurrExpVal = MaxExpVal - diffOfTime.TotalMinutes;
}
await InvokeAsync(() => StateHasChanged());
});
pUpd.Wait();
}
public void StartTimer()
{
int tOutPeriod = 1000;
aTimer = new System.Timers.Timer(tOutPeriod);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
aTimer.Start();
}
#endregion Public Methods
#region Protected Properties
protected int dtScadLogin { get; set; } = 0;
[Inject]
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected int typeScadLogin { get; set; } = 0;
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
var rawVers = typeof(Program).Assembly.GetName().Version;
version = rawVers != null ? rawVers : new Version("0.0.0.0");
typeScadLogin = SMServ.GetConfInt("TAB_TypeScadLogin");
dtScadLogin = SMServ.GetConfInt("TAB_dtTimerScadLogin");
MaxExpVal = dtScadLogin;
yLimit = MaxExpVal * 0.3;
rLimit = MaxExpVal * 0.1;
StartTimer();
}
#endregion Protected Methods
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private System.Timers.Timer aTimer = null!;
private Version version = null!;
#endregion Private Fields
#region Private Properties
private int dtTimerScadenzaLogin { get; set; } = 0;
private double yLimit { get; set; } = 30;
#endregion Private Properties
}
+9 -5
View File
@@ -35,7 +35,8 @@ namespace MP_TAB3.Components
protected string CurrOprTknRedis { get; set; } = null!;
protected int expLoginType { get; set; } = 0;
[Parameter]
public int TypeScadLogin { get; set; } = -1;
protected bool HideMenu
{
@@ -67,7 +68,7 @@ namespace MP_TAB3.Components
protected async Task RefreshLogIn(string decodValue)
{
bool done = false;
if (expLoginType == 0)
if (TypeScadLogin <= 0)
{
done = await MsgServ.DoLogIn(decodValue, false);
}
@@ -97,11 +98,13 @@ namespace MP_TAB3.Components
await InvokeAsync(StateHasChanged);
var currToken = await MsgServ.GetCurrOperDtoLSAsync();
var lastOpr = await MsgServ.GetLastMatrOprAsync();
var devGuid = await MsgServ.GetCurrDevGuidLSAsync();
// reset cache varie
await MsgServ.ClearLocalStor();
await MsgServ.ClearSessionStor();
await MDataService.FlushCache();
// salvo di nuovo opr
// salvo di nuovo opr + GUID
await MsgServ.SetCurrDevGuidLSAsync(devGuid);
await MsgServ.SetLastMatrOprAsync(lastOpr);
await MsgServ.SetCurrOperDtoLSAsync(currToken);
// reload MStor
@@ -132,10 +135,11 @@ namespace MP_TAB3.Components
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
expLoginType = SMServ.GetConfInt("TAB_TypeScadLogin");
#if false
TypeScadLogin = SMServ.GetConfInt("TAB_TypeScadLogin");
#endif
var CurrDevGuid = await MsgServ.GetCurrDevGuidLSAsync();
//if (string.IsNullOrEmpty(CurrDevGuid.ToString()))
if (CurrDevGuid == Guid.Empty)
{
CurrDevGuid = Guid.NewGuid();
+1
View File
@@ -2,6 +2,7 @@
<div class="row">
<div class="col-12">
<MachSel RecMSE="RecMSE" E_MachSel="SetMacc"></MachSel>
<ShowProcessing IsProcessing="@isProcessing"></ShowProcessing>
</div>
@if (isProcessing)
{
+35 -75
View File
@@ -28,10 +28,6 @@ namespace MP_TAB3.Components
#endregion Public Properties
#if false
protected PzProdModel? prodMacchina = null;
#endif
#region Protected Properties
/// <summary>
@@ -688,7 +684,7 @@ namespace MP_TAB3.Components
await InvokeAsync(StateHasChanged);
}
protected override async Task OnInitializedAsync()
protected override void OnInitialized()
{
//baseLang = SMServ.GetConf("baseLang");
numDayOdl = SMServ.GetConfInt("numDaySelOdl");
@@ -708,6 +704,9 @@ namespace MP_TAB3.Components
gPeriodReopenOdlTav = SMServ.GetConfInt("gPeriodReopenOdlTav");
string rawEmailDest = SMServ.GetConf("_adminEmail");
emailAdmDest = rawEmailDest.Split(',').ToList();
}
protected override async Task OnParametersSetAsync()
{
if (RecMSE != null)
{
if (string.IsNullOrEmpty(IdxMaccSel))
@@ -724,11 +723,11 @@ namespace MP_TAB3.Components
}
}
IdxMaccParent = getIdxMaccParent();
// verifica stato inAttr
await CheckAttr();
await ReloadData(true);
}
checkAll();
// verifica stato inAttr
await CheckAttr();
await ReloadData(true);
}
protected async Task ProdEnd()
@@ -965,19 +964,6 @@ namespace MP_TAB3.Components
{
showSplitOdlRiattr = !showSplitOdlRiattr;
await ReloadXDL(true);
#if false
if (tcRichAttr == 0)
{
tcRichAttr = currPodl.Tcassegnato;
}
if (string.IsNullOrEmpty(noteAttr))
{
noteAttr = currOdl.Note;
}
PzPallet = currOdl.PzPallet;
#endif
}
protected async Task SplitOdl()
@@ -1016,8 +1002,6 @@ namespace MP_TAB3.Components
}
await advStep(currStep++);
// invio email!
await advStep(currStep++);
// processo chiusura setup
string evText = "Registrato Riattrezzaggio ODL (old :{0})";
StringBuilder sb = new StringBuilder();
@@ -1035,6 +1019,8 @@ namespace MP_TAB3.Components
await RefreshData();
await CheckAttr();
await advStep(currStep++);
showSplitOdlRiattr = false;
await ReloadXDL(true);
// chiudo update...
isProcessing = false;
await InvokeAsync(StateHasChanged);
@@ -1101,6 +1087,7 @@ namespace MP_TAB3.Components
private bool isMulti = false;
private bool isProcessing = false;
private bool isLoading = false;
private bool isSlave = false;
@@ -1149,12 +1136,9 @@ namespace MP_TAB3.Components
{
get => IdxPOdlSel > 0 ? "bg-info text-light" : "bg-warning";
}
private string txtShowXDL
{
get => showPOdlData ? "PODL" : "ODL";
}
private ODLExpModel currOdl { get; set; } = new ODLExpModel();
private PODLExpModel currPodl { get; set; } = new PODLExpModel();
/// <summary>
@@ -1187,41 +1171,11 @@ namespace MP_TAB3.Components
/// Valore calcolato key ODL corrente...
/// </summary>
private int IdxOdl { get; set; } = 0;
#if false
{
get
{
int answ = 0;
var pUpd = Task.Run(async () =>
{
var tabOdl = await TabDServ.OdlCurrByMacc(IdxMaccSel, false);
answ = tabOdl.IdxOdl;
});
pUpd.Wait();
return answ;
}
}
#endif
/// <summary>
/// Valore calcolato key ODL altra tavola attivo...
/// </summary>
private int IdxOdlAltra { get; set; } = 0;
#if false
{
get
{
int answ = 0;
var pUpd = Task.Run(async () =>
{
var tabOdl = await TabDServ.OdlCurrByMacc(idxMaccAltraTav, false);
answ = tabOdl.IdxOdl;
});
pUpd.Wait();
return answ;
}
}
#endif
private string lblWarnBody
{
@@ -1348,6 +1302,11 @@ namespace MP_TAB3.Components
get => forceCloseOdl ? Traduci("ForceCloseODL") : Traduci("SplitCurrODL");
}
private string txtShowXDL
{
get => showPOdlData ? "PODL" : "ODL";
}
#endregion Private Properties
#region Private Methods
@@ -1479,6 +1438,19 @@ namespace MP_TAB3.Components
}
}
private void fixTcNotePzPallet()
{
if (tcRichAttr == 0)
{
tcRichAttr = IdxPOdlSel == 0 ? currOdl.Tcassegnato : currPodl.Tcassegnato;
}
if (string.IsNullOrEmpty(noteAttr))
{
noteAttr = IdxPOdlSel == 0 ? currOdl.Note : currPodl.Note;
}
PzPallet = IdxPOdlSel == 0 ? currOdl.PzPallet : currPodl.PzPallet;
}
/// <summary>
/// processa evento richiesto
/// </summary>
@@ -1530,7 +1502,8 @@ namespace MP_TAB3.Components
private async Task ReloadData(bool forceReload)
{
Log.Trace("OdlMan.ReloadData");
isLoading = true;
Log.Trace("OdlMan.ReloadData 01");
if (forceReload)
{
isMaster = SMServ.ListM2S
@@ -1551,17 +1524,15 @@ namespace MP_TAB3.Components
{
ListODL = ListODLAll.Where(x => x.label.Contains(SearchPodl, StringComparison.InvariantCultureIgnoreCase) || x.value == 0).ToList();
}
Log.Trace($"found {ListODL.Count} rec");
Log.Trace($"OdlMan.ReloadData | found {ListODL.Count} rec");
if (forceReload)
{
if (!isMulti || (isMulti && IdxMaccSel.IndexOf("#") > 0))
{
var rawData = await TabDServ.PezziProdMacchina(IdxMaccSel);
datiProdAct = await TabDServ.StatoProdMacchina(IdxMaccSel, DateTime.Now);
#if false
prodMacchina = rawData.FirstOrDefault() ?? new PzProdModel();
#endif
checkConfProd();
Log.Trace("OdlMan.ReloadData | check checkConfProd done");
}
}
await updateIdxOdl();
@@ -1583,6 +1554,8 @@ namespace MP_TAB3.Components
}
}
}
isLoading = false;
Log.Trace("OdlMan.ReloadData | END");
}
private async Task ReloadPOdlDetailData()
@@ -1650,19 +1623,6 @@ namespace MP_TAB3.Components
}
}
private void fixTcNotePzPallet()
{
if (tcRichAttr == 0)
{
tcRichAttr = IdxPOdlSel == 0 ? currOdl.Tcassegnato : currPodl.Tcassegnato;
}
if (string.IsNullOrEmpty(noteAttr))
{
noteAttr = IdxPOdlSel == 0 ? currOdl.Note : currPodl.Note;
}
PzPallet = IdxPOdlSel == 0 ? currOdl.PzPallet : currPodl.PzPallet;
}
#endregion Private Methods
}
}
+10 -14
View File
@@ -29,14 +29,6 @@ namespace MP_TAB3.Components
[Parameter]
public EventCallback<List<MappaStatoExpl>> E_Updated { get; set; }
/// <summary>
/// Verifica ODL OK (ovvero caricato x macchina...)
/// </summary>
public bool odlOk
{
get => (RecMSE != null && RecMSE.IdxOdl > 0);
}
[Parameter]
public MappaStatoExpl? RecMSE
{
@@ -51,8 +43,6 @@ namespace MP_TAB3.Components
}
}
private MappaStatoExpl? currRecMSE { get; set; } = null;
#endregion Public Properties
#region Protected Properties
@@ -133,6 +123,14 @@ namespace MP_TAB3.Components
protected int numPzScarto2Rec { get; set; } = 0;
/// <summary>
/// Verifica ODL OK (ovvero caricato x macchina...)
/// </summary>
protected bool odlOk
{
get => (RecMSE != null && RecMSE.IdxOdl > 0);
}
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
@@ -269,17 +267,17 @@ namespace MP_TAB3.Components
private bool chkPzBuoniNeg = false;
private bool confRett = false;
private bool enableMagPrint = false;
private bool enablePzProdLasciati = false;
private string lblOut = "";
private int modoConfProd = 0;
#endregion Private Fields
#region Private Properties
private bool confProdActive { get; set; } = false;
private MappaStatoExpl? currRecMSE { get; set; } = null;
private DateTime dtReqUpdate { get; set; } = DateTime.Now;
private string IdxMaccSel { get; set; } = "";
@@ -295,8 +293,6 @@ namespace MP_TAB3.Components
private bool showConfirm { get; set; } = true;
private bool confProdActive { get; set; } = false;
#endregion Private Properties
#region Private Methods
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2401.417</Version>
<Version>6.16.2401.511</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB3</RootNamespace>
</PropertyGroup>
+3 -3
View File
@@ -39,9 +39,9 @@ namespace MP_TAB3.Pages
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
await localStorage.SetItemAsync("currTkn", "");
await localStorage.SetItemAsync("CurrMach", "");
await localStorage.SetItemAsync("LastPage", "");
await MsgServ.SetCurrOperDtoLSAsync("");
await MsgServ.IdxMaccSet("");
await MsgServ.LastOpenedPageSet("");
var CurrOprTknLS = await MsgServ.GetCurrOperDtoLSAsync();
var CurrDevGuid = await MsgServ.GetCurrDevGuidLSAsync();
if (!string.IsNullOrEmpty(CurrOprTknLS))
-1
View File
@@ -1,6 +1,5 @@
@page "/machine-detail"
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
+9 -10
View File
@@ -49,7 +49,6 @@ namespace MP_TAB3.Pages
await RefreshMBlock();
}
}
//await InvokeAsync(StateHasChanged);
}
protected async Task RefreshMBlock()
@@ -105,22 +104,22 @@ namespace MP_TAB3.Pages
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
try
{
try
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
catch (Exception exc)
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
Log.Error($"Eccezione in ReloadData{Environment.NewLine}{exc}");
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in ReloadData{Environment.NewLine}{exc}");
}
// recupero parametri configurazione...
await setupConf();
}
+16 -7
View File
@@ -1,6 +1,7 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using NLog;
namespace MP_TAB3.Pages
{
@@ -38,7 +39,6 @@ namespace MP_TAB3.Pages
await RefreshMBlock();
}
}
await InvokeAsync(StateHasChanged);
}
protected async Task RefreshMBlock()
@@ -59,6 +59,7 @@ namespace MP_TAB3.Pages
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private string IdxMaccSubSel = "";
#endregion Private Fields
@@ -67,15 +68,23 @@ namespace MP_TAB3.Pages
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
try
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in ReloadData{Environment.NewLine}{exc}");
}
}
#endregion Private Methods
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2401.417</h4>
<h4>Versione: 6.16.2401.511</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2401.417
6.16.2401.511
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2401.417</version>
<version>6.16.2401.511</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+2 -2
View File
@@ -6,7 +6,7 @@
<div class="page" @onclick="()=>handleBodyClick()">
<main>
<CmpTop CurrMenuItems="@CurrMenuItems" EA_UserIsOk="checkIfUserOk"></CmpTop>
<CmpTop TypeScadLogin="@typeScadLogin" CurrMenuItems="@CurrMenuItems" EA_UserIsOk="checkIfUserOk"></CmpTop>
@if (userIsOk || NavMan.Uri.Contains("reg-new-device"))
{
<article class="content pt-1 d-flex mb-5">
@@ -24,5 +24,5 @@
</main>
</div>
<div class="fixed-bottom">
<CmpFooter></CmpFooter>
<CmpFooter TypeScadLogin="@typeScadLogin" DtScadLogin="@dtScadLogin"></CmpFooter>
</div>
+71 -57
View File
@@ -27,6 +27,13 @@ namespace MP_TAB3.Shared
#region Protected Properties
protected string bodyType
{
get => pageOk ? "mainBodyNoSide" : "mainBody";
}
protected Guid currDevGuid { get; set; } = new Guid();
/// <summary>
/// Livello corrente del menu
/// </summary>
@@ -37,11 +44,19 @@ namespace MP_TAB3.Shared
/// </summary>
protected List<LinkMenu> CurrMenuItems { get; set; } = new List<LinkMenu>();
/// <summary>
/// Scadenza del login
/// </summary>
protected int dtScadLogin { get; set; } = 0;
protected bool HideMenu
{
get => NavMan.Uri.Contains("reg-new-device");
}
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected ListSelectDataSrv MDataService { get; set; } = null!;
@@ -54,21 +69,6 @@ namespace MP_TAB3.Shared
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
[Inject]
protected TabDataService TDataService { get; set; } = null!;
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected string bodyType
{
get => pageOk ? "mainBodyNoSide" : "mainBody";
}
protected bool pageOk
{
get
@@ -78,23 +78,19 @@ namespace MP_TAB3.Shared
}
}
[Inject]
protected TabDataService TDataService { get; set; } = null!;
protected async Task handleBodyClick()
{
await Task.Delay(1);
if (!pageOk)
{
await checkDtDiff2Logout();
}
/// <summary>
/// Tipo scadenza login Postoa -1 di default così da NON avere problemi in caso di setuop errato...
/// </summary>
protected int typeScadLogin { get; set; } = -1;
}
private int MatrOpr
{
get => MsgServ.MatrOpr;
}
protected int typeScadLogin { get; set; } = 0;
protected int dtScadLogin { get; set; } = 0;
protected Guid currDevGuid { get; set; } = new Guid();
protected bool userIsOk { get; set; } = false;
#endregion Protected Properties
#region Protected Methods
protected async Task checkDtDiff2Logout()
{
@@ -102,14 +98,8 @@ namespace MP_TAB3.Shared
TimeSpan tsDeltaSave = DateTime.Now.Subtract(MsgServ.dtLastSave);
switch (typeScadLogin)
{
case 0:
if (tsDeltaAct.Minutes >= dtScadLogin)
{
NavMan.NavigateTo("logout");
}
break;
case 1:
if (tsDeltaAct.Minutes >= dtScadLogin)
if (tsDeltaAct.TotalMinutes >= dtScadLogin)
{
var userTkn = await TDataService.OperatoreGetRedis(MatrOpr, currDevGuid);
if (!string.IsNullOrEmpty(userTkn))
@@ -138,6 +128,35 @@ namespace MP_TAB3.Shared
}
}
break;
case 2:
if (tsDeltaAct.TotalMinutes >= dtScadLogin)
{
NavMan.NavigateTo("logout");
}
break;
case 0:
case -1:
await ReloadMemStor();
typeScadLogin = MStor.GetConfInt("TAB_TypeScadLogin");
dtScadLogin = MStor.GetConfInt("TAB_dtTimerScadLogin");
break;
}
}
protected async Task checkIfUserOk(bool isOk)
{
await Task.Delay(1);
userIsOk = isOk;
}
protected async Task handleBodyClick()
{
await Task.Delay(1);
if (!pageOk)
{
await checkDtDiff2Logout();
}
}
@@ -147,33 +166,27 @@ namespace MP_TAB3.Shared
/// <returns></returns>
protected override async Task OnInitializedAsync()
{
typeScadLogin = MStor.GetConfInt("TAB_TypeScadLogin");
dtScadLogin = MStor.GetConfInt("TAB_dtTimerScadLogin");
NavMan.LocationChanged += HandleLocationChanged;
currDevGuid = await MsgServ.GetCurrDevGuidLSAsync();
// verifica preliminare setup mdati
if (!MStor.MenuOk)
{
await ReloadMemStor();
}
// leggo resto della configurazione
typeScadLogin = MStor.GetConfInt("TAB_TypeScadLogin");
dtScadLogin = MStor.GetConfInt("TAB_dtTimerScadLogin");
CurrLevel = MStor.PageLevel(NavMan.Uri);
// recupero men
// recupero menu corrente
if (MStor.DictMenu.ContainsKey(CurrLevel))
{
CurrMenuItems = MStor.DictMenu[CurrLevel];
}
await Task.Delay(1);
}
protected bool userIsOk { get; set; } = false;
protected async Task checkIfUserOk(bool isOk)
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await Task.Delay(1);
userIsOk = isOk;
currDevGuid = await MsgServ.GetCurrDevGuidLSAsync();
}
protected async Task ReloadMemStor()
@@ -199,9 +212,6 @@ namespace MP_TAB3.Shared
// fix elenco stati
var allStati = await TDataService.AnaStatiGetAll();
MStor.SetStati(allStati);
// non da farsi globalmente // fix macchine var allMach = await
// MDataService.MacchineByMatrOper(0); MStor.DictMacchine = allMach.ToDictionary(x =>
// x.IdxMacchina, x => $"{x.IdxMacchina} | {x.Nome}");
// fix vocabolario
var allVoc = TDataService.VocabolarioGetAll();
@@ -221,6 +231,15 @@ namespace MP_TAB3.Shared
#endregion Private Fields
#region Private Properties
private int MatrOpr
{
get => MsgServ.MatrOpr;
}
#endregion Private Properties
#region Private Methods
private void HandleLocationChanged(object? sender, LocationChangedEventArgs e)
@@ -235,11 +254,6 @@ namespace MP_TAB3.Shared
}
}
private void OnYes()
{
Console.WriteLine($"{DateTime.Now} | 'Yes' button selected.");
}
#endregion Private Methods
}
}
+2 -1
View File
@@ -1343,9 +1343,10 @@ namespace MP.Data.Controllers
var PzPallet = new SqlParameter("@PzPallet", pzPallet);
var Note = new SqlParameter("@Note", note);
var DtEvento = new SqlParameter("@dtEvento", dtEvent);
var FlagNoteAppend = new SqlParameter("@FlgNoteAppend", false);
var callResult = dbCtx
.Database
.ExecuteSqlRaw("EXEC stp_ODL_inizioSetupPromessa @idxPromessa, @MatrOpr, @IdxMacchina, @TCRichAttr, @PzPallet, @Note, @dtEvento", IdxPromessa, MatrOpr, IdxMacchina, TCRichAttr, PzPallet, Note, DtEvento);
.ExecuteSqlRaw("EXEC stp_ODL_inizioSetupPromessa @idxPromessa, @MatrOpr, @IdxMacchina, @TCRichAttr, @PzPallet, @Note, @dtEvento, @FlgNoteAppend", IdxPromessa, MatrOpr, IdxMacchina, TCRichAttr, PzPallet, Note, DtEvento, FlagNoteAppend);
answ = true;
}
+8 -4
View File
@@ -262,6 +262,8 @@ namespace MP.Data.Services
var rigaOpr = await TDService.OperatoreSearch(opData.currOpr.MatrOpr, opData.currOpr.authKey);
if (rigaOpr != null)
{
await SetLastMatrOprAsync(rigaOpr.MatrOpr);
userTknDTO newUserTkn = new userTknDTO()
{
currOpr = rigaOpr,
@@ -271,8 +273,10 @@ namespace MP.Data.Services
var jsonTkn = JsonConvert.SerializeObject(newUserTkn);
string hash = TDService.EncryptData(jsonTkn);
RigaOper = rigaOpr;
await SetLastMatrOprAsync(rigaOpr.MatrOpr);
await SetCurrOperDtoLSAsync(hash);
if (!hash.Equals(decodValue))
{
await SetCurrOperDtoLSAsync(hash);
}
if (saveOpr)
{
await TDService.OperatoreSetRedis(rigaOpr.MatrOpr, hash, devGuid);
@@ -370,8 +374,8 @@ namespace MP.Data.Services
public async Task<MappaStatoExpl?> GetMachineMse(string idxMacchina)
{
MappaStatoExpl answ = null;
string rawData = await localStorage.GetItemAsync<string>(machineMse(idxMacchina));
if (rawData != "")
var rawData = await localStorage.GetItemAsync<string>(machineMse(idxMacchina));
if (!string.IsNullOrEmpty(rawData))
{
answ = JsonConvert.DeserializeObject<MappaStatoExpl>(rawData);
}
-1
View File
@@ -1715,7 +1715,6 @@ namespace MP.Data.Services
// cerco in redis...
string currKey = $"{redisBaseKey}:PzProd:{idxMacchina}";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
//if (!string.IsNullOrEmpty($"{rawData}"))
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<PzProdModel>>($"{rawData}");