inizio filtro macchina per Reparto

This commit is contained in:
zaccaria.majid
2022-11-30 10:02:40 +01:00
parent e4fe344af9
commit 53b42c6862
13 changed files with 75 additions and 53 deletions
+22 -7
View File
@@ -696,16 +696,31 @@ namespace MP.Data.Controllers
/// Elenco da tabella Macchine
/// </summary>
/// <returns></returns>
public List<Macchine> MacchineGetAll()
public List<Gruppi2MaccModel> MacchineGetAll(string codGruppo = "*")
{
List<Macchine> dbResult = new List<Macchine>();
List<Gruppi2MaccModel> dbResult = new List<Gruppi2MaccModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetMacchine
.AsNoTracking()
.OrderBy(x => x.IdxMacchina)
.ToList();
if (codGruppo == "*")
{
dbResult = dbCtx
.DbSetGrp2Macc
.AsNoTracking()
.Include(m => m.MachineNav)
.OrderBy(x => x.IdxMacchina)
.ToList();
}
else
{
dbResult = dbCtx
.DbSetGrp2Macc
.Where(c => c.CodGruppo == codGruppo)
.AsNoTracking()
.Include(m => m.MachineNav)
.OrderBy(x => x.IdxMacchina)
.ToList();
}
}
return dbResult;
}
+2 -2
View File
@@ -106,11 +106,11 @@ else
@if (item.IdxMacchina == currRecordClone.IdxMacchina)
{
<option value="@item.IdxMacchina" selected>@item.IdxMacchina | @item.Descrizione</option>
<option value="@item.IdxMacchina" selected>@item.IdxMacchina | @item.MachineNav.Descrizione</option>
}
else
{
<option value="@item.IdxMacchina">@item.IdxMacchina | @item.Descrizione</option>
<option value="@item.IdxMacchina">@item.IdxMacchina | @item.MachineNav.Descrizione</option>
}
}
}
+2 -2
View File
@@ -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.MacchineGetAll("*");
await reloadData(true);
}
@@ -309,7 +309,7 @@ namespace MP.SPEC.Components
private List<AnagArticoli>? ListArticoli;
private List<AnagGruppi>? ListGruppiFase;
private List<Macchine>? ListMacchine;
private List<Gruppi2MaccModel>? ListMacchine;
private List<DossierModel>? ListRecords;
private List<ListValues>? ListStati;
+1 -1
View File
@@ -42,7 +42,7 @@
{
foreach (var item in ListMacchine)
{
<option value="@item.IdxMacchina">@item.Descrizione</option>
<option value="@item.IdxMacchina">@item.MachineNav.Descrizione</option>
}
}
</select>
+1 -1
View File
@@ -19,7 +19,7 @@ namespace MP.SPEC.Components
public List<AnagGruppi>? ListGruppiFase { get; set; } = null;
[Parameter]
public List<Macchine>? ListMacchine { get; set; } = null;
public List<Gruppi2MaccModel>? ListMacchine { get; set; } = null;
[Parameter]
public List<ListValues>? ListStati { get; set; } = null;
+9 -8
View File
@@ -177,7 +177,8 @@ namespace MP.SPEC.Data
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisArtList}:{azienda}";
string sKey = string.IsNullOrEmpty(searchVal) ? "***" : searchVal;
string currKey = $"{redisArtList}:{azienda}:{sKey}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
@@ -789,30 +790,30 @@ namespace MP.SPEC.Data
/// Elenco di tutte le macchine gestite
/// </summary>
/// <returns></returns>
public async Task<List<Macchine>> MacchineGetAll()
public async Task<List<Gruppi2MaccModel>> MacchineGetAll(string codGruppo)
{
List<Macchine>? result = new List<Macchine>();
List<Gruppi2MaccModel>? result = new List<Gruppi2MaccModel>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = redisMacList;
string currKey = $"{redisMacList}:{codGruppo}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<Macchine>>($"{rawData}");
result = JsonConvert.DeserializeObject<List<Gruppi2MaccModel>>($"{rawData}");
readType = "REDIS";
}
else
{
result = await Task.FromResult(dbController.MacchineGetAll());
result = await Task.FromResult(dbController.MacchineGetAll(codGruppo));
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
redisDb.StringSet(redisMacList, rawData, getRandTOut(redisLongTimeCache));
}
if (result == null)
{
result = new List<Macchine>();
result = new List<Gruppi2MaccModel>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2211.3008</Version>
<Version>6.16.2211.3010</Version>
</PropertyGroup>
<ItemGroup>
+2 -2
View File
@@ -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.MacchineGetAll(selReparto);
padCodXdl = await MDService.tryGetConfig("padCodXdl");
}
@@ -160,7 +160,7 @@ namespace MP.SPEC.Pages
#region Private Fields
private List<Macchine>? ListMacchine;
private List<Gruppi2MaccModel>? ListMacchine;
private List<MP.Data.DatabaseModels.ListValues>? ListStati;
#endregion Private Fields
+3 -3
View File
@@ -161,16 +161,16 @@
{
foreach (var item in ListMacchine)
{
@if (!item.Descrizione.Contains("NEW Descrizione"))
@if (!item.MachineNav.Descrizione.Contains("NEW Descrizione"))
{
if (item.IdxMacchina == currRecordControlli.IdxMacchina)
{
<option selected value="@item.IdxMacchina">@item.IdxMacchina | @item.Descrizione</option>
<option selected value="@item.IdxMacchina">@item.IdxMacchina | @item.MachineNav.Descrizione</option>
}
else
{
<option value="@item.IdxMacchina">@item.IdxMacchina | @item.Descrizione</option>
<option value="@item.IdxMacchina">@item.IdxMacchina | @item.MachineNav.Descrizione</option>
}
}
}
+29 -23
View File
@@ -98,25 +98,16 @@ namespace MP.SPEC.Pages
await localStorage.SetItemAsync(keyStor, selReparto);
}
}
protected override async Task OnInitializedAsync()
protected override async Task OnParametersSetAsync()
{
await getReparto();
ListAziende = await MDService.ElencoAziende();
var allGruppiData = await MDService.ElencoGruppiFase();
if (allGruppiData != null)
{
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);
currAzienda = await MDService.tryGetConfig("AZIENDA");
padCodXdl = await MDService.tryGetConfig("padCodXdl");
// carico dati
await reloadData();
}
protected override async Task OnInitializedAsync()
{
// carico dati
//await reloadData();
}
protected async Task pgResetReq(bool doReset)
{
@@ -143,6 +134,7 @@ namespace MP.SPEC.Pages
//}
//currArticolo = "";
if (ListArticoli != null && ListArticoli.Count > 0)
{
//var firstArt = ListArticoli.FirstOrDefault();
@@ -166,7 +158,7 @@ namespace MP.SPEC.Pages
string codMacc = "";
if (ListMacchine != null && ListMacchine.Count > 0)
{
var firstMacc = ListMacchine.FirstOrDefault(x => x.Nome.Contains(currAzienda));
var firstMacc = ListMacchine.FirstOrDefault(x => x.MachineNav.Nome.Contains(currAzienda));
if (firstMacc != null)
{
codMacc = firstMacc.IdxMacchina;
@@ -232,7 +224,7 @@ namespace MP.SPEC.Pages
private List<AnagGruppi>? ListGruppiFase;
private List<Macchine>? ListMacchine;
private List<Gruppi2MaccModel>? ListMacchine;
private List<ListValues>? ListStati;
@@ -342,8 +334,11 @@ namespace MP.SPEC.Pages
get => _currRecord;
set
{
_currRecord = value;
artSearch = value == null ? "" : value.CodArticolo;
if (value != null)
{
_currRecord = value;
artSearch = value == null ? "" : value.CodArticolo;
}
}
}
@@ -426,13 +421,24 @@ namespace MP.SPEC.Pages
{
isLoading = true;
await Task.Delay(1);
ListAziende = await MDService.ElencoAziende();
var allGruppiData = await MDService.ElencoGruppiFase();
if (allGruppiData != null)
{
ListGruppiFase = allGruppiData.Where(x => x.SelEnabled).ToList();
}
ListMacchine = await MDService.MacchineGetAll(selReparto);
ListStati = await MDService.AnagStatiComm();
ListArticoli = await MDService.ArticoliGetSearch(100, currAzienda, artSearch);
// ListArticoli = new List<AnagArticoli>();
//}
//SearchRecords = await MDService.ListPODLFilt(hasOdl, StatoSel, macchina, selReparto, selDtStart, selDtEnd);
currAzienda = await MDService.tryGetConfig("AZIENDA");
padCodXdl = await MDService.tryGetConfig("padCodXdl");
//ListMacchine = await MDService.MacchineGetAll(selReparto);
//ListArticoli = await MDService.ArticoliGetSearch(100, currAzienda, artSearch);
isLoading = false;
}
protected string header
protected string header
{
get => currFilter.Header;
set => currFilter.Header = value;
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2211.3008</h4>
<h4>Versione: 6.16.2211.3010</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2211.3008
6.16.2211.3010
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2211.3008</version>
<version>6.16.2211.3010</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>