diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs
index 2805f13d..e45e05e8 100644
--- a/MP.Data/Controllers/MpSpecController.cs
+++ b/MP.Data/Controllers/MpSpecController.cs
@@ -695,17 +695,50 @@ namespace MP.Data.Controllers
///
/// Elenco da tabella Macchine
///
+ ///
///
- public List MacchineGetAll()
+ public List MacchineGetFilt(string codGruppo)
{
List dbResult = new List();
using (var dbCtx = new MoonProContext(_configuration))
{
- dbResult = dbCtx
- .DbSetMacchine
- .AsNoTracking()
- .OrderBy(x => x.IdxMacchina)
- .ToList();
+ if (codGruppo == "*")
+ {
+ dbResult = dbCtx
+ .DbSetMacchine
+ .AsNoTracking()
+ .OrderBy(x => x.IdxMacchina)
+ .ToList();
+ }
+ else
+ {
+ dbResult = dbCtx
+ .DbSetGrp2Macc
+ .Where(g => g.CodGruppo == codGruppo)
+ .Join(dbCtx.DbSetMacchine,
+ g => g.IdxMacchina,
+ m => m.IdxMacchina,
+ (g, m) => m
+
+ //(m, g) => new Macchine
+ //{
+ // IdxMacchina = m.IdxMacchina,
+ // CodMacchina = m.CodMacchina,
+ // Descrizione = m.Descrizione,
+ // Nome = m.Nome,
+ // Note = m.Note,
+ // url = m.url,
+ // locazione = m.locazione,
+ // css = m.css,
+ // RowNum = m.RowNum,
+ // ColNum = m.ColNum
+ //}
+ )
+ //.Distinct()
+ .AsNoTracking()
+ .OrderBy(x => x.IdxMacchina)
+ .ToList();
+ }
}
return dbResult;
}
diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs
index d91907a0..89106654 100644
--- a/MP.SPEC/Components/ListDossiers.razor.cs
+++ b/MP.SPEC/Components/ListDossiers.razor.cs
@@ -227,7 +227,7 @@ namespace MP.SPEC.Components
ListStati = await MDService.AnagStatiComm();
selAzienda = await MDService.tryGetConfig("AZIENDA");
ListArticoli = await MDService.ArticoliGetSearch(100000, selAzienda, "");
- ListMacchine = await MDService.MacchineGetAll();
+ ListMacchine = await MDService.MacchineGetFilt("*");
await reloadData(true);
}
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index d6c12f21..7e766bdf 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -788,14 +788,16 @@ namespace MP.SPEC.Data
///
/// Elenco di tutte le macchine gestite
///
+ ///
///
- public async Task> MacchineGetAll()
+ public async Task> MacchineGetFilt(string codGruppo)
{
List? result = new List();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
- string currKey = redisMacList;
+ string keyGrp = codGruppo != "*" ? codGruppo : "ALL";
+ string currKey = $"{redisMacList}:{keyGrp}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
@@ -805,7 +807,7 @@ namespace MP.SPEC.Data
}
else
{
- result = await Task.FromResult(dbController.MacchineGetAll());
+ result = await Task.FromResult(dbController.MacchineGetFilt(codGruppo));
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj
index 78d235dd..451d8288 100644
--- a/MP.SPEC/MP.SPEC.csproj
+++ b/MP.SPEC/MP.SPEC.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.SPEC
- 6.16.2211.3008
+ 6.16.2211.3015
diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs
index b7662ce5..eff6487f 100644
--- a/MP.SPEC/Pages/ODL.razor.cs
+++ b/MP.SPEC/Pages/ODL.razor.cs
@@ -111,7 +111,7 @@ namespace MP.SPEC.Pages
ListGruppiFase = allGruppiData.Where(x => x.SelEnabled).ToList();
}
ListStati = await MDService.AnagStatiComm();
- ListMacchine = await MDService.MacchineGetAll();
+ ListMacchine = await MDService.MacchineGetFilt(selReparto);
padCodXdl = await MDService.tryGetConfig("padCodXdl");
}
diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs
index dc3d2cc2..19f3fd84 100644
--- a/MP.SPEC/Pages/PODL.razor.cs
+++ b/MP.SPEC/Pages/PODL.razor.cs
@@ -108,12 +108,14 @@ namespace MP.SPEC.Pages
{
ListGruppiFase = allGruppiData.Where(x => x.SelEnabled).ToList();
}
- ListMacchine = await MDService.MacchineGetAll();
ListStati = await MDService.AnagStatiComm();
- ListArticoli = await MDService.ArticoliGetSearch(100, currAzienda, artSearch);
- //SearchRecords = await MDService.ListPODLFilt(hasOdl, StatoSel, macchina, selReparto, selDtStart, selDtEnd);
+ //ListArticoli = await MDService.ArticoliGetSearch(100, currAzienda, artSearch);
currAzienda = await MDService.tryGetConfig("AZIENDA");
padCodXdl = await MDService.tryGetConfig("padCodXdl");
+ }
+
+ protected override async Task OnParametersSetAsync()
+ {
// carico dati
await reloadData();
}
@@ -136,13 +138,6 @@ namespace MP.SPEC.Pages
///
protected async Task reqNewPODL()
{
- // aggiungo record articolo
- //if (SearchRecords != null)
- //{
- // currRecordControlli = SearchRecords.FirstOrDefault();
- //}
-
- //currArticolo = "";
if (ListArticoli != null && ListArticoli.Count > 0)
{
//var firstArt = ListArticoli.FirstOrDefault();
@@ -427,12 +422,11 @@ namespace MP.SPEC.Pages
isLoading = true;
await Task.Delay(1);
+ ListMacchine = await MDService.MacchineGetFilt(selReparto);
ListArticoli = await MDService.ArticoliGetSearch(100, currAzienda, artSearch);
- // ListArticoli = new List();
- //}
isLoading = false;
}
- protected string header
+ protected string header
{
get => currFilter.Header;
set => currFilter.Header = value;
@@ -444,6 +438,7 @@ namespace MP.SPEC.Pages
currPage = 1;
// salvo comunque filtro reparto x utente
await localStorage.SetItemAsync("reparto", selReparto);
+ await reloadData();
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
currFilter = newParams;
diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html
index 8a2ab009..d541ddeb 100644
--- a/MP.SPEC/Resources/ChangeLog.html
+++ b/MP.SPEC/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MAPOSPEC
- Versione: 6.16.2211.3008
+ Versione: 6.16.2211.3015
Note di rilascio:
-
diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt
index 81c7abf1..6b9d7ca4 100644
--- a/MP.SPEC/Resources/VersNum.txt
+++ b/MP.SPEC/Resources/VersNum.txt
@@ -1 +1 @@
-6.16.2211.3008
+6.16.2211.3015
diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml
index dadec365..a9c8ec9d 100644
--- a/MP.SPEC/Resources/manifest.xml
+++ b/MP.SPEC/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.16.2211.3008
+ 6.16.2211.3015
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