diff --git a/GWMS.UI/GWMS.UI.csproj b/GWMS.UI/GWMS.UI.csproj index b5021d6..a368d47 100644 --- a/GWMS.UI/GWMS.UI.csproj +++ b/GWMS.UI/GWMS.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.0.2111.2514 + 1.0.2111.2515 95c9f021-52d1-4390-a670-5810b7b777b0 true true diff --git a/GWMS.UI/Pages/GasStation.razor b/GWMS.UI/Pages/GasStation.razor index 3042242..39710ea 100644 --- a/GWMS.UI/Pages/GasStation.razor +++ b/GWMS.UI/Pages/GasStation.razor @@ -1,5 +1,4 @@ @page "/GasStation" -@page "/GasStation/{PlantCode}/{OrderCode}" @using Blazorise.Components @using GWMS.UI.Components diff --git a/GWMS.UI/Pages/GasStation.razor.cs b/GWMS.UI/Pages/GasStation.razor.cs index 6a02ee0..5aeda1e 100644 --- a/GWMS.UI/Pages/GasStation.razor.cs +++ b/GWMS.UI/Pages/GasStation.razor.cs @@ -68,33 +68,31 @@ namespace GWMS.UI.Pages #region Public Properties - public string BarcodeText { get; set; } = ""; - [Parameter] public string OrderCode { get { - return BarcodeText; + return MessageService.SelOrderCode; } set { - BarcodeText = $"{value}"; + MessageService.SelOrderCode = $"{value}"; } } - [Parameter] - public string PlantCode - { - get - { - return _plantCode; - } - set - { - _plantCode = $"{value}"; - } - } + //[Parameter] + //public string PlantCode + //{ + // get + // { + // return _plantCode; + // } + // set + // { + // _plantCode = $"{value}"; + // } + //} public int SelPlantId { @@ -133,9 +131,12 @@ namespace GWMS.UI.Pages private void forceReset() { - errorDescription = ""; - OrderCode = ""; - NavManager.NavigateTo("GasStation"); + InvokeAsync(() => + { + errorDescription = ""; + OrderCode = ""; + NavManager.NavigateTo("GasStation"); + }); } /// @@ -162,62 +163,80 @@ namespace GWMS.UI.Pages } } - protected bool isProcessing = false; + protected bool doProcess(string newVal) + { + bool answ = false; + // verifico se sia da processare il NUOVO valore (se != da precedente...) + answ = OrderCode != newVal; + return answ; + } + + protected DateTime vetoScan = DateTime.Now; private async Task LocalReceivedBarcodeText(BarcodeReceivedEventArgs args) { - // verifico ordine e stazione siano coerenti... + DateTime adesso = DateTime.Now; + // input string ordCode = args.BarcodeText; - if (!isProcessing) + // non nullo + if (!string.IsNullOrEmpty(ordCode)) { - isProcessing = true; - await InvokeAsync(() => + // non veto... + if (adesso.Subtract(vetoScan).TotalMinutes > 0) { - OrderCode = ordCode; - }); - var ordine = await DataService.OrderGetByCode(ordCode); - if (ordine != null) - { - if (ordine.DtExecEnd > ordine.DtOrder) + vetoScan = adesso.AddSeconds(4); + if (doProcess(ordCode)) { - errorDescription = "Errore: ordine già completato"; - await Task.Run(() => + await InvokeAsync(() => { - Thread.Sleep(3000); - forceReset(); + OrderCode = ordCode; }); - } - else if (ordine.PlantId != SelPlantId) - { - errorDescription = "Errore: ordine destinato ad altro impianto"; + var ordine = await DataService.OrderGetByCode(ordCode); + if (ordine != null) + { + if (ordine.DtExecEnd > ordine.DtOrder) + { + errorDescription = "Errore: ordine già completato"; + await Task.Run(() => + { + Thread.Sleep(3000); + forceReset(); + }); + } + else if (ordine.PlantId != SelPlantId) + { + errorDescription = "Errore: ordine destinato ad altro impianto"; - await Task.Run(() => + await Task.Run(() => + { + Thread.Sleep(3000); + forceReset(); + }); + } + else + { + // salvo... + MessageService.SelPlantId = $"{SelPlantId}"; + MessageService.SelOrderCode = args.BarcodeText; + // rimando a pagina con codice ordine.... + NavManager.NavigateTo($"GasStationLoad"); + //NavManager.NavigateTo($"GasStationLoad/{SelPlantId}/{args.BarcodeText}"); + } + } + else { - Thread.Sleep(3000); - forceReset(); - }); - } - else - { - // salvo... - MessageService.SelPlantId = $"{SelPlantId}"; - MessageService.SelOrderCode = args.BarcodeText; - // rimando a pagina con codice ordine.... - NavManager.NavigateTo($"GasStationLoad"); - //NavManager.NavigateTo($"GasStationLoad/{SelPlantId}/{args.BarcodeText}"); + errorDescription = "Errore: ordine non trovato"; + } } } - else - { - errorDescription = "Errore: ordine non trovato"; - } - isProcessing = false; } + // verifico ordine e stazione siano coerenti... } private async Task ReloadAllData() { isLoading = true; + OrderCode = ""; errorDescription = ""; PlantsList = null; await GetClaimsData(); diff --git a/GWMS.UI/Startup.cs b/GWMS.UI/Startup.cs index b37d07e..be0c8ac 100644 --- a/GWMS.UI/Startup.cs +++ b/GWMS.UI/Startup.cs @@ -132,7 +132,6 @@ namespace GWMS.UI string connStringRedis = Configuration.GetConnectionString("Redis"); string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":")); -#if FALSE // healthchecks services.AddHealthChecks() .AddMySql(connStringDB, "MySql instance") @@ -156,7 +155,6 @@ namespace GWMS.UI s.SetHeaderText("GWMS Health Check Status"); }) .AddInMemoryStorage(); -#endif // abilitazione x email management con MailKit services.AddTransient(); @@ -235,8 +233,8 @@ namespace GWMS.UI services.AddDatabaseDeveloperPageExceptionFilter(); services.AddSingleton(Configuration); //services.AddSingleton(); - services.AddTransient(); - //services.AddScoped(); + //services.AddTransient(); + services.AddScoped(); services.AddScoped(); } diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 07b0b69..41b3343 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GWMS - Gas Warehouse Management System -

Versione: 1.0.2111.2514

+

Versione: 1.0.2111.2515


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 5b5ed15..4f19d33 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.0.2111.2514 +1.0.2111.2515 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 18f6afa..f9a114e 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.0.2111.2514 + 1.0.2111.2515 http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html false