diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs
index 0336450..9f717c7 100644
--- a/AppData/ComLib.cs
+++ b/AppData/ComLib.cs
@@ -1117,7 +1117,7 @@ namespace AppData
}
else
{
- tabBunk = DLMan.taSTL.getLoaded();
+ tabBunk = DLMan.taSTL.getLoaded(machine);
// salvo in redis
setCurrBunkTab(machine, tabBunk);
}
@@ -1790,13 +1790,14 @@ namespace AppData
}
///
- /// Restituisce il BUNK che è il primo della lista:
+ /// Restituisce il BUNK che è il primo della lista x la MACCHINA indicata:
/// - posizione = 3 (ho letto da webApp il BUNK e preso in carico)
/// - NumSheet > NumSheetUnload
/// - Ordinato per StackIndex (crescente) x avere il più VECCHIO
///
+ ///
///
- public static ProdBunk prodGetFirstBunk()
+ public static ProdBunk prodGetFirstBunk(string machine)
{
DataLayer DLMan = new DataLayer();
// cerco prima su REDIS...
@@ -1804,7 +1805,7 @@ namespace AppData
if (answ == null)
{
// vado sul DB e leggo ...
- DS_App.StackListDataTable tabBunks = DLMan.taSTL.getLoaded();
+ DS_App.StackListDataTable tabBunks = DLMan.taSTL.getLoaded(machine);
// controllo di averne almeno 1...
if (tabBunks.Count > 0)
{
@@ -1818,21 +1819,22 @@ namespace AppData
}
///
- /// Restituisce il PROSSIMO bunk secondo criterio:
+ /// Restituisce il PROSSIMO bunk x la MACCHINA indicata secondo criterio:
/// - posizione = 5 (ho letto da webApp il BUNK e preso in carico)
/// - NumSheet > NumSheetUnload
/// - Ordinato per StackIndex (crescente) x avere il più VECCHIO
/// - SUCCESSIVO al BunkID(=StackID) ricevuto
///
+ ///
///
- public static ProdBunk prodGetNextBunk(int BunkID)
+ public static ProdBunk prodGetNextBunk(int BunkID, string machine)
{
DataLayer DLMan = new DataLayer();
ProdBunk answ = getRedisNextBunk(BunkID);
if (answ == null)
{
// vado sul DB e leggo ...
- DS_App.StackListDataTable tabBunks = DLMan.taSTL.getLoaded();
+ DS_App.StackListDataTable tabBunks = DLMan.taSTL.getLoaded(machine);
// controllo di averne almeno 1...
if (tabBunks.Count > 0)
{
diff --git a/AppData/DS_App.Designer.cs b/AppData/DS_App.Designer.cs
index 5429784..d683aa1 100644
--- a/AppData/DS_App.Designer.cs
+++ b/AppData/DS_App.Designer.cs
@@ -28911,6 +28911,7 @@ namespace AppData.DS_AppTableAdapters {
this._commandCollection[5].CommandText = "dbo.stp_Stacks_getLoaded";
this._commandCollection[5].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PlaceCod", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[6].Connection = this.Connection;
this._commandCollection[6].CommandText = "dbo.stp_Stacks_getNext";
@@ -29029,8 +29030,14 @@ namespace AppData.DS_AppTableAdapters {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
- public virtual DS_App.StackListDataTable getLoaded() {
+ public virtual DS_App.StackListDataTable getLoaded(string PlaceCod) {
this.Adapter.SelectCommand = this.CommandCollection[5];
+ if ((PlaceCod == null)) {
+ this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
+ }
+ else {
+ this.Adapter.SelectCommand.Parameters[1].Value = ((string)(PlaceCod));
+ }
DS_App.StackListDataTable dataTable = new DS_App.StackListDataTable();
this.Adapter.Fill(dataTable);
return dataTable;
diff --git a/AppData/DS_App.xsd b/AppData/DS_App.xsd
index 7b778c2..01ec8c7 100644
--- a/AppData/DS_App.xsd
+++ b/AppData/DS_App.xsd
@@ -428,6 +428,7 @@ FROM v_StackList
dbo.stp_Stacks_getLoaded
+
diff --git a/AppData/DS_App.xss b/AppData/DS_App.xss
index 705abc7..49b8c56 100644
--- a/AppData/DS_App.xss
+++ b/AppData/DS_App.xss
@@ -4,49 +4,49 @@
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
-->
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -185,7 +185,7 @@
-
+
1034
diff --git a/NKC_SDK/NKC.cs b/NKC_SDK/NKC.cs
index 87c5cdd..e15b983 100644
--- a/NKC_SDK/NKC.cs
+++ b/NKC_SDK/NKC.cs
@@ -29,7 +29,7 @@ namespace NKC_SDK
{
_baseIp = baseIp;
_baseUrl = baseUrl;
- _machine = codPost;
+ _codPost = codPost;
}
#endregion Public Constructors
@@ -52,7 +52,7 @@ namespace NKC_SDK
///
/// COD macchina x cui si effettua chiamata
///
- protected string _machine { get; set; } = "";
+ protected string _codPost { get; set; } = "";
protected string urlAlive
{
@@ -82,7 +82,7 @@ namespace NKC_SDK
{
get
{
- return $"{_baseUrl}api/Sheet/{_machine}";
+ return $"{_baseUrl}api/Sheet/{_codPost}";
}
}
@@ -107,7 +107,7 @@ namespace NKC_SDK
{
get
{
- return $"{_baseUrl}api/Sheet/{_machine}";
+ return $"{_baseUrl}api/Sheet/{_codPost}";
}
}
@@ -209,14 +209,14 @@ namespace NKC_SDK
#region Protected Methods
- protected string urlGetBunk(int currBunkId)
+ protected string urlGetBunk(int currBunkId, string CodPost)
{
- return $"{_baseUrl}api/Bunk/{currBunkId}?showNext=false";
+ return $"{_baseUrl}api/Bunk/{currBunkId}?showNext=false&machine={CodPost}";
}
- protected string urlNextBunk(int currBunkId)
+ protected string urlNextBunk(int currBunkId, string CodPost)
{
- return $"{_baseUrl}api/Bunk/{currBunkId}?showNext=true";
+ return $"{_baseUrl}api/Bunk/{currBunkId}?showNext=true&machine={CodPost}";
}
protected string urlPutBunk(int currBunkId)
@@ -347,7 +347,7 @@ namespace NKC_SDK
try
{
// aggiungo macchina nel codice dei fogli...
- updatedInfo.Machine = _machine;
+ updatedInfo.Machine = _codPost;
// serializzo oggetto
rawdata = JsonConvert.SerializeObject(updatedInfo);
// invio con metodo put!
@@ -372,7 +372,7 @@ namespace NKC_SDK
try
{
// aggiungo macchina nel codice dei fogli...
- updatedSheetList.Machine = _machine;
+ updatedSheetList.Machine = _codPost;
// serializzo oggetto
rawdata = JsonConvert.SerializeObject(updatedSheetList);
// invio con metodo put!
diff --git a/NKC_WF/BasePage.cs b/NKC_WF/BasePage.cs
index 62a3af5..f2b6e04 100644
--- a/NKC_WF/BasePage.cs
+++ b/NKC_WF/BasePage.cs
@@ -16,7 +16,7 @@ namespace NKC_WF
protected DataLayer DLMan = new DataLayer();
///
- /// Codice macchina (HARD CODED x ora)
+ /// Codice macchina (da v2)
///
protected string machine = "WRK001";
diff --git a/NKC_WF/Controllers/BunkController.cs b/NKC_WF/Controllers/BunkController.cs
index 72a22fd..0864f1a 100644
--- a/NKC_WF/Controllers/BunkController.cs
+++ b/NKC_WF/Controllers/BunkController.cs
@@ -8,14 +8,22 @@ namespace NKC_WF.Controllers
{
public class BunkController : ApiController
{
+ #region Protected Fields
+
+ ///
+ /// COdice macchina (HARD CODED)
+ ///
+ protected string CodPost = "WRK001";
+
///
/// oggetto static/singleton per fare chiamate sul datalayer
///
protected DataLayer DLMan = new DataLayer();
- ///
- /// COdice macchina (HARD CODED)
- ///
- protected string machine = "WRK001";
+
+ #endregion Protected Fields
+
+ #region Public Methods
+
///
/// Restituisce il FIRST BUNK da lavorare
/// GET: api/Bunk
@@ -27,7 +35,7 @@ namespace NKC_WF.Controllers
ProdBunk answ = null;
try
{
- answ = ComLib.prodGetFirstBunk();
+ answ = ComLib.prodGetFirstBunk(CodPost);
}
catch
{ }
@@ -42,14 +50,15 @@ namespace NKC_WF.Controllers
///
///
[HttpGet]
- public ProdBunk Get(int id, bool showNext)
+ public ProdBunk Get(int id, bool showNext, string machine)
{
ProdBunk answ = null;
+ CodPost = machine;
try
{
if (showNext)
{
- answ = ComLib.prodGetNextBunk(id);
+ answ = ComLib.prodGetNextBunk(id, CodPost);
}
else
{
@@ -63,9 +72,9 @@ namespace NKC_WF.Controllers
/************************************
* METODI PUT
- *
+ *
* per abilitare è necessario agire sulla conf di IIS:
- *
+ *
* - modificare il file applicationHost.config che si trova in C:\Windows\System32\inetsrv\config
* - disinstallare webDav oppure commentare le righe
*
@@ -74,44 +83,9 @@ namespace NKC_WF.Controllers
* - aggiungere PUT/DELETE a handler:
*
*
- *
+ *
**************************************/
-
- ///
- /// Effettua la chiamata di update
- ///
- ///
- ///
- // PUT: api/Bunk/5
- [HttpPut]
- public void Put(ProdBunk currBunk)
- {
- // NB. decodifico direttamente come oggetto, vedere qui:
- // https://weblog.west-wind.com/posts/2013/dec/13/accepting-raw-request-body-content-with-aspnet-web-api
- // https://weblog.west-wind.com/posts/2017/sep/14/accepting-raw-request-body-content-in-aspnet-core-api-controllers
-
- // se non nullo...
- if (currBunk != null)
- {
- foreach (var item in currBunk.SheetList)
- {
- DLMan.taSHL.updateDate(item.SheetId, item.Printing.DtStart, item.Printing.DtEnd, item.Machining.DtStart, item.Machining.DtEnd, item.Unloading.DtStart, item.Unloading.DtEnd, (int)item.Status);
- // verifico SE SIA AVVENUTO CON SUCCESSO lo step di lavorazione...
- if (item.Machining.Success)
- {
- // SE machining completato --> status a LAVORATO!
- if (item.Machining.DtEnd != null)
- {
- DLMan.taIL.updateSheetStatus(item.SheetId, 1, "PROD");
- }
- }
- }
- }
- // INVALIDO eventuale valore BUNK in REDIS...
- ComLib.resetRedisBunkData(machine);
- }
-
///
/// Processa una chiamata POST per l'invio in blocco status BUNK
/// POST: api/Bunk
@@ -142,7 +116,6 @@ namespace NKC_WF.Controllers
{
// calcolo stsatus dalle date valide...
-
DLMan.taSHL.updateDate(item.SheetId, item.Printing.DtStart, item.Printing.DtEnd, item.Machining.DtStart, item.Machining.DtEnd, item.Unloading.DtStart, item.Unloading.DtEnd, (int)item.Status);
// SE machining completato --> status a LAVORATO!
if (item.Machining.DtEnd != null)
@@ -162,5 +135,40 @@ namespace NKC_WF.Controllers
return answ;
}
+ ///
+ /// Effettua la chiamata di update
+ ///
+ ///
+ ///
+ // PUT: api/Bunk/5
+ [HttpPut]
+ public void Put(ProdBunk currBunk)
+ {
+ // NB. decodifico direttamente come oggetto, vedere qui:
+ // https://weblog.west-wind.com/posts/2013/dec/13/accepting-raw-request-body-content-with-aspnet-web-api
+ // https://weblog.west-wind.com/posts/2017/sep/14/accepting-raw-request-body-content-in-aspnet-core-api-controllers
+
+ // se non nullo...
+ if (currBunk != null)
+ {
+ foreach (var item in currBunk.SheetList)
+ {
+ DLMan.taSHL.updateDate(item.SheetId, item.Printing.DtStart, item.Printing.DtEnd, item.Machining.DtStart, item.Machining.DtEnd, item.Unloading.DtStart, item.Unloading.DtEnd, (int)item.Status);
+ // verifico SE SIA AVVENUTO CON SUCCESSO lo step di lavorazione...
+ if (item.Machining.Success)
+ {
+ // SE machining completato --> status a LAVORATO!
+ if (item.Machining.DtEnd != null)
+ {
+ DLMan.taIL.updateSheetStatus(item.SheetId, 1, "PROD");
+ }
+ }
+ }
+ }
+ // INVALIDO eventuale valore BUNK in REDIS...
+ ComLib.resetRedisBunkData(CodPost);
+ }
+
+ #endregion Public Methods
}
-}
+}
\ No newline at end of file
diff --git a/NKC_WF/site/MachineLoad.aspx b/NKC_WF/site/MachineLoad.aspx
index b4a9642..5a6d72b 100644
--- a/NKC_WF/site/MachineLoad.aspx
+++ b/NKC_WF/site/MachineLoad.aspx
@@ -10,9 +10,10 @@