diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor
index 1c031d67..3abd6733 100644
--- a/MP.SPEC/Components/ListODL.razor
+++ b/MP.SPEC/Components/ListODL.razor
@@ -1,6 +1,4 @@
-@using MP.SPEC.Components
-@using MP.SPEC.Data
-
+
@if (ListRecords == null)
{
@@ -17,7 +15,7 @@ else
@if (enableForceSync)
{
-
+
}
else
{
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs
index d22bbe3a..4dcef85e 100644
--- a/MP.SPEC/Components/ListODL.razor.cs
+++ b/MP.SPEC/Components/ListODL.razor.cs
@@ -1,10 +1,13 @@
using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.DataProtection;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
+using MP.SPEC.Components;
using MP.SPEC.Data;
using MP.SPEC.Services;
using NLog;
+
namespace MP.SPEC.Components
{
public partial class ListODL : IDisposable
@@ -96,29 +99,45 @@ namespace MP.SPEC.Components
// effettua chiusura sul DB
await MDService.ODLClose(currRecord.IdxOdl, currRecord.IdxMacchina, 0, true);
Log.Info($"Effettuata chiusura ODL {currRecord.IdxOdl}");
+
+ // RESETTO task x setComm, setArt, SetPzComm
+ await MpIoApiCall.addTask2Exe(currRecord.IdxMacchina, "setArt", "");
+ await MpIoApiCall.addTask2Exe(currRecord.IdxMacchina, "setComm", "");
+ await MpIoApiCall.addTask2Exe(currRecord.IdxMacchina, "setPzComm","");
+
+ // richiesto anche sync DB
+ await MpIoApiCall.callSyncDb(currRecord.IdxMacchina);
+
// ricarica...
await selRecord(null);
}
- await reloadData();
+ await ReloadData();
}
///
/// Richiesta invio sync all'IOB-WIN
///
///
- protected async Task forceSyncDb()
+ protected async Task ForceSyncDb()
{
if (!await JSRuntime.InvokeAsync
("confirm", "Sei sicuro di voler (re)inviare i dati (Articoli, PODL) all'impianto?"))
return;
if (currRecord != null)
{
- await callSyncDb(currRecord.IdxMacchina);
- Log.Info($"Richiesto forceSyncDb per idxMacc {currRecord.IdxMacchina}");
+ // imposto task x setComm, setArt, SetPzComm
+ await MpIoApiCall.addTask2Exe(currRecord.IdxMacchina, "setArt", currRecord.CodArticolo);
+ await MpIoApiCall.addTask2Exe(currRecord.IdxMacchina, "setComm", $"ODL{currRecord.IdxOdl:00000000}");
+ await MpIoApiCall.addTask2Exe(currRecord.IdxMacchina, "setPzComm", $"{currRecord.NumPezzi}");
+
+ // richiesto anche sync DB
+ await MpIoApiCall.callSyncDb(currRecord.IdxMacchina);
+
+ Log.Info($"Richiesto ForceSyncDb per idxMacc {currRecord.IdxMacchina}");
// ricarica...
await selRecord(null);
}
- await reloadData();
+ await ReloadData();
}
protected int getPodl(int idxOdl)
@@ -180,23 +199,13 @@ namespace MP.SPEC.Components
protected override async Task OnParametersSetAsync()
{
- await reloadData();
- }
-
- protected async void OnSeachUpdated()
- {
- await InvokeAsync(() =>
- {
- PagerResetReq.InvokeAsync(true);
- Task task = UpdateData();
- StateHasChanged();
- });
+ await ReloadData();
}
protected async Task resetSel()
{
await selRecord(null);
- await reloadData();
+ await ReloadData();
}
protected async Task selBrowseRecord(ODLExpModel? currRec)
@@ -239,7 +248,7 @@ namespace MP.SPEC.Components
protected async Task UpdateData()
{
await selRecord(null);
- await reloadData();
+ await ReloadData();
}
#endregion Protected Methods
@@ -316,44 +325,16 @@ namespace MP.SPEC.Components
#region Private Methods
- ///
- /// Chiama metodo x chiedere sync DB
- ///
- ///
- ///
- private async Task addTask2Exe(string idxMacc, string taskName, string taskVal)
- {
- // compongo URL e chiamo
- string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName={taskName}&taskVal={taskVal}";
- try
- {
- var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
- }
- catch (Exception exc)
- {
- Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
- }
- }
-
- ///
- /// Chiama metodo x chiedere sync DB
- ///
- ///
- ///
- private async Task callSyncDb(string IdxMacc)
- {
- // chiamo aggiunta task SyncDb...
- await addTask2Exe(IdxMacc, "syncDbData", "");
- }
-
- private async Task reloadData()
+ private async Task ReloadData()
{
isLoading = true;
SearchRecords = await MDService.OdlListGetFilt(currFilter.IsActive, currFilter.SearchVal, currFilter.CodFase, currFilter.CodReparto, currFilter.IdxMacchina, currFilter.DtStart, currFilter.DtEnd);
totalCount = SearchRecords.Count;
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
- await InvokeAsync(() => StateHasChanged());
+#if false
+ await InvokeAsync(StateHasChanged);
+#endif
isLoading = false;
}
diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs
index 967d30cd..64ed599f 100644
--- a/MP.SPEC/Components/ListPODL.razor.cs
+++ b/MP.SPEC/Components/ListPODL.razor.cs
@@ -261,6 +261,10 @@ namespace MP.SPEC.Components
evMess = $"Registrata inizio Produzione | PODL {selRec.IdxPromessa} | ODL {newOdl.IdxOdl} | ART {newOdl.CodArticolo}";
processaEvento(selRec.IdxMacchina, idxEvento, evMess, newOdl.IdxOdl, newOdl.CodArticolo);
+ // imposto task x setComm, setArt, SetPzComm
+ await callTask2Exe(selRec.IdxMacchina, "setArt", newOdl.CodArticolo);
+ await callTask2Exe(selRec.IdxMacchina, "setComm", $"ODL{newOdl.IdxOdl:00000000}");
+ await callTask2Exe(selRec.IdxMacchina, "setPzComm", $"{newOdl.NumPezzi}");
// chiamo task x IOB
await callForceUpdate(selRec.IdxMacchina);
await Task.Delay(1);
@@ -271,6 +275,10 @@ namespace MP.SPEC.Components
// svuoto memorie pagina...
await MDService.FlushRedisCache();
+ // svuoto cache MpIoNsCache
+ await MDService.FlushMpIoOdlCache();
+
+ // ricarico pagina!
NavManager.NavigateTo(NavManager.Uri, true);
}
}
@@ -470,6 +478,19 @@ namespace MP.SPEC.Components
await addTask2Exe(IdxMacc, "syncDbData", "");
}
+ ///
+ /// Chiama metodo x chiedere registrazione di un Task2Exe a MP-IO
+ ///
+ /// IdxMacchina interessata
+ /// Richiesta da impostare
+ /// Valore da impostare
+ ///
+ private async Task callTask2Exe(string IdxMacc, string KeyReq, string ValReq)
+ {
+ // chiamo aggiunta task SyncDb...
+ await addTask2Exe(IdxMacc, KeyReq, ValReq);
+ }
+
///
/// verifica se sia avviabile ODL x macchina
///
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index f6aa8374..6a1fed52 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -1764,6 +1764,21 @@ namespace MP.SPEC.Data
return answ;
}
+ ///
+ /// Flush cache relativa a MP-IO x dati ODL
+ ///
+ ///
+ public async Task FlushMpIoOdlCache()
+ {
+ // svuoto dalla cache REDIS del server IO...
+ bool ok01 = await ResetIoCache("CurrODL");
+ bool ok02 = await ResetIoCache("CurrOdlRow");
+ bool ok03 = await ResetIoCache("CurrStatoMacc");
+ bool ok04 = await ResetIoCache("DtMac");
+ return ok01 && ok02 && ok03 && ok04;
+ }
+
+
///
/// Statistiche ODL calcolate (da stored stp_STAT_ODL)
///
diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj
index 636649b0..9ca733d1 100644
--- a/MP.SPEC/MP.SPEC.csproj
+++ b/MP.SPEC/MP.SPEC.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.SPEC
- 6.16.2410.3111
+ 6.16.2411.210
1800a78a-6ff1-40f9-b490-87fb8bfc1394
diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html
index a830d833..cb74ba2c 100644
--- a/MP.SPEC/Resources/ChangeLog.html
+++ b/MP.SPEC/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MAPOSPEC
- Versione: 6.16.2410.3111
+ Versione: 6.16.2411.210
Note di rilascio:
-
diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt
index 0ea27289..76cded98 100644
--- a/MP.SPEC/Resources/VersNum.txt
+++ b/MP.SPEC/Resources/VersNum.txt
@@ -1 +1 @@
-6.16.2410.3111
+6.16.2411.210
diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml
index 791a23fd..113283da 100644
--- a/MP.SPEC/Resources/manifest.xml
+++ b/MP.SPEC/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.16.2410.3111
+ 6.16.2411.210
https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip
https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html
false
diff --git a/MP.SPEC/Services/IOApiService.cs b/MP.SPEC/Services/IOApiService.cs
index 58a29039..05f70c25 100644
--- a/MP.SPEC/Services/IOApiService.cs
+++ b/MP.SPEC/Services/IOApiService.cs
@@ -7,22 +7,12 @@ namespace MP.SPEC.Services
{
///
/// Classe per chiamare metodi da MP-IO
- ///
- /// rif:
- /// https://www.ezzylearning.net/tutorial/making-http-requests-in-blazor-server-apps
- /// https://wellsb.com/csharp/aspnet/blazor-httpclientfactory-and-web-api/
+ ///
+ /// rif: https://www.ezzylearning.net/tutorial/making-http-requests-in-blazor-server-apps https://wellsb.com/csharp/aspnet/blazor-httpclientfactory-and-web-api/
///
public class IOApiService
{
- private readonly IHttpClientFactory _clientFactory;
- private static ILogger _logger = null!;
- private static IConfiguration _configuration = null!;
-
-
-
- private static Logger Log = LogManager.GetCurrentClassLogger();
-
- private static string MpIoBaseUrl = "";
+ #region Public Constructors
public IOApiService(IHttpClientFactory clientFactory, IConfiguration configuration, ILogger logger)
{
@@ -33,6 +23,40 @@ namespace MP.SPEC.Services
// conf url x chiamate REST
MpIoBaseUrl = _configuration.GetValue("ServerConf:MpIoBaseUrl");
}
+
+ #endregion Public Constructors
+
+ #region Public Methods
+
+ ///
+ /// Chiama metodo x registrare esecuzione task da IOB
+ ///
+ ///
+ ///
+ public async Task addTask2Exe(string idxMacc, string taskName, string taskVal)
+ {
+ // compongo URL e chiamo
+ string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName={taskName}&taskVal={taskVal}";
+ try
+ {
+ var response = await callMpIoUrlGet(restUrl);
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Errore durante chiamata addTask2Exe:{Environment.NewLine}{exc}");
+ }
+ }
+ ///
+ /// Chiama metodo x chiedere sync DB
+ ///
+ ///
+ ///
+ public async Task callSyncDb(string IdxMacc)
+ {
+ // chiamo aggiunta task SyncDb...
+ await addTask2Exe(IdxMacc, "syncDbData", "");
+ }
+
///
/// Effettua chiamata ad MP-IO
///
@@ -50,7 +74,7 @@ namespace MP.SPEC.Services
{
var stringResponse = await response.Content.ReadAsStringAsync();
result = stringResponse;
- Log.Info($"Richiesta call per {MpIoBaseUrl}{relUrl}");
+ Log.Info($"Effettuata coin successo call per {MpIoBaseUrl}{relUrl}");
}
else
{
@@ -59,5 +83,17 @@ namespace MP.SPEC.Services
}
return result;
}
+
+ #endregion Public Methods
+
+ #region Private Fields
+
+ private static IConfiguration _configuration = null!;
+ private static ILogger _logger = null!;
+ private static Logger Log = LogManager.GetCurrentClassLogger();
+ private static string MpIoBaseUrl = "";
+ private readonly IHttpClientFactory _clientFactory;
+
+ #endregion Private Fields
}
-}
+}
\ No newline at end of file