Merge branch 'Release/AddGiacenzaPrelim'

This commit is contained in:
Samuele Locatelli
2022-11-29 16:44:19 +01:00
60 changed files with 870 additions and 2120 deletions
+105 -13
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;
@@ -329,6 +330,55 @@ namespace MP.Data.Controllers
return answ;
}
/// <summary>
/// Elenco giacenze
/// </summary>
/// <param name="IdxOdl">id odl da cercare</param>
/// <returns></returns>
public List<AnagGiacenzeModel> ListGiacenze(int IdxOdl)
{
List<AnagGiacenzeModel> dbResult = new List<AnagGiacenzeModel>();
using (var dbCtx = new MoonPro_InveContext(_configuration))
{
try
{
dbResult = dbCtx
.DbGiacenzeData
.AsNoTracking()
.Where(x => x.IdxOdl == IdxOdl)
.ToList();
}
catch (Exception exc)
{
Log.Error($"Eccezione durante ListGiacenze{Environment.NewLine}{exc}");
}
}
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
/// macchina (ordinato x data registrazione)
@@ -600,7 +650,7 @@ namespace MP.Data.Controllers
/// <param name="idxMacchina">Macchina</param>
/// <param name="codGruppo">Gruppo</param>
/// <returns></returns>
public List<PODLExpModel> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo)
public List<PODLExpModel> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate)
{
List<PODLExpModel> dbResult = new List<PODLExpModel>();
@@ -610,10 +660,12 @@ namespace MP.Data.Controllers
var KeyRich = new SqlParameter("@KeyRich", keyRichPart);
var IdxMacc = new SqlParameter("@IdxMacchina", idxMacchina);
var CodGrp = new SqlParameter("@CodGruppo", codGruppo);
var DateFrom = new SqlParameter("@DateFrom", startDate);
var DateTo = new SqlParameter("@DateTo", endDate);
dbResult = dbCtx
.DbSetPODLExp
.FromSqlRaw("EXEC stp_PODL_getByFiltSpec @Lanciato, @KeyRich, @CodGruppo, @IdxMacchina", Lanc, KeyRich, CodGrp, IdxMacc)
.FromSqlRaw("EXEC stp_PODL_getByFiltSpec @Lanciato, @KeyRich, @CodGruppo, @IdxMacchina, @DateFrom, @DateTo", Lanc, KeyRich, CodGrp, IdxMacc, DateFrom, DateTo)
.AsNoTracking()
//.AsEnumerable()
.ToList();
@@ -621,6 +673,7 @@ namespace MP.Data.Controllers
return dbResult;
}
#if false
/// <summary>
/// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato)
@@ -643,7 +696,8 @@ namespace MP.Data.Controllers
.ToList();
}
return dbResult;
}
}
#endif
/// <summary>
/// Elenco valori ammessi x tabella/colonna
@@ -954,22 +1008,42 @@ namespace MP.Data.Controllers
public async Task<bool> PODL_startSetup(PODLExpModel editRec, int matrOpr, double tcRich, int pzPallet, string note)
{
bool answ = false;
PODLModel recPODL = new PODLModel()
{
IdxPromessa = editRec.IdxPromessa,
KeyRichiesta = editRec.KeyRichiesta,
KeyBCode = editRec.KeyBCode,
IdxOdl = editRec.IdxOdl,
CodArticolo = editRec.CodArticolo,
CodGruppo = editRec.CodGruppo,
IdxMacchina = editRec.IdxMacchina,
NumPezzi = editRec.NumPezzi,
Tcassegnato = editRec.Tcassegnato,
DueDate = editRec.DueDate,
Priorita = editRec.Priorita,
PzPallet = editRec.PzPallet,
Note = editRec.Note,
CodCli = editRec.CodCli,
InsertDate = editRec.InsertDate
};
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
var currRec = dbCtx
.DbSetPODLExp
.DbSetPODL
.AsNoTracking()
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
.Where(x => x.IdxPromessa == recPODL.IdxPromessa)
.FirstOrDefault();
if (currRec != null)
{
// eseguo stored attrezzaggio
var IdxPromessa = new SqlParameter("@idxPromessa", editRec.IdxPromessa);
var IdxPromessa = new SqlParameter("@idxPromessa", recPODL.IdxPromessa);
var MatrOpr = new SqlParameter("@MatrOpr", matrOpr);
var IdxMacchina = new SqlParameter("@IdxMacchina", editRec.IdxMacchina);
var IdxMacchina = new SqlParameter("@IdxMacchina", recPODL.IdxMacchina);
var TCRichAttr = new SqlParameter("@TCRichAttr", tcRich);
var PzPallet = new SqlParameter("@PzPallet", pzPallet);
var Note = new SqlParameter("@Note", note);
@@ -996,17 +1070,35 @@ namespace MP.Data.Controllers
/// <returns></returns>
public async Task<bool> PODLDeleteRecord(PODLExpModel currRec)
{
PODLModel recPODL = new PODLModel()
{
IdxPromessa = currRec.IdxPromessa,
KeyRichiesta = currRec.KeyRichiesta,
KeyBCode = currRec.KeyBCode,
IdxOdl = currRec.IdxOdl,
CodArticolo = currRec.CodArticolo,
CodGruppo = currRec.CodGruppo,
IdxMacchina = currRec.IdxMacchina,
NumPezzi = currRec.NumPezzi,
Tcassegnato = currRec.Tcassegnato,
DueDate = currRec.DueDate,
Priorita = currRec.Priorita,
PzPallet = currRec.PzPallet,
Note = currRec.Note,
CodCli = currRec.CodCli,
InsertDate = currRec.InsertDate
};
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
var currVal = dbCtx
.DbSetPODLExp
.Where(x => x.IdxPromessa == currRec.IdxPromessa)
.DbSetPODL
.Where(x => x.IdxPromessa == recPODL.IdxPromessa)
.FirstOrDefault();
dbCtx
.DbSetPODLExp
.DbSetPODL
.Remove(currVal);
await dbCtx.SaveChangesAsync();
fatto = true;
@@ -1024,7 +1116,7 @@ namespace MP.Data.Controllers
/// </summary>
/// <param name="currRec"></param>
/// <returns></returns>
public async Task<bool> PODLUpdateRecord(PODLExpModel editRec)
public async Task<bool> PODLUpdateRecord(PODLModel editRec)
{
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
@@ -1032,7 +1124,7 @@ namespace MP.Data.Controllers
try
{
var currRec = dbCtx
.DbSetPODLExp
.DbSetPODL
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
.FirstOrDefault();
if (currRec != null)
@@ -1051,7 +1143,7 @@ namespace MP.Data.Controllers
else
{
dbCtx
.DbSetPODLExp
.DbSetPODL
.Add(editRec);
}
await dbCtx.SaveChangesAsync();
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
[Table("RegGiacenze")]
public class AnagGiacenzeModel
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int IdxRG { get; set; } = 0;
public int IdxOdl { get; set; } = 0;
public string IdentRG { get; set; } = "";
public string Product { get; set; } = "";
public string Variety { get; set; } = "";
public string Supplier { get; set; } = "";
public string ExtDoc { get; set; } = "";
public DateTime DateRif { get; set; }
public double QtyTot { get; set; } = 0;
public int NumPack { get; set; } = 0;
public string Notes { get; set; } = "";
}
}
+9
View File
@@ -45,11 +45,20 @@ namespace MP.Data
#region Public Properties
#region PER INVE
public virtual DbSet<AnagMagModel> DbAnagMag { get; set; }
public virtual DbSet<InventorySessionModel> DbInveSess { get; set; }
public virtual DbSet<ScanDataModel> DbScanData { get; set; }
public virtual DbSet<AnagUdcModel> DbUdcData { get; set; }
public virtual DbSet<AnagLottoModel> DbLottoData { get; set; }
#endregion PER INVE
#region PER SPEC
public virtual DbSet<AnagGiacenzeModel> DbGiacenzeData { get; set; }
#endregion PER SPEC
#endregion Public Properties
+64 -1
View File
@@ -1,5 +1,6 @@
using Blazored.LocalStorage;
using Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using System;
using System.Collections.Generic;
@@ -13,7 +14,7 @@ namespace MP.Data
public class Utils
{
#region Public Properties
public static string redKeyArtUsed
{
@@ -109,6 +110,68 @@ namespace MP.Data
return answ;
}
public class POdlExt
{
/// <summary>
/// Clona un POdleExt a POdl
/// </summary>
/// <param name="selRec"></param>
/// <returns></returns>
public static PODLModel convertToPOdl(PODLExpModel selRec)
{
// creo record duplicato...
PODLModel newRec = new PODLModel()
{
Attivabile = selRec.Attivabile,
CodArticolo = selRec.CodArticolo,
CodCli = selRec.CodCli,
CodGruppo = selRec.CodGruppo,
DueDate = selRec.DueDate,
IdxMacchina = selRec.IdxMacchina,
IdxOdl = selRec.IdxOdl,
IdxPromessa = 0,
InsertDate = selRec.InsertDate,
KeyBCode = selRec.KeyBCode,
KeyRichiesta = selRec.KeyRichiesta,
Note = selRec.Note,
NumPezzi = selRec.NumPezzi,
Priorita = selRec.Priorita,
PzPallet = selRec.PzPallet,
Tcassegnato = selRec.Tcassegnato
};
return newRec;
}
/// <summary>
/// Clona un POdleExt
/// </summary>
/// <param name="selRec"></param>
/// <returns></returns>
public static PODLExpModel clone(PODLExpModel selRec)
{
// creo record duplicato...
PODLExpModel newRec = new PODLExpModel()
{
Attivabile = selRec.Attivabile,
CodArticolo = selRec.CodArticolo,
CodCli = selRec.CodCli,
CodGruppo = selRec.CodGruppo,
DueDate = selRec.DueDate,
IdxMacchina = selRec.IdxMacchina,
IdxOdl = selRec.IdxOdl,
IdxPromessa = 0,
InsertDate = selRec.InsertDate,
KeyBCode = selRec.KeyBCode,
KeyRichiesta = selRec.KeyRichiesta,
Note = $"DUPLICATED - {selRec.Note}",
NumPezzi = selRec.NumPezzi,
Priorita = selRec.Priorita,
PzPallet = selRec.PzPallet,
Tcassegnato = selRec.Tcassegnato
};
return newRec;
}
}
#endregion Public Methods
}
}
+2 -2
View File
@@ -1,9 +1,9 @@
<div class="row text-light">
<div class="col-5 pe-0 text-left">
<div class="col-5 pe-0 text-left text-nowrap">
<b>Mapo INVE @(DateTime.Today.Year)</b> | <span class="small">v.@version</span>
</div>
<div class="col-7 ps-0 text-end">
<span class="small">@($"{DateTime.Now:HH:mm:ss}")</span> | <a class="text-light" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="images/LogoEgw.png" /> Egalware </a>
<span class="small">@*@($"{DateTime.Now:HH:mm:ss}")*@</span><a class="text-light" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="images/LogoEgw.png" /> Egalware </a>
</div>
</div>
+2 -19
View File
@@ -3,38 +3,21 @@
@using System.Security.Claims
@using Microsoft.AspNetCore.Components.Authorization
@inject AuthenticationStateProvider AuthenticationStateProvider
<div class="d-flex w-100 justify-content-between">
<div class="px-2 py-1">
@if (userName != "0")
{
<div class="input-group text-truncate">
<div class="input-group-prepend">
<a title="LogOut" class="btn btn-sm btn-danger" @onclick="() => LogOut()"><i class="fas fa-sign-out-alt"></i></a>
</div>
<a title="Gestione account @userName" class="btn btn-sm btn-outline-dark mx-0 px-1" disabled>
<button title="LogOut" class="btn btn-sm btn-danger" @onclick="() => LogOut()"><i class="fas fa-sign-out-alt"></i></button>
<a title="Gestione account @userName" class="form-control btn btn-sm btn-outline-dark mx-0 px-1" disabled>
<i class="fas fa-user-alt"></i> <b>@userName</b>
</a>
</div>
}
else
{
}
</div>
<div class="pe-2">
<button class="btn btn-primary" @onclick="() => flushCache()" title="Forza Refresh Dati correnti"> Force Reload </button>
</div>
@* <div class="px-2 flex-grow-1 text-end">
<span class="text-secondary">@TipoSearch</span>
</div>
<div class="px-2 text-end">
@if (ShowSearch)
{
<SearchMod></SearchMod>
}
</div>*@
</div>
+16 -13
View File
@@ -34,7 +34,7 @@ namespace MP.INVE.Components
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected MiDataService MIDataService{ get; set; } = null!;
protected MiDataService MIDataService { get; set; } = null!;
#endregion Protected Properties
@@ -44,20 +44,23 @@ namespace MP.INVE.Components
{
OperatoreDTO answ = new OperatoreDTO();
answ = await localStorage.GetItemAsync<OperatoreDTO>("MatrOpr");
if (answ != null)
if (!NavManager.Uri.Contains("Jumper?"))
{
userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})";
if (NavManager.Uri.Contains("OperatoreLogin"))
{
NavManager.NavigateTo("Starter", true);
}
}
else
{
userName = "0";
if (!NavManager.Uri.Contains("OperatoreLogin"))
if (answ != null)
{
NavManager.NavigateTo("OperatoreLogin", true);
userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})";
if (NavManager.Uri.Contains("OperatoreLogin"))
{
NavManager.NavigateTo("Starter", true);
}
}
else
{
userName = "0";
if (!NavManager.Uri.Contains("OperatoreLogin"))
{
NavManager.NavigateTo("OperatoreLogin", true);
}
}
}
}
+3 -2
View File
@@ -1,5 +1,6 @@
<input @bind="@rawScan" class="fs-3 mb-2" @ref="@target" style="width: 17rem;" />
<div class="input-group input-group-sm">
<input @bind="@rawScan" class="fs-6 text-center mb-2 form-control" @ref="@target" style="width: 17rem;" />
</div>
@if (rawScan != null)
{
+2 -2
View File
@@ -21,9 +21,9 @@
<span class="input-group-text" id="inputGroup-sizing-sm">Magazzino</span>
<select class="form-select" @bind="@magazzino">
<option value="-1" selected>--Selezionare magazzino--</option>
@if (elencoMagazzini != null)
@if (ElencoMagazzini != null)
{
@foreach (var item in elencoMagazzini)
@foreach (var item in ElencoMagazzini)
{
@if (!item.DescMag.Contains("NON USARE"))
{
+4 -4
View File
@@ -26,7 +26,7 @@ namespace MP.INVE.Components
public void Dispose()
{
elencoSessioni = null;
elencoMagazzini = null;
ElencoMagazzini = null;
elencoOperatori = null;
SearchRecords = null;
GC.Collect();
@@ -83,7 +83,7 @@ namespace MP.INVE.Components
{
reqNew = false;
elencoOperatori = new List<AnagOperatoriModel>();
elencoMagazzini = new List<AnagMagModel>();
ElencoMagazzini = new List<AnagMagModel>();
}
private DateTime dtStart { get; set; } = DateTime.Now.AddMonths(-1);
@@ -107,7 +107,7 @@ namespace MP.INVE.Components
if (reqNew)
{
elencoOperatori = MIDataservice.ElencoOperatori();
elencoMagazzini = MIDataservice.ElencoMagazzini();
ElencoMagazzini = MIDataservice.ElencoMagazzini();
}
}
@@ -203,6 +203,6 @@ namespace MP.INVE.Components
private List<InventorySessionModel>? elencoSessioni;
private List<InventorySessionModel>? SearchRecords;
private List<AnagOperatoriModel>? elencoOperatori;
private List<AnagMagModel>? elencoMagazzini;
private List<AnagMagModel>? ElencoMagazzini;
}
}
+2 -2
View File
@@ -84,9 +84,9 @@
</tr>
</thead>
<tbody>
@if (elencoMagazzini != null)
@if (ElencoMagazzini != null)
{
@foreach (var item in elencoMagazzini)
@foreach (var item in ElencoMagazzini)
{
<tr>
<td>
+3 -3
View File
@@ -57,7 +57,7 @@ namespace MP.INVE.Components
mod = false;
desc = "";
}
private List<AnagMagModel>? elencoMagazzini;
private List<AnagMagModel>? ElencoMagazzini;
private List<AnagMagModel>? SearchRecords;
private AnagMagModel currMag { get; set; } = null!;
private bool mod { get; set; } = false;
@@ -88,11 +88,11 @@ namespace MP.INVE.Components
private async Task reloadData()
{
isLoading = true;
elencoMagazzini = null;
ElencoMagazzini = null;
SearchRecords = null;
SearchRecords = MIDataservice.ElencoMagazzini();
totalCount = SearchRecords.Count;
elencoMagazzini = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
ElencoMagazzini = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
await Task.Delay(1);
+3 -3
View File
@@ -8,9 +8,9 @@ elenco di buttons che servono a confermare operazione:
<li>mostrare button conferma/annulla</li>
</ul>*@
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-success">Conferma</button>
<button type="button" class="btn btn-danger">Annulla</button>
<div class="btn-group col-12" role="group" aria-label="Basic example">
<button type="button" class="btn btn-success col-6">Conferma</button>
<button type="button" class="btn btn-danger col-6">Annulla</button>
</div>
+32 -12
View File
@@ -11,31 +11,51 @@
@if (udc != null)
{
<div class="card">
<div class="card-title d-flex justify-content-between px-2">
<span class="fs-6 py-1 fw-bold">
@udc.UDC
</span>
<span class="fs-5 fw-bold">
@tipo
</span>
</div>
@*
<div class="card-title d-flex justify-content-between px-2">
<span class="fs-6 py-1 fw-bold">
@udc.UDC
</span>
<span class="fs-5 fw-bold">
@tipo
</span>
</div>*@
<div class="card-body">
<ul class="p-0">
<li class="list-group-item">Lotto: @udc.lottoNav.Lotto</li>
<li class="list-group-item">Articolo: @udc.lottoNav.CodArt</li>
<li class="list-group-item">
Lotto:
<div class="input-group input-group-sm">
<input class="form-control" value="@udc.lottoNav.Lotto" disabled />
<span class="input-group-text" id="basic-addon1">@tipo</span>
</div>
</li>
<li class="list-group-item">
Articolo:
<div class="input-group input-group-sm">
<input class="form-control @reqArtMod" value="@udc.lottoNav.CodArt" type="text" />
<button title="Mod articolo" @onclick="@cssDisableArt" class="btn btn-sm btn-primary"><i class="fa-solid fa-pen-to-square"></i></button>
</div>
</li>
<li class="list-group-item">
Quantità:
<div class="input-group input-group-sm">
<input class="form-control" value="@Math.Round(udc.Qta, 0)" />
<input class="form-control @reqQtaMod" value="@Math.Round(udc.Qta, 0)" type="number" />
<button title="Mod quantità" @onclick="@cssDisableQta" class="btn btn-sm btn-primary"><i class="fa-solid fa-pen-to-square"></i></button>
</div>
</li>
</ul>
<div class="col-12 d-flex flex-row-reverse">
<div class="col-12">
<ProcOperat></ProcOperat>
</div>
</div>
<div class="card-footer">
<div class="col-12">
Last scan: @udc.UDC
</div>
</div>
</div>
}
else
{
@@ -52,5 +52,15 @@ namespace MP.INVE.Components
}
}
protected string reqArtMod = "disabilita";
protected string reqQtaMod = "disabilita";
protected void cssDisableArt()
{
reqArtMod = "";
}
protected void cssDisableQta()
{
reqQtaMod = "";
}
}
}
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.2513</Version>
<Version>6.16.2211.2916</Version>
</PropertyGroup>
<ItemGroup>
+5 -23
View File
@@ -2,27 +2,9 @@
<div class="card mb-5">
<div class="card-header">
<h3>Acquisizione</h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-12">
<CodeScan></CodeScan>
</div>
</div>
</div>
<div class="card-footer">
<div class="row">
@if (lastScan != null)
{
<div class="col-12 text-end">
last scan: @($"{lastScan:yyyy.MM.dd HH:mm:ss}")
</div>
}
</div>
</div>
<div class="mb-2">
<h3 class="fw-bold">Acquisizione</h3>
</div>
<div class="col-12">
<CodeScan></CodeScan>
</div>
+2 -2
View File
@@ -53,9 +53,9 @@
<span class="input-group-text" id="inputGroup-sizing-sm">Magazzino</span>
<select class="form-select" @bind="@magazzino">
<option value="-1" selected>--Selezionare magazzino--</option>
@if (elencoMagazzini != null)
@if (ElencoMagazzini != null)
{
@foreach (var item in elencoMagazzini)
@foreach (var item in ElencoMagazzini)
{
<option value="@item.MagID">@item.CodMag @item.CodCS | @item.DescMag</option>
}
+1 -1
View File
@@ -31,7 +31,7 @@ namespace MP.INVE.Pages
private List<InventorySessionModel>? elencoSessioni;
private List<InventorySessionModel>? SearchRecords;
private List<AnagOperatoriModel>? elencoOperatori;
private List<AnagMagModel>? elencoMagazzini;
private List<AnagMagModel>? ElencoMagazzini;
private DataPager pagerSession = null!;
+37 -31
View File
@@ -1,46 +1,39 @@
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 Blazored.LocalStorage;
using Blazored.SessionStorage;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.WebUtilities;
using MP.INVE.Data;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using Microsoft.IdentityModel.Tokens;
using Blazored.SessionStorage;
using MP.INVE.Data;
namespace MP.INVE.Pages
{
public partial class Jumper
{
#region Protected Properties
protected string authKey { get; set; } = null!;
protected string idOPeratore { get; set; } = null!;
protected int inveSessionId { get; set; } = 0;
[Inject]
protected ILocalStorageService localStorage { get; set; } = null!;
[Inject]
protected ISessionStorageService sessionStorage { get; set; } = null!;
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
protected ILocalStorageService localStorage { get; set; } = null!;
[Inject]
protected MiDataService MIService { get; set; } = null!;
private bool logged { get; set; } = false;
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
[Inject]
protected ISessionStorageService sessionStorage { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
private List<AnagOperatoriModel> operatore = new List<AnagOperatoriModel>();
protected string idOPeratore { get; set; } = null!;
protected string authKey { get; set; } = null!;
protected int inveSessionId { get; set; } = 0;
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
@@ -63,7 +56,6 @@ namespace MP.INVE.Pages
if (currOpr != null)
{
string hash = MIService.EncriptData(currOpr.authKey);
OperatoreDTO sessionOpr = new OperatoreDTO
{
@@ -76,9 +68,23 @@ namespace MP.INVE.Pages
await localStorage.SetItemAsync("MatrOpr", currOpr);
await sessionStorage.SetItemAsync("idSessione", inveSessionId);
}
NavManager.NavigateTo($"Acquisizione?idSessione={inveSessionId}");
NavManager.NavigateTo($"Acquisizione?idSessione={inveSessionId}");
}
}
}
#endregion Protected Methods
#region Private Fields
private List<AnagOperatoriModel> operatore = new List<AnagOperatoriModel>();
#endregion Private Fields
#region Private Properties
private bool logged { get; set; } = false;
#endregion Private Properties
}
}
+14 -2
View File
@@ -34,7 +34,19 @@ namespace MP.INVE.Pages
private ILocalStorageService localStorage { get; set; } = null!;
private int idOperatore { get; set; } = 0;
private string authKey { get; set; } = "";
private string authKey
{
get => _authKey;
set {
if (_authKey != value)
{
_authKey = value;
login();
}
}
}
private string _authKey { get; set; } = "";
private bool logged { get; set; } = false;
private List<AnagOperatoriModel>? elencoOperatori;
@@ -64,8 +76,8 @@ namespace MP.INVE.Pages
Cognome = currOpr.Cognome,
hashAuthKey = hash
};
NavManager.NavigateTo("InveSession", true);
localStorage.SetItemAsync("MatrOpr", sessionOpr);
NavManager.NavigateTo("InveSession", true);
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
@page "/Elencomagazzini"
@page "/ElencoMagazzini"
@inject IJSRuntime JSRuntime
+4 -4
View File
@@ -85,7 +85,7 @@ namespace MP.INVE.Pages
}
private List<AnagMagModel>? elencoMagazzini;
private List<AnagMagModel>? ElencoMagazzini;
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
@@ -106,9 +106,9 @@ namespace MP.INVE.Pages
private async Task reloadData()
{
await Task.Delay(1);
elencoMagazzini = null;
ElencoMagazzini = null;
isLoading = true;
elencoMagazzini = MIDataservice.ElencoMagazzini();
ElencoMagazzini = MIDataservice.ElencoMagazzini();
isLoading = false;
}
@@ -143,7 +143,7 @@ namespace MP.INVE.Pages
if (alert)
{
await MIDataservice.DeleteMag(mag);
NavManager.NavigateTo("Elencomagazzini", true);
NavManager.NavigateTo("ElencoMagazzini", true);
await reloadData();
}
}
+1
View File
@@ -63,5 +63,6 @@
<script type="text/javascript" src="~/lib/qrcode.js"></script>
<script type="text/javascript" src="~/lib/qrHelper.js"></script>
<script type="text/javascript" src="~/lib/WindowSize.js"></script>
<script type="text/javascript" src="~/lib/UserAgent.js"></script>
</body>
</html>
-11
View File
@@ -25,15 +25,7 @@ string connStringRedis = configuration.GetConnectionString("Redis");
string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
// avvio oggetto shared x redis...
var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
// Add services to the container.
builder.Services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
.AddNegotiate();
builder.Services.AddAuthorization(options =>
{
// By default, all incoming requests will be authorized according to the default policy.
options.FallbackPolicy = options.DefaultPolicy;
});
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
@@ -65,9 +57,6 @@ app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
+3 -3
View File
@@ -1,9 +1,9 @@
{
"iisSettings": {
"windowsAuthentication": true,
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:46815",
"applicationUrl": "http://localhost:46816",
"sslPort": 44370
}
},
@@ -12,7 +12,7 @@
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7212;http://localhost:5212",
"applicationUrl": "https://localhost:7213;http://localhost:5213",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOINVE </i>
<h4>Versione: 6.16.2211.2513</h4>
<h4>Versione: 6.16.2211.2916</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2211.2513
6.16.2211.2916
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2211.2513</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>
+4 -12
View File
@@ -6,24 +6,16 @@
<div class="page">
<div class="@sideClass">
@if ((Height != 480) && (Width != 320))
{
<NavMenu EC_compressUpdated="@UpdateNavDisplay" />
}
<NavMenu EC_compressUpdated="@UpdateNavDisplay" />
</div>
<main>
<div class="top-row px-4 justify-content-between">
@if ((Height != 480) && (Width != 320))
{
<CmpTop></CmpTop>
}
<CmpTop></CmpTop>
</div>
<article class="content pt-0 m-2">
@if (userName != "0" || NavManager.Uri.Contains("OperatoreLogin"))
{
@Body
}
@*@remoteUserAgent*@
@Body
</article>
<div class="fixed-bottom bottom-row px-2">
<CmpFooter></CmpFooter>
+10 -24
View File
@@ -1,7 +1,10 @@
using Blazored.LocalStorage;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Components;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.JSInterop;
using MP.Data.DTO;
using System.Reflection;
namespace MP.INVE.Shared
{
@@ -23,29 +26,10 @@ namespace MP.INVE.Shared
#region Protected Methods
protected async Task getId()
protected string remoteUserAgent = "--";
protected async Task getAgent()
{
OperatoreDTO answ = new OperatoreDTO();
answ = await localStorage.GetItemAsync<OperatoreDTO>("MatrOpr");
if (answ != null)
{
userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})";
if (NavManager.Uri.Contains("OperatoreLogin"))
{
NavManager.NavigateTo("Elencomagazzini", true);
}
}
else
{
userName = "0";
if (Height != 480 && Width != 320)
{
if (!NavManager.Uri.Contains("OperatoreLogin"))
{
NavManager.NavigateTo("OperatoreLogin", true);
}
}
}
remoteUserAgent = await JSRuntime.InvokeAsync<string>("getUserAgent");
}
public int Height { get; set; }
@@ -59,10 +43,12 @@ namespace MP.INVE.Shared
protected override async Task OnInitializedAsync()
{
#if false
var dimension = await JSRuntime.InvokeAsync<WindowDimension>("getWindowDimensions");
Height = dimension.Height;
Width = dimension.Width;
await getId();
Width = dimension.Width;
#endif
await getAgent();
}
protected void UpdateNavDisplay()
+1 -1
View File
@@ -33,7 +33,7 @@
</NavLink>
</div>
<div class="nav-item px-2 col-12">
<NavLink class="nav-link px-2" href="Elencomagazzini">
<NavLink class="nav-link px-2" href="ElencoMagazzini">
<div class="col-2">
<span class="px-2" aria-hidden="true"><i class="fa-solid fa-warehouse"></i></span>
</div>
+2 -2
View File
@@ -19,7 +19,7 @@
"redisLongTimeCache": "15",
"MpIoBaseUrl": "http://localhost:20967/",
"BaseUrl": "https://iis01.egalware.com/mp/inve/Acquisizione?",
"BaseUrlJumper": "https://iis01.egalware.com/mp/inve/jumper?",
"BaseUrlJumperTest": "https://Localhost:7212/jumper?"
"BaseUrlJumper": "https://iis01.egalware.com/mp/inve/Jumper?",
"BaseUrlJumperTest": "https://localhost:7213/Jumper?"
}
}
+8 -3
View File
@@ -23,9 +23,9 @@ body {
font-family: 'Roboto Condensed', sans-serif;
}
@media (max-width: 320px) {
.navbar-toggler {
display: none;
}
/*.navbar-toggler {
display: none;
}*/
}
.compresser {
display: none;
@@ -60,6 +60,11 @@ a,
.loginOperatore {
box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
}
.disabilita {
pointer-events: none;
color: #AAA;
background: #F5F5F5;
}
.watermark {
position: absolute;
top: 250px;
+8 -2
View File
@@ -17,9 +17,9 @@ html, body {
@media(max-width: 320px) {
.navbar-toggler {
/*.navbar-toggler {
display: none;
}
}*/
}
.compresser {
@@ -64,6 +64,12 @@ a, .btn-link {
box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
}
.disabilita {
pointer-events: none;
color: #AAA;
background: #F5F5F5;
}
.watermark {
position: absolute;
top: 250px;
+1 -1
View File
File diff suppressed because one or more lines are too long
+3
View File
@@ -0,0 +1,3 @@
window.getUserAgent = () => {
return navigator.userAgent;
};
+11 -2
View File
@@ -245,13 +245,22 @@ else
</td>
<td>
@record.IdxMacchina
@*<div class="small textConsensed text-secondary">@record.MachineNav.Descrizione</div>*@
</td>
<td>
@record.DtRif
</td>
<td>
@record.IdxODL
<div>
<div>
@record.IdxODL
</div>
@if (record.IdxODL > 0)
{
<div>
<span class="badge bg-primary textConsensed"><a href="Giacenze?IdxOdl=@record.IdxODL" target="_blank" class="text-light text-decoration-none">APRI GIACENZE</a></span>
</div>
}
</div>
</td>
<td>
@if (isEditing == false)
+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);
}
}
}
+36 -22
View File
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using MP.SPEC.Services;
@@ -76,28 +77,10 @@ namespace MP.SPEC.Components
protected async Task cloneRecord(PODLExpModel selRec)
{
// creo record duplicato...
PODLExpModel newRec = new PODLExpModel()
{
Attivabile = selRec.Attivabile,
CodArticolo = selRec.CodArticolo,
CodCli = selRec.CodCli,
CodGruppo = selRec.CodGruppo,
DueDate = selRec.DueDate,
IdxMacchina = selRec.IdxMacchina,
IdxOdl = selRec.IdxOdl,
IdxPromessa = 0,
InsertDate = selRec.InsertDate,
KeyBCode = selRec.KeyBCode,
KeyRichiesta = selRec.KeyRichiesta,
Note = $"DUPLICATED - {selRec.Note}",
NumPezzi = selRec.NumPezzi,
Priorita = selRec.Priorita,
PzPallet = selRec.PzPallet,
Tcassegnato = selRec.Tcassegnato
};
currRecord = null;
currRecord = selRec;
await RecordSel.InvokeAsync(newRec);
await RecordSel.InvokeAsync(Utils.POdlExt.clone(selRec));
header = "Nuovo PODL";
}
/// <summary>
@@ -157,6 +140,7 @@ namespace MP.SPEC.Components
protected async Task selRecord(PODLExpModel? selRec)
{
currRecord = selRec;
header = "Modifica PODL";
await RecordSel.InvokeAsync(selRec);
}
@@ -241,6 +225,31 @@ namespace MP.SPEC.Components
#region Private Properties
private DateTime selDtStart
{
get => actFilter.DtStart;
set
{
if (!actFilter.DtStart.Equals(value))
{
actFilter.DtStart = value;
currPage = 1;
}
}
}
private DateTime selDtEnd
{
get => actFilter.DtEnd;
set
{
if (!actFilter.DtEnd.Equals(value))
{
actFilter.DtEnd = value;
currPage = 1;
}
}
}
private int _totalCount { get; set; } = 0;
private int currPage
@@ -374,6 +383,11 @@ namespace MP.SPEC.Components
answ = !odlCurrList.Contains(idxMacchina);
return answ;
}
protected string header
{
get => actFilter.Header;
set => actFilter.Header = value;
}
/// <summary>
/// processa evento richiesto
@@ -413,7 +427,7 @@ namespace MP.SPEC.Components
{
ListRecords = null;
isLoading = true;
SearchRecords = await MDService.ListPODLFilt(hasOdl, StatoSel, macchina, reparto);
SearchRecords = await MDService.ListPODLFilt(hasOdl, StatoSel, macchina, reparto, selDtStart, selDtEnd);
totalCount = SearchRecords.Count;
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
-72
View File
@@ -1,72 +0,0 @@
<div class="offcanvas offcanvas-end" tabindex="-1" id="paramsFilterExample" aria-labelledby="paramsFilterExampleLabel">
<div class="offcanvas-header">
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTRI</b></h3>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div>
<div>
Seleziona i filtri per:
</div>
</div>
<div>
<div class="small mt-2">
<label class="px-2" for="macchina" title="Selezionare inizio periodo">Reparto</label>
</div>
<div class="input-group px-2">
<label class="input-group-text" for="macchina" title="Selezionare la macchina da visualizzare"><i class="fa-solid fa-hard-drive"></i></label>
<select @bind="@selReparto" id="macchina" class="form-select" title="Selezionare la macchina da visualizzare">
<option value="*">--- Tutti ---</option>
@if (ListGruppiFase != null)
{
foreach (var item in ListGruppiFase)
{
<option value="@item.CodGruppo">@item.DescrGruppo</option>
}
}
</select>
</div>
</div>
<div>
<div class="small mt-2">
<label class="px-2" for="macchina" title="Selezionare inizio periodo">Macchina</label>
</div>
<div class="input-group px-2">
<label class="input-group-text" for="macchina" title="Selezionare la macchina da visualizzare"><i class="fa-solid fa-hard-drive"></i></label>
<select @bind="@selMacchina" id="macchina" class="form-select" title="Selezionare la macchina da visualizzare">
<option value="*">--- Tutti ---</option>
@if (ListMacchine != null)
{
foreach (var item in ListMacchine)
{
<option value="@item.CodMacchina">@item.Descrizione</option>
}
}
</select>
</div>
</div>
<div>
<div class="small mt-2">
<label class="px-2" for="fase" title="Selezionare inizio periodo">Fase</label>
</div>
<div class="input-group px-2">
<label class="input-group-text" for="fase" title="Selezionare la fase da visualizzare"><i class="fa-solid fa-screwdriver-wrench"></i></label>
<select @bind="@selStato" id="fase" class="form-select" title="Selezionare la fase da visualizzare">
<option value="*">--- Tutti ---</option>
@if (ListStati != null)
{
foreach (var item in ListStati)
{
<option value="@item.value">@item.label</option>
}
}
</select>
</div>
</div>
</div>
</div>
-114
View File
@@ -1,114 +0,0 @@
using Blazored.LocalStorage;
using Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
namespace MP.SPEC.Components
{
public partial class SelFilterPODL
{
#region Public Properties
[Parameter]
public SelectPOdlParams currFilter { get; set; } = new SelectPOdlParams();
[Parameter]
public EventCallback<SelectPOdlParams> FilterChanged { get; set; }
[Parameter]
public List<AnagGruppi>? ListGruppiFase { get; set; } = null;
[Parameter]
public List<Macchine>? ListMacchine { get; set; } = null;
[Parameter]
public List<ListValues>? ListStati { get; set; } = null;
#endregion Public Properties
#region Protected Properties
[Inject]
protected ILocalStorageService localStorage { get; set; } = null!;
protected async Task getReparto()
{
string keyStor = "reparto";
string localReparto = await localStorage.GetItemAsync<string>(keyStor);
if (!string.IsNullOrEmpty(localReparto))
{
selReparto = localReparto;
}
else
{
await localStorage.SetItemAsync(keyStor, selReparto);
}
}
protected bool hasOdl
{
get => currFilter.hasOdl;
}
#endregion Protected Properties
#region Private Properties
private string selMacchina
{
get => currFilter.IdxMacchina;
set
{
if (currFilter.IdxMacchina != value)
{
currFilter.IdxMacchina = value;
Task.Delay(1);
reportChange();
}
}
}
private string selReparto
{
get => currFilter.CodReparto;
set
{
if (currFilter.CodReparto != value)
{
currFilter.CodReparto = value;
Task.Delay(1);
reportChange();
}
}
}
private string selStato
{
get => currFilter.CodFase;
set
{
if (currFilter.CodFase != value)
{
currFilter.CodFase = value;
Task.Delay(1);
reportChange();
}
}
}
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
//selReparto = localStorage.GetItemAsync<string>("reparto").ToString();
await getReparto();
}
#endregion Private Properties
#region Private Methods
private void reportChange()
{
FilterChanged.InvokeAsync(currFilter);
}
#endregion Private Methods
}
}
+2 -2
View File
@@ -16,7 +16,7 @@
<label class="px-2" for="macchina" title="Selezionare inizio periodo">Reparto</label>
</div>
<div class="input-group px-2">
<label class="input-group-text" for="macchina" title="Selezionare la macchina da visualizzare"><i class="fa-solid fa-hard-drive"></i></label>
<label class="input-group-text" for="macchina" title="Selezionare la macchina da visualizzare"><i class="fa-solid fa-building"></i> &nbsp; </label>
<select @bind="@selReparto" id="macchina" class="form-select" title="Selezionare la macchina da visualizzare">
<option value="*">--- Tutti ---</option>
@if (ListGruppiFase != null)
@@ -42,7 +42,7 @@
{
foreach (var item in ListMacchine)
{
<option value="@item.CodMacchina">@item.Descrizione</option>
<option value="@item.IdxMacchina">@item.Descrizione</option>
}
}
</select>
+76 -26
View File
@@ -701,14 +701,16 @@ namespace MP.SPEC.Data
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
/// <param name="idxMacchina">Macchina</param>
/// <param name="codGruppo">Gruppo</param>
/// <param name="startDate">Data inizio</param>
/// <param name="endDate">Data fine</param>
/// <returns></returns>
public async Task<List<PODLExpModel>> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo)
public async Task<List<PODLExpModel>> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate)
{
List<PODLExpModel>? result = new List<PODLExpModel>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisPOdlList}:{lanciato}:{keyRichPart}:{idxMacchina}:{codGruppo}";
string currKey = $"{redisPOdlList}:{codGruppo}:{idxMacchina}:{keyRichPart}:{lanciato}:{startDate:yyyyMMdd_HHmmss}:{endDate:yyyyMMdd_HHmmss}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
@@ -718,7 +720,7 @@ namespace MP.SPEC.Data
}
else
{
result = await Task.FromResult(dbController.ListPODLFilt(lanciato, keyRichPart, idxMacchina, codGruppo));
result = await Task.FromResult(dbController.ListPODLFilt(lanciato, keyRichPart, idxMacchina, codGruppo, startDate, endDate));
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache));
@@ -733,41 +735,75 @@ namespace MP.SPEC.Data
return result;
}
/// <summary>
/// Elenco PODL avviati filtrati x articolo, KeyRich (che contiene stato)
/// </summary>
/// <param name="codArt">Cod articolo</param>
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
/// <param name="IdxOdl">id odl da cercare</param>
/// <returns></returns>
public async Task<List<PODLModel>> ListPODLFiltNOOdl(string codArt, string keyRichPart)
public async Task<List<AnagGiacenzeModel>> ListGiacenze(int IdxOdl)
{
List<PODLModel>? result = new List<PODLModel>();
List<AnagGiacenzeModel>? result = new List<AnagGiacenzeModel>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisPOdlListNOOdl}:{codArt}:{keyRichPart}";
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));
result = await Task.FromResult(dbController.ListGiacenze(IdxOdl));
// 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>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ListPODLFiltNOOdl | Read from {readType}: {ts.TotalMilliseconds}ms");
Log.Debug($"ListGiacenze | Read from {readType}: {ts.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// elenco TUTTI gli ODL
/// </summary>
/// <param name="IdxOdl"></param>
/// <returns></returns>
public List<ODLModel> ListOdlAll()
{
List<ODLModel>? result = new List<ODLModel>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
#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<AnagGiacenzeModel>>($"{rawData}");
readType = "REDIS";
}
else
{
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache));
}
if (result == null)
{
result = new List<AnagGiacenzeModel>();
}
#endif
result = dbController.ListOdlAll();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ListOdlAll | Read from {readType}: {ts.TotalMilliseconds}ms");
return result;
}
@@ -1062,7 +1098,12 @@ namespace MP.SPEC.Data
/// <returns></returns>
public async Task<bool> PODLDeleteRecord(PODLExpModel currRec)
{
return await dbController.PODLDeleteRecord(currRec);
var dbResult = await dbController.PODLDeleteRecord(currRec);
// elimino cache redis...
RedisValue pattern = new RedisValue($"{redisXdlData}:*");
bool answ = await ExecFlushRedisPattern(pattern);
await Task.Delay(1);
return dbResult;
}
/// <summary>
@@ -1072,7 +1113,12 @@ namespace MP.SPEC.Data
/// <returns></returns>
public async Task<bool> POdlDoSetup(PODLExpModel currRec)
{
return await dbController.PODL_startSetup(currRec, 0, 1, 1, "");
var dbResult = await dbController.PODL_startSetup(currRec, 0, 1, 1, "");
// elimino cache redis...
RedisValue pattern = new RedisValue($"{redisXdlData}:*");
bool answ = await ExecFlushRedisPattern(pattern);
await Task.Delay(1);
return dbResult;
}
/// <summary>
@@ -1080,13 +1126,13 @@ namespace MP.SPEC.Data
/// </summary>
/// <param name="currRec"></param>
/// <returns></returns>
public async Task<bool> POdlUpdateRecord(PODLExpModel currRec)
public async Task<bool> POdlUpdateRecord(PODLModel currRec)
{
var dbResult = await dbController.PODLUpdateRecord(currRec);
// elimino cache redis...
RedisValue pattern = new RedisValue($"{redisPOdlList}:*");
RedisValue pattern = new RedisValue($"{redisXdlData}:*");
bool answ = await ExecFlushRedisPattern(pattern);
await Task.Delay(1);
return dbResult;
}
@@ -1241,13 +1287,17 @@ namespace MP.SPEC.Data
private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList";
private const string redisOdlCurrByMac = redisBaseAddr + "SPEC:Cache:OdlByMac";
private const string redisOdlList = redisBaseAddr + "SPEC:Cache:OdlList";
private const string redisPOdlByOdl = redisBaseAddr + "SPEC:Cache:POdlByOdl";
private const string redisPOdlByPOdl = redisBaseAddr + "SPEC:Cache:POdlByPOdl";
private const string redisPOdlList = redisBaseAddr + "SPEC:Cache:POdlList";
private const string redisPOdlListNOOdl = redisBaseAddr + "SPEC:Cache:POdlListNOOdl";
private const string redisXdlData = redisBaseAddr + "SPEC:Cache:XDL";
private const string redisOdlCurrByMac = redisXdlData + ":OdlByMac";
private const string redisOdlList = redisXdlData + ":OdlList";
private const string redisPOdlByOdl = redisXdlData + ":POdlByOdl";
private const string redisPOdlByPOdl = redisXdlData + ":POdlByPOdl";
private const string redisPOdlList = redisXdlData + ":POdlList";
private const string redisGiacenzaList = redisBaseAddr + ":GiacenzaList";
private const string redisPOdlListNOOdl = redisXdlData + ":POdlListNOOdl";
private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom";
private const string redisTipoArt = redisBaseAddr + "SPEC:Cache:TipoArt";
-77
View File
@@ -1,77 +0,0 @@
using MP.Data;
namespace MP.SPEC.Data
{
public class SelectOdlParams
{
#region Public Constructors
public SelectOdlParams()
{ }
#endregion Public Constructors
#region Public Properties
public bool IsActive { get; set; } = true;
public string CodReparto { get; set; } = "*";
public string CodStato { get; set; } = "*";
public string IdxMacchina { get; set; } = "*";
public int MaxRecord { get; set; } = 100;
public int NumRec { get; set; } = 10;
public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-10);
public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
public int CurrPage { get; set; } = 1;
public string SearchVal { get; set; } = "*";
public int TotCount { get; set; } = 0;
#endregion Public Properties
#region Public Methods
public override bool Equals(object obj)
{
if (!(obj is SelectOdlParams item))
return false;
if (IsActive != item.IsActive)
return false;
if (CodReparto != item.CodReparto)
return false;
if (CodStato != item.CodStato)
return false;
if (IdxMacchina != item.IdxMacchina)
return false;
if (MaxRecord != item.MaxRecord)
return false;
if (NumRec != item.NumRec)
return false;
if (DtStart != item.DtStart)
return false;
if (DtEnd != item.DtEnd)
return false;
if (CurrPage != item.CurrPage)
return false;
if (SearchVal != item.SearchVal)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
-92
View File
@@ -1,92 +0,0 @@
namespace MP.SPEC.Data
{
public class SelectPOdlParams
{
#region Public Constructors
public SelectPOdlParams()
{ }
#endregion Public Constructors
#region Public Properties
public string CodFase { get; set; } = "*";
public string CodReparto { get; set; } = "*";
public int CurrPage { get; set; } = 1;
public bool hasOdl { get; set; } = false;
public string IdxMacchina { get; set; } = "*";
public int MaxRecord { get; set; } = 100;
public int NumRec { get; set; } = 10;
public string SearchVal { get; set; } = "*";
public int TotCount { get; set; } = 0;
#endregion Public Properties
#region Public Methods
public SelectPOdlParams clone()
{
SelectPOdlParams clonedData = new SelectPOdlParams()
{
CodFase = this.CodFase,
CurrPage = this.CurrPage,
IdxMacchina = this.IdxMacchina,
CodReparto = this.CodReparto,
MaxRecord = this.MaxRecord,
NumRec = this.NumRec,
SearchVal = this.SearchVal,
TotCount = this.TotCount,
hasOdl = this.hasOdl
};
return clonedData;
}
public override bool Equals(object obj)
{
if (!(obj is SelectPOdlParams item))
return false;
if (CodFase != item.CodFase)
return false;
if (CodReparto != item.CodReparto)
return false;
if (MaxRecord != item.MaxRecord)
return false;
if (NumRec != item.NumRec)
return false;
if (TotCount != item.TotCount)
return false;
if (CurrPage != item.CurrPage)
return false;
if (IdxMacchina != item.IdxMacchina)
return false;
if (SearchVal != item.SearchVal)
return false;
if (hasOdl != item.hasOdl)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
+5 -1
View File
@@ -17,13 +17,14 @@ namespace MP.SPEC.Data
public string CodReparto { get; set; } = "*";
public int CurrPage { get; set; } = 1;
public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-10);
public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddMonths(-2);
public bool HasOdl { get; set; } = false;
public string IdxMacchina { get; set; } = "*";
public bool IsActive { get; set; } = true;
public int MaxRecord { get; set; } = 100;
public int NumRec { get; set; } = 10;
public string SearchVal { get; set; } = "*";
public string Header { get; set; } = "";
public int TotCount { get; set; } = 0;
#endregion Public Properties
@@ -45,6 +46,7 @@ namespace MP.SPEC.Data
MaxRecord = this.MaxRecord,
NumRec = this.NumRec,
SearchVal = this.SearchVal,
Header = this.Header,
TotCount = this.TotCount
};
return clonedData;
@@ -87,6 +89,8 @@ namespace MP.SPEC.Data
if (SearchVal != item.SearchVal)
return false;
if (Header != item.Header)
return false;
if (TotCount != item.TotCount)
return false;
+2 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2211.2519</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>
+21
View File
@@ -0,0 +1,21 @@
@page "/Giacenze"
<div class="card">
<div class="card-header">
<h3>Giacenze</h3>
@if (odlExp != null)
{
@odlExp.CodArticolo
}
</div>
<div class="card-body">
<ListGiacenze IdxOdl="@IdxOdl"></ListGiacenze>
</div>
<div class="card-footer">
</div>
</div>
+53
View File
@@ -0,0 +1,53 @@
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 MP.Data.DatabaseModels;
using MP.SPEC.Data;
using Microsoft.AspNetCore.WebUtilities;
using Blazored.SessionStorage;
namespace MP.SPEC.Pages
{
public partial class Giacenze
{
[Inject]
MpDataService MDService { get; set; } = null!;
[Inject]
ISessionStorageService sessionStorage { get; set; } = null!;
[Inject]
NavigationManager NavManager { get; set; } = null!;
protected List<ODLModel>? elencoOdl;
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);
}
elencoOdl = MDService.ListOdlAll();
odlExp = elencoOdl.Where(o => (o.IdxOdl == IdxOdl)).SingleOrDefault();
}
}
}
+23 -104
View File
@@ -8,7 +8,7 @@
<h3><b>ODL</b></h3>
</div>
</div>
<div class="col-4">
<div class="col-2">
<div class="input-group input-group-sm">
<div class="input-group-text">
<span class="me-1 @leftStringCSS">Completati</span>
@@ -19,116 +19,35 @@
</div>
</div>
</div>
<div class="d-flex justify-content-end">
<div class="d-flex justify-content-end col-6">
<div class="d-flex justify-content-between">
@if (filtActive)
{
<div class=" rounded small d-flex justify-content-between" title="Filtri attivi">
@*<i class="fas fa-exclamation text-warning"></i>*@
@if (filtActive)
{
<div class=" rounded small d-flex justify-content-between" title="Filtri attivi">
@*<i class="fas fa-exclamation text-warning"></i>*@
@if (selReparto != "*")
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetReparto()" title="Rimuovi Filtro Reparto"><i class="fa-solid fa-building"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
@if (selMacchina != "*")
{
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetMacchina()" title="Rimuovi Filtro Impianto"><i class="fa-solid fa-hard-drive"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
@if (selStato != "*")
{
}
@if (selStato != "*")
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetFase()" title="Rimuovi Filtro Parametro"><i class="fa-solid fa-sliders"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
}
</div>
}
<span class="badge bg-secondary mx-2 text-nowrap" title="Filtro Data inizio attivo">@selDtStart &nbsp <i class="fa-solid fa-calendar-days"></i></span>
<span class="badge bg-secondary mx-2 text-nowrap" title="Filtro Data fine attivo">@selDtEnd &nbsp <i class="fa-solid fa-calendar-days"></i></span>
<div class="p-2 text-end">
<a class="pt-2 text-dark" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample" @onclick="setDtMax">
<i class="fa-solid fa-bars"></i>
</a>
</div>
}
<div class="p-2">
<a class="pt-2 text-dark" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample" @onclick="setDtMax">
<i class="fa-solid fa-bars"></i>
</a>
</div>
</div>
<SelFilterXDL currFilter="@currFilter" ListMacchine="@ListMacchine" ListStati="@ListStati" ListGruppiFase="@ListGruppiFase" FilterChanged="updateFilter"></SelFilterXDL>
@*<div class="offcanvas offcanvas-end" tabindex="-1" id="paramsFilterExample" aria-labelledby="paramsFilterExampleLabel">
<div class="offcanvas-header">
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTRI</b></h3>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div>
<div>
Seleziona i filtri per:
</div>
</div>
<div>
<div class="small mt-2">
<label class="px-2" for="macchina" title="Selezionare inizio periodo">Reparto</label>
</div>
<div class="input-group px-2">
<label class="input-group-text" for="macchina" title="Selezionare la macchina da visualizzare"><i class="fa-solid fa-hard-drive"></i></label>
<select @bind="@selMacchina" id="macchina" class="form-select" title="Selezionare la macchina da visualizzare">
<option value="*">--- Tutti ---</option>
@if (ListMacchine != null)
{
foreach (var item in ListMacchine)
{
<option value="@item">@item</option>
}
}
</select>
</div>
</div>
<div>
<div class="small mt-2">
<label class="px-2" for="macchina" title="Selezionare inizio periodo">Macchina</label>
</div>
<div class="input-group px-2">
<label class="input-group-text" for="macchina" title="Selezionare la macchina da visualizzare"><i class="fa-solid fa-hard-drive"></i></label>
<select @bind="@selMacchina" id="macchina" class="form-select" title="Selezionare la macchina da visualizzare">
<option value="*">--- Tutti ---</option>
@if (ListMacchine != null)
{
foreach (var item in ListMacchine)
{
<option value="@item">@item</option>
}
}
</select>
</div>
</div>
<div>
<div class="small mt-2">
<label class="px-2" for="fase" title="Selezionare inizio periodo">Fase</label>
</div>
<div class="input-group px-2">
<label class="input-group-text" for="fase" title="Selezionare la fase da visualizzare"><i class="fa-solid fa-screwdriver-wrench"></i></label>
<select @bind="@selStato" id="fase" class="form-select" title="Selezionare la fase da visualizzare">
<option value="*">--- Tutti ---</option>
@if (ListStati != null)
{
foreach (var item in ListStati)
{
<option value="@item.value">@item.label</option>
}
}
</select>
</div>
</div>
@if (!isActive)
{
<div class="small mt-2">
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Inizio Periodo</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="dtMin" title="Selezionare inizio periodo"><i class="fa-regular fa-calendar-minus"></i></label>
<input class="form-control" @bind="@selDtStart" id="dtMin" type="datetime-local" title="Data minima eventi da visualizzare">
</div>
<div class="small mt-2">
<label class="px-2" for="dtMax" title="Selezionare fine periodo">Fine Periodo</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="dtMax" title="Selezionare fine periodo"><i class="fa-regular fa-calendar-plus"></i></label>
<input class="form-control" @bind="@selDtEnd" id="dtMax" type="datetime-local" title="Selezionare fine periodo">
</div>
}
</div>
</div>*@
</div>
</div>
</div>
+10 -5
View File
@@ -136,12 +136,17 @@ namespace MP.SPEC.Pages
{
selMacchina = "*";
}
protected void resetReparto()
{
selReparto = "*";
}
protected void setDtMax()
{
// copio il filtro
currFilter.DtEnd = RoundDatetime(5);
currFilter.DtStart = RoundDatetime(5).AddDays(-10);
if (currFilter.HasOdl == true)
{
currFilter.DtEnd = RoundDatetime(5);
currFilter.DtStart = RoundDatetime(5).AddDays(-10);
}
}
protected void UpdateTotCount(int newTotCount)
@@ -170,7 +175,7 @@ namespace MP.SPEC.Pages
private bool filtActive
{
get => selMacchina != "*" || selStato != "*";
get => selMacchina != "*" || selStato != "*" || selReparto != "*";
}
private bool isLoading { get; set; } = false;
+55 -56
View File
@@ -3,73 +3,65 @@
<div class="card mb-5">
<div class="card-header table-primary">
<div class="d-flex justify-content-between">
<div class="col-6 col-lg-8">
<div class="d-flex">
<div class="px-2 col-5">
<h3><b>P</b>romesse <b>ODL</b></h3>
</div>
<div class="col-4 align-content-center">
<div class="input-group input-group-sm">
<div class="input-group-text">
<span class="me-1" title="Elenco PODL disponibili da produrre">Da Produrre</span>
<div class="form-check form-check-sm form-switch py-1" title="Parameter View Mode (RealTime / LogData)">
<input class="form-check-input" type="checkbox" name="setupAlarms" @onclick="()=> toggleClosed()">
</div>
<span class="" title="Elenco PODL già lanciati/prodotti">Lanciati</span>
</div>
<div class="d-flex justify-content-between col-12">
<div class="px-2 col-3">
<h3><b>P</b>romesse <b>ODL</b></h3>
</div>
<div class="col-3 d-flex justify-content-between">
<div class="input-group input-group-sm">
<div class="input-group-text">
<span class="me-1" title="Elenco PODL disponibili da produrre">Da Produrre</span>
<div class="form-check form-check-sm form-switch py-1" title="Parameter View Mode (RealTime / LogData)">
<input class="form-check-input" type="checkbox" name="setupAlarms" @onclick="()=> toggleClosed()">
</div>
</div>
<div class="px-2">
@if (addEnabled)
{
<button class="btn btn-success" @onclick="() => reqNewPODL()">Nuovo PODL <i class="bi bi-plus-square"></i></button>
}
<span class="" title="Elenco PODL già lanciati/prodotti">Lanciati</span>
</div>
@if (addEnabled)
{
<button class="btn btn-success" @onclick="() => reqNewPODL()">Nuovo PODL <i class="bi bi-plus-square"></i></button>
}
</div>
</div>
<div class="col-5 col-lg-4">
<div class="input-group input-group-sm d-flex flex-row-reverse">
@*<label class="input-group-text" for="maxRecord" title="Selezionare l'azienda da visualizzare"><i class="fa-solid fa-industry"></i></label>
<select @bind="@currAzienda" class="form-select" title="Selezionare l'azienda da visualizzare">
@if (ListAziende != null)
<div class="d-flex justify-content-end col-6">
<div class="d-flex justify-content-between">
@if (filtActive)
{
foreach (var item in ListAziende)
<div class=" rounded small d-flex justify-content-between" title="Filtri attivi">
@*<i class="fas fa-exclamation text-warning"></i>*@
@if (selReparto != "*")
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetReparto()" title="Rimuovi Filtro Reparto"><i class="fa-solid fa-building"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
@if (macchina != "*")
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetMacchina()" title="Rimuovi Filtro Impianto"><i class="fa-solid fa-hard-drive"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
@if (StatoSel != "*")
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetFase()" title="Rimuovi Filtro Parametro"><i class="fa-solid fa-sliders"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
</div>
}
@if (hasOdl)
{
<option value="@item.CodGruppo">@item.DescrGruppo</option>
<span class="badge bg-secondary mx-2 text-nowrap" title="Filtro Data inizio attivo">@selDtStart &nbsp <i class="fa-solid fa-calendar-days"></i></span>
<span class="badge bg-secondary mx-2 text-nowrap" title="Filtro Data fine attivo">@selDtEnd &nbsp <i class="fa-solid fa-calendar-days"></i></span>
}
}
</select>*@
@*<label class="input-group-text" for="maxRecord" title="Selezionare la fase da visualizzare"><i class="fa-solid fa-screwdriver-wrench"></i></label>
<select @bind="@currFase" class="form-select" title="Selezionare la fase da visualizzare">
<option value="*">--- Tutti ---</option>
@if (ListStati != null)
{
foreach (var item in ListStati)
{
<option value="@item.value">@item.label</option>
}
}
</select>*@
@*<SelFilterPODL currFilter="@currFilter" ListMacchine="@ListMacchine" ListStati="@ListStati" ListGruppiFase="@ListGruppiFase" FilterChanged="updateFilter"></SelFilterPODL>*@
<SelFilterXDL currFilter="@currFilter" ListMacchine="@ListMacchine" ListStati="@ListStati" ListGruppiFase="@ListGruppiFase" FilterChanged="updateFilter"></SelFilterXDL>
<div class="p-2">
<div class="p-2 text-end">
<a class="pt-2 text-dark" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample">
<i class="fa-solid fa-bars"></i>
</a>
</div>
</div>
<SelFilterXDL currFilter="@currFilter" ListMacchine="@ListMacchine" ListStati="@ListStati" ListGruppiFase="@ListGruppiFase" FilterChanged="updateFilter"></SelFilterXDL>
</div>
</div>
@if (currRecord != null)
{
<div class="row">
<div class="col-12">
<div class="card mb-5">
<div class="card-header bg-primary text-light">Modifica PODL</div>
<div class="card-header bg-primary text-light">@header</div>
<div class="card-body">
<div class="row">
<div class="col-6">
@@ -86,7 +78,7 @@
<select @bind="@currRecord.CodArticolo" class="form-select">
@if (ListArticoli != null)
{
foreach (var item in ListArticoli.Where(x => x.Azienda == currAzienda).ToList())
foreach (var item in ListArticoli)
{
@if (item.CodArticolo == currRecordControlli.CodArticolo)
{
@@ -169,13 +161,17 @@
{
foreach (var item in ListMacchine)
{
if (item.IdxMacchina == currRecordControlli.IdxMacchina)
@if (!item.Descrizione.Contains("NEW Descrizione"))
{
<option selected value="@item.IdxMacchina">@item.IdxMacchina | @item.Descrizione</option>
}
else
{
<option value="@item.IdxMacchina">@item.IdxMacchina | @item.Descrizione</option>
if (item.IdxMacchina == currRecordControlli.IdxMacchina)
{
<option selected value="@item.IdxMacchina">@item.IdxMacchina | @item.Descrizione</option>
}
else
{
<option value="@item.IdxMacchina">@item.IdxMacchina | @item.Descrizione</option>
}
}
}
}
@@ -213,7 +209,10 @@
</div>
<div class="col-3">
<div class="d-grid gap-2">
<button class="btn btn-success" @onclick="() => update(currRecord)">Salva <i class="bi bi-save"></i></button>
@if (currRecord.CodArticolo != "" && currRecord.CodFase != "" && currRecord.CodGruppo != "" && currRecord.IdxMacchina != "")
{
<button class="btn btn-success" @onclick="() => update(currRecord)">Salva <i class="bi bi-save"></i></button>
}
</div>
</div>
</div>
+69 -21
View File
@@ -60,6 +60,20 @@ namespace MP.SPEC.Pages
await Task.Delay(1);
}
protected void resetFase()
{
StatoSel = "*";
}
protected void resetMacchina()
{
macchina = "*";
}
protected void resetReparto()
{
selReparto = "*";
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
@@ -96,7 +110,8 @@ namespace MP.SPEC.Pages
}
ListMacchine = await MDService.MacchineGetAll();
ListStati = await MDService.AnagStatiComm();
SearchRecords = await MDService.ListPODLFilt(hasOdl, StatoSel, macchina, selReparto);
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
@@ -130,14 +145,19 @@ namespace MP.SPEC.Pages
//currArticolo = "";
if (ListArticoli != null && ListArticoli.Count > 0)
{
var firstArt = ListArticoli.FirstOrDefault();
currArticolo = firstArt != null ? firstArt.CodArticolo : "";
//var firstArt = ListArticoli.FirstOrDefault();
//currArticolo = firstArt != null ? firstArt.CodArticolo : "";
var firstArt = ListArticoli.FirstOrDefault(x => x.Azienda.StartsWith(currAzienda));
if (firstArt != null)
{
currArticolo = firstArt.Azienda;
}
}
string codExt = $"{currFase}";
string codGruppo = "";
if (ListGruppiFase != null && ListGruppiFase.Count > 0)
{
var firstFase = ListGruppiFase.FirstOrDefault(x => x.CodGruppo.StartsWith(_currAzienda));
var firstFase = ListGruppiFase.FirstOrDefault(x => x.CodGruppo.StartsWith(currAzienda));
if (firstFase != null)
{
codGruppo = firstFase.CodGruppo;
@@ -182,16 +202,15 @@ namespace MP.SPEC.Pages
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare le modifiche?"))
return;
await Task.Delay(1);
var done = await MDService.POdlUpdateRecord(selRec);
await callSyncDb(selRec);
var clonedRec = MP.Data.Utils.POdlExt.convertToPOdl(selRec);
var done = await MDService.POdlUpdateRecord(clonedRec);
await callSyncDb(clonedRec);
currRecord = null;
await reloadData();
// forzo update parametri
await Task.Delay(1);
currFase = "*";
await Task.Delay(1);
NavManager.NavigateTo(NavManager.Uri, true);
}
protected void UpdateTotCount(int newTotCount)
{
totalCount = newTotCount;
@@ -285,6 +304,30 @@ namespace MP.SPEC.Pages
}
}
}
private DateTime selDtStart
{
get => currFilter.DtStart;
set
{
if (!currFilter.DtStart.Equals(value))
{
currFilter.DtStart = value;
currPage = 1;
}
}
}
private DateTime selDtEnd
{
get => currFilter.DtEnd;
set
{
if (!currFilter.DtEnd.Equals(value))
{
currFilter.DtEnd = value;
currPage = 1;
}
}
}
private SelectXdlParams currFilter { get; set; } = new SelectXdlParams();
@@ -350,6 +393,11 @@ namespace MP.SPEC.Pages
set => currFilter.TotCount = value;
}
private bool filtActive
{
get => macchina != "*" || StatoSel != "*" || selReparto != "*";
}
#endregion Private Properties
#region Private Methods
@@ -359,7 +407,7 @@ namespace MP.SPEC.Pages
/// </summary>
/// <param name="selRec"></param>
/// <returns></returns>
private async Task callSyncDb(PODLExpModel selRec)
private async Task callSyncDb(PODLModel selRec)
{
// chiamo aggiunta task SyncDb...
string idxMacc = selRec.IdxMacchina;
@@ -378,17 +426,17 @@ namespace MP.SPEC.Pages
{
isLoading = true;
await Task.Delay(1);
if (currAzienda != "*")
{
ListArticoli = await MDService.ArticoliGetSearch(100, currAzienda, artSearch);
}
else
{
ListArticoli = new List<AnagArticoli>();
}
ListArticoli = await MDService.ArticoliGetSearch(100, currAzienda, artSearch);
// ListArticoli = new List<AnagArticoli>();
//}
isLoading = false;
}
protected string header
{
get => currFilter.Header;
set => currFilter.Header = value;
}
private async Task updateFilter(SelectXdlParams newParams)
{
isLoading = true;
+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.2519</h4>
<h4>Versione: 6.16.2211.2916</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2211.2519
6.16.2211.2916
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2211.2519</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>