aggiunta pagina invio

This commit is contained in:
zaccaria.majid
2022-12-14 14:43:45 +01:00
parent 55d6c2f706
commit 087969dbe4
15 changed files with 388 additions and 17 deletions
+28 -2
View File
@@ -462,7 +462,7 @@ namespace MP.Data.Controllers
}
#endregion gestione UDC
#region gestione lotti
#region gestione lotti interni
/// <summary>
/// elenco lotti
/// </summary>
@@ -500,7 +500,7 @@ namespace MP.Data.Controllers
return dbResult;
}
#endregion gestione lotti
#endregion gestione lotti interni
#region gestione sessione
@@ -598,6 +598,32 @@ namespace MP.Data.Controllers
#endregion gestione sessione
#region gestione totale lotti
/// <summary>
/// Elenco Totale lotti x sessione
/// </summary>
/// <param name="sessID"></param>
/// <returns></returns>
public List<InveSessTotLotModel> InveSessTotLotList(int sessID)
{
List<InveSessTotLotModel> dbResult = new List<InveSessTotLotModel>();
using (var dbCtx = new MoonPro_InveContext(_configuration))
{
var SessID = new SqlParameter("@sessId", sessID);
dbResult = dbCtx
.DbTotLotti
.FromSqlRaw("exec dbo.stp_INVE_TotLotBySess @sessId", SessID)
.AsNoTracking()
.AsEnumerable()
.ToList();
}
return dbResult;
}
#endregion gestione totale lotti
#endregion Public Methods
#region Private Fields
-1
View File
@@ -665,7 +665,6 @@ namespace MP.Data.Controllers
.DbSetPODLExp
.FromSqlRaw("EXEC stp_PODL_getByFiltSpec @Lanciato, @KeyRich, @CodGruppo, @IdxMacchina, @DateFrom, @DateTo", Lanc, KeyRich, CodGrp, IdxMacc, DateFrom, DateTo)
.AsNoTracking()
//.AsEnumerable()
.ToList();
}
return dbResult;
@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data.DatabaseModels
{
[Keyless]
public partial class InveSessTotLotModel
{
public int InveSessID { get; set; }
public int MagID { get; set; }
public string CodMag { get; set; }
public string DescMag { get; set; }
public string Lotto { get; set; }
public string CodArticolo { get; set; }
public string DescrArt { get; set; }
public int NumColli { get; set; }
public decimal TotLotto { get; set; }
public bool IsForced { get; set; }
}
}
+1
View File
@@ -54,6 +54,7 @@ namespace MP.Data
public virtual DbSet<AnagLottoModel> DbLottoData { get; set; }
public virtual DbSet<AnagArticoli_MAG> DbArtMag { get; set; }
public virtual DbSet<AnagLottiArca> DbLottoArca { get; set; }
public virtual DbSet<InveSessTotLotModel> DbTotLotti { get; set; }
#endregion PER INVE
#region PER SPEC
+50
View File
@@ -0,0 +1,50 @@
<table class="table">
<thead>
<tr>
<th scope="col">ID sessione</th>
<th scope="col">Magazzino</th>
<th scope="col">Descrizione Mag</th>
<th scope="col">Lotto</th>
<th scope="col">Articolo</th>
<th scope="col">Descrizione Art</th>
<th scope="col">Tot colli</th>
<th scope="col">Tot lotto</th>
</tr>
</thead>
<tbody>
@if (elencoTotLotto != null)
{
@foreach (var item in elencoTotLotto)
{
<tr>
<td>
@item.InveSessID
</td>
<td>
@item.CodMag
</td>
<td>
@item.DescMag
</td>
<td>
@item.Lotto
</td>
<td>
@item.CodArticolo
</td>
<td class="small textCondensed">
@item.DescrArt
</td>
<td>
@item.NumColli
</td>
<td>
@item.TotLotto
</td>
</tr>
}
}
</tbody>
</table>
+92
View File
@@ -0,0 +1,92 @@
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.INVE;
using MP.INVE.Shared;
using MP.INVE.Components;
using MP.Data.DatabaseModels;
using MP.INVE.Data;
namespace MP.INVE.Components
{
public partial class ListTotLotto
{
public void Dispose()
{
elencoTotLotto = null;
SearchRecords = null;
GC.Collect();
}
[Parameter]
public int SessionID { get; set; } = 0;
[Inject]
protected MiDataService MIService { get; set; } = null!;
private int totalCount
{
get => currParams.TotCount;
set
{
currParams.TotCount = value;
StateHasChanged();
}
}
private int numRecord
{
get => currParams.NumRec;
set
{
currParams.NumRec = value;
StateHasChanged();
}
}
private int currPage
{
get => currParams.CurrPage;
set
{
currParams.CurrPage = value;
StateHasChanged();
}
}
protected async override Task OnParametersSetAsync()
{
await Task.Delay(1);
if (SessionID != 0)
{
await reloadData();
}
}
private async Task reloadData()
{
elencoTotLotto = null;
totalCount = 0;
isLoading = true;
SearchRecords = MIService.InveSessTotLotList(SessionID);
totalCount = SearchRecords.Count;
elencoTotLotto = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
await Task.Delay(1);
isLoading = false;
}
protected List<InveSessTotLotModel>? elencoTotLotto;
private List<InveSessTotLotModel>? SearchRecords;
[Parameter]
public SelectInvioParams currParams { get; set; } = null!;
[Parameter]
public bool isLoading { get; set; }
}
}
+19
View File
@@ -360,6 +360,24 @@ namespace MP.INVE.Data
Log.Debug($"ScanList Read from {source}: {ts.TotalMilliseconds}ms");
return result;
}
public List<InveSessTotLotModel> InveSessTotLotList(int sessID)
{
string source = "";
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
List<InveSessTotLotModel>? result = new List<InveSessTotLotModel>();
result = dbController.InveSessTotLotList(sessID);
source = "DB";
if (result == null)
{
result = new List<InveSessTotLotModel>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"InveSessTotLotList Read from {source}: {ts.TotalMilliseconds}ms");
return result;
}
public ScanDataModel ScanByUdcSession(string udc, int inveSessId)
{
string source = "";
@@ -675,6 +693,7 @@ namespace MP.INVE.Data
private const string redisOperatoriBaseAddr = ":Operatore";
private const string redisLottiBaseAddr = ":Lotti";
private const string redisUdcBaseAddr = ":UDC";
private const string redisTotLottoAddr = ":TotaleLotto";
private const string redisLottiInterni = redisBaseAddr + redisLottiBaseAddr + ":LottiInterni";
private const string redisLottiEsterni = redisBaseAddr + redisLottiBaseAddr + ":LottiEsterni";
private const string redisConfigBaseAddr = ":Config";
+55
View File
@@ -0,0 +1,55 @@
using MP.Data;
namespace MP.INVE.Data
{
public class SelectScanParams
{
#region Public Constructors
public SelectScanParams()
{ }
#endregion Public Constructors
#region Public Properties
public int CurrPage { get; set; } = 1;
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
public int MaxRecord { get; set; } = 100;
public string UDC { get; set; } = "";
#endregion Public Properties
#region Public Methods
public override bool Equals(object obj)
{
if (!(obj is SelectScanParams item))
return false;
if (MaxRecord != item.MaxRecord)
return false;
if (TotCount != item.TotCount)
return false;
if (NumRec != item.NumRec)
if (CurrPage != item.CurrPage)
return false;
if (UDC != item.UDC)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
+3 -7
View File
@@ -2,11 +2,11 @@
namespace MP.INVE.Data
{
public class SelectScanParams
public class SelectInvioParams
{
#region Public Constructors
public SelectScanParams()
public SelectInvioParams()
{ }
#endregion Public Constructors
@@ -17,7 +17,6 @@ namespace MP.INVE.Data
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
public int MaxRecord { get; set; } = 100;
public string UDC { get; set; } = "";
#endregion Public Properties
@@ -25,7 +24,7 @@ namespace MP.INVE.Data
public override bool Equals(object obj)
{
if (!(obj is SelectScanParams item))
if (!(obj is SelectInvioParams item))
return false;
if (MaxRecord != item.MaxRecord)
@@ -39,9 +38,6 @@ namespace MP.INVE.Data
if (CurrPage != item.CurrPage)
return false;
if (UDC != item.UDC)
return false;
return true;
}
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.INVE</RootNamespace>
<Version>6.16.2212.1409</Version>
<Version>6.16.2212.1413</Version>
</PropertyGroup>
<ItemGroup>
+39 -1
View File
@@ -1,6 +1,44 @@
@page "/Invio"
<h3>Invio</h3>
@if (isLoading)
{
<LoadingData></LoadingData>
}
else
{
<div class="card mb-5">
<div class="card-header">
<h3>Invio</h3>
</div>
<div class="card-body">
@if (elencoSessioni != null)
{
<div class="input-group">
<span class="input-group-text">SESSIONE</span>
<select class="form-select" aria-label="Default select example" @bind="@sessID">
<option value="0">--Selezionare una sessione--</option>
@foreach (var item in elencoSessioni)
{
<option value="@item.InveSessID">@item.InveSessID | @item.Description</option>
}
</select>
</div>
@if (sessID != 0)
{
<ListTotLotto SessionID="@sessID" currParams="@currParams" isLoading="@isLoading"></ListTotLotto>
}
}
</div>
@*if (sessID != 0)
{
<div class="card-footer py-1">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="@isLoading" />
</div>
}*@
</div>
}
+73 -2
View File
@@ -17,15 +17,86 @@ using MP.INVE.Components;
using Blazored.LocalStorage;
using MP.Data.DTO;
using MP.Data;
using MP.INVE.Data;
using MP.Data.DatabaseModels;
namespace MP.INVE.Pages
{
public partial class Invio
{
[Inject]
public MiDataService MIService { get; set; } = null!;
protected SelectInvioParams currParams = new SelectInvioParams();
private int totalCount
{
get => currParams.TotCount;
set
{
if (currParams.TotCount != value)
{
currParams.TotCount = value;
}
}
}
private int numRecord
{
get => currParams.NumRec;
set
{
if (currParams.NumRec != value)
{
currParams.NumRec = value;
}
}
}
private int currPage
{
get => currParams.CurrPage;
set
{
if (currParams.CurrPage != value)
{
currParams.CurrPage = value;
}
}
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
}
protected void ForceReloadPage(int newNum)
{
currPage = newNum;
}
protected List<InventorySessionModel> sessions { get; set; } = null!;
protected override async Task OnInitializedAsync()
{
await reloadData();
}
private List<InventorySessionModel>? elencoSessioni;
protected bool isLoading = false;
private async Task reloadData()
{
elencoSessioni = null;
isLoading = true;
elencoSessioni = MIService.InventSessCurrList();
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
await Task.Delay(1);
isLoading = false;
}
private int _sessID;
protected int sessID
{
get => _sessID;
set=> _sessID = value;
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOINVE </i>
<h4>Versione: 6.16.2212.1409</h4>
<h4>Versione: 6.16.2212.1413</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2212.1409
6.16.2212.1413
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2212.1409</version>
<version>6.16.2212.1413</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>