fIX CALCOLO ULTIMO EVENTO SU GIORNO SUCCESSIVO
This commit is contained in:
@@ -148,6 +148,9 @@ namespace MP_TAB3.Components
|
||||
// imposto altri campi secondo il TIPO di record...
|
||||
if (EditRecord.IsWork)
|
||||
{
|
||||
// controllo min pezzi a 1
|
||||
EditRecord.PzBuoni = EditRecord.PzBuoni > 0 ? EditRecord.PzBuoni : 1;
|
||||
// calcolo durata
|
||||
EditRecord.MinProd = EditRecord.TCiclo * EditRecord.PzBuoni;
|
||||
}
|
||||
else
|
||||
@@ -200,7 +203,7 @@ namespace MP_TAB3.Components
|
||||
if (ListPeriod != null && ListPeriod.Count > 0)
|
||||
{
|
||||
// chiamo insert con eventi spenta (12) HardCoded...
|
||||
int numAdd = await TabDServ.InsManFillMissing(ListDay, 12, MServ.MatrOpr);
|
||||
int numAdd = await TabDServ.InsManFillMissing(dtCurr, ListDay, 12, MServ.MatrOpr);
|
||||
// rileggo i dati...
|
||||
ReloadData();
|
||||
RecalcDayData(dtCurr);
|
||||
@@ -352,9 +355,10 @@ namespace MP_TAB3.Components
|
||||
{
|
||||
string IdxMacc = RecMSE.IdxMacchina;
|
||||
fatto = await TabDServ.InsManFreezeDay(IdxMacc, dtCurr);
|
||||
if(fatto)
|
||||
if (fatto)
|
||||
{
|
||||
EditRecord = null;
|
||||
ReloadData();
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2504.811</Version>
|
||||
<Version>6.16.2504.813</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB3</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2504.811</h4>
|
||||
<h4>Versione: 6.16.2504.813</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2504.811
|
||||
6.16.2504.813
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2504.811</version>
|
||||
<version>6.16.2504.813</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>
|
||||
|
||||
@@ -970,11 +970,12 @@ namespace MP.Data.Services
|
||||
/// <summary>
|
||||
/// Riempie eventuali buchi con evento indicato
|
||||
/// </summary>
|
||||
/// <param name="dtRif">Data per cui effettuare ricalcolo giornata</param>
|
||||
/// <param name="listDetail">Record dettaglio giornata</param>
|
||||
/// <param name="idxTipoEv">IdxTipo da riempire</param>
|
||||
/// <param name="matrOpr">MatrOperatore corrente</param>
|
||||
/// <returns></returns>
|
||||
public async Task<int> InsManFillMissing(List<InsManualiModel> listDetail, int idxTipoEv, int matrOpr)
|
||||
public async Task<int> InsManFillMissing(DateTime dtRif, List<InsManualiModel> listDetail, int idxTipoEv, int matrOpr)
|
||||
{
|
||||
List<InsManualiModel> rec2add = new List<InsManualiModel>();
|
||||
InsManualiModel newRec = new InsManualiModel();
|
||||
@@ -1007,10 +1008,15 @@ namespace MP.Data.Services
|
||||
rec2add.Add(newRec);
|
||||
}
|
||||
|
||||
// cerco ultimo record...
|
||||
currRec = listDetail.LastOrDefault();
|
||||
// cerco ultimo record... che sia della data odierna!
|
||||
currRec = listDetail.Where(x => x.InizioStato.Date == dtRif.Date).LastOrDefault();
|
||||
periodStart = currRec.InizioStato;
|
||||
periodEnd = currRec.FineStato.Value;
|
||||
// se andassi a domani lo "accorcio"...
|
||||
if (periodEnd > dtRif.Date.AddDays(1))
|
||||
{
|
||||
periodEnd = dtRif.Date.AddDays(1);
|
||||
}
|
||||
// se non arrivo a mezzanotte aggiungo "pad finale"
|
||||
var lastPeriod = TimeSpan.FromHours(24).Subtract(periodEnd.TimeOfDay).TotalMinutes;
|
||||
if (lastPeriod > 1)
|
||||
@@ -1152,7 +1158,7 @@ namespace MP.Data.Services
|
||||
}
|
||||
// se non arrivo a mezzanotte aggiungo "pad finale"
|
||||
var deltaFin = TimeSpan.FromHours(24).Subtract(periodEnd.TimeOfDay);
|
||||
if (deltaFin.TotalMinutes > 0.01)
|
||||
if (deltaFin.TotalMinutes > 0.01)
|
||||
{
|
||||
lastIdxTipo = 0;
|
||||
currRec = new ManualStatusDTO
|
||||
@@ -1160,7 +1166,7 @@ namespace MP.Data.Services
|
||||
IdxTipo = lastIdxTipo,
|
||||
CssBlock = "bg-light text-dark",
|
||||
Title = "missing",
|
||||
Value = deltaFin.TotalMinutes,
|
||||
Value = deltaFin.TotalMinutes,
|
||||
ValueMax = 1440
|
||||
};
|
||||
result.Add(currRec);
|
||||
|
||||
Reference in New Issue
Block a user