From cde56aae50adc11ff8db84e424d873843c566bfd Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期一, 24 二月 2025 23:40:41 +0800 Subject: [PATCH] 优化WCS移库逻辑 --- 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs | 89 +++++++++++++++++++++++++++++++------------- 1 files changed, 63 insertions(+), 26 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs" index 5bcb690..10ec77a 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs" @@ -30,39 +30,76 @@ _taskRepository = taskRepository; _routerService = routerService; } + //static int i = 1; public Task Execute(IJobExecutionContext context) { try { - OtherDevice ProductionLine = (OtherDevice)context.JobDetail.JobDataMap.Get("JobParams"); - short[] shorts = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; - ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO() - { - Barcode = "A1001", - batchNo = "20241212001T1", - stationCode = "Z1", - productQty = string.Join(",", shorts), - traytype = 4 - }; - ProductionLineToWMSRequest(MaterielGroupDTO); - if (ProductionLine != null) - { - switch (ProductionLine.DeviceName) - { - case "鍏ュ簱浜х嚎": - ProductionLineIn(ProductionLine); - break; - case "鍑哄簱浜х嚎": - ProductionLineOut(ProductionLine); - break; - default: - throw new Exception("鏈畾涔変骇绾�"); - } - } + //ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO() + //{ + // stationCode = "MDX01", + // traytype = 4, + // Barcode = "25" + i.ToString("000000"), + // batchNo = "20250222T3", + //}; + //var content = ProductionLineToWMSRequest(MaterielGroupDTO); + //i++; + #region MyRegion + //OtherDevice ProductionLine = (OtherDevice)context.JobDetail.JobDataMap.Get("JobParams"); + //if (ProductionLine != null) + //{ + // var request = ProductionLine.GetValue<ProductionLineDBName, short>(ProductionLineDBName.request); + // if (request == 1) + // { + // var traytype = ProductionLine.GetValue<ProductionLineDBName, short>(ProductionLineDBName.trayType); + // //var content = Request(ProductionLine, traytype, ProductionLine.DeviceCode); + // if (traytype == 4) + // { + // var Barcode = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.trayBarcode); + // var batchNo = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.batchNo); + // ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO() + // { + // stationCode = ProductionLine.DeviceCode, + // traytype = traytype, + // Barcode = Barcode, + // batchNo = batchNo, + // }; + // var content = ProductionLineToWMSRequest(MaterielGroupDTO); + // if (content.Status) ProductionLine.SetValue(ProductionLineDBName.Wrequest, 1); + // } + // } + //} + #endregion + #region MyRegion + //short[] shorts = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; + //ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO() + //{ + // Barcode = "A1001", + // batchNo = "20241212001T1", + // stationCode = "Z1", + // productQty = string.Join(",", shorts), + // traytype = 4 + //}; + //ProductionLineToWMSRequest(MaterielGroupDTO); + //if (ProductionLine != null) + //{ + // switch (ProductionLine.DeviceName) + // { + // case "鍏ュ簱浜х嚎": + // ProductionLineIn(ProductionLine); + // break; + // case "鍑哄簱浜х嚎": + // ProductionLineOut(ProductionLine); + // break; + // default: + // throw new Exception("鏈畾涔変骇绾�"); + // } + //} + #endregion } catch (Exception ex) { - Console.Out.WriteLine(nameof(CommonProductionLineJob) + ":" + ex.ToString()); + //Console.Out.WriteLine(nameof(CommonProductionLineJob) + ":" + ex.ToString()); } return Task.CompletedTask; } -- Gitblit v1.9.3