-
- 6.16.2211.2408
+ 6.16.2211.2409
https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip
https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html
false
diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor
index eda270ca..f5e4b7ba 100644
--- a/MP.SPEC/Components/ListODL.razor
+++ b/MP.SPEC/Components/ListODL.razor
@@ -55,8 +55,31 @@ else
}
|
- ODL @($"{record.IdxOdl:000000}")
- PODL @($"{getPodl(record.IdxOdl):000000}")
+
+
+
+ ODL
+
+
+ @($"{record.IdxOdl.ToString(padCodXdl)}")
+
+
+
+
+ PODL
+
+ @if (getPodl(record.IdxOdl) > 0)
+ {
+
+ @($"{getPodl(record.IdxOdl).ToString(padCodXdl)}")
+
+ }
+ else
+ {
+ ------
+ }
+
+
|
@record.CodArticolo
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs
index 6f11213c..7e776432 100644
--- a/MP.SPEC/Components/ListODL.razor.cs
+++ b/MP.SPEC/Components/ListODL.razor.cs
@@ -14,6 +14,9 @@ namespace MP.SPEC.Components
[Parameter]
public SelectOdlParams currFilter { get; set; } = null!;
+ [Parameter]
+ public string padCodXdl { get; set; } = "0000";
+
[Parameter]
public EventCallback PagerResetReq { get; set; }
@@ -122,6 +125,17 @@ namespace MP.SPEC.Components
await reloadData();
}
+ protected int getPodl(int idxOdl)
+ {
+ int answ = 0;
+ var pOdlData = MDService.PODL_getByOdl(idxOdl);
+ if (pOdlData != null)
+ {
+ answ = pOdlData.IdxPromessa;
+ }
+ return answ;
+ }
+
protected override async Task OnInitializedAsync()
{
ListStati = await MDService.AnagStatiComm();
@@ -253,17 +267,6 @@ namespace MP.SPEC.Components
}
}
- protected int getPodl(int idxOdl)
- {
- int answ = 0;
- var pOdlData = MDService.PODL_getByOdl(idxOdl);
- if (pOdlData != null)
- {
- answ = pOdlData.IdxPromessa;
- }
- return answ;
- }
-
private bool hideSpenta { get; set; } = false;
///
diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor
index c8188a62..b27a5106 100644
--- a/MP.SPEC/Components/ListPODL.razor
+++ b/MP.SPEC/Components/ListPODL.razor
@@ -36,31 +36,54 @@ else
@foreach (var record in ListRecords)
{
- |
- @if (canStartOdl(record.IdxMacchina))
- {
-
- }
- else
- {
-
- }
+ |
- @if (canStartOdl(record.IdxMacchina))
+ @if (record.IdxOdl == 0)
{
-
- }
- else
- {
-
+ @if (canStartOdl(record.IdxMacchina))
+ {
+
+ }
+ else
+ {
+
+ }
+ @if (canStartOdl(record.IdxMacchina))
+ {
+
+ }
+ else
+ {
+
+ }
}
|
- PODL @($"{record.IdxPromessa:000000}")
+
+
+
+ PODL
+
+
+ @($"{record.IdxPromessa.ToString(padCodXdl)}")
+
+
+ @if (record.IdxOdl > 0)
+ {
+
+
+ ODL
+
+
+ @($"{record.IdxOdl.ToString(padCodXdl)}")
+
+
+ }
+
|
@record.CodArticolo
diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs
index dd5efe89..33539043 100644
--- a/MP.SPEC/Components/ListPODL.razor.cs
+++ b/MP.SPEC/Components/ListPODL.razor.cs
@@ -4,6 +4,7 @@ using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using MP.SPEC.Services;
using NLog;
+using StackExchange.Redis;
namespace MP.SPEC.Components
{
@@ -14,6 +15,9 @@ namespace MP.SPEC.Components
[Parameter]
public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams();
+ [Parameter]
+ public string padCodXdl { get; set; } = "0000";
+
[Parameter]
public EventCallback PagerResetReq { get; set; }
@@ -195,11 +199,19 @@ namespace MP.SPEC.Components
await Task.Delay(1);
await callSyncDb(selRec.IdxMacchina);
await Task.Delay(1);
+
+ // svuoto memorie pagina...
+ await MDService.FlushRedisCache();
+ NavManager.NavigateTo(NavManager.Uri, true);
}
}
}
}
+
+ [Inject]
+ protected NavigationManager NavManager { get; set; } = null!;
+
protected async Task UpdateData()
{
currRecord = null;
@@ -239,6 +251,12 @@ namespace MP.SPEC.Components
set => actFilter.CurrPage = value;
}
+ private bool hasOdl
+ {
+ get => actFilter.hasOdl;
+ set => actFilter.hasOdl = value;
+ }
+
private bool isLoading { get; set; } = false;
private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 };
@@ -383,8 +401,16 @@ namespace MP.SPEC.Components
private async Task reloadData()
{
+ ListRecords = null;
isLoading = true;
- SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel);
+ if (hasOdl)
+ {
+ SearchRecords = await MDService.ListPODLFiltNOOdl(SearchVal, StatoSel);
+ }
+ else
+ {
+ SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel);
+ }
totalCount = SearchRecords.Count;
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index 32635129..e76e0a6b 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -312,6 +312,27 @@ namespace MP.SPEC.Data
return result;
}
+ ///
+ /// Restituisce valore della stringa (SE disponibile)
+ ///
+ ///
+ ///
+ public async Task tryGetConfig(string keyName)
+ {
+ string answ = "";
+ // preselezione valori
+ var configData = await ConfigGetAll();
+ var currRec = configData.FirstOrDefault(x => x.Chiave == keyName);
+ if (currRec != null)
+ {
+ answ = currRec.Valore;
+ }
+
+ return answ;
+ }
+
+
+
///
/// Reset dati cache config
///
@@ -506,6 +527,7 @@ namespace MP.SPEC.Data
return answ;
}
+
///
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
///
@@ -644,6 +666,44 @@ namespace MP.SPEC.Data
return result;
}
+
+ ///
+ /// Elenco PODL avviati filtrati x articolo, KeyRich (che contiene stato)
+ ///
+ /// Cod articolo
+ /// KeyRich (parziale) da cercare (es cod stato x yacht)
+ ///
+ public async Task> ListPODLFiltNOOdl(string codArt, string keyRichPart)
+ {
+ List? result = new List();
+ Stopwatch stopWatch = new Stopwatch();
+ stopWatch.Start();
+ string readType = "DB";
+ string currKey = $"{redisPOdlListNOOdl}:{codArt}:{keyRichPart}";
+ // cerco in redis dato valore sel macchina...
+ RedisValue rawData = redisDb.StringGet(currKey);
+ if (rawData.HasValue)
+ {
+ result = JsonConvert.DeserializeObject>($"{rawData}");
+ readType = "REDIS";
+ }
+ else
+ {
+ result = await Task.FromResult(dbController.ListPODLFiltNOOdl(codArt, keyRichPart));
+ // serializzo e salvo...
+ rawData = JsonConvert.SerializeObject(result);
+ redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3));
+ }
+ if (result == null)
+ {
+ result = new List();
+ }
+ stopWatch.Stop();
+ TimeSpan ts = stopWatch.Elapsed;
+ Log.Debug($"ListPODLFiltNOOdl | Read from {readType}: {ts.TotalMilliseconds}ms");
+ return result;
+ }
+
///
/// Elenco di tutte le macchine gestite
///
@@ -1113,6 +1173,7 @@ namespace MP.SPEC.Data
private const string redisPOdlByOdl = redisBaseAddr + "SPEC:Cache:POdlByOdl";
private const string redisPOdlByPOdl = redisBaseAddr + "SPEC:Cache:POdlByPOdl";
private const string redisPOdlList = redisBaseAddr + "SPEC:Cache:POdlList";
+ private const string redisPOdlListNOOdl = redisBaseAddr + "SPEC:Cache:POdlListNOOdl";
private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom";
private const string redisTipoArt = redisBaseAddr + "SPEC:Cache:TipoArt";
diff --git a/MP.SPEC/Data/SelectGlobalToggle.cs b/MP.SPEC/Data/SelectGlobalToggle.cs
index 527bc25a..53f19dfe 100644
--- a/MP.SPEC/Data/SelectGlobalToggle.cs
+++ b/MP.SPEC/Data/SelectGlobalToggle.cs
@@ -12,7 +12,7 @@
#region Public Properties
///
- /// Bool: indica se il toggle è attivo
+ /// Bool: indica se il toggleClosed è attivo
///
public bool isActive { get; set; } = true;
diff --git a/MP.SPEC/Data/SelectPOdlParams.cs b/MP.SPEC/Data/SelectPOdlParams.cs
index 0c743ce7..7d8b35f4 100644
--- a/MP.SPEC/Data/SelectPOdlParams.cs
+++ b/MP.SPEC/Data/SelectPOdlParams.cs
@@ -26,6 +26,7 @@ namespace MP.SPEC.Data
public string SearchVal { get; set; } = "*";
public int TotCount { get; set; } = 0;
+ public bool hasOdl { get; set; } = false;
#endregion Public Properties
@@ -41,7 +42,8 @@ namespace MP.SPEC.Data
MaxRecord = this.MaxRecord,
NumRec = this.NumRec,
SearchVal = this.SearchVal,
- TotCount = this.TotCount
+ TotCount = this.TotCount,
+ hasOdl = this.hasOdl
};
return clonedData;
}
@@ -72,6 +74,9 @@ namespace MP.SPEC.Data
if (SearchVal != item.SearchVal)
return false;
+ if (hasOdl != item.hasOdl)
+ return false;
+
return true;
}
diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj
index 4830c1e9..45554cf4 100644
--- a/MP.SPEC/MP.SPEC.csproj
+++ b/MP.SPEC/MP.SPEC.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.SPEC
- 6.16.2211.2317
+ 6.16.2211.2410
diff --git a/MP.SPEC/Pages/Articoli.razor.cs b/MP.SPEC/Pages/Articoli.razor.cs
index a558357a..c69fc1ca 100644
--- a/MP.SPEC/Pages/Articoli.razor.cs
+++ b/MP.SPEC/Pages/Articoli.razor.cs
@@ -129,12 +129,15 @@ namespace MP.SPEC.Pages
protected override async Task OnInitializedAsync()
{
numRecord = 10;
+#if false
configData = await MDService.ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
if (currRec != null)
{
selAzienda = currRec.Valore;
- }
+ }
+#endif
+ selAzienda = await MDService.tryGetConfig("AZIENDA");
ListAziende = await MDService.ElencoAziende();
ListTipoArt = await MDService.AnagTipoArtLV();
}
@@ -210,7 +213,10 @@ namespace MP.SPEC.Pages
private int _currPage { get; set; } = 1;
private int _numRecord { get; set; } = 10;
- private List? configData { get; set; } = null;
+
+#if false
+ private List? configData { get; set; } = null;
+#endif
private int currPage
{
diff --git a/MP.SPEC/Pages/Index.razor.cs b/MP.SPEC/Pages/Index.razor.cs
index 0751fffd..1193385d 100644
--- a/MP.SPEC/Pages/Index.razor.cs
+++ b/MP.SPEC/Pages/Index.razor.cs
@@ -30,6 +30,7 @@ namespace MP.SPEC.Pages
MessageService.ShowSearch = false;
// recupero elenco JQM
ElencoLink = await MDService.ElencoLink();
+#if false
configData = await MDService.ConfigGetAll();
if (configData != null)
{
@@ -38,7 +39,9 @@ namespace MP.SPEC.Pages
{
currAzienda = currRec.Valore;
}
- }
+ }
+#endif
+ currAzienda = await MDService.tryGetConfig("AZIENDA");
await Task.Delay(1);
}
@@ -52,7 +55,9 @@ namespace MP.SPEC.Pages
#region Private Properties
- private List? configData { get; set; } = null;
+#if false
+ private List? configData { get; set; } = null;
+#endif
#endregion Private Properties
}
diff --git a/MP.SPEC/Pages/ODL.razor b/MP.SPEC/Pages/ODL.razor
index b31a35a4..bd021744 100644
--- a/MP.SPEC/Pages/ODL.razor
+++ b/MP.SPEC/Pages/ODL.razor
@@ -113,7 +113,7 @@
-
+
| |