Aggiunta nuova gestioen salvataggio (con delete vecchio) e recupero dati nesting archiviati
This commit is contained in:
@@ -13,6 +13,8 @@ namespace AppData
|
||||
/// </summary>
|
||||
public class ComLib
|
||||
{
|
||||
#region Gestione persistenza risposte via REST da NESTING
|
||||
|
||||
/// <summary>
|
||||
/// Database corrente MongoDB
|
||||
/// </summary>
|
||||
@@ -39,8 +41,15 @@ namespace AppData
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
// definisco filtro
|
||||
var filtBuilder = Builders<nestReplyBatchInitial>.Filter;
|
||||
var filter = filtBuilder.Eq<int>("BatchID", nestAnsw.BatchID);
|
||||
var collRawData = database.GetCollection<nestReplyBatchInitial>("EstimationArchive");
|
||||
// elimino old
|
||||
collRawData.DeleteMany(filter);
|
||||
// aggiungo
|
||||
collRawData.InsertOne(nestAnsw);
|
||||
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
@@ -57,7 +66,13 @@ namespace AppData
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
// definisco filtro
|
||||
var filtBuilder = Builders<nestReplyBatchFinal>.Filter;
|
||||
var filter = filtBuilder.Eq<int>("BatchID", nestAnsw.BatchID);
|
||||
var collRawData = database.GetCollection<nestReplyBatchFinal>("NestingArchive");
|
||||
// elimino old
|
||||
collRawData.DeleteMany(filter);
|
||||
// aggiungo
|
||||
collRawData.InsertOne(nestAnsw);
|
||||
answ = true;
|
||||
}
|
||||
@@ -65,6 +80,48 @@ namespace AppData
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupero risposta stima salvata
|
||||
/// </summary>
|
||||
/// <param name="BatchID"></param>
|
||||
/// <returns></returns>
|
||||
public nestReplyBatchInitial geEstAnsw(int BatchID)
|
||||
{
|
||||
nestReplyBatchInitial answ = null;
|
||||
try
|
||||
{
|
||||
// definisco filtro
|
||||
var filtBuilder = Builders<nestReplyBatchInitial>.Filter;
|
||||
var filter = filtBuilder.Eq<int>("BatchID", BatchID);
|
||||
var collRawData = database.GetCollection<nestReplyBatchInitial>("EstimationArchive");
|
||||
// recupero
|
||||
answ = collRawData.Find(filter).FirstOrDefault<nestReplyBatchInitial>();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupero risposta nesting salvata
|
||||
/// </summary>
|
||||
/// <param name="BatchID"></param>
|
||||
/// <returns></returns>
|
||||
public nestReplyBatchFinal getNestAnsw(int BatchID)
|
||||
{
|
||||
nestReplyBatchFinal answ = null;
|
||||
try
|
||||
{
|
||||
// definisco filtro
|
||||
var filtBuilder = Builders<nestReplyBatchFinal>.Filter;
|
||||
var filter = filtBuilder.Eq<int>("BatchID", BatchID);
|
||||
var collRawData = database.GetCollection<nestReplyBatchFinal>("NestingArchive");
|
||||
// recupero
|
||||
answ = collRawData.Find(filter).FirstOrDefault<nestReplyBatchFinal>();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
//public object getEstAnsw(int BatchId)
|
||||
//{
|
||||
@@ -83,6 +140,22 @@ namespace AppData
|
||||
// return answ;
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// restitusice ultima chiamata REST registrata su REDIS
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string lastRestAnsw()
|
||||
{
|
||||
string answ = "";
|
||||
// recupero ultima call
|
||||
string redKey = $"{ComLib.redNestAnsw}:LAST_CALL";
|
||||
answ = memLayer.ML.getRSV(redKey);
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper traduzione termini
|
||||
/// </summary>
|
||||
|
||||
@@ -162,6 +162,31 @@ namespace NKC_SDK
|
||||
/// </summary>
|
||||
public double EstimatedWorktime { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// Superficie WORK (lavorata/tagliata) del foglio lavorato (= somma area dei pezzi disposti)
|
||||
/// </summary>
|
||||
public double SurfaceWork { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// Superficie totale del foglio lavorato (= materiale)
|
||||
/// </summary>
|
||||
public double SurfaceTotal { get; set; } = 1;
|
||||
/// <summary>
|
||||
/// Resa (OEE) dell'impiego del materiale
|
||||
/// </summary>
|
||||
public double SurfaceOEE
|
||||
{
|
||||
get
|
||||
{
|
||||
double answ = 0;
|
||||
try
|
||||
{
|
||||
answ = SurfaceWork / SurfaceTotal;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Programma x printing
|
||||
/// </summary>
|
||||
public string PrintProgram { get; set; } = "";
|
||||
|
||||
Reference in New Issue
Block a user