Update display avanzamento freeze day

This commit is contained in:
Samuele Locatelli
2025-04-08 18:55:57 +02:00
parent a95447e355
commit 8a94f6ed2d
4 changed files with 42 additions and 41 deletions
+2 -2
View File
@@ -266,5 +266,5 @@
</div>
@if (showProgress)
{
<ProgressDisplay RefreshInterval="50" Title="@progressTitle" MaxVal="100" CurrVal="@currVal" NextVal="@nextVal" ExpTimeMSec="@expTimeMsec" DisplaySize="ProgressDisplay.ModalSize.Medium"></ProgressDisplay>
}
<ProgressDisplay RefreshInterval="100" Title="@progressTitle" MaxVal="100" CurrVal="@currVal" NextVal="@nextVal" ExpTimeMSec="@expTimeMsec" DisplaySize="ProgressDisplay.ModalSize.Medium"></ProgressDisplay>
}
+32 -33
View File
@@ -33,6 +33,19 @@ namespace MP_TAB3.Components
#region Protected Properties
protected DateTime dtCurr
{
get => selDtCurr;
set
{
if (selDtCurr != value)
{
selDtCurr = value;
dtMonthStart = new DateTime(value.Year, value.Month, 1);
}
}
}
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
@@ -226,13 +239,11 @@ namespace MP_TAB3.Components
await Task.Delay(1);
}
private string idxMacc = "";
private DateTime dtMonthStart = new DateTime(2000, 1, 1);
#endregion Protected Methods
#region Private Fields
private int currVal = 0;
private Dictionary<DateTime, string> DateCFF = new Dictionary<DateTime, string>();
/// <summary>
@@ -265,6 +276,7 @@ namespace MP_TAB3.Components
/// </summary>
private bool doSearchArt = false;
private DateTime dtMonthStart = new DateTime(2000, 1, 1);
private InsManualiModel? EditRecord = null;
/// <summary>
@@ -272,8 +284,14 @@ namespace MP_TAB3.Components
/// </summary>
private bool enableEditTime = false;
private int expTimeMsec = 1000;
private string idxMacc = "";
private int nextVal = 0;
private string progressTitle = "Approvazione Giornata";
private List<ManualStatusDTO> SeqStatus = new List<ManualStatusDTO>();
private bool showProgress = false;
#endregion Private Fields
#region Private Properties
@@ -281,22 +299,6 @@ namespace MP_TAB3.Components
private bool confProdActive { get; set; } = false;
private MappaStatoExpl? currRecMSE { get; set; } = null;
protected DateTime dtCurr
{
get => selDtCurr;
set
{
if (selDtCurr != value)
{
selDtCurr = value;
dtMonthStart = new DateTime(value.Year, value.Month, 1);
}
}
}
//
private DateTime selDtCurr { get; set; } = DateTime.Today;
private List<InsManualiModel>? ListDay { get; set; } = new List<InsManualiModel>();
private List<InsManDayDto>? ListDTO { get; set; } = new List<InsManDayDto>();
@@ -313,6 +315,9 @@ namespace MP_TAB3.Components
/// </summary>
private Dictionary<decimal, string> ListTCiclo { get; set; } = new Dictionary<decimal, string>();
//
private DateTime selDtCurr { get; set; } = DateTime.Today;
private bool showDetail { get; set; } = false;
#endregion Private Properties
@@ -376,23 +381,22 @@ namespace MP_TAB3.Components
return;
// esegue stored
bool fatto = false;
progressTitle = "Avvio processo";
showProgress = true;
await Task.Delay(10);
bool fatto = false;
progressTitle = "Registrazione conferma giornaliera";
currVal = 0;
nextVal = 20;
nextVal = 90;
await InvokeAsync(StateHasChanged);
if (RecMSE != null)
{
currVal = 20;
nextVal = 90;
progressTitle = "Start conferma giornaliera";
await Task.Delay(10);
await InvokeAsync(StateHasChanged);
string IdxMacc = RecMSE.IdxMacchina;
fatto = await TabDServ.InsManFreezeDay(IdxMacc, dtCurr);
await Task.Delay(10);
fatto = await TabDServ.InsManFreezeDay(RecMSE.IdxMacchina, dtCurr);
currVal = 90;
nextVal = 100;
progressTitle = "Ricalcolo giornata";
progressTitle = "Ricalcolo Giornata";
await InvokeAsync(StateHasChanged);
EditRecord = null;
ReloadData();
@@ -401,11 +405,6 @@ namespace MP_TAB3.Components
}
return;
}
private int currVal = 0;
private int nextVal = 0;
private int expTimeMsec = 100;
private bool showProgress = false;
private string progressTitle = "Approvazione Giornata";
private bool IsTimeInfoOk(DateTime reqDate, bool reloadDay)
{
+3 -3
View File
@@ -699,7 +699,7 @@ namespace MP.Data.Controllers
/// <param name="idxMacchina"></param>
/// <param name="dtCurr"></param>
/// <returns></returns>
public bool InsManFreezeDay(string idxMacchina, DateTime dtCurr)
public async Task<bool> InsManFreezeDay(string idxMacchina, DateTime dtCurr)
{
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
@@ -707,9 +707,9 @@ namespace MP.Data.Controllers
var IdxMacc = new SqlParameter("@IdxMacchina", idxMacchina);
var DataElab = new SqlParameter("@DataElab", dtCurr);
var dbResult = dbCtx
var dbResult = await dbCtx
.Database
.ExecuteSqlRaw("EXEC stp_IM_ElaboraInsManuali @IdxMacchina, @DataElab", IdxMacc, DataElab);
.ExecuteSqlRawAsync("EXEC stp_IM_ElaboraInsManuali @IdxMacchina, @DataElab", IdxMacc, DataElab);
fatto = dbResult > 0;
}
+5 -3
View File
@@ -1195,14 +1195,16 @@ namespace MP.Data.Services
public async Task<bool> InsManFreezeDay(string idxMacchina, DateTime dtCurr)
{
bool fatto = false;
Stopwatch sw = new Stopwatch();
sw.Start();
Log.Info($"Inizio InsManFreezeDay | idxMacchina: {idxMacchina}");
// salvo
fatto = dbTabController.InsManFreezeDay(idxMacchina, dtCurr);
Log.Info($"Fine stored | idxMacchina: {idxMacchina}");
fatto = await dbTabController.InsManFreezeDay(idxMacchina, dtCurr);
// svuoto cache
RedisValue pattern = $"{redisBaseKey}:InsMan:*";
await ExecFlushRedisPatternAsync(pattern);
Log.Info($"Fine InsManFreezeDay | idxMacchina: {idxMacchina}");
sw.Stop();
Log.Info($"Fine InsManFreezeDay | idxMacchina: {idxMacchina} | elapsed: {sw.Elapsed.TotalMilliseconds:N2} ms");
return fatto;
}