This commit is contained in:
Samuele Locatelli
2022-12-28 18:48:40 +01:00
13 changed files with 95 additions and 69 deletions
+1
View File
@@ -644,6 +644,7 @@ namespace MP.Data.Controllers
InventorySessionModel dbResult = new InventorySessionModel();
using (var dbCtx = new MoonPro_InveContext(_configuration))
{
dbResult = dbCtx
.DbInveSess
.Where(x => x.InveSessID == sessID)
+11
View File
@@ -42,6 +42,17 @@
</div>
</NavLink>
</div>
<div class="nav-item px-2 col-12">
<NavLink class="nav-link px-2" Match="NavLinkMatch.All" @onclick="()=>changeSess()">
<div class="col-2">
<i class="fa-solid fa-warehouse text-dark"></i>
</div>
<div>
<span class="text-dark ">Cambia Sessione</span>
</div>
</NavLink>
</div>
</nav>
</div>
+22 -4
View File
@@ -35,14 +35,18 @@ namespace MP.INVE.Components
protected string cssScanBack = "";
protected string cssCancBack = "";
protected string @cssCancScan = "";
protected string cssCancScan = "";
protected string authKey = "";
protected int idOpr = 0;
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
if (isScan)
{
cssCancScan = "bg-info";
cssScanBack = "background-color: rgba(255,255,255,0.7)";
cssScan = "fw-bold text-decoration-underline";
}
@@ -64,21 +68,35 @@ namespace MP.INVE.Components
}
protected async Task goBack()
{
if (NavigationManager.Uri.Contains(""))
if (NavManager.Uri.Contains(""))
await JSRuntime.InvokeVoidAsync("history.go", -1);
}
protected async Task changeSess()
{
var currSess = await localStorage.GetItemAsync<InveSessDTO>("SessioneCorrente");
if(currSess != null)
{
authKey = currSess.hashAuthKey;
idOpr = currSess.MatrOpr;
NavManager.NavigateTo($"Jumper?MatrOpr={idOpr}&UserAuthKey={authKey}");
}
}
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!;
protected NavigationManager NavManager { get; set; } = null!;
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
+31 -20
View File
@@ -1,26 +1,37 @@
@if (lastScanSessione != "0" && !string.IsNullOrEmpty(lastScanSessione))
@if (isLoading)
{
@if (currSess != null)
<LoadingData></LoadingData>
}
else
{
@if (lastScanSessione != "0" && !string.IsNullOrEmpty(lastScanSessione))
{
<div class="card">
<div class="card-body text-center">
<span class="fw-bold fs-5">Id sessione:</span>
<div class="fs-4">
@currSess.InveSessID
</div>
<span class="fw-bold fs-5">Descrizione sessione:</span>
<div class="fs-4">
@currSess.Description
</div>
<span class="fw-bold fs-5">Descrizione magazzino:</span>
<div class="fs-4">
@if (currSess.AnagMagNav != null)
{
@currSess.AnagMagNav.DescMag
}
@if (currSess != null)
{
<div class="card">
<div class="card-body text-center">
<span class="fw-bold fs-5">Id sessione:</span>
<div class="fs-4">
@currSess.InveSessID
</div>
<span class="fw-bold fs-5">Descrizione sessione:</span>
<div class="fs-4">
@currSess.Description
</div>
<span class="fw-bold fs-5">Descrizione magazzino:</span>
<div class="fs-4">
@if (currSess.AnagMagNav != null)
{
@currSess.AnagMagNav.DescMag
}
</div>
</div>
<button class="btn btn-sm btn-success" @onclick="()=>connetti(currSess.InveSessID, currSess.AnagMagNav.CodMag)">Connetti</button>
</div>
<button class="btn btn-sm btn-success" @onclick="()=>connetti(currSess.InveSessID, currSess.AnagMagNav.CodMag)">Connetti</button>
</div>
}
else
{
<div class="alert bg-warning text-center"><span class="fs-3">Sessione inesistente</span></div>
}
}
}
+10 -14
View File
@@ -40,6 +40,7 @@ namespace MP.INVE.Components
[Inject]
protected MessageService MsgService { get; set; } = null!;
protected bool isLoading = false;
protected InventorySessionModel? currSess = new InventorySessionModel();
@@ -55,13 +56,16 @@ namespace MP.INVE.Components
}
private async Task reloadData(bool first)
{
currSess = null;
isLoading = true;
await Task.Delay(1);
if (lastScanSessione != null)
{
currSess = MIService.InventSessByID(int.Parse(lastScanSessione));
}
isLoading = false;
}
protected void connetti(int sessionId, string magazzinoId)
protected async void connetti(int sessionId, string magazzinoId)
{
var decrypt = MIService.DeriptData(authKey);
var log = MIService.loginOperatore(idOpr, decrypt);
@@ -69,24 +73,16 @@ namespace MP.INVE.Components
{
if (currSess != null)
{
//string hash = MIService.EncriptData(sessioneScelta.authKey);
#if false
OperatoreDTO sessionOpr = new OperatoreDTO
InveSessDTO currSess = new InveSessDTO()
{
MatrOpr = idOpr,
Nome = sessioneScelta.Nome,
Cognome = sessioneScelta.Cognome,
InveSessID = sessionId,
MagID = magazzinoId,
hashAuthKey = authKey,
dtExp = DateTime.Now.AddMinutes(1)
dtExp = DateTime.Now.AddHours(8)
};
#endif
#if false
await localStorage.SetItemAsync("MatrOpr", currOpr);
localStorage.SetItemAsync("idSessione", inveSessionId);
await MsgService.setCurrOperDtoAsync(sessionOpr);
#endif
await localStorage.SetItemAsync("SessioneCorrente", currSess);
NavManager.NavigateTo($"Acquisizione?idSess={sessionId}&idOpr={idOpr}&codMag={magazzinoId}");
}
+4 -4
View File
@@ -390,10 +390,10 @@ namespace MP.INVE.Data
InventorySessionModel result = new InventorySessionModel();
string source = "DB";
result = dbController.InventSessByID(sessID);
if (result == null)
{
result = new InventorySessionModel();
}
//if (result == null)
//{
// result = new InventorySessionModel();
//}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"InventSessByID Read from {source}: {ts.TotalMilliseconds}ms");
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.INVE</RootNamespace>
<Version>6.16.2212.2812</Version>
<Version>6.16.2212.2815</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -140,7 +140,7 @@ namespace MP.INVE.Pages
if ((sessione.DtEnd == null) && (!sessione.Transferred))
{
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode);
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", sessione.InveSessID);
}
}
}
+4 -18
View File
@@ -6,26 +6,12 @@
}
else
{
@if (idOpr == "0")
{
<span class="fs-4">Selezionare l'operatore</span>
}
else
{
<span class="fs-4">Selezionare la sessione</span>
}
<span class="fs-4">Scansionare la sessione</span>
@*<input type="text" class="form-control" @bind="@idOpr" />*@
<CodeScan lastRawScan="saveScan"></CodeScan>
@if (rawScan != "")
{
@if (string.IsNullOrEmpty(idOpr))
{
<ProcOperatore lastScanOperatore="@rawScan" sessionId="@inveSessionId" magazzinoId="@codMag"></ProcOperatore>
}
else if(inveSessionId == 0)
{
<ProcSess lastScanSessione="@rawScan" idOpr="@int.Parse(idOpr)" authKey="@authKey"></ProcSess>
}
@if (!string.IsNullOrEmpty(rawScan))
{
<ProcSess lastScanSessione="@rawScan" idOpr="@int.Parse(idOpr)" authKey="@authKey"></ProcSess>
}
}
+7 -4
View File
@@ -117,13 +117,14 @@ namespace MP.INVE.Pages
Dictionary<string, string> uriProcDict = new Dictionary<string, string>();
protected void saveScan(string newScan)
{
uriProcDict.Clear();
//uriProcDict.Clear();
if (!string.IsNullOrEmpty(newScan))
{
#if false
//eseguo split su "?" e divido in due il link
//var uriProc1 = newScan.Split("?");
var uriProc1 = newScan.Split("?");
//eseguo split su "&" e divido il rimanente del link ottenendo così le variabili singole
var uriProc2 = newScan.Split("&");
var uriProc2 = uriProc1[1].Split("&");
string[] uriProc3;
for (int i = 0; i < uriProc2.Length; i++)
@@ -139,7 +140,9 @@ namespace MP.INVE.Pages
else
{
rawScan = uriProcDict["IdSessione"];
}
}
#endif
rawScan = newScan;
}
}
protected string rawScan { get; set; } = null!;
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOINVE </i>
<h4>Versione: 6.16.2212.2812</h4>
<h4>Versione: 6.16.2212.2815</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2212.2812
6.16.2212.2815
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2212.2812</version>
<version>6.16.2212.2815</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>