Merge branch 'release/MpIoAddPodlFunc01'
This commit is contained in:
@@ -111,33 +111,6 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Chiude ODL x macchina:
|
||||
///
|
||||
/// GET: IOB/closeODL/SIMUL_03?idxOdl=123
|
||||
/// </summary>
|
||||
/// <param name="id">id macchina</param>
|
||||
/// <param name="idxOdl">idx dell'ODL da chiudere</param>
|
||||
/// <returns>bool esecuzione</returns>
|
||||
public bool closeODL(string id, int idxOdl)
|
||||
{
|
||||
bool answ = false;
|
||||
// init obj DataLayer
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
try
|
||||
{
|
||||
// chiamata diretta sul DB...
|
||||
DateTime dtEvento = DateTime.Now;
|
||||
DataLayerObj.taODL.forceClose(idxOdl, id, dtEvento);
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Chiude ODL x macchina:
|
||||
///
|
||||
@@ -740,33 +713,6 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera codice numerico ODL/PODL dato CodXdl, in pratica la parte finale SENZA ODL/PODL
|
||||
/// Funzione per impianti che accettano solo INT in scrittura:
|
||||
///
|
||||
/// GET: IOB/getXdlNum/SIMUL_03?CodXdl=ODL00000123
|
||||
/// </summary>
|
||||
/// <param name="id">IdxMacchina (NON considerato)</param>
|
||||
/// <param name="CodXdl">CodXdl richiesto, se vuoto restituisce TUTTI i valori in tabella di decodifica</param>
|
||||
/// <returns>SINGOLO VALORE calcolato on the fly</returns>
|
||||
public string getXdlNum(string id, string CodXdl = "")
|
||||
{
|
||||
// in realtà ID macchina non conta e lo ignoriamo...
|
||||
string answ = "";
|
||||
// scrivo keep alive!!! (se necessario, altrimenti è in cache...)
|
||||
MapoDb.MapoDb connDb = new MapoDb.MapoDb();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
connDb.scriviKeepAlive(id, DateTime.Now);
|
||||
try
|
||||
{
|
||||
// sostituisco PODL/ODL con "" e lascio zero iniziali (conversione INT in IOB)
|
||||
answ = CodXdl.Replace("PODL", "").Replace("ODL", "");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco articoli USATI:
|
||||
///
|
||||
@@ -987,25 +933,8 @@ namespace MP_IO.Controllers
|
||||
/// <returns>Json contenente lista oggetti PODL serializzati</returns>
|
||||
public string getCurrPODL(string id)
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" viene filtrato ci aspettiamo il
|
||||
// carattere "|" che poi trasformiamo ora in "#"
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
id = id.Replace("|", "#");
|
||||
}
|
||||
string answ = "";
|
||||
|
||||
// init obj DataLayer
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
try
|
||||
{
|
||||
// recupero dati macchina...
|
||||
var elencoOdl = DataLayerObj.taPODL.getByMaccArt(id, "", "", true);
|
||||
answ = JsonConvert.SerializeObject(elencoOdl);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
// lasciato x retrocompatibilità, FixMe ToDo ELiminare con udpate IOB....
|
||||
return getPOdlNext(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1506,6 +1435,70 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera DATI PODL Running/Actual (AVVIATO e in corso) x macchina:
|
||||
///
|
||||
/// GET: IOB/getPOdlAct/SIMUL_03
|
||||
/// </summary>
|
||||
/// <param name="id">id macchina, se "" mostra tutto</param>
|
||||
/// <returns>Json contenente lista 1 oggetto PODL serializzato, se presente</returns>
|
||||
public string getPOdlAct(string id)
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" viene filtrato ci aspettiamo il
|
||||
// carattere "|" che poi trasformiamo ora in "#"
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
id = id.Replace("|", "#");
|
||||
}
|
||||
string answ = "";
|
||||
|
||||
// init obj DataLayer
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
try
|
||||
{
|
||||
// recupero IdxOdl corrente
|
||||
string sIdxOdl = DataLayerObj.currODL(id);
|
||||
int IdxOdl = 0;
|
||||
int.TryParse(sIdxOdl, out IdxOdl);
|
||||
// recupero Podl running x macchina ...
|
||||
DS_ProdTempi.PromesseODLDataTable elencoOdl = DataLayerObj.taPODL.getByIdxOdl(IdxOdl);
|
||||
answ = JsonConvert.SerializeObject(elencoOdl);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera DATI PODL NEXT (=NON AVVIATI) x macchina: (copia di getCurrPODL)
|
||||
///
|
||||
/// GET: IOB/getPOdlNext/SIMUL_03
|
||||
/// </summary>
|
||||
/// <param name="id">id macchina, se "" mostra tutto</param>
|
||||
/// <returns>Json contenente lista oggetti PODL serializzati</returns>
|
||||
public string getPOdlNext(string id)
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" viene filtrato ci aspettiamo il
|
||||
// carattere "|" che poi trasformiamo ora in "#"
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
id = id.Replace("|", "#");
|
||||
}
|
||||
string answ = "";
|
||||
|
||||
// init obj DataLayer
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
try
|
||||
{
|
||||
// recupero dati macchina...
|
||||
var elencoOdl = DataLayerObj.taPODL.getByMaccArt(id, "", "", true);
|
||||
answ = JsonConvert.SerializeObject(elencoOdl);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera TASK richiesto x macchina:
|
||||
///
|
||||
@@ -1531,6 +1524,35 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera codice numerico ODL/PODL dato CodXdl, in pratica la parte finale SENZA ODL/PODL
|
||||
/// Funzione per impianti che accettano solo INT in scrittura:
|
||||
///
|
||||
/// GET: IOB/getXdlNum/SIMUL_03?CodXdl=ODL00000123
|
||||
/// </summary>
|
||||
/// <param name="id">IdxMacchina (NON considerato)</param>
|
||||
/// <param name="CodXdl">
|
||||
/// CodXdl richiesto, se vuoto restituisce TUTTI i valori in tabella di decodifica
|
||||
/// </param>
|
||||
/// <returns>SINGOLO VALORE calcolato on the fly</returns>
|
||||
public string getXdlNum(string id, string CodXdl = "")
|
||||
{
|
||||
// in realtà ID macchina non conta e lo ignoriamo...
|
||||
string answ = "";
|
||||
// scrivo keep alive!!! (se necessario, altrimenti è in cache...)
|
||||
MapoDb.MapoDb connDb = new MapoDb.MapoDb();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
connDb.scriviKeepAlive(id, DateTime.Now);
|
||||
try
|
||||
{
|
||||
// sostituisco PODL/ODL con "" e lascio zero iniziali (conversione INT in IOB)
|
||||
answ = CodXdl.Replace("PODL", "").Replace("ODL", "");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
// GET: IOB (è un check alive del server)
|
||||
public string Index()
|
||||
{
|
||||
@@ -1996,6 +2018,7 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SALVA in blocco un incremento pezzi x macchina restituendo il valore appena inviato o,
|
||||
/// se mancasse chaive redis, del valore da DB
|
||||
|
||||
@@ -265,6 +265,7 @@ namespace MapoSDK
|
||||
/// Imposta Articolo su PLC
|
||||
/// </summary>
|
||||
setArt,
|
||||
|
||||
/// <summary>
|
||||
/// Imposta Articolo IN MODALITA' NUMERICA su PLC
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user