diff --git a/MP-TAB3/Components/InsManual.razor b/MP-TAB3/Components/InsManual.razor
index 884b41b9..cd36b533 100644
--- a/MP-TAB3/Components/InsManual.razor
+++ b/MP-TAB3/Components/InsManual.razor
@@ -262,9 +262,9 @@
-
-
}
-
-
+@if (showProgress)
+{
+
+}
\ No newline at end of file
diff --git a/MP-TAB3/Components/InsManual.razor.cs b/MP-TAB3/Components/InsManual.razor.cs
index 6f1f57bc..bbac7de9 100644
--- a/MP-TAB3/Components/InsManual.razor.cs
+++ b/MP-TAB3/Components/InsManual.razor.cs
@@ -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!;
@@ -63,6 +76,11 @@ namespace MP_TAB3.Components
{
startPeriod = dtCurr.Date.AddHours(6);
}
+ enableEditTime = ListDay.Count == 0;
+ }
+ else
+ {
+ enableEditTime = true;
}
// evento da richiesta: default lavora/spenta
int idxTipo = isWork ? 1 : 12;
@@ -118,6 +136,7 @@ namespace MP_TAB3.Components
}
else
{
+ enableEditTime = true;
if (ListDay != null && ListDay.Count > 0)
{
var firstRec = ListDay.FirstOrDefault();
@@ -220,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 DateCFF = new Dictionary();
///
@@ -259,6 +276,7 @@ namespace MP_TAB3.Components
///
private bool doSearchArt = false;
+ private DateTime dtMonthStart = new DateTime(2000, 1, 1);
private InsManualiModel? EditRecord = null;
///
@@ -266,8 +284,14 @@ namespace MP_TAB3.Components
///
private bool enableEditTime = false;
+ private int expTimeMsec = 1000;
+ private string idxMacc = "";
+ private int nextVal = 0;
+ private string progressTitle = "Approvazione Giornata";
private List SeqStatus = new List();
+ private bool showProgress = false;
+
#endregion Private Fields
#region Private Properties
@@ -275,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? ListDay { get; set; } = new List();
private List? ListDTO { get; set; } = new List();
@@ -307,6 +315,9 @@ namespace MP_TAB3.Components
///
private Dictionary ListTCiclo { get; set; } = new Dictionary();
+ //
+ private DateTime selDtCurr { get; set; } = DateTime.Today;
+
private bool showDetail { get; set; } = false;
#endregion Private Properties
@@ -370,17 +381,27 @@ namespace MP_TAB3.Components
return;
// esegue stored
+ showProgress = true;
+ await Task.Delay(10);
bool fatto = false;
+ progressTitle = "Registrazione conferma giornaliera";
+ currVal = 0;
+ nextVal = 90;
+ await InvokeAsync(StateHasChanged);
if (RecMSE != null)
{
- string IdxMacc = RecMSE.IdxMacchina;
- fatto = await TabDServ.InsManFreezeDay(IdxMacc, dtCurr);
- if (fatto)
- {
- EditRecord = null;
- ReloadData();
- RecalcDayData(dtCurr);
- }
+ await Task.Delay(10);
+ await InvokeAsync(StateHasChanged);
+ await Task.Delay(10);
+ fatto = await TabDServ.InsManFreezeDay(RecMSE.IdxMacchina, dtCurr);
+ currVal = 90;
+ nextVal = 100;
+ progressTitle = "Ricalcolo Giornata";
+ await InvokeAsync(StateHasChanged);
+ EditRecord = null;
+ ReloadData();
+ RecalcDayData(dtCurr);
+ showProgress = false;
}
return;
}
@@ -509,7 +530,7 @@ namespace MP_TAB3.Components
string cssOkDay = "bg-success bg-opacity-50 text-light rounded-circle p-2";
string cssPartDay = "bg-info bg-opacity-25 text-light rounded-circle p-2";
string cssHasData = "bg-warning text-light rounded-circle p-2";
- string cssToday = "border border-info text-info rounded-circle p-2";
+ string cssToday = " border border-info rounded-circle p-2";
if (ListDTO != null)
{
string currCss = "";
@@ -521,10 +542,6 @@ namespace MP_TAB3.Components
{
currCss = cssImport;
}
- else if (item.DataRif == oggi)
- {
- currCss = cssToday;
- }
else if (IsTimeInfoOk(item.DataRif.Date, true))
{
currCss = item.MinProdTot < 1440 ? cssPartDay : cssOkDay;
@@ -541,6 +558,10 @@ namespace MP_TAB3.Components
{
DateCheck.Add(oggi, cssToday);
}
+ else
+ {
+ DateCheck[oggi] += cssToday;
+ }
}
}
diff --git a/MP-TAB3/MP-TAB3.csproj b/MP-TAB3/MP-TAB3.csproj
index e80c50bc..4c009b44 100644
--- a/MP-TAB3/MP-TAB3.csproj
+++ b/MP-TAB3/MP-TAB3.csproj
@@ -3,7 +3,7 @@
net6.0
enable
- 6.16.2504.817
+ 6.16.2504.818
enable
MP_TAB3
diff --git a/MP-TAB3/Resources/ChangeLog.html b/MP-TAB3/Resources/ChangeLog.html
index df8aac49..74311ea4 100644
--- a/MP-TAB3/Resources/ChangeLog.html
+++ b/MP-TAB3/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MAPOSPEC
- Versione: 6.16.2504.817
+ Versione: 6.16.2504.818
Note di rilascio:
-
diff --git a/MP-TAB3/Resources/VersNum.txt b/MP-TAB3/Resources/VersNum.txt
index 1fe43d10..fa522a58 100644
--- a/MP-TAB3/Resources/VersNum.txt
+++ b/MP-TAB3/Resources/VersNum.txt
@@ -1 +1 @@
-6.16.2504.817
+6.16.2504.818
diff --git a/MP-TAB3/Resources/manifest.xml b/MP-TAB3/Resources/manifest.xml
index 3fd86e6e..3a057580 100644
--- a/MP-TAB3/Resources/manifest.xml
+++ b/MP-TAB3/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.16.2504.817
+ 6.16.2504.818
https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip
https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html
false
diff --git a/MP.Data/Controllers/MpTabController.cs b/MP.Data/Controllers/MpTabController.cs
index 8039b9a8..a3e62c7d 100644
--- a/MP.Data/Controllers/MpTabController.cs
+++ b/MP.Data/Controllers/MpTabController.cs
@@ -699,7 +699,7 @@ namespace MP.Data.Controllers
///
///
///
- public bool InsManFreezeDay(string idxMacchina, DateTime dtCurr)
+ public async Task 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;
}
diff --git a/MP.Data/Services/TabDataService.cs b/MP.Data/Services/TabDataService.cs
index a987c167..92c6b5cb 100644
--- a/MP.Data/Services/TabDataService.cs
+++ b/MP.Data/Services/TabDataService.cs
@@ -1195,11 +1195,16 @@ namespace MP.Data.Services
public async Task 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);
+ fatto = await dbTabController.InsManFreezeDay(idxMacchina, dtCurr);
// svuoto cache
RedisValue pattern = $"{redisBaseKey}:InsMan:*";
await ExecFlushRedisPatternAsync(pattern);
+ sw.Stop();
+ Log.Info($"Fine InsManFreezeDay | idxMacchina: {idxMacchina} | elapsed: {sw.Elapsed.TotalMilliseconds:N2} ms");
return fatto;
}