Merge branch 'FeaturemodificheGiacenze' into develop

This commit is contained in:
zaccaria.majid
2022-11-29 16:43:15 +01:00
17 changed files with 175 additions and 1420 deletions
+27 -2
View File
@@ -6,6 +6,7 @@ using NLog;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
@@ -332,7 +333,7 @@ namespace MP.Data.Controllers
/// <summary>
/// Elenco giacenze
/// </summary>
/// <param name="currRec">record dossier da eliminare</param>
/// <param name="IdxOdl">id odl da cercare</param>
/// <returns></returns>
public List<AnagGiacenzeModel> ListGiacenze(int IdxOdl)
{
@@ -344,7 +345,8 @@ namespace MP.Data.Controllers
dbResult = dbCtx
.DbGiacenzeData
.AsNoTracking()
.Where(x => x.IdxOdl == IdxOdl).ToList();
.Where(x => x.IdxOdl == IdxOdl)
.ToList();
}
catch (Exception exc)
{
@@ -353,6 +355,29 @@ namespace MP.Data.Controllers
}
return dbResult;
}
/// <summary>
/// Elenco TUTTI GLI ODL
/// </summary>
/// <returns></returns>
public List<ODLModel> ListOdlAll()
{
List<ODLModel> dbResult = new List<ODLModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
dbResult = dbCtx
.DbSetODL
.AsNoTracking()
.ToList();
}
catch (Exception exc)
{
Log.Error($"Eccezione durante ListOdlAll{Environment.NewLine}{exc}");
}
}
return dbResult;
}
/// <summary>
/// Elenco ultimi n record DOssiers (che contengono ad esempio "salvataggi" di FLuxLog) dato
@@ -26,6 +26,5 @@ namespace MP.Data.DatabaseModels
public double QtyTot { get; set; } = 0;
public int NumPack { get; set; } = 0;
public string Notes { get; set; } = "";
}
}
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.INVE</RootNamespace>
<Version>6.16.2211.2815</Version>
<Version>6.16.2211.2916</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOINVE </i>
<h4>Versione: 6.16.2211.2815</h4>
<h4>Versione: 6.16.2211.2916</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2211.2815
6.16.2211.2916
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2211.2815</version>
<version>6.16.2211.2916</version>
<url>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+61
View File
@@ -0,0 +1,61 @@
<table class="table">
<thead>
<tr>
<th scope="col">Id Giacenza</th>
<th scope="col">IdentRG</th>
<th scope="col">Prodotto</th>
<th scope="col">Tipo</th>
<th scope="col">Fornitore</th>
<th scope="col">Data riferimento</th>
<th scope="col">ExtDoc</th>
<th scope="col">Quantita totale</th>
<th scope="col">Numero pacchetti</th>
<th scope="col">Note</th>
</tr>
</thead>
<tbody>
@if (elencoGiacenze != null)
{
@foreach (var item in elencoGiacenze)
{
<tr>
<td class="fw-bold">
@item.IdxRG
</td>
<td>
@item.IdentRG
</td>
<td>
@item.Product
</td>
<td>
@item.Variety
</td>
<td>
@item.Supplier
</td>
<td>
@item.DateRif
</td>
<td>
@item.ExtDoc
</td>
<td>
@item.QtyTot
</td>
<td>
@item.NumPack
</td>
<td>
@item.Notes
</td>
</tr>
}
}
</tbody>
</table>
+45
View File
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.SPEC;
using MP.SPEC.Shared;
using MP.SPEC.Components;
using Microsoft.AspNetCore.WebUtilities;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using Blazored.SessionStorage;
namespace MP.SPEC.Components
{
public partial class ListGiacenze
{
[Inject]
MpDataService MDService { get; set; } = null!;
[Inject]
NavigationManager NavManager { get; set; } = null!;
[Inject]
ISessionStorageService sessionStorage { get; set; } = null!;
protected List<AnagGiacenzeModel>? elencoGiacenze;
[Parameter]
public int IdxOdl { get; set; } = 0;
protected override async Task OnInitializedAsync()
{
elencoGiacenze = await MDService.ListGiacenze(IdxOdl);
}
}
}
+16 -19
View File
@@ -734,10 +734,10 @@ namespace MP.SPEC.Data
Log.Debug($"ListPODLFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato)
/// </summary>
/// <param name="IdxOdl">Solo lanciati (1) o ancora disponibili (0)</param>
/// <param name="IdxOdl">id odl da cercare</param>
/// <returns></returns>
public async Task<List<AnagGiacenzeModel>> ListGiacenze(int IdxOdl)
{
@@ -769,46 +769,43 @@ namespace MP.SPEC.Data
Log.Debug($"ListGiacenze | Read from {readType}: {ts.TotalMilliseconds}ms");
return result;
}
#if false
/// <summary>
/// Elenco PODL avviati filtrati x articolo, KeyRich (che contiene stato)
/// elenco TUTTI gli ODL
/// </summary>
/// <param name="codArt">Cod articolo</param>
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
/// <param name="IdxOdl"></param>
/// <returns></returns>
public async Task<List<PODLModel>> ListPODLFiltNOOdl(string codArt, string keyRichPart)
public List<ODLModel> ListOdlAll()
{
List<PODLModel>? result = new List<PODLModel>();
List<ODLModel>? result = new List<ODLModel>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisPOdlListNOOdl}:{codArt}:{keyRichPart}";
#if false
string currKey = $"{redisGiacenzaList}:{IdxOdl}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<PODLModel>>($"{rawData}");
result = JsonConvert.DeserializeObject<List<AnagGiacenzeModel>>($"{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));
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache));
}
if (result == null)
{
result = new List<PODLModel>();
}
result = new List<AnagGiacenzeModel>();
}
#endif
result = dbController.ListOdlAll();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ListPODLFiltNOOdl | Read from {readType}: {ts.TotalMilliseconds}ms");
Log.Debug($"ListOdlAll | Read from {readType}: {ts.TotalMilliseconds}ms");
return result;
}
#endif
}
/// <summary>
/// Elenco di tutte le macchine gestite
+2 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2211.2912</Version>
<Version>6.16.2211.2916</Version>
</PropertyGroup>
<ItemGroup>
@@ -28,6 +28,7 @@
<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.2.0" />
<PackageReference Include="Blazored.SessionStorage" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.9" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
+5 -67
View File
@@ -3,77 +3,15 @@
<div class="card">
<div class="card-header">
<h3>Giacenze</h3>
@if (odlExp != null)
{
@odlExp.CodArticolo
}
</div>
<div class="card-body">
<table class="table">
<thead>
<tr>
<th scope="col">IdxRG</th>
<th scope="col">IdxOdl</th>
<th scope="col">IdentRG</th>
<th scope="col">Product</th>
<th scope="col">Variety</th>
<th scope="col">Supplier</th>
<th scope="col">ExtDoc</th>
<th scope="col">DateRif</th>
<th scope="col">QtyTot</th>
<th scope="col">NumPack</th>
<th scope="col">Notes</th>
</tr>
</thead>
<tbody>
@if (elencoGiacenze != null)
{
@foreach (var item in elencoGiacenze)
{
<tr>
<td>
@item.IdxRG
</td>
<td>
@item.IdxOdl
</td>
<td>
@item.IdentRG
</td>
<td>
@item.Product
</td>
<td>
@item.Variety
</td>
<td>
@item.Supplier
</td>
<td>
@item.ExtDoc
</td>
<td>
@item.DateRif
</td>
<td>
@item.QtyTot
</td>
<td>
@item.NumPack
</td>
<td>
@item.Notes
</td>
</tr>
}
}
</tbody>
</table>
<ListGiacenze IdxOdl="@IdxOdl"></ListGiacenze>
</div>
<div class="card-footer">
</div>
</div>
+10 -4
View File
@@ -17,6 +17,7 @@ using MP.SPEC.Components;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using Microsoft.AspNetCore.WebUtilities;
using Blazored.SessionStorage;
namespace MP.SPEC.Pages
{
@@ -25,22 +26,27 @@ namespace MP.SPEC.Pages
[Inject]
MpDataService MDService { get; set; } = null!;
[Inject]
ISessionStorageService sessionStorage { get; set; } = null!;
[Inject]
NavigationManager NavManager { get; set; } = null!;
protected List<AnagGiacenzeModel>? elencoGiacenze;
protected List<ODLModel>? elencoOdl;
protected int IdxOdl = 0;
protected ODLModel? odlExp;
protected int IdxOdl { get; set; } = 0;
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("IdxOdl", out var _idxOdl))
{
IdxOdl = int.Parse(_idxOdl);
}
elencoGiacenze = await MDService.ListGiacenze(IdxOdl);
elencoOdl = MDService.ListOdlAll();
odlExp = elencoOdl.Where(o => (o.IdxOdl == IdxOdl)).SingleOrDefault();
}
}
+2
View File
@@ -1,4 +1,5 @@
using Blazored.LocalStorage;
using Blazored.SessionStorage;
using Microsoft.AspNetCore.Authentication.Negotiate;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
@@ -40,6 +41,7 @@ builder.Services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
builder.Services.AddSingleton<MpDataService>();
builder.Services.AddScoped<MessageService>();
builder.Services.AddBlazoredLocalStorage();
builder.Services.AddBlazoredSessionStorage();
builder.Services.AddHttpClient();
builder.Services.AddSingleton<IOApiService>();
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2211.2912</h4>
<h4>Versione: 6.16.2211.2916</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2211.2912
6.16.2211.2916
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2211.2912</version>
<version>6.16.2211.2916</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>