From 96f8b9f0629b3e4697269f0c271b43ad165f71b0 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期三, 24 四月 2024 10:13:52 +0800 Subject: [PATCH] 优化机加工下料任务逻辑 --- 代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs" index 4f2348c..2b3a160 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs" @@ -43,9 +43,10 @@ var Station = stationinfoRepository.Find(x => x.stationCode == inventory.stationCode).FirstOrDefault();//鏌ユ壘搴撳瓨璐т綅 if (Station != null) { - dt_stationinfo stationinfo = null; - #region 搴撳尯涓� + #region + + dt_stationinfo stationinfo = null; if (Station.area == "1") { //鏌ユ壘褰撳墠璐т綅鍚屽垪鏄惁瀛樺湪鍏ュ簱浠诲姟 @@ -53,7 +54,6 @@ stationinfo = stationinfoRepository.Find(x => x.column == Station.column && x.enable && x.area == "1" && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderBy(x => x.line).FirstOrDefault(); } - #endregion else { //鏌ユ壘褰撳墠璐т綅鍚屽垪鏄惁瀛樺湪鍏ュ簱浠诲姟 @@ -61,9 +61,10 @@ stationinfo = stationinfoRepository.Find(x => x.line == Station.line && x.area == Station.area && x.enable && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderByDescending(x => x.column).FirstOrDefault(); } - if (stationinfo != null) { + if (stationinfoRepository.Find(x => x.line == stationinfo.line && x.area == stationinfo.area && x.column > stationinfo.column && !x.enable).Any()) + continue; if (string.IsNullOrEmpty(stationinfo.bindSN)) { stationinfo.remark = "杞﹁疆SN鍙蜂俊鎭紓甯�"; @@ -86,8 +87,8 @@ var count = 0; foreach (var SN in lists) { - //if (!workinfoRepository.Find(x => x.processCode == "28" && x.SN.Contains(SN)).Any()) return; - if (workinfoRepository.Find(x => x.processCode == "28" && x.SN.Contains(SN)).Any()) count++; + if (workinfoRepository.Find(x => x.processCode == "28" && x.SN == SN).Any()) count++; + //if (workinfoRepository.Find(x => x.processCode == "28" && x.SN.Contains(SN)).Any()) count++; } if (count != lists.Count) continue; @@ -105,7 +106,7 @@ agv_toaddress = "", agv_userid = "绯荤粺", bindSN = stationinfo.bindSN, - jobID = Mes_Work.jobID, + jobID = Mes_Work.workOrder, agv_worktype = Convert.ToInt32(Mes_Work.processCode), agv_materbarcode = Mes_Work.materialCode, agv_Traytype = stationinfo.tray_type, @@ -153,6 +154,7 @@ //} #endregion } + #endregion } } } @@ -162,6 +164,5 @@ WriteDBLog.Error("鍒涘缓鍑哄簱浠诲姟", $"閿欒淇℃伅锛歿ex.Message}", "PCS"); } } - } } -- Gitblit v1.9.3