Merge branch 'Release/MpTab3_14'

This commit is contained in:
Samuele Locatelli
2025-04-08 18:56:17 +02:00
8 changed files with 70 additions and 44 deletions
+4 -4
View File
@@ -262,9 +262,9 @@
</tbody>
</table>
</div>
<div class="col-12 px-1">
</div>
}
</div>
@if (showProgress)
{
<ProgressDisplay RefreshInterval="100" Title="@progressTitle" MaxVal="100" CurrVal="@currVal" NextVal="@nextVal" ExpTimeMSec="@expTimeMsec" DisplaySize="ProgressDisplay.ModalSize.Medium"></ProgressDisplay>
}
+53 -32
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!;
@@ -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<DateTime, string> DateCFF = new Dictionary<DateTime, string>();
/// <summary>
@@ -259,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>
@@ -266,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
@@ -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<InsManualiModel>? ListDay { get; set; } = new List<InsManualiModel>();
private List<InsManDayDto>? ListDTO { get; set; } = new List<InsManDayDto>();
@@ -307,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
@@ -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;
}
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2504.817</Version>
<Version>6.16.2504.818</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB3</RootNamespace>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2504.817</h4>
<h4>Versione: 6.16.2504.818</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2504.817
6.16.2504.818
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2504.817</version>
<version>6.16.2504.818</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+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;
}
+6 -1
View File
@@ -1195,11 +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);
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;
}