inizio fix errore invio pezzi in blocco

This commit is contained in:
Samuele E. Locatelli
2020-02-27 20:34:17 +01:00
parent 860f54ac32
commit a13d2d2fc6
3 changed files with 19 additions and 11 deletions
+17 -9
View File
@@ -1038,10 +1038,6 @@ namespace MapoDb
{
// default: 0, non registrato come cautela...
string answ = "0";
if (qty == null)
{
throw new ArgumentNullException(nameof(qty));
}
// controllo per proseguire
if (!string.IsNullOrEmpty(idxMacchina) && !string.IsNullOrEmpty(qty))
{
@@ -1054,14 +1050,16 @@ namespace MapoDb
var currData = currODLRowTab(idxMacchina);
// registro evento 120 --> contapezzi in blocco !!!HARD CODED!!! !!!FIXME!!!
int idxEvento = 120;
MapoDb.obj.scriviRigaEventoBarcode(idxMacchina, idxEvento, currData[0].CodArticolo, qty);
// istanziato un NUOVO oggetto x scrivere...
MapoDb connDb = new MapoDb();
connDb.scriviRigaEventoBarcode(idxMacchina, idxEvento, currData[0].CodArticolo, qty);
}
// registro in risposta che è andato tutto bene... ovvero la qty richiesta...
answ = qty;
}
else
{
string errore = "Errore: mancano parametri macchina/incremento";
string errore = $"Errore: mancano parametri macchina/incremento: idxMacchina {idxMacchina} | qty {qty}";
logger.lg.scriviLog(errore, tipoLog.ERROR);
answ = errore;
}
@@ -1229,7 +1227,13 @@ namespace MapoDb
{
if (idxMacchina != "" && currODL != "")
{
memLayer.ML.setRSV(currODLHash(idxMacchina), currODL, memLayer.ML.CRI("currOdlCacheDur"));
int currOdlCacheDur = memLayer.ML.CRI("currOdlCacheDur");
// se ODL fosse 0 USO DURATA CACHE 1/4...
if (currODL == "0")
{
currOdlCacheDur = currOdlCacheDur / 4;
}
memLayer.ML.setRSV(currODLHash(idxMacchina), currODL, currOdlCacheDur);
// registro in risposta che è andato tutto bene...
answ = "OK";
}
@@ -1926,7 +1930,9 @@ namespace MapoDb
}
else
{
answTab = MapoDb.obj.currODLTab(idxMacchina);
// istanzio un NUOVO oggetto lettura
MapoDb connDb = new MapoDb();
answTab = connDb.currODLTab(idxMacchina);
// salvo in redis...
rCall = JsonConvert.SerializeObject(answTab);
int currOdlRowCacheDur = memLayer.ML.CRI("currOdlRowCacheDur");
@@ -1940,7 +1946,9 @@ namespace MapoDb
}
else
{
answTab = MapoDb.obj.currODLTab(idxMacchina);
// istanzio un NUOVO oggetto lettura
MapoDb connDb = new MapoDb();
answTab = connDb.currODLTab(idxMacchina);
}
return answTab;
}