diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index d272db4..489d31b 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -333,6 +333,7 @@ namespace AppData public int Qty { get; set; } } +#if false public class BatchData { /// @@ -348,7 +349,7 @@ namespace AppData /// 1 = stima /// 2 = nesting /// - [JsonConverter(typeof(StringEnumConverter))] + //[JsonConverter(typeof(StringEnumConverter))] public int procType { get; set; } /// /// Codice della amcchina x cui si effettua richeista @@ -358,9 +359,10 @@ namespace AppData /// /// Tipo di ordine richeisto /// - [JsonConverter(typeof(StringEnumConverter))] + //[JsonConverter(typeof(StringEnumConverter))] public oType orderType { get; set; } - } + } +#endif /// /// Salva su redis l'oggetto dei materiali serializzato /// @@ -670,34 +672,70 @@ namespace AppData try { int mTime = 5; + // FIX pType a ESTIM int pType = 1; - // serializzo ordini come ARRAY VUOTO - string redVal = "[]"; - // salvo - string redKey = $"{redOutPath}:{nextEnv}:ORDERS"; - // scrivo su REDIS - memLayer.ML.setRSV(redKey, redVal); // ora ITEMS var tblItm = DataLayer.man.taIL.getByOfflineOrder(OffOrderID); - // serializzo - redVal = JsonConvert.SerializeObject(tblItm); - // salvo - redKey = $"{redOutPath}:{nextEnv}:ITEMS"; - // scrivo su REDIS - memLayer.ML.setRSV(redKey, redVal); + + // init oggetti x fare cicli... + Order currOrder = null; + Kit currentKit = null; + Part currPart = null; + List listOrder = new List(); + List listKit = new List(); + List listPart = new List(); + + // elenco ITEMS + foreach (var rigaItem in tblItm) + { + currPart = new Part() + { + PartId = rigaItem.ItemID, + PartExtCode = rigaItem.ItemExtCode, + PartDtmx = rigaItem.ItemDtmx, + PartQty = rigaItem.ItemQty, + MatId = rigaItem.MatID, + CadFilePath = rigaItem.CadFilePath + }; + listPart.Add(currPart); + } + // compongo KIT + currentKit = new Kit() + { + KitId = OffOrderID, + KitExtCode = $"OOK{OffOrderID:000000000}", + PartList = listPart + }; + listKit.Add(currentKit); + + // compongo ordine + currOrder = new Order() + { + OrderId = OffOrderID, + OrderCod = $"OFOR{OffOrderID:000000000}", + OrderExtCode = $"OFOR{OffOrderID:000000000}", + DestPlant = "00", + KitList = listKit + }; + listOrder.Add(currOrder); + + + // ora versione gerarchica - var currBatch = new BatchData() + batchRequest newBatchreq = new batchRequest() { BatchId = OffOrderID, - maxTime = mTime, - procType = pType, - machineType = mType.Offline, - orderType = oType.OfflineOrder + EnvNum = nextEnv, + MaxTime = mTime, + ProcType = pType, + MachineType = mType.Offline, + OrderType = oType.OfflineOrder, + OrderList = listOrder }; // serializzo - redVal = JsonConvert.SerializeObject(currBatch); + string redVal = JsonConvert.SerializeObject(newBatchreq); // salvo - redKey = $"{redOutPath}:{nextEnv}:DATA"; + string redKey = $"{redOutPath}:{nextEnv}"; // scrivo su REDIS memLayer.ML.setRSV(redKey, redVal); @@ -2281,6 +2319,5 @@ namespace AppData #endregion - } } diff --git a/Jenkinsfile b/Jenkinsfile index 24c49f6..0bb5d9d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=315']) { + withEnv(['NEXT_BUILD_NUMBER=316']) { // env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.versionNumberBeta = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') diff --git a/NKC_SDK/Objects.cs b/NKC_SDK/Objects.cs index 8fe8af4..0ae1d60 100644 --- a/NKC_SDK/Objects.cs +++ b/NKC_SDK/Objects.cs @@ -159,9 +159,6 @@ namespace NKC_SDK /// public List SecOp { get; set; } = new List(); } - - - /// /// Classe Sheet x Nesting /// @@ -315,7 +312,7 @@ namespace NKC_SDK /// /// Tipo di ordine richiesto /// - [JsonConverter(typeof(StringEnumConverter))] + //[JsonConverter(typeof(StringEnumConverter))] public oType OrderType { get; set; } = oType.BatchRequest; /// /// Status del processo di nesting diff --git a/NKC_WF/Controllers/BatchProcController.cs b/NKC_WF/Controllers/BatchProcController.cs index e06bd62..f9ebb5e 100644 --- a/NKC_WF/Controllers/BatchProcController.cs +++ b/NKC_WF/Controllers/BatchProcController.cs @@ -277,6 +277,8 @@ namespace NKC_WF.Controllers { // deserializzo come OfflineOrder nestReplyOffOrd rispNest = JsonConvert.DeserializeObject(content); + // segno offline order come processato... + // SALVO!!! answ = "OK"; } diff --git a/NKC_WF/Web.config b/NKC_WF/Web.config index 8fcfdb6..b9bacb7 100644 --- a/NKC_WF/Web.config +++ b/NKC_WF/Web.config @@ -36,9 +36,9 @@ - + - +