Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
@if (isMulti)
|
||||
{
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="basic-addon1">Macchina</span>
|
||||
<span class="input-group-text" id="basic-addon1">Selezione Impianto</span>
|
||||
<select class="form-select form-select-sm" @bind="@IdxMaccSel">
|
||||
<option disabled>--- Selezionare impianto ---</option>
|
||||
@if (ListMacchineAll == null)
|
||||
<option>--- Selezionare impianto ---</option>
|
||||
@if (ListMacchine == null)
|
||||
{
|
||||
<option value="" disabled>No record found</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var item in ListMacchineAll)
|
||||
@foreach (var item in ListMacchine)
|
||||
{
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using System;
|
||||
using System.Reflection.Metadata;
|
||||
|
||||
namespace MP_TAB_SERV.Components
|
||||
@@ -19,9 +20,21 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string IdxMaccSel { get; set; } = "";
|
||||
protected string IdxMaccSel
|
||||
{
|
||||
get => idxMaccSel;
|
||||
set
|
||||
{
|
||||
if (idxMaccSel != value)
|
||||
{
|
||||
idxMaccSel = value;
|
||||
E_MachSel.InvokeAsync(value).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
private string idxMaccSel { get; set; } = "";
|
||||
|
||||
protected Dictionary<string, string>? ListMacchineAll { get; set; } = null;
|
||||
protected Dictionary<string, string>? ListMacchine { get; set; } = null;
|
||||
|
||||
[Inject]
|
||||
protected SharedMemService MServ { get; set; } = null!;
|
||||
@@ -41,12 +54,20 @@ namespace MP_TAB_SERV.Components
|
||||
{
|
||||
isMulti = MServ.DictMacchMulti[RecMSE?.IdxMacchina] == 1;
|
||||
}
|
||||
ListMacchineAll = MServ.DictMacchine;
|
||||
if (isMulti)
|
||||
{
|
||||
|
||||
var listMulti = await TDataService.VMSFDGetAll();
|
||||
ListMacchine = listMulti.Where(x => x.IdxMacchina.Contains($"{RecMSE?.IdxMacchina}#")).ToDictionary(x => x.IdxMacchina, x => $"{x.IdxMacchina.Replace($"{RecMSE?.IdxMacchina}#", "")}");
|
||||
}
|
||||
}
|
||||
//await E_MachSel.InvokeAsync(RecMSE?.IdxMacchina);
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TDataService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
@@ -9,7 +9,14 @@
|
||||
@($"{NumGray}%")
|
||||
</div>
|
||||
<div runat="server" id="divBlue" class="progress-bar bg-primary" style="width: @(NumBlue)%">
|
||||
@($"+{NumBlue}%")
|
||||
@if (NumGreen >0)
|
||||
{
|
||||
@($"+ {NumBlue}%")
|
||||
}
|
||||
else
|
||||
{
|
||||
@($"{NumBlue}%")
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<asp:HiddenField runat="server" ID="hfProdCount" />
|
||||
|
||||
@@ -72,21 +72,6 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (isProcessing)
|
||||
{
|
||||
<div class="row textCondens">
|
||||
<div class="col-12">
|
||||
<div class="text-center text-warning align-middle">
|
||||
<i class="fa fa-spinner fa-pulse"></i>
|
||||
<b>ELABORAZIONE IN CORSO</b>
|
||||
<i class="fa fa-spinner fa-pulse"></i>
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-striped bg-success progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="row textCondens">
|
||||
<div class="col-6 py-1 text-start text-uppercase">
|
||||
<b>Dati Globali ODL</b>
|
||||
@@ -99,13 +84,23 @@
|
||||
<span>@dtFine</span>
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-sm-3 pr-1 py-0 text-end">
|
||||
<div class="alert alert-warning py-1">
|
||||
<div class="text-truncate">
|
||||
[A] NUOVI Pz.Prod
|
||||
</div>
|
||||
<div class="my-0 fw-bold fs-2">
|
||||
<span>@numPz2Rec.ToString("N0")</span>
|
||||
@if (isProcessing)
|
||||
{
|
||||
<div class="placeholder-glow">
|
||||
<span class="placeholder col-3"></span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>@numPz2Rec.ToString("N0")</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -115,7 +110,16 @@
|
||||
Pz Prodotti TOT [A+B+C]
|
||||
</div>
|
||||
<div class="my-0 fw-bold fs-2">
|
||||
<span>@numPzProdotti.ToString("N0")</span>
|
||||
@if (isProcessing)
|
||||
{
|
||||
<div class="placeholder-glow">
|
||||
<span class="placeholder col-3"></span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>@numPzProdotti.ToString("N0")</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -125,7 +129,16 @@
|
||||
[B] Scarti VERS.
|
||||
</div>
|
||||
<div class="my-0 fw-bold fs-2">
|
||||
<span>@numPzScaConf.ToString("N0")</span>
|
||||
@if (isProcessing)
|
||||
{
|
||||
<div class="placeholder-glow">
|
||||
<span class="placeholder col-3"></span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>@numPzScaConf.ToString("N0")</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -135,7 +148,16 @@
|
||||
[C] Pz Buoni VERS.
|
||||
</div>
|
||||
<div class="my-0 fw-bold fs-2">
|
||||
<span>@numPzBuoniConf.ToString("N0")</span>
|
||||
@if (isProcessing)
|
||||
{
|
||||
<div class="placeholder-glow">
|
||||
<span class="placeholder col-3"></span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>@numPzBuoniConf.ToString("N0")</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -148,3 +170,18 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (isProcessing)
|
||||
{
|
||||
<div class="row textCondens mb-2">
|
||||
<div class="col-12">
|
||||
<div class="text-center text-warning align-middle">
|
||||
<div class="progress" style="height:2rem;">
|
||||
<div class="progress-bar progress-bar-striped bg-primary progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%;">
|
||||
<b>ELABORAZIONE IN CORSO</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -47,6 +47,8 @@ namespace MP_TAB_SERV.Components
|
||||
/// <param name="newDate"></param>
|
||||
public async Task doUpdate()
|
||||
{
|
||||
isProcessing= true;
|
||||
await Task.Delay(1);
|
||||
datiProdAct = await TabDServ.StatoProdMacchina(IdxMaccSel, dtReqUpdate);
|
||||
// aggiorno visualizzazione...
|
||||
numPzProdotti = datiProdAct.PzTotODL;
|
||||
@@ -55,9 +57,10 @@ namespace MP_TAB_SERV.Components
|
||||
numPzBuoniConf = datiProdAct.PzConfBuoni;
|
||||
numPzProdotti2Rec = datiProdAct.Pz2RecTot;
|
||||
numPzScarto2Rec = datiProdAct.Pz2RecScarto;
|
||||
dtInizio = RecMSE?.DataInizioOdl ?? DateTime.Today.AddMonths(-2); ;
|
||||
dtInizio = RecMSE?.DataInizioOdl ?? DateTime.Today.AddMonths(-2);
|
||||
dtFine = dtReqUpdate;
|
||||
//reportUpdate();
|
||||
isProcessing = false;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
@@ -191,9 +194,14 @@ namespace MP_TAB_SERV.Components
|
||||
showConfirm = newVal;
|
||||
}
|
||||
|
||||
protected void SetMacc(string selIdxMacc)
|
||||
protected async Task SetMacc(string selIdxMacc)
|
||||
{
|
||||
isProcessing = true;
|
||||
await Task.Delay(100);
|
||||
IdxMaccSel = selIdxMacc;
|
||||
await doUpdate();
|
||||
isProcessing = false;
|
||||
await Task.Delay(100);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,7 +11,7 @@ else
|
||||
</div>
|
||||
<ProdStat RecMSE="CurrMSE"></ProdStat>
|
||||
<PrintMag RecMSE="CurrMSE"></PrintMag>
|
||||
<ProdConfirm RecMSE="CurrMSE"></ProdConfirm>
|
||||
<ProdConfirm RecMSE="CurrMSE" E_newVal="RefreshMBlock"></ProdConfirm>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<a class="btn btn-info btn-lg w-100" href="scrap"><i class="fa fa-bug"></i> Reg. SCARTI</a>
|
||||
|
||||
@@ -358,7 +358,7 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Vista v_MSFD CALCOALTA x singola macchina (da stored) - singolo record
|
||||
/// Vista v_MSFD x singola macchina (da stored) - singolo record
|
||||
/// </summary>
|
||||
/// <param name="idxMacc"></param>
|
||||
/// <returns></returns>
|
||||
@@ -378,6 +378,27 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// Vista v_MSFD delle machine MULTI filtrato x macchina (da stored)
|
||||
/// </summary>
|
||||
/// <param name="idxMacc"></param>
|
||||
/// <returns></returns>
|
||||
public List<VMSFDModel> VMSFDGetMultiByMacc(string idxMacc)
|
||||
{
|
||||
List<VMSFDModel> dbResult = new List<VMSFDModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacc);
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetMSFD
|
||||
.FromSqlRaw("exec dbo.stp_MSFD_getMulti @IdxMacchina", IdxMacchina)
|
||||
.AsNoTracking()
|
||||
.AsEnumerable()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ namespace MP.Data.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Vista v_MSFD CALCOALTA x singola macchina (da stored) - singolo record
|
||||
/// Vista v_MSFD x singola macchina (da stored) - singolo record
|
||||
/// </summary>
|
||||
/// <param name="idxMacc"></param>
|
||||
/// <returns></returns>
|
||||
@@ -358,6 +358,41 @@ namespace MP.Data.Services
|
||||
Log.Debug($"VMSFDGetByMacc | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// Vista v_MSFD delle machine MULTI filtrato x macchina (da stored)
|
||||
/// </summary>
|
||||
/// <param name="idxMacc"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<VMSFDModel>> VMSFDGetMultiByMacc(string idxMacc)
|
||||
{
|
||||
// setup parametri costanti
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
List<VMSFDModel>? result = new List<VMSFDModel>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:MSFD:MULTI:{idxMacc}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<VMSFDModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbIocController.VMSFDGetByMacc(idxMacc);
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<VMSFDModel>();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"VMSFDGetMultiByMacc | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
|
||||
Reference in New Issue
Block a user