Merge branch 'release/VersioneTestEdilchimica'
This commit is contained in:
@@ -5,6 +5,7 @@ using MP.Data.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Formats.Asn1;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -37,12 +38,12 @@ namespace MP.Data.Controllers
|
||||
/// <param name="codLotto">Codice lotto</param>
|
||||
/// <param name="codMagazzino">Codice magazzino</param>
|
||||
/// <returns></returns>
|
||||
public List<AnagLottiArca> ListLottiEsterni(string codArt, string codLotto, string codMagazzino)
|
||||
public List<AnagLottiArca> LottoEsterno(string codArt, string codLotto, string codMagazzino)
|
||||
{
|
||||
List<AnagLottiArca> dbResult = new List<AnagLottiArca>();
|
||||
using (var dbCtx = new MoonPro_ISContext(_configuration))
|
||||
{
|
||||
var DataGiac = new SqlParameter("@DataGiac", DateTime.Now);
|
||||
var DataGiac = new SqlParameter("@DataGiac", DBNull.Value);
|
||||
var CodArt = new SqlParameter("@CodArt", codArt);
|
||||
var CodLotto = new SqlParameter("@CodLotto", codLotto);
|
||||
var CodMagaz = new SqlParameter("@CodMagaz", codMagazzino);
|
||||
@@ -52,7 +53,7 @@ namespace MP.Data.Controllers
|
||||
.DbLottoArca
|
||||
.FromSqlRaw("exec dbo.stp_GIAC_getByDate @DataGiac,@CodArt,@CodLotto,@CodMagaz,@OnlyTest", DataGiac, CodArt, CodLotto, CodMagaz, OnlyTest)
|
||||
.AsNoTracking()
|
||||
//.AsEnumerable()
|
||||
.AsEnumerable()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
@@ -123,28 +124,54 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Elenco Scansioni Totali
|
||||
/// </summary>
|
||||
/// <param name="InveSessId"></param>
|
||||
/// <returns></returns>
|
||||
public List<ScanDataModel> ScanBySession(int InveSessId)
|
||||
public ScanDataModel ScanByUdcSession(string udc, int InveSessId)
|
||||
{
|
||||
ScanDataModel dbResult = new ScanDataModel();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
if (InveSessId != 0)
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbScanData
|
||||
.Where(x => (x.ScanValue == udc) && (x.InveSessID == InveSessId))
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtScan)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbScanData
|
||||
.Where(x => (x.ScanValue == udc))
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtScan)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// Elenco Scansioni per valore, operatore e sessione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<ScanDataModel> ScanByValueSessionOpr(string scanData, int InveSessId, string idOpr)
|
||||
{
|
||||
List<ScanDataModel> dbResult = new List<ScanDataModel>();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbScanData
|
||||
.Where(x => (x.ScanValue == scanData) && (x.InveSessID == InveSessId) && (x.UserScan == idOpr))
|
||||
.AsNoTracking()
|
||||
.Where(x => x.InveSessID == InveSessId)
|
||||
.OrderByDescending(x => x.DtScan)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Scansioni dato Id sessione inventario
|
||||
@@ -228,6 +255,31 @@ namespace MP.Data.Controllers
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// delete scansione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> deleteScansione(ScanDataModel record)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
dbCtx
|
||||
.DbScanData
|
||||
.Remove(record);
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante deleteScansione{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
|
||||
#endregion gestione scansioni
|
||||
|
||||
@@ -408,35 +460,29 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// check udc
|
||||
/// </summary>
|
||||
/// <param name="Udc"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsUDC(string Udc)
|
||||
public AnagUdcModel IsUDC(string Udc)
|
||||
{
|
||||
List<AnagUdcModel> dbResult = new List<AnagUdcModel>();
|
||||
bool answ = false;
|
||||
AnagUdcModel dbResult = new AnagUdcModel();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbUdcData
|
||||
.Where(x => x.UDC == Udc)
|
||||
.Include(m => m.lottoNav)
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.UDC)
|
||||
.ToList();
|
||||
|
||||
if (dbResult.Count == 1)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
.FirstOrDefault(); ;
|
||||
}
|
||||
return answ;
|
||||
return dbResult;
|
||||
}
|
||||
#endregion gestione UDC
|
||||
|
||||
#region gestione lotti
|
||||
#region gestione lotti interni
|
||||
/// <summary>
|
||||
/// elenco lotti
|
||||
/// </summary>
|
||||
@@ -454,17 +500,14 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// check lotto
|
||||
/// </summary>
|
||||
/// <param name="lotto"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsLotto(string lotto)
|
||||
public AnagLottoModel LottoInterno(string lotto)
|
||||
{
|
||||
List<AnagLottoModel> dbResult = new List<AnagLottoModel>();
|
||||
bool answ = false;
|
||||
AnagLottoModel dbResult = new AnagLottoModel();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -472,17 +515,12 @@ namespace MP.Data.Controllers
|
||||
.Where(x => x.Lotto == lotto)
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.Lotto)
|
||||
.ToList();
|
||||
|
||||
if (dbResult.Count == 1)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
.FirstOrDefault();
|
||||
}
|
||||
return answ;
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#endregion gestione lotti
|
||||
#endregion gestione lotti interni
|
||||
|
||||
#region gestione sessione
|
||||
|
||||
@@ -536,20 +574,40 @@ namespace MP.Data.Controllers
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Inventari Filtrati per id
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public InventorySessionModel InventSessByID(int sessID)
|
||||
{
|
||||
InventorySessionModel dbResult = new InventorySessionModel();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbInveSess
|
||||
.Where(x => x.InveSessID == sessID)
|
||||
.Include(m => m.AnagMagNav)
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtStart)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Inventari tipo Azienda (TUTTI, chiusi e paerti) filtrati x data
|
||||
/// </summary>
|
||||
/// <param name="FromDate"></param>
|
||||
/// <param name="ToDate"></param>
|
||||
/// <returns></returns>
|
||||
public List<InventorySessionModel> InventSessHistList(DateTime FromDate, DateTime ToDate)
|
||||
public List<InventorySessionModel> InventSessHistList()
|
||||
{
|
||||
List<InventorySessionModel> dbResult = new List<InventorySessionModel>();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbInveSess
|
||||
.Where(x => x.DtStart >= FromDate && x.DtStart <= ToDate && x.DtEnd != null)
|
||||
.Where(x => x.Transferred)
|
||||
.Include(m => m.AnagMagNav)
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtStart)
|
||||
@@ -569,7 +627,7 @@ namespace MP.Data.Controllers
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbInveSess
|
||||
.Where(x => x.DtEnd == null)
|
||||
.Where(x => (x.DtEnd == null) || !(x.Transferred))
|
||||
.Include(m => m.AnagMagNav)
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtStart)
|
||||
@@ -578,8 +636,76 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiusura/apertura sessione
|
||||
/// </summary>
|
||||
/// <param name="sessID"></param>
|
||||
/// <param name="flgclose"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> CloseOpenSessione(int sessID, bool flgClose)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
var SessID = new SqlParameter("@InveSessID", sessID);
|
||||
var FlgClose = new SqlParameter("@FlgClose", flgClose);
|
||||
|
||||
var callResulr = await dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRawAsync("exec dbo.stp_INV_CloseOpen @InveSessID, @FlgClose", SessID, FlgClose);
|
||||
|
||||
answ = true;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Trasferimento
|
||||
/// </summary>
|
||||
/// <param name="sessID"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> TransferSessione(int sessID)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
var SessID = new SqlParameter("@InveSessID", sessID);
|
||||
|
||||
var callResulr = await dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRawAsync("exec dbo.stp_INV_InveSess_Transfer @InveSessID", SessID);
|
||||
|
||||
answ = true;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
#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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -11,35 +11,34 @@ namespace MP.Data.DatabaseModels
|
||||
[Keyless]
|
||||
public partial class AnagLottiArca
|
||||
{
|
||||
|
||||
public string Cd_MGEsercizio { get; set; }
|
||||
public string Cd_MG { get; set; }
|
||||
public string Cd_AR { get; set; }
|
||||
public string Id_DoDB { get; set; }
|
||||
public string Cd_MGUbicazione { get; set; }
|
||||
public string Cd_ARLotto { get; set; }
|
||||
public string Cd_DoSottoCommessa { get; set; }
|
||||
public string Quantita { get; set; }
|
||||
public string Valore { get; set; }
|
||||
public string IniQ { get; set; }
|
||||
public string IniV { get; set; }
|
||||
public string RetQ { get; set; }
|
||||
public string RetV { get; set; }
|
||||
public string CarQ { get; set; }
|
||||
public string CarV { get; set; }
|
||||
public string ScaQ { get; set; }
|
||||
public string ScaV { get; set; }
|
||||
public string CarQA { get; set; }
|
||||
public string CarVA { get; set; }
|
||||
public string CarQP { get; set; }
|
||||
public string CarVP { get; set; }
|
||||
public string CarQT { get; set; }
|
||||
public string CarVT { get; set; }
|
||||
public string ScaQV { get; set; }
|
||||
public string ScaVV { get; set; }
|
||||
public string ScaQP { get; set; }
|
||||
public string ScaVP { get; set; }
|
||||
public string ScaQT { get; set; }
|
||||
public string ScaVT { get; set; }
|
||||
public int? Id_DoDB { get; set; }
|
||||
public string? Cd_MGUbicazione { get; set; }
|
||||
public string? Cd_ARLotto { get; set; }
|
||||
public string? Cd_DoSottoCommessa { get; set; }
|
||||
public decimal Quantita { get; set; }
|
||||
public decimal Valore { get; set; }
|
||||
public decimal IniQ { get; set; }
|
||||
public decimal IniV { get; set; }
|
||||
public decimal RetQ { get; set; }
|
||||
public decimal RetV { get; set; }
|
||||
public decimal CarQ { get; set; }
|
||||
public decimal CarV { get; set; }
|
||||
public decimal ScaQ { get; set; }
|
||||
public decimal ScaV { get; set; }
|
||||
public decimal CarQA { get; set; }
|
||||
public decimal CarVA { get; set; }
|
||||
public decimal CarQP { get; set; }
|
||||
public decimal CarVP { get; set; }
|
||||
public decimal CarQT { get; set; }
|
||||
public decimal CarVT { get; set; }
|
||||
public decimal ScaQV { get; set; }
|
||||
public decimal ScaVV { get; set; }
|
||||
public decimal ScaQP { get; set; }
|
||||
public decimal ScaVP { get; set; }
|
||||
public decimal ScaQT { get; set; }
|
||||
public decimal ScaVT { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="input-group input-group-sm mb-2">
|
||||
<input @bind="LastScan" class="fs-6 text-center form-control @css" @ref="@target" style="width: 17rem;" />
|
||||
<button class="btn btn-sm btn-primary" @onclick="()=>newScan()">
|
||||
<i class="fa-solid fa-qrcode"></i>
|
||||
</button>
|
||||
<input type="hidden" @ref="@target2"/>
|
||||
<input @bind="LastScan" class="fs-6 text-center form-control @css" @ref="@target" style="width: 17rem;" />
|
||||
<input type="hidden" @ref="@target2" />
|
||||
</div>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace MP.INVE.Components
|
||||
get => _lastScan;
|
||||
set
|
||||
{
|
||||
_lastScan = value;
|
||||
_lastScan = value.Trim();
|
||||
if (value != "")
|
||||
{
|
||||
saveSel(LastScan);
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<table class="table">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@if (inCorso)
|
||||
@@ -90,15 +90,12 @@
|
||||
@foreach (var item in elencoSessioni)
|
||||
{
|
||||
<tr>
|
||||
@if (inCorso)
|
||||
{
|
||||
<td>
|
||||
<!-- Button trigger modal -->
|
||||
<button type="button" class="btn btn-dark" data-bs-toggle="modal" data-bs-target="#exampleModal" @onclick="()=> getCurrSess(item.InveSessID, item.AnagMagNav.CodMag)" title="Apri qr per connettersi alla sessione">
|
||||
<i class="fa-solid fa-qrcode"></i>
|
||||
</button>
|
||||
</td>
|
||||
}
|
||||
<td>
|
||||
<!-- Button trigger modal -->
|
||||
<a href="Invio?sessID=@item.InveSessID&codMag=@item.AnagMagNav.CodMag" class="btn btn-dark" title="Apri pagina sessione">
|
||||
<i class="fa-solid fa-up-right-from-square"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
@item.InveSessID
|
||||
</td>
|
||||
@@ -139,9 +136,12 @@
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-danger btn-sm" @onclick="()=>deleteSession(item)">
|
||||
<i class="fa-solid fa-trash-can"></i>
|
||||
</button>
|
||||
@if (!item.Transferred)
|
||||
{
|
||||
<button class="btn btn-danger btn-sm" @onclick="()=>deleteSession(item)">
|
||||
<i class="fa-solid fa-trash-can"></i>
|
||||
</button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace MP.INVE.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchRecords = MIDataservice.InventSessHistList(dtStart, dtEnd);
|
||||
SearchRecords = MIDataservice.InventSessHistList();
|
||||
}
|
||||
totalCount = SearchRecords.Count;
|
||||
elencoSessioni = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
@@ -186,10 +186,7 @@ namespace MP.INVE.Components
|
||||
[Parameter]
|
||||
public bool isLoading { get; set; }
|
||||
|
||||
|
||||
[Parameter]
|
||||
public int currIdSess { get; set; }
|
||||
[Parameter]
|
||||
public string currIdMag { get; set; }
|
||||
|
||||
[Inject]
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<h3>ListScan</h3>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Oggetto</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (elencoSCAN != null)
|
||||
{
|
||||
@foreach (var item in elencoSCAN)
|
||||
{
|
||||
<tr>
|
||||
<td class="d-flex justify-content-between">
|
||||
<div class="col-6">
|
||||
<div>
|
||||
<span class="small textCondensed"><b>Cod: </b></span>@item.ScanValue
|
||||
</div>
|
||||
<div>
|
||||
<span class="small textCondensed"><b>Lotto: </b></span>@item.Lotto
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div>
|
||||
<span class="small textCondensed"><b>Art: </b></span>@item.CodArticolo
|
||||
</div>
|
||||
<div>
|
||||
<span class="small textCondensed"><b>Qty: </b></span>@Math.Round(item.Qty, 0)
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<button class="btn btn-sm btn-danger">
|
||||
<i class="fa-solid fa-trash-can"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,46 @@
|
||||
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 ListScan
|
||||
{
|
||||
[Inject]
|
||||
MiDataService MIService { get; set; } = null!;
|
||||
[Inject]
|
||||
IJSRuntime JSRuntime { get; set; } = null!;
|
||||
[Parameter]
|
||||
public string lastScan { get; set; } = "";
|
||||
[Parameter]
|
||||
public string userScan { get; set; } = null!;
|
||||
[Parameter]
|
||||
public int sessID { get; set; } = 0;
|
||||
[Parameter]
|
||||
public string magID { get; set; } = "";
|
||||
protected string rawScan { get; set; } = null!;
|
||||
|
||||
List<ScanDataModel>? elencoSCAN;
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<h3>Totale lotti</h3>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<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.Lotto
|
||||
</td>
|
||||
<td>
|
||||
@item.CodArticolo
|
||||
</td>
|
||||
<td class="small textCondensed">
|
||||
@item.DescrArt
|
||||
</td>
|
||||
<td>
|
||||
@item.NumColli
|
||||
</td>
|
||||
<td>
|
||||
@($"{item.TotLotto:N2}")
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<table class="table">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID magazzino</th>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
@using MP.INVE.Components
|
||||
@using MP.INVE.Data
|
||||
|
||||
<div class="top-row ps-2 navbar navbar-dark mb-0 @cssCancScan" style="border-radius: 15px 15px 0px 0px;">
|
||||
<div class="container-fluid px-0">
|
||||
@if (!showText)
|
||||
{
|
||||
<a class="navbar-brand p-0 text-dark" @onclick="() => ToggleCompress()">MI </a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="navbar-brand text-dark" @onclick="() => ToggleCompress()">MP.INVE </a>
|
||||
}
|
||||
<div class="@cssCancScan">
|
||||
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
|
||||
<i class="fa-solid fa-bars text-dark"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="@NavMenuCssClass @cssCancScan" @onclick="ToggleNavMenu">
|
||||
<nav class="flex-column">
|
||||
<div class="nav-item px-2 col-12">
|
||||
<NavLink class="nav-link px-2" style="@cssCancBack" href="@link" Match="NavLinkMatch.All">
|
||||
<div class="col-2">
|
||||
<i class="fa-solid fa-trash-can text-dark"></i>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-dark @cssCanc">Modalità Cancellazione</span>
|
||||
</div>
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
<div class="nav-item px-2 col-12">
|
||||
<NavLink class="nav-link px-2" style="@cssScanBack" Match="NavLinkMatch.All" @onclick="()=>goBack()">
|
||||
<div class="col-2">
|
||||
<i class="fa-solid fa-qrcode text-dark"></i>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-dark @cssScan">Modalità Scansione</span>
|
||||
</div>
|
||||
</NavLink>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
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.INVE.Data;
|
||||
using MP.Data.DTO;
|
||||
using Blazored.LocalStorage;
|
||||
|
||||
namespace MP.INVE.Components
|
||||
{
|
||||
public partial class NavMenuTerm
|
||||
{
|
||||
private bool collapseNavMenu = true;
|
||||
//public List<MP.Data.DatabaseModels.LinkMenu>? ElencoLink { get; set; }
|
||||
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
|
||||
private void ToggleNavMenu()
|
||||
{
|
||||
collapseNavMenu = !collapseNavMenu;
|
||||
}
|
||||
|
||||
protected string cssScan = "";
|
||||
protected string cssCanc = "";
|
||||
|
||||
protected string cssScanBack = "";
|
||||
protected string cssCancBack = "";
|
||||
|
||||
protected string @cssCancScan = "";
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (isScan)
|
||||
{
|
||||
cssCancScan = "bg-info";
|
||||
|
||||
cssScanBack = "background-color: rgba(255,255,255,0.7)";
|
||||
cssScan = "fw-bold text-decoration-underline";
|
||||
}
|
||||
else
|
||||
{
|
||||
cssCancScan = "bg-danger";
|
||||
cssCancBack = "background-color: rgba(255,255,255,0.7)";
|
||||
cssCanc = "fw-bold text-decoration-underline";
|
||||
}
|
||||
// recupero elenco JQM
|
||||
//ElencoLink = await MDService.ElencoLink();
|
||||
}
|
||||
|
||||
protected bool showText { get; set; } = true;
|
||||
protected void ToggleCompress()
|
||||
{
|
||||
showText = !showText;
|
||||
EC_compressUpdated.InvokeAsync(showText);
|
||||
}
|
||||
protected async Task goBack()
|
||||
{
|
||||
if (NavigationManager.Uri.Contains(""))
|
||||
await JSRuntime.InvokeVoidAsync("history.go", -1);
|
||||
}
|
||||
protected string hideText { get => showText ? "" : "invisible"; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_compressUpdated { get; set; }
|
||||
[Parameter]
|
||||
public bool isScan { get; set; } = false;
|
||||
[Parameter]
|
||||
public string link { get; set; } = "";
|
||||
[Inject]
|
||||
protected ILocalStorageService localStorage { get; set; } = null!;
|
||||
[Inject]
|
||||
protected NavigationManager NavigationManager { get; set; } = null!;
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
.navbar-toggler {
|
||||
background-color: rgba(255,255,255,0);
|
||||
}
|
||||
|
||||
.top-row {
|
||||
height: 3.5rem;
|
||||
background-color: rgba(255,255,255,1);
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.oi {
|
||||
width: 2rem;
|
||||
font-size: 1.1rem;
|
||||
vertical-align: text-top;
|
||||
top: -2px;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
font-size: 0.9rem;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.nav-item:first-of-type {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.nav-item:last-of-type {
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.nav-item ::deep a {
|
||||
color: #d7d7d7;
|
||||
border-radius: 4px;
|
||||
height: 3rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 3rem;
|
||||
}
|
||||
|
||||
.nav-item ::deep a.active {
|
||||
background-color: rgba(255,255,255,0.25);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-item ::deep a:hover {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
color: white;
|
||||
}
|
||||
|
||||
@media (min-width: 641px) {
|
||||
.navbar-toggler {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.collapse {
|
||||
/* Never collapse the sidebar for wide screens */
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
@@ -8,22 +8,22 @@
|
||||
<li>totalmente ignoto</li>
|
||||
</ul>*@
|
||||
|
||||
|
||||
@if (currUdc != null || currLotto != null)
|
||||
@if (!firstMsg)
|
||||
{
|
||||
|
||||
<ul class="p-0">
|
||||
<li class="list-group-item">
|
||||
<li class="list-group-item p-0">
|
||||
Lotto:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control" value="@lottoScan" disabled />
|
||||
<span class="input-group-text" id="basic-addon1">@tipo</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<li class="list-group-item p-0">
|
||||
Articolo:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control @reqArtMod" @bind-value="@articoloScan" type="text" />
|
||||
@if ((canMod != "false") || (tipo != "UDC"))
|
||||
@if ((canMod != "false") || (tipo != "U") || (!isKnown))
|
||||
{
|
||||
<button title="Mod articolo" @onclick="@cssDisableArt" class="btn btn-sm btn-primary">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
@@ -31,10 +31,10 @@
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<li class="list-group-item p-0">
|
||||
Quantità:
|
||||
<div class="input-group input-group-sm">
|
||||
@if (currLotto != null)
|
||||
@if (currLottoInterno != null || currLottoEsterno != null)
|
||||
{
|
||||
<input class="form-control" @bind-value="@quantitaScan" type="number" />
|
||||
}
|
||||
@@ -42,7 +42,7 @@
|
||||
{
|
||||
<input class="form-control @reqQtaMod" @bind-value="@quantitaScan" type="number" />
|
||||
}
|
||||
@if ((canMod != "false") || (tipo != "UDC"))
|
||||
@if ((canMod != "false") || (tipo != "U") || (!isKnown))
|
||||
{
|
||||
<button title="Mod quantità" @onclick="@cssDisableQta" class="btn btn-sm btn-primary">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
@@ -50,157 +50,42 @@
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<li class="list-group-item p-0">
|
||||
Note:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control " @bind-value="@noteScan" type="text" />
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="btn-group col-12" role="group">
|
||||
@if (articoloScan != "" && quantitaScan != 0)
|
||||
<div class="btn-group col-12 py-1" role="group">
|
||||
@if (articoloScan != "" && quantitaScan != 0 && canSave)
|
||||
{
|
||||
<button type="button" class="btn btn-success col-6" @onclick="()=>insertScan()">Conferma</button>
|
||||
<button type="button" class="btn btn-danger col-6" @onclick="()=>resetAll()">Annulla</button>
|
||||
}
|
||||
else if (articoloScan == "" && quantitaScan != 0)
|
||||
{
|
||||
<div class="alert bg-warning col-12">Dati mancanti: Codice articolo</div>
|
||||
<div class="alert bg-warning col-12 py-1">Dati mancanti: Codice articolo</div>
|
||||
}
|
||||
else if (quantitaScan == 0 && articoloScan != "")
|
||||
{
|
||||
<div class="alert bg-warning col-12">Dati mancanti: Quantità a "0"</div>
|
||||
<div class="alert bg-warning col-12 py-1">Dati mancanti: Quantità a "0"</div>
|
||||
}
|
||||
else if (isKnown)
|
||||
{
|
||||
<div class="alert bg-warning col-12 py-1">Codice già scansionato per la sessione corrente</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert bg-warning col-12">Dati mancanti: Codice articolo e Quantità </div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else if (alreadyScan != null)
|
||||
{
|
||||
<ul class="p-0 mb-1">
|
||||
<li class="list-group-item">
|
||||
Codice Scannerizzato:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control" value="@alreadyScan.ScanValue" disabled />
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
Articolo:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control @reqArtMod" @bind-value="@alreadyScan.CodArticolo" type="text" />
|
||||
@if (isMod)
|
||||
{
|
||||
|
||||
<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 @reqQtaMod" @bind-value="@alreadyScan.Qty" type="number" />
|
||||
@if (isMod)
|
||||
{
|
||||
|
||||
<button title="Mod quantità" @onclick="@cssDisableQta" class="btn btn-sm btn-primary">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
Note:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control " @bind-value="@noteScan" type="text" />
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="btn-group col-12 mb-1" role="group">
|
||||
@if (!alreadyScan.IsUnique)
|
||||
{
|
||||
<button type="button" class="btn btn-success col-6" @onclick="()=>insertScan()">Conferma</button>
|
||||
<button type="button" class="btn btn-danger col-6" @onclick="()=>resetAll()">Annulla</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert bg-warning col-12 p-2 mb-0">Trovato UDC | scansione già effettuata / UDC caricato (impossibile caricare 2 volte)</div>
|
||||
<div class="alert bg-warning col-12 py-1">Dati mancanti: Codice articolo e Quantità </div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<ul class="p-0">
|
||||
<li class="list-group-item">
|
||||
Lotto:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control" value="@lottoScan" 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">
|
||||
@if (!string.IsNullOrEmpty(lastScan))
|
||||
{
|
||||
<input class="form-control " @bind-value="@articoloScan" type="text" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input class="form-control " @bind-value="@articoloScan" type="text" disabled />
|
||||
}
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
Quantità:
|
||||
<div class="input-group input-group-sm">
|
||||
@if (!string.IsNullOrEmpty(lastScan))
|
||||
{
|
||||
<input class="form-control" @bind-value="@quantitaScan" type="number" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input class="form-control" @bind-value="@quantitaScan" type="number" disabled />
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
Note:
|
||||
<div class="input-group input-group-sm">
|
||||
@if (!string.IsNullOrEmpty(lastScan))
|
||||
{
|
||||
<input class="form-control " @bind-value="@noteScan" type="text" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input class="form-control" @bind-value="@quantitaScan" type="number" disabled />
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="btn-group col-12" role="group">
|
||||
@if (articoloScan != "" && quantitaScan != 0)
|
||||
{
|
||||
<button type="button" class="btn btn-success col-6" @onclick="()=>insertScan()">Conferma</button>
|
||||
<button type="button" class="btn btn-danger col-6" @onclick="()=>resetAll()">Annulla</button>
|
||||
}
|
||||
else if (articoloScan == "" && quantitaScan != 0)
|
||||
{
|
||||
<div class="alert bg-warning col-12">Dati mancanti: Codice articolo</div>
|
||||
}
|
||||
else if (quantitaScan == 0 && articoloScan != "")
|
||||
{
|
||||
<div class="alert bg-warning col-12">Dati mancanti: Quantità a "0"</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert bg-warning col-12">Dati mancanti: Codice articolo e Quantità </div>
|
||||
}
|
||||
</div>
|
||||
<div class="alert bg-warning col-12 mt-3">Eseguire scansione</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,38 +26,39 @@ namespace MP.INVE.Components
|
||||
{
|
||||
[Inject]
|
||||
private MiDataService MIService { get; set; } = null!;
|
||||
[Inject]
|
||||
public IJSRuntime JSRuntime { get; set; } = null!;
|
||||
[Inject]
|
||||
public NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public string lastScan { get; set; } = "";
|
||||
//[Parameter]
|
||||
//public EventCallback<AnagUdcModel> udcSend { get; set; }
|
||||
[Parameter]
|
||||
public string userScan { get; set; } = null!;
|
||||
[Parameter]
|
||||
public int sessID { get; set; } = 0;
|
||||
[Parameter]
|
||||
public string magID { get; set; } = "";
|
||||
[Inject]
|
||||
public IJSRuntime JSRuntime { get; set; } = null!;
|
||||
[Inject]
|
||||
public NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
private string tipo { get; set; } = "";
|
||||
private string canMod = "false";
|
||||
public string lastScanCheck { get; set; } = "";
|
||||
|
||||
protected List<AnagUdcModel>? searchRecordsUDC;
|
||||
protected List<AnagLottoModel>? searchRecordsLottoInterni;
|
||||
protected List<AnagLottiArca>? searchRecordsLottoEsterni;
|
||||
protected List<ScanDataModel>? elencoScansioni;
|
||||
protected AnagUdcModel? udc;
|
||||
protected AnagLottoModel? lottoInterno;
|
||||
protected AnagLottiArca? lottoEsterno;
|
||||
protected List<AnagLottiArca>? listLottiEsterni;
|
||||
protected ScanDataModel? alreadyScan;
|
||||
|
||||
protected AnagUdcModel? currUdc;
|
||||
protected AnagLottoModel? currLotto;
|
||||
protected AnagLottoModel? currLottoInterno;
|
||||
protected AnagLottiArca? currLottoEsterno;
|
||||
protected bool alertScan;
|
||||
protected bool isScannedLotto;
|
||||
protected bool firstMsg = false;
|
||||
protected bool isMod = true;
|
||||
protected bool isKnown = false;
|
||||
protected bool canSave = true;
|
||||
protected string oldArt = "";
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
@@ -69,34 +70,53 @@ namespace MP.INVE.Components
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
isKnown = false;
|
||||
currLottoInterno = null;
|
||||
currUdc = null;
|
||||
alreadyScan = null;
|
||||
|
||||
// se il valore scansionato è != null...
|
||||
if (string.IsNullOrEmpty(lastScan))
|
||||
{
|
||||
await Task.Delay(1);
|
||||
firstMsg = true;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lastScan.StartsWith("S"))
|
||||
{
|
||||
lastScanCheck = lastScan.Substring(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
lastScanCheck = lastScan;
|
||||
}
|
||||
firstMsg = false;
|
||||
await MIService.ConfigResetCache();
|
||||
var result = await MIService.tryGetConfig("MAG_SmartUdcEdit");
|
||||
elencoScansioni = MIService.ScanList();
|
||||
var exists = elencoScansioni.Select(x => x.ScanValue).Contains(lastScan);
|
||||
var scansioneClone = elencoScansioni.Where(x => x.ScanValue == lastScan).FirstOrDefault();
|
||||
int sessIDSearch = 0;
|
||||
|
||||
if (exists)
|
||||
if (lastScanCheck.Contains("MFI") && lastScanCheck.Length == 14)
|
||||
{
|
||||
if (scansioneClone != null)
|
||||
sessIDSearch = sessID;
|
||||
}
|
||||
var scansioneClone = MIService.ScanByUdcSession(lastScan, sessID);
|
||||
if (scansioneClone != null)
|
||||
{
|
||||
//isScannedLotto = scansioneClone.ScanValue.StartsWith("M2");
|
||||
isKnown = false;
|
||||
if (scansioneClone.IsUnique)
|
||||
{
|
||||
isScannedLotto = scansioneClone.ScanValue.StartsWith("M2");
|
||||
isMod = true;
|
||||
if (scansioneClone.IsUnique)
|
||||
{
|
||||
isMod = false;
|
||||
}
|
||||
alreadyScan = elencoScansioni.Where(x => x.ScanValue == lastScan).FirstOrDefault();
|
||||
currUdc = null;
|
||||
currLotto = null;
|
||||
|
||||
isKnown = true;
|
||||
canSave = false;
|
||||
}
|
||||
alreadyScan = scansioneClone;
|
||||
lottoScan = alreadyScan.Lotto;
|
||||
oldArt = alreadyScan.CodArticolo;
|
||||
articoloScan = alreadyScan.CodArticolo;
|
||||
quantitaScan = Math.Round(alreadyScan.Qty, 2);
|
||||
noteScan = alreadyScan.Note;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -105,36 +125,48 @@ namespace MP.INVE.Components
|
||||
canMod = result;
|
||||
}
|
||||
await Task.Delay(1);
|
||||
searchRecordsUDC = MIService.ElencoUDC();
|
||||
udc = searchRecordsUDC.Where(x => x.UDC == lastScan).FirstOrDefault();
|
||||
udc = MIService.IsUDC(lastScanCheck);
|
||||
|
||||
if (udc != null && !udc.UDC.Contains("MSL"))
|
||||
if (udc != null)
|
||||
{
|
||||
var udcString = udc.UDC.Substring(2, 3);
|
||||
if (udcString == "MFI")
|
||||
{
|
||||
|
||||
currUdc = udc;
|
||||
tipo = "UDC";
|
||||
lottoScan = udc.lottoNav.Lotto;
|
||||
articoloScan = udc.lottoNav.CodArt;
|
||||
quantitaScan = udc.Qta;
|
||||
noteScan = udc.Note;
|
||||
isKnown = true;
|
||||
canSave = true;
|
||||
currUdc = udc;
|
||||
tipo = "U";
|
||||
lottoScan = udc.lottoNav.Lotto;
|
||||
oldArt = udc.lottoNav.CodArt;
|
||||
articoloScan = udc.lottoNav.CodArt;
|
||||
quantitaScan = Math.Round(udc.Qta, 2);
|
||||
noteScan = udc.Note;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (lastScan.StartsWith("M") && lastScan.Length == 10)
|
||||
{
|
||||
searchRecordsLottoInterni = MIService.ElencoLotti();
|
||||
lottoInterno = searchRecordsLottoInterni.Where(x => (x.Lotto == lastScan) && x.Origine == "INT").FirstOrDefault();
|
||||
lottoInterno = MIService.LottoInterno(lastScan);
|
||||
}
|
||||
else
|
||||
{
|
||||
searchRecordsLottoEsterni = MIService.ListLottiEsterni(articoloScan, lastScan, magID);
|
||||
lottoEsterno = searchRecordsLottoEsterni.FirstOrDefault();
|
||||
listLottiEsterni = MIService.LottoEsterno("", lastScan, magID);
|
||||
if (listLottiEsterni.Count == 1)
|
||||
{
|
||||
lottoEsterno = listLottiEsterni.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
if (lottoInterno != null)
|
||||
{
|
||||
tipo = "LOTTO";
|
||||
currLotto = lottoInterno;
|
||||
canSave = true;
|
||||
tipo = "LI";
|
||||
currLottoInterno = lottoInterno;
|
||||
lottoScan = lottoInterno.Lotto;
|
||||
oldArt = lottoInterno.CodArt;
|
||||
articoloScan = lottoInterno.CodArt;
|
||||
quantitaScan = 0;
|
||||
}
|
||||
@@ -142,14 +174,27 @@ namespace MP.INVE.Components
|
||||
{
|
||||
if (lottoEsterno != null)
|
||||
{
|
||||
tipo = "LOTTO EXT";
|
||||
canSave = true;
|
||||
tipo = "LE";
|
||||
currLottoEsterno = lottoEsterno;
|
||||
if (lottoEsterno.Cd_ARLotto != null)
|
||||
{
|
||||
lottoScan = lottoEsterno.Cd_ARLotto;
|
||||
}
|
||||
oldArt = lottoEsterno.Cd_AR;
|
||||
articoloScan = lottoEsterno.Cd_AR;
|
||||
quantitaScan = 0;
|
||||
noteScan = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
currLotto = null;
|
||||
canSave = true;
|
||||
tipo = "S";
|
||||
#if false
|
||||
currLottoInterno = null;
|
||||
currUdc = null;
|
||||
alreadyScan = null;
|
||||
alreadyScan = null;
|
||||
#endif
|
||||
lottoScan = lastScan;
|
||||
articoloScan = "";
|
||||
quantitaScan = 0;
|
||||
@@ -170,86 +215,44 @@ namespace MP.INVE.Components
|
||||
|
||||
if (artExists != null)
|
||||
{
|
||||
//var alertInsert = await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi di voler salvare la seguente scansione per la sessione {sessID}?");
|
||||
//if (alertInsert)
|
||||
//{
|
||||
var force = false;
|
||||
if (articoloScan != oldArt)
|
||||
{
|
||||
force = true;
|
||||
}
|
||||
var lottoSave = lastScan;
|
||||
var known = false;
|
||||
var unique = false;
|
||||
if (currUdc != null)
|
||||
{
|
||||
if ((currUdc.lottoNav.CodArt != udc.lottoNav.CodArt) || (currUdc.Qta != udc.Qta))
|
||||
{
|
||||
isForced = true;
|
||||
}
|
||||
//if()
|
||||
|
||||
ScanDataModel newScan = new ScanDataModel()
|
||||
{
|
||||
DtScan = DateTime.Now,
|
||||
UserScan = userScan,
|
||||
ScanValue = lastScan,
|
||||
IsForced = isForced,
|
||||
CodArticolo = currUdc.lottoNav.CodArt,
|
||||
Lotto = currUdc.lottoNav.Lotto,
|
||||
RifExt = currUdc.lottoNav.RifExt,
|
||||
Qty = currUdc.Qta,
|
||||
Note = currUdc.Note,
|
||||
IsKnown = true,
|
||||
IsUnique = true,
|
||||
InveSessID = sessID
|
||||
};
|
||||
|
||||
|
||||
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
lottoSave = currUdc.Lotto;
|
||||
known = true;
|
||||
unique = true;
|
||||
}
|
||||
else if (currLotto != null)
|
||||
else if (currLottoEsterno != null || currLottoInterno != null)
|
||||
{
|
||||
ScanDataModel newScan = new ScanDataModel()
|
||||
{
|
||||
DtScan = DateTime.Now,
|
||||
UserScan = userScan,
|
||||
ScanValue = lastScan,
|
||||
IsForced = true,
|
||||
CodArticolo = currLotto.CodArt,
|
||||
Lotto = currLotto.Lotto,
|
||||
RifExt = currLotto.RifExt,
|
||||
Qty = qtaLotto,
|
||||
Note = currLotto.Note,
|
||||
IsKnown = true,
|
||||
IsUnique = false,
|
||||
InveSessID = sessID
|
||||
};
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
|
||||
known = true;
|
||||
unique = false;
|
||||
}
|
||||
else if (alreadyScan != null)
|
||||
|
||||
ScanDataModel newScan = new ScanDataModel()
|
||||
{
|
||||
ScanDataModel newScan = new ScanDataModel()
|
||||
{
|
||||
DtScan = DateTime.Now,
|
||||
UserScan = userScan,
|
||||
ScanValue = lastScan,
|
||||
IsForced = true,
|
||||
CodArticolo = alreadyScan.CodArticolo,
|
||||
Lotto = alreadyScan.Lotto,
|
||||
RifExt = alreadyScan.RifExt,
|
||||
Qty = alreadyScan.Qty,
|
||||
Note = alreadyScan.Note,
|
||||
IsKnown = alreadyScan.IsKnown,
|
||||
IsUnique = alreadyScan.IsUnique,
|
||||
InveSessID = sessID
|
||||
};
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// currLotto = null;
|
||||
// currUdc = null;
|
||||
// alreadyScan = null;
|
||||
// NavManager.NavigateTo(NavManager.Uri, true);
|
||||
//}
|
||||
DtScan = DateTime.Now,
|
||||
UserScan = userScan,
|
||||
ScanValue = lastScan,
|
||||
IsForced = force,
|
||||
CodArticolo = articoloScan,
|
||||
Lotto = lottoSave,
|
||||
RifExt = "",
|
||||
Qty = quantitaScan,
|
||||
Note = noteScan,
|
||||
IsKnown = known,
|
||||
IsUnique = unique,
|
||||
InveSessID = sessID
|
||||
};
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -284,13 +287,13 @@ namespace MP.INVE.Components
|
||||
protected string lottoScan
|
||||
{
|
||||
get => _lotto;
|
||||
set => _lotto = value;
|
||||
set => _lotto = value.Trim();
|
||||
}
|
||||
protected string _articolo = "";
|
||||
protected string articoloScan
|
||||
{
|
||||
get => _articolo;
|
||||
set => _articolo = value;
|
||||
set => _articolo = value.Trim();
|
||||
}
|
||||
protected decimal _qta = 0;
|
||||
protected decimal quantitaScan
|
||||
@@ -302,7 +305,7 @@ namespace MP.INVE.Components
|
||||
protected string noteScan
|
||||
{
|
||||
get => _note;
|
||||
set => _note = value;
|
||||
set => _note = value.Trim();
|
||||
}
|
||||
|
||||
protected void cssDisableArt()
|
||||
@@ -313,11 +316,5 @@ namespace MP.INVE.Components
|
||||
{
|
||||
reqQtaMod = "";
|
||||
}
|
||||
|
||||
|
||||
//private void saveSel(AnagUdcModel udcToSend)
|
||||
//{
|
||||
// Task.FromResult(udcSend.InvokeAsync(udcToSend));
|
||||
//}
|
||||
}
|
||||
}
|
||||
+139
-24
@@ -162,6 +162,7 @@ namespace MP.INVE.Data
|
||||
return result;
|
||||
// aggiungo record al DB
|
||||
}
|
||||
|
||||
public async Task<bool> deleteSessione(InventorySessionModel session)
|
||||
{
|
||||
bool result = false;
|
||||
@@ -177,6 +178,21 @@ namespace MP.INVE.Data
|
||||
return result;
|
||||
// elimino record dal DB
|
||||
}
|
||||
public async Task<bool> deleteScansione(ScanDataModel scan)
|
||||
{
|
||||
bool result = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
result = await dbController.deleteScansione(scan);
|
||||
// elimino cache redis...
|
||||
RedisValue pattern = new RedisValue($"{redisScanBaseAddr}*");
|
||||
bool answ = await ExecFlushRedisPattern(pattern);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"deleteScansione | Id scansione: {scan.ScanID} | Codice scansionato: {scan.ScanValue} | {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
// elimino record dal DB
|
||||
}
|
||||
|
||||
public async Task<bool> InsertNewMag(AnagMagModel newMag)
|
||||
{
|
||||
@@ -298,35 +314,18 @@ namespace MP.INVE.Data
|
||||
}
|
||||
|
||||
|
||||
public List<AnagLottiArca> ListLottiEsterni(string codArt, string codLotto, string codMagazzino)
|
||||
public List<AnagLottiArca> LottoEsterno(string codArt, string codLotto, string codMagazzino)
|
||||
{
|
||||
string source = "";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
List<AnagLottiArca>? result = new List<AnagLottiArca>();
|
||||
// cerco in redis...
|
||||
RedisValue rawData = redisDb.StringGet(redisLottiEsterni);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<AnagLottiArca>>($"{rawData}");
|
||||
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbController.ListLottiEsterni(codArt, codLotto, codMagazzino);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSetAsync(redisLottiEsterni, rawData, getRandTOut(redisLongTimeCache));
|
||||
source = "DB";
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<AnagLottiArca>();
|
||||
}
|
||||
result = dbController.LottoEsterno(codArt, codLotto, codMagazzino);
|
||||
source = "DB";
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ListLottiEsterni Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
Log.Debug($"LottoEsterno Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -361,6 +360,52 @@ 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 = "";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
ScanDataModel? result = new ScanDataModel();
|
||||
result = dbController.ScanByUdcSession(udc, inveSessId);
|
||||
source = "DB";
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ScanByUdcSession Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<ScanDataModel> ScanByValueSessionOpr(string scanData, int inveSessId, string Opr)
|
||||
{
|
||||
string source = "";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
List<ScanDataModel>? result = new List<ScanDataModel>();
|
||||
result = dbController.ScanByValueSessionOpr(scanData, inveSessId, Opr);
|
||||
source = "DB";
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ScanByValueSessionOpr Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<ScanDataModel> ScanBySession(int idSessione)
|
||||
{
|
||||
string source = "";
|
||||
@@ -408,6 +453,7 @@ namespace MP.INVE.Data
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<AnagUdcModel> ElencoUDC()
|
||||
{
|
||||
string source = "";
|
||||
@@ -439,6 +485,33 @@ namespace MP.INVE.Data
|
||||
Log.Debug($"ElencoUDC Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
public AnagUdcModel IsUDC(string udc)
|
||||
{
|
||||
string source = "";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
AnagUdcModel? result = new AnagUdcModel();
|
||||
result = dbController.IsUDC(udc);
|
||||
source = "DB";
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"IsUDC Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
public AnagLottoModel LottoInterno(string lotto)
|
||||
{
|
||||
string source = "";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
AnagLottoModel? result = new AnagLottoModel();
|
||||
result = dbController.LottoInterno(lotto);
|
||||
source = "DB";
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"LottoInterno Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
public List<AnagLottoModel> ElencoLotti()
|
||||
{
|
||||
string source = "";
|
||||
@@ -536,14 +609,14 @@ namespace MP.INVE.Data
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<InventorySessionModel> InventSessHistList(DateTime dtStart, DateTime dtEnd)
|
||||
public List<InventorySessionModel> InventSessHistList()
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
List<InventorySessionModel> result = new List<InventorySessionModel>();
|
||||
string source = "DB";
|
||||
// cerco in redis...
|
||||
RedisValue rawData = redisDb.StringGet($"{redisSessionHistList}:{dtStart:yyyyMMdd_HHmmss}:{dtEnd:yyyyMMdd_HHmmss}");
|
||||
RedisValue rawData = redisDb.StringGet($"{redisSessionHistList}");
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<InventorySessionModel>>($"{rawData}");
|
||||
@@ -551,7 +624,7 @@ namespace MP.INVE.Data
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbController.InventSessHistList(dtStart, dtEnd);
|
||||
result = dbController.InventSessHistList();
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSetAsync(redisSessionHistList, rawData, getRandTOut(redisLongTimeCache));
|
||||
@@ -566,6 +639,47 @@ namespace MP.INVE.Data
|
||||
return result;
|
||||
}
|
||||
|
||||
public InventorySessionModel InventSessByID(int sessID)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
InventorySessionModel result = new InventorySessionModel();
|
||||
string source = "DB";
|
||||
result = dbController.InventSessByID(sessID);
|
||||
if (result == null)
|
||||
{
|
||||
result = new InventorySessionModel();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"InventSessByID Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<bool> CloseOpenSessione(int sessID, bool flgClose)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
bool result = false;
|
||||
string source = "DB";
|
||||
result = await dbController.CloseOpenSessione(sessID, flgClose);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"CloseOpenSessione Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
public async Task<bool> TransferSessione(int sessID)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
bool result = false;
|
||||
string source = "DB";
|
||||
result = await dbController.TransferSessione(sessID);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"TransferSessione Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
@@ -634,6 +748,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";
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.INVE</RootNamespace>
|
||||
<Version>6.16.2212.1218</Version>
|
||||
<Version>6.16.2212.1610</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,12 +1,43 @@
|
||||
@page "/Acquisizione"
|
||||
|
||||
@*<div class="d-flex justify-content-between">
|
||||
<h5 class="fw-bold py-1">MP.INVE</h5>
|
||||
<div class="fs-5 py-0">
|
||||
<span class="fw-bold badge bg-dark py-1 text-light">Acquisizione</span>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button class="btn btn-sm btn-primary mb-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasRight" aria-controls="offcanvasRight"><i class="fa-solid fa-bars"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offcanvas offcanvas-end" data-bs-scroll="true" data-bs-backdrop="false" tabindex="-1" id="offcanvasRight" aria-labelledby="offcanvasRightLabel">
|
||||
<div class="offcanvas-header">
|
||||
<h5 id="offcanvasRightLabel">Menu</h5>
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body text-center">
|
||||
|
||||
<a class="btn btn-sm btn-danger text-end mb-2" href="Cancellazione?idOpr=@idOpr&sessID=@sessionId">
|
||||
MODALITÀ CANCELLAZIONE
|
||||
</a>
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="mb-2">
|
||||
<NavMenuTerm isScan="true" link="@link"></NavMenuTerm>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<CodeScan lastRawScan="saveScan"></CodeScan>
|
||||
</div>
|
||||
<div class="card mb-5">
|
||||
<div class="card-header py-1">
|
||||
<div class="col-12">
|
||||
Last scan: <b>@rawScan</b>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
Last scan: <b>@rawScan</b>
|
||||
</div>
|
||||
<div>
|
||||
#:<b>@nScansioniTot</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body py-0">
|
||||
@@ -23,12 +54,11 @@
|
||||
<div>
|
||||
S.<b>@sessionId</b> | @descr
|
||||
</div>
|
||||
<div>
|
||||
#:<b>@nScansioniTot</b>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@magInv
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace MP.INVE.Pages
|
||||
|
||||
protected string descr { get; set; } = "";
|
||||
protected string magInv { get; set; } = "";
|
||||
protected string link { get; set; } = "";
|
||||
|
||||
protected List<ScanDataModel>? eleScansioni;
|
||||
//protected AnagUdcModel currUdc{ get; set; } = null!;
|
||||
@@ -59,13 +60,14 @@ namespace MP.INVE.Pages
|
||||
nScansioniTot = eleScansioni.Count();
|
||||
// recupero dati della sessione di inventario...
|
||||
var currSessions = MIService.InventSessCurrList();
|
||||
var currInv = currSessions.Where(x=> x.InveSessID== sessionId).FirstOrDefault();
|
||||
var currInv = currSessions.Where(x => x.InveSessID == sessionId).FirstOrDefault();
|
||||
if (currInv != null)
|
||||
{
|
||||
descr = currInv.Description;
|
||||
magInv = currInv.AnagMagNav.DescMag;
|
||||
}
|
||||
}
|
||||
link = $"Cancellazione?idOpr={idOpr}&sessID={sessionId}";
|
||||
}
|
||||
protected void saveScan(string newScan)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
@page "/Cancellazione"
|
||||
|
||||
@*<div class="d-flex justify-content-between">
|
||||
<h5 class="fw-bold py-1">MP.INVE</h5>
|
||||
<div class="fs-5 py-0">
|
||||
<span class="fw-bold badge bg-info py-1 text-dark">Cancellazione</span>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button class="btn btn-sm btn-primary mb-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasRight" aria-controls="offcanvasRight"><i class="fa-solid fa-bars"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offcanvas offcanvas-end" data-bs-scroll="true" data-bs-backdrop="false" tabindex="-1" id="offcanvasRight" aria-labelledby="offcanvasRightLabel">
|
||||
<div class="offcanvas-header">
|
||||
<h5 id="offcanvasRightLabel">Menu</h5>
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body text-center">
|
||||
|
||||
<button class="btn btn-sm btn-success text-end mb-2" @onclick="()=>goBack()">
|
||||
MODALITÀ SCANSIONE
|
||||
</button>
|
||||
</div>
|
||||
</div>*@
|
||||
|
||||
<div class="mb-2">
|
||||
<NavMenuTerm isScan="false"></NavMenuTerm>
|
||||
</div>
|
||||
|
||||
<CodeScan lastRawScan="saveScan"></CodeScan>
|
||||
@if (currScan != null)
|
||||
{
|
||||
<div class="card p-0">
|
||||
<div class="card-header d-flex justify-content-between">
|
||||
<span>
|
||||
Dati ultima scansione
|
||||
</span>
|
||||
<div>
|
||||
<span class="fw-bold">#:</span>@totScan
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
|
||||
<div class="text-center">
|
||||
<div>
|
||||
<div class="fs-5">
|
||||
<span><b>Codice: </b></span>
|
||||
</div>
|
||||
<div class="fs-3">
|
||||
@currScan.ScanValue
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="fs-5">
|
||||
<span><b>Lotto: </b></span>
|
||||
</div>
|
||||
<div class="fs-3">
|
||||
@currScan.Lotto
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="fs-5">
|
||||
<span><b>Articolo: </b></span>
|
||||
</div>
|
||||
<div class="fs-3">
|
||||
@currScan.CodArticolo
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="fs-5">
|
||||
<span><b>Quantità: </b></span>
|
||||
</div>
|
||||
<div class="fs-3">
|
||||
@Math.Round(currScan.Qty, 0)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<button class="btn btn-sm btn-danger col-12" @onclick="()=>deleteScan(currScan)">
|
||||
<i class="fa-solid fa-trash-can"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (first)
|
||||
{
|
||||
<div class="alert bg-warning">Eseguire scansione</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert bg-danger">Nessuna scansione trovata</div>
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
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;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
|
||||
namespace MP.INVE.Pages
|
||||
{
|
||||
public partial class Cancellazione
|
||||
{
|
||||
[Inject]
|
||||
MiDataService MIService { get; set; } = null!;
|
||||
[Inject]
|
||||
IJSRuntime JSRuntime { get; set; } = null!;
|
||||
[Inject]
|
||||
private NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
protected string rawScan { get; set; } = null!;
|
||||
|
||||
protected ScanDataModel? currScan;
|
||||
protected List<ScanDataModel>? scanList;
|
||||
protected bool first { get; set; } = false;
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
first = true;
|
||||
await Task.Delay(1);
|
||||
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("sessID", out var _inveSessionId) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("idOpr", out var _idOpr))
|
||||
{
|
||||
sessID = int.Parse(_inveSessionId);
|
||||
idOPr = _idOpr;
|
||||
}
|
||||
}
|
||||
|
||||
protected int sessID { get; set; } = 0;
|
||||
protected int totScan { get; set; } = 0;
|
||||
protected string idOPr { get; set; } = "";
|
||||
|
||||
protected void saveScan(string newScan)
|
||||
{
|
||||
first = false;
|
||||
if (!string.IsNullOrEmpty(newScan))
|
||||
{
|
||||
rawScan = newScan;
|
||||
scanList = MIService.ScanByValueSessionOpr(rawScan, sessID, idOPr);
|
||||
currScan = scanList.FirstOrDefault();
|
||||
totScan = scanList.Count;
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task deleteScan(ScanDataModel scan)
|
||||
{
|
||||
await MIService.deleteScansione(scan);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
|
||||
|
||||
private string CodUDC { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
@page "/DeleteScan"
|
||||
|
||||
<h3>DeleteScan</h3>
|
||||
|
||||
<CodeScan lastRawScan="saveScan"></CodeScan>
|
||||
<ListScan lastScan="@rawScan" sessID="@sessionId" magID="@magazzinoId" userScan="@idOpr"></ListScan>
|
||||
@@ -0,0 +1,56 @@
|
||||
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;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
|
||||
namespace MP.INVE.Pages
|
||||
{
|
||||
public partial class DeleteScan
|
||||
{
|
||||
[Inject]
|
||||
MiDataService MIService { get; set; } = null!;
|
||||
[Inject]
|
||||
NavigationManager NavManager { get; set; } = null!;
|
||||
protected void saveScan(string newScan)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(newScan))
|
||||
{
|
||||
rawScan = newScan;
|
||||
}
|
||||
}
|
||||
protected async Task deleteScan(ScanDataModel scan)
|
||||
{
|
||||
await MIService.deleteScansione(scan);
|
||||
}
|
||||
protected string rawScan { get; set; } = null!;
|
||||
protected string idOpr { get; set; } = null!;
|
||||
protected int sessionId { get; set; } = 0;
|
||||
protected string magazzinoId { get; set; } = "";
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("idOpr", out var _matrOpr) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("idSess", out var _inveSessionId) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("codMag", out var _idMag))
|
||||
{
|
||||
idOpr = _matrOpr;
|
||||
sessionId = int.Parse(_inveSessionId);
|
||||
magazzinoId = _idMag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="form-check form-check-sm form-switch py-1" title="Parameter View Mode (RealTime / LogData)">
|
||||
<input class="form-check-input" type="checkbox" id="mySwitch" name="setupAlarms" @onclick="() => toggle()">
|
||||
</div>
|
||||
<span class="">Concluse</span>
|
||||
<span class="">Trasferite</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+121
-1
@@ -1,5 +1,125 @@
|
||||
@page "/Invio"
|
||||
|
||||
<h3>Invio</h3>
|
||||
@if (isLoading)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@if (sessione != null)
|
||||
{
|
||||
<div class="card mb-5">
|
||||
<div class="card-header">
|
||||
<div class="d-flex justify-content-between">
|
||||
<h3>Invio</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID sessione</th>
|
||||
<th>Descrizione</th>
|
||||
<th>Magazzino</th>
|
||||
<th>Descrizione Mag</th>
|
||||
<th class="text-center">Durata</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
@sessione.InveSessID
|
||||
</td>
|
||||
<td>
|
||||
@sessione.Description
|
||||
</td>
|
||||
<td>
|
||||
@sessione.AnagMagNav.CodMag
|
||||
</td>
|
||||
<td>
|
||||
@sessione.AnagMagNav.DescMag
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex justify-content-between small">
|
||||
<div class="px-0">
|
||||
@sessione.DtStart
|
||||
</div>
|
||||
<div class="px-0">
|
||||
>>
|
||||
</div>
|
||||
@if (sessione.DtEnd != null)
|
||||
{
|
||||
<div class="px-0">
|
||||
@sessione.DtEnd
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="px-0">
|
||||
In corso..
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center d-flex justify-content-between">
|
||||
<div>
|
||||
<button class="btn btn-sm btn-primary mx-1" @onclick="mostraDati">
|
||||
<i class="fa-regular fa-rectangle-list"></i>
|
||||
</button>
|
||||
@if (sessione.DtEnd == null)
|
||||
{
|
||||
<button class="btn btn-sm btn-danger mx-1" @onclick="()=>chiudiSessione(sessione.InveSessID)"><i class="fa-solid fa-stop"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-sm btn-secondary mx-1" @onclick="()=>chiudiSessione(sessione.InveSessID)" disabled><i class="fa-solid fa-stop"></i></button>
|
||||
}
|
||||
@if ((sessione.DtEnd != null) && (!sessione.Transferred))
|
||||
{
|
||||
<button class="btn btn-sm btn-success mx-1" @onclick="()=>apriSessione(sessione.InveSessID)"><i class="fa-regular fa-circle-play"></i></button>
|
||||
<button class="btn btn-sm btn-warning mx-1" @onclick="()=>trasfSessione(sessione.InveSessID)"><i class="fa-solid fa-file-import"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-sm btn-secondary mx-1" @onclick="()=>apriSessione(sessione.InveSessID)" disabled><i class="fa-regular fa-circle-play"></i></button>
|
||||
<button class="btn btn-sm btn-secondary mx-1" @onclick="()=>trasfSessione(sessione.InveSessID)" disabled><i class="fa-solid fa-file-import"></i></button>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@if ((sessione.DtEnd == null) && (!sessione.Transferred))
|
||||
{
|
||||
<div class="text-center">
|
||||
<h3>Scansiona il codice per connetterti alla sessione @sessID</h3>
|
||||
<div>
|
||||
<div class="img-fluid" id="qrCodeImg_101"></div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (mostra)
|
||||
{
|
||||
@if (sessID != 0)
|
||||
{
|
||||
<ListTotLotto SessionID="@sessID" currParams="@invioParams" 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>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -17,15 +17,180 @@ using MP.INVE.Components;
|
||||
using Blazored.LocalStorage;
|
||||
using MP.Data.DTO;
|
||||
using MP.Data;
|
||||
using MP.INVE.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
|
||||
namespace MP.INVE.Pages
|
||||
{
|
||||
public partial class Invio
|
||||
{
|
||||
|
||||
[Inject]
|
||||
public MiDataService MIService { get; set; } = null!;
|
||||
|
||||
protected SelectInvioParams invioParams = new SelectInvioParams();
|
||||
protected SelectInveSessionParams sessParams = new SelectInveSessionParams();
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => invioParams.TotCount;
|
||||
set
|
||||
{
|
||||
if (invioParams.TotCount != value)
|
||||
{
|
||||
invioParams.TotCount = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
private int numRecord
|
||||
{
|
||||
get => invioParams.NumRec;
|
||||
set
|
||||
{
|
||||
if (invioParams.NumRec != value)
|
||||
{
|
||||
invioParams.NumRec = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
private int currPage
|
||||
{
|
||||
get => invioParams.CurrPage;
|
||||
set
|
||||
{
|
||||
if (invioParams.CurrPage != value)
|
||||
{
|
||||
invioParams.CurrPage = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
private string idOperatore
|
||||
{
|
||||
get => sessParams.idOperatore;
|
||||
set => sessParams.idOperatore = value;
|
||||
}
|
||||
private string authKey
|
||||
{
|
||||
get => sessParams.authKey;
|
||||
set => sessParams.authKey = value;
|
||||
}
|
||||
|
||||
protected void ForceReload(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
}
|
||||
|
||||
protected void ForceReloadPage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
}
|
||||
protected bool mostra = false;
|
||||
|
||||
protected void mostraDati()
|
||||
{
|
||||
mostra = true;
|
||||
}
|
||||
protected async void chiudiSessione(int sessID)
|
||||
{
|
||||
var closed = await MIService.CloseOpenSessione(sessID, true);
|
||||
if (closed)
|
||||
{
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected async void apriSessione(int sessID)
|
||||
{
|
||||
var open = await MIService.CloseOpenSessione(sessID, false);
|
||||
if (open)
|
||||
{
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
protected async void trasfSessione(int sessID)
|
||||
{
|
||||
var trasf = await MIService.TransferSessione(sessID);
|
||||
if (trasf)
|
||||
{
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
|
||||
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("sessID", out var _inveSessionId) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("codMag", out var _idMag))
|
||||
{
|
||||
sessID = int.Parse(_inveSessionId);
|
||||
codMag = _idMag;
|
||||
}
|
||||
|
||||
await reloadData();
|
||||
|
||||
}
|
||||
protected async override Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
if (sessione != null)
|
||||
{
|
||||
await getId();
|
||||
if ((sessione.DtEnd == null) && (!sessione.Transferred))
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private IConfiguration Configuration { get; set; } = null!;
|
||||
[Inject]
|
||||
private IJSRuntime JSRuntime { get; set; } = null!;
|
||||
[Inject]
|
||||
private NavigationManager NavManager { get; set; } = null!;
|
||||
[Inject]
|
||||
private ILocalStorageService localStorage { get; set; } = null!;
|
||||
protected string BaseUrlTab { get => $"{Configuration["ServerConf:BaseUrlJumper"]}"; }
|
||||
|
||||
|
||||
protected string rawCode
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
answ = $"{BaseUrlTab}IdSessione={sessID}&IdMag={codMag}&MatrOpr={idOperatore}&UserAuthKey={authKey}";
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private InventorySessionModel? sessione;
|
||||
protected bool isLoading = false;
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
|
||||
sessione = null;
|
||||
isLoading = true;
|
||||
sessione = MIService.InventSessByID(sessID);
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected int sessID { get; set; } = 0;
|
||||
protected string codMag { get; set; } = "";
|
||||
|
||||
|
||||
protected async Task getId()
|
||||
{
|
||||
OperatoreDTO local = new OperatoreDTO();
|
||||
local = await localStorage.GetItemAsync<OperatoreDTO>("MatrOpr");
|
||||
if (local != null)
|
||||
{
|
||||
idOperatore = local.MatrOpr.ToString();
|
||||
authKey = local.hashAuthKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
@page "/Test"
|
||||
<div class="row">
|
||||
@*<div class="row">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="card">
|
||||
<div>UDC Già presente</div>
|
||||
@@ -46,4 +46,50 @@
|
||||
<div class="img-fluid" id="qrCodeImg_107"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>*@
|
||||
<CodeScan lastRawScan="saveScan"></CodeScan>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Oggetto</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (elencoSCAN != null)
|
||||
{
|
||||
@foreach (var item in elencoSCAN)
|
||||
{
|
||||
<tr>
|
||||
<td class="d-flex justify-content-between">
|
||||
<div class="col-6">
|
||||
<div>
|
||||
<span class="small textCondensed"><b>Cod: </b></span>@item.ScanValue
|
||||
</div>
|
||||
<div>
|
||||
<span class="small textCondensed"><b>Lotto: </b></span>@item.Lotto
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div>
|
||||
<span class="small textCondensed"><b>Art: </b></span>@item.CodArticolo
|
||||
</div>
|
||||
<div>
|
||||
<span class="small textCondensed"><b>Qty: </b></span>@Math.Round(item.Qty, 0)
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<button class="btn btn-sm btn-danger" @onclick="()=>deleteScan(item)">
|
||||
<i class="fa-solid fa-trash-can"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
+37
-26
@@ -26,41 +26,52 @@ namespace MP.INVE.Pages
|
||||
[Inject]
|
||||
IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
List<AnagUdcModel>? elencoUDC;
|
||||
protected override async Task OnInitializedAsync()
|
||||
protected string rawScan { get; set; } = null!;
|
||||
|
||||
List<ScanDataModel>? elencoSCAN;
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
//elencoUDC = MIService.ElencoUDC().Take(4).ToList();
|
||||
|
||||
|
||||
|
||||
//await getId();
|
||||
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
//if (firstRender)
|
||||
//{
|
||||
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
|
||||
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", "20MFI000000001");
|
||||
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{102}");
|
||||
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{102}", "20MSL000000002");
|
||||
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{103}");
|
||||
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{103}", "21MFI000000017");
|
||||
|
||||
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{104}");
|
||||
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{104}", "M200000019");
|
||||
|
||||
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{105}");
|
||||
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{105}", "M210000055");
|
||||
|
||||
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{106}");
|
||||
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{106}", "027407");
|
||||
|
||||
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{107}");
|
||||
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{107}", "ABCDE");
|
||||
//}
|
||||
}
|
||||
|
||||
protected void saveScan(string newScan)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(newScan))
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", "20MFI000000001");
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{102}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{102}", "20MSL000000002");
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{103}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{103}", "21MFI000000017");
|
||||
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{104}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{104}", "M200000019");
|
||||
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{105}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{105}", "M210000055");
|
||||
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{106}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{106}", "027407");
|
||||
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{107}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{107}", "ABCDE");
|
||||
rawScan = newScan;
|
||||
elencoSCAN = MIService.ScanList().Where(x => x.ScanValue == newScan).ToList();
|
||||
}
|
||||
}
|
||||
protected async Task deleteScan(ScanDataModel scan)
|
||||
{
|
||||
await MIService.deleteScansione(scan);
|
||||
}
|
||||
private string CodUDC { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOINVE </i>
|
||||
<h4>Versione: 6.16.2212.1218</h4>
|
||||
<h4>Versione: 6.16.2212.1610</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2212.1218
|
||||
6.16.2212.1610
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2212.1218</version>
|
||||
<version>6.16.2212.1610</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>
|
||||
|
||||
@@ -5,10 +5,9 @@
|
||||
<PageTitle>MP.INVE</PageTitle>
|
||||
|
||||
<div class="page">
|
||||
<div class="@sideClass">
|
||||
<div class="@sideClass menuHide">
|
||||
<NavMenu EC_compressUpdated="@UpdateNavDisplay" />
|
||||
</div>
|
||||
|
||||
<main>
|
||||
<div class="top-row px-4 justify-content-between">
|
||||
<CmpTop></CmpTop>
|
||||
|
||||
@@ -46,7 +46,9 @@ main {
|
||||
.top-row:not(.auth) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.menuHide {
|
||||
display: none;
|
||||
}
|
||||
.top-row.auth {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</div>
|
||||
</NavLink>
|
||||
</div>*@
|
||||
<div class="nav-item px-2 col-12">
|
||||
@*<div class="nav-item px-2 col-12">
|
||||
<NavLink class="nav-link px-2" href="Invio">
|
||||
<div class="col-2">
|
||||
<span class="px-2" aria-hidden="true"><i class="fa-solid fa-file-export"></i></span>
|
||||
@@ -71,7 +71,7 @@
|
||||
<span class="@hideText">Invio</span>
|
||||
</div>
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>*@
|
||||
</nav>
|
||||
}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user