fix gestione errori
This commit is contained in:
+8
-4
@@ -1860,10 +1860,14 @@ namespace AppData
|
||||
var tabBatchRunning = DLMan.taBL.getByStatus(1, "", 0);
|
||||
if (tabBatchRunning.Count == 0)
|
||||
{
|
||||
// ora verifico, se ci sono batch in stato 8 (da validare) --> metto in coda!
|
||||
var tabBatch = DLMan.taBL.getByStatus(8, "", 1);
|
||||
bool hasValReq = tabBatch.Count > 0;
|
||||
if (hasValReq)
|
||||
// ora verifico, se ci sono batch per FILE (dxf) VALIDATION in stato 8 (da validare) --> metto in coda!
|
||||
DS_App.BatchListDataTable tabBatch = DLMan.taBL.getByStatus(8, "", 2);
|
||||
// se non ne ho cerco nei PartValidation
|
||||
if (tabBatch.Count == 0)
|
||||
{
|
||||
tabBatch = DLMan.taBL.getByStatus(8, "", 1);
|
||||
}
|
||||
if (tabBatch.Count > 0)
|
||||
{
|
||||
// invia a redis una richiesta...
|
||||
sendMaterials();
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace NKC_WF.Controllers
|
||||
// recupero ordine da batch
|
||||
if (tabOrd.Count > 0)
|
||||
{
|
||||
DLMan.taFV.upsertQuery(tabOrd[0].OrdCodOrig, rispStima.BatchID, bStatus, rispStima.EstimatedWorktime);
|
||||
DLMan.taFV.upsertQuery(tabOrd[0].OrderExtCode, rispStima.BatchID, bStatus, rispStima.EstimatedWorktime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace NKC_WF.site
|
||||
/// <summary>
|
||||
/// Path base x nesting, area TEMP
|
||||
/// </summary>
|
||||
protected string cadBasePath = $"{memLayer.ML.CRS("nestBasePath")}{memLayer.ML.CRS("fileTestFolder")}\\";
|
||||
protected string cadBasePath = $"{memLayer.ML.CRS("nestBasePath")}{memLayer.ML.CRS("fileTestFolder")}/";
|
||||
|
||||
/// <summary>
|
||||
/// Path base x server, area TEMP
|
||||
/// </summary>
|
||||
protected string srvCadBasePath = $"{memLayer.ML.CRS("servBasePath")}{memLayer.ML.CRS("fileTestFolder")}\\";
|
||||
protected string srvCadBasePath = $"{memLayer.ML.CRS("servBasePath")}{memLayer.ML.CRS("fileTestFolder")}/";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
@@ -40,6 +40,8 @@ namespace NKC_WF.site
|
||||
bool dataValidated = true;
|
||||
DateTime adesso = DateTime.Now;
|
||||
string dirFrom = e.LocalPath;
|
||||
int batchID = 0;
|
||||
string TaktCode = $"T{e.FileName.ToLower().Replace(".dxf", "")}";
|
||||
// copio su area testing
|
||||
try
|
||||
{
|
||||
@@ -64,12 +66,33 @@ namespace NKC_WF.site
|
||||
DLMan.taEL.insertQuery(DateTime.Now, "Import KIT TEST", $"{e.BatchName}", $"{e.BatchName}.{e.FileName}", $"Exception: {exc}");
|
||||
dataValidated = false;
|
||||
}
|
||||
// FIX eventuali cadFilePath...
|
||||
DLMan.taIL.updateCadPath(cadBasePath, 0, false);
|
||||
if (dataValidated)
|
||||
try
|
||||
{
|
||||
// avvio validazione!
|
||||
bool newValidSent = ComLib.sendFirstValidationBatch();
|
||||
var tabBatch = DLMan.taBL.getLastByTakt(TaktCode);
|
||||
if (tabBatch != null)
|
||||
{
|
||||
if (tabBatch.Count > 0)
|
||||
{
|
||||
batchID = tabBatch[0].BatchID;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"{traduci("ErrOrderCsvImp03")}:{Environment.NewLine}{exc}");
|
||||
dataValidated = false;
|
||||
}
|
||||
if (batchID > 0)
|
||||
{
|
||||
// FIX eventuali cadFilePath...
|
||||
DLMan.taIL.updateCadPath(cadBasePath, 0, false);
|
||||
// chiamo procedura x inserire come NON validato in FileValidation
|
||||
DLMan.taFV.upsertQuery(TaktCode, batchID, 8, 0);
|
||||
if (dataValidated)
|
||||
{
|
||||
// avvio validazione!
|
||||
bool newValidSent = ComLib.sendFirstValidationBatch();
|
||||
}
|
||||
}
|
||||
Response.Redirect(Request.RawUrl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user