Fix gest OffOrders x richiesta

This commit is contained in:
Samuele E. Locatelli
2020-08-10 19:10:55 +02:00
parent e3c8bc9923
commit ef6468ff40
2 changed files with 61 additions and 23 deletions
+60 -22
View File
@@ -333,6 +333,7 @@ namespace AppData
public int Qty { get; set; }
}
#if false
public class BatchData
{
/// <summary>
@@ -348,7 +349,7 @@ namespace AppData
/// 1 = stima
/// 2 = nesting
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
//[JsonConverter(typeof(StringEnumConverter))]
public int procType { get; set; }
/// <summary>
/// Codice della amcchina x cui si effettua richeista
@@ -358,9 +359,10 @@ namespace AppData
/// <summary>
/// Tipo di ordine richeisto
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
//[JsonConverter(typeof(StringEnumConverter))]
public oType orderType { get; set; }
}
}
#endif
/// <summary>
/// Salva su redis l'oggetto dei materiali serializzato
/// </summary>
@@ -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<Order> listOrder = new List<Order>();
List<Kit> listKit = new List<Kit>();
List<Part> listPart = new List<Part>();
// 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 = $"OFK{OffOrderID:000000000}",
PartList = listPart
};
listKit.Add(currentKit);
// compongo ordine
currOrder = new Order()
{
OrderId = OffOrderID,
OrderCod = "OFF",
OrderExtCode = $"OFR{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);
+1 -1
View File
@@ -315,7 +315,7 @@ namespace NKC_SDK
/// <summary>
/// Tipo di ordine richiesto
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
//[JsonConverter(typeof(StringEnumConverter))]
public oType OrderType { get; set; } = oType.BatchRequest;
/// <summary>
/// Status del processo di nesting