POST modifiche al DB impostata scrittura pezzi in blocco (DA TESTARE)
This commit is contained in:
Vendored
+1
-1
@@ -12,7 +12,7 @@ pipeline {
|
||||
steps {
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=1264']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=1265']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '6.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '6.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'MAPO'
|
||||
|
||||
@@ -1042,6 +1042,32 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// SALVA in blocco un incremento pezzi x macchina:
|
||||
///
|
||||
/// GET: IOB/savePzCountInc/5?qty=10
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id">codice macchina</param>
|
||||
/// <param name="qty">num peziz da salvare in blocco</param>
|
||||
/// <returns></returns>
|
||||
public string savePzCountInc(string id, string qty)
|
||||
{
|
||||
string answ = "";
|
||||
DateTime dataOraEvento = DateTime.Now;
|
||||
// salvo SEMPRE log x questo tipo di dati!
|
||||
logger.lg.scriviLog($"Salvataggio incremento contapezzi:{Environment.NewLine}idxMacchina: {id}{Environment.NewLine}pezzi: {qty}", tipoLog.INFO);
|
||||
try
|
||||
{
|
||||
answ = DataLayer.saveCaricoPezzi(id, qty);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in savePzCountInc{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Salva associazione tra macchina, device IOB chiamante e sue info
|
||||
/// </summary>
|
||||
/// <param name="id">Id della macchina</param>
|
||||
|
||||
@@ -1003,6 +1003,43 @@ namespace MapoDb
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Processa registrazione EVENTO CONTEGGIO PEZZI x una data macchina IOB
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina">Macchina</param>
|
||||
/// <param name="qty">Pezzi da registrare</param>
|
||||
/// <returns></returns>
|
||||
public static string saveCaricoPezzi(string idxMacchina, string qty)
|
||||
{
|
||||
// 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))
|
||||
{
|
||||
int numPzIncr = -1;
|
||||
int.TryParse(qty, out numPzIncr);
|
||||
// se il conteggio è >= 0 SALVO evento...
|
||||
if (numPzIncr >= 0)
|
||||
{
|
||||
// registro evento 120 --> contapezzi in blocco !!!HARD CODED!!! !!!FIXME!!!
|
||||
int idxEvento = 120;
|
||||
MapoDb.obj.scriviRigaEventoBarcode(idxMacchina, idxEvento, "", qty);
|
||||
}
|
||||
// registro in risposta che è andato tutto bene... ovvero la qty richiesta...
|
||||
answ = qty;
|
||||
}
|
||||
else
|
||||
{
|
||||
string errore = "Errore: mancano parametri macchina/incremento";
|
||||
logger.lg.scriviLog(errore, tipoLog.ERROR);
|
||||
answ = errore;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Salvataggio su della mappa di memoria dell'IOB x ulteriori impieghi
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
|
||||
Reference in New Issue
Block a user