diff --git a/MP.Data/Controllers/MpInveController.cs b/MP.Data/Controllers/MpInveController.cs index 8fda9e72..002bf103 100644 --- a/MP.Data/Controllers/MpInveController.cs +++ b/MP.Data/Controllers/MpInveController.cs @@ -462,7 +462,7 @@ namespace MP.Data.Controllers } #endregion gestione UDC - #region gestione lotti + #region gestione lotti interni /// /// elenco lotti /// @@ -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 + + + /// + /// Elenco Totale lotti x sessione + /// + /// + /// + public List InveSessTotLotList(int sessID) + { + List dbResult = new List(); + 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 diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index 920ba9b2..3f8b3c6d 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -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; diff --git a/MP.Data/DatabaseModels/InveSessTotLotModel.cs b/MP.Data/DatabaseModels/InveSessTotLotModel.cs new file mode 100644 index 00000000..a4966250 --- /dev/null +++ b/MP.Data/DatabaseModels/InveSessTotLotModel.cs @@ -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; } + } +} diff --git a/MP.Data/MoonPro_InveContext.cs b/MP.Data/MoonPro_InveContext.cs index a6cec875..383ecec5 100644 --- a/MP.Data/MoonPro_InveContext.cs +++ b/MP.Data/MoonPro_InveContext.cs @@ -54,6 +54,7 @@ namespace MP.Data public virtual DbSet DbLottoData { get; set; } public virtual DbSet DbArtMag { get; set; } public virtual DbSet DbLottoArca { get; set; } + public virtual DbSet DbTotLotti { get; set; } #endregion PER INVE #region PER SPEC diff --git a/MP.INVE/Components/ListTotLotto.razor b/MP.INVE/Components/ListTotLotto.razor new file mode 100644 index 00000000..8c12f29d --- /dev/null +++ b/MP.INVE/Components/ListTotLotto.razor @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + @if (elencoTotLotto != null) + { + @foreach (var item in elencoTotLotto) + { + + + + + + + + + + + } + } + +
ID sessioneMagazzinoDescrizione MagLottoArticoloDescrizione ArtTot colliTot lotto
+ @item.InveSessID + + @item.CodMag + + @item.DescMag + + @item.Lotto + + @item.CodArticolo + + @item.DescrArt + + @item.NumColli + + @item.TotLotto +
diff --git a/MP.INVE/Components/ListTotLotto.razor.cs b/MP.INVE/Components/ListTotLotto.razor.cs new file mode 100644 index 00000000..b8bc91a2 --- /dev/null +++ b/MP.INVE/Components/ListTotLotto.razor.cs @@ -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? elencoTotLotto; + private List? SearchRecords; + [Parameter] + public SelectInvioParams currParams { get; set; } = null!; + + [Parameter] + public bool isLoading { get; set; } + } +} \ No newline at end of file diff --git a/MP.INVE/Data/MiDataService.cs b/MP.INVE/Data/MiDataService.cs index 1fdb940c..76856a20 100644 --- a/MP.INVE/Data/MiDataService.cs +++ b/MP.INVE/Data/MiDataService.cs @@ -360,6 +360,24 @@ namespace MP.INVE.Data Log.Debug($"ScanList Read from {source}: {ts.TotalMilliseconds}ms"); return result; } + public List InveSessTotLotList(int sessID) + { + string source = ""; + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + List? result = new List(); + result = dbController.InveSessTotLotList(sessID); + source = "DB"; + if (result == null) + { + result = new List(); + } + 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"; diff --git a/MP.INVE/Data/SelectInvioParams.cs b/MP.INVE/Data/SelectInvioParams.cs new file mode 100644 index 00000000..d6257110 --- /dev/null +++ b/MP.INVE/Data/SelectInvioParams.cs @@ -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 + } +} \ No newline at end of file diff --git a/MP.INVE/Data/SelectScanParams.cs b/MP.INVE/Data/SelectScanParams.cs index d6257110..c5ef148c 100644 --- a/MP.INVE/Data/SelectScanParams.cs +++ b/MP.INVE/Data/SelectScanParams.cs @@ -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; } diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj index 13d240d1..9554dd75 100644 --- a/MP.INVE/MP.INVE.csproj +++ b/MP.INVE/MP.INVE.csproj @@ -5,7 +5,7 @@ enable enable MP.INVE - 6.16.2212.1409 + 6.16.2212.1413 diff --git a/MP.INVE/Pages/Invio.razor b/MP.INVE/Pages/Invio.razor index a9dd4f12..4ed02cf6 100644 --- a/MP.INVE/Pages/Invio.razor +++ b/MP.INVE/Pages/Invio.razor @@ -1,6 +1,44 @@ @page "/Invio" -

Invio

+@if (isLoading) +{ + +} +else +{ + +
+
+

Invio

+
+
+ @if (elencoSessioni != null) + { +
+ SESSIONE + +
+ @if (sessID != 0) + { + + } + } +
+ + @*if (sessID != 0) + { + + }*@ +
+} diff --git a/MP.INVE/Pages/Invio.razor.cs b/MP.INVE/Pages/Invio.razor.cs index 9988e20a..6e72459e 100644 --- a/MP.INVE/Pages/Invio.razor.cs +++ b/MP.INVE/Pages/Invio.razor.cs @@ -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 sessions { get; set; } = null!; + protected override async Task OnInitializedAsync() { - + await reloadData(); + } + + private List? 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; } } } \ No newline at end of file diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html index ee89d9b1..c4cb6949 100644 --- a/MP.INVE/Resources/ChangeLog.html +++ b/MP.INVE/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOINVE -

Versione: 6.16.2212.1409

+

Versione: 6.16.2212.1413


Note di rilascio:
  • diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt index 46d2f8cf..f076be7a 100644 --- a/MP.INVE/Resources/VersNum.txt +++ b/MP.INVE/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2212.1409 +6.16.2212.1413 diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml index a9a3e7e5..702cc69d 100644 --- a/MP.INVE/Resources/manifest.xml +++ b/MP.INVE/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2212.1409 + 6.16.2212.1413 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