From 15cfe97f5cf6f1e8591da7cf658fab2452e0d60f Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期日, 21 四月 2024 10:13:20 +0800
Subject: [PATCH] 优化检测上料逻辑,优化出库逻辑

---
 代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs |   15 ++++++++-------
 代码管理/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs   |    2 +-
 2 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/Jobs/equipment/PipelineJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs"
index eed63b1..045de56 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs"
@@ -111,11 +111,11 @@
                     {
                         if (AreaNr == 0)
                         {
+                            Gantry_client.WriteByOrder("W_Wheel_Type", (Int16)Convert.ToInt16(QueryMateriel(Station.stationType) == null ? QueryMateriel1(Station.stationType).TypeId : QueryMateriel(Station.stationType).TypeId), number);//杞﹁疆绫诲瀷
                             var area = Convert.ToInt16(Station.stationCode.Substring(Station.stationCode.Length - 1, 1));
                             Gantry_client.WriteByOrder("W_AreaNr", (Int16)area, number);//鍖哄煙璐т綅鍙�
                             Gantry_client.WriteByOrder("W_IndexNr", (Int16)SNS.Length, number);//鎵樼洏涓婄殑绗嚑涓溅杞�
                             Gantry_client.WriteByOrder("W_Storage_Type", (Int16)1, number); //鎵樼洏绫诲瀷1-妯斁;2-绔栨斁
-                            Gantry_client.WriteByOrder("W_Wheel_Type", (Int16)Convert.ToInt16(QueryMateriel(Station.stationType) == null ? QueryMateriel1(Station.stationType).TypeId : QueryMateriel(Station.stationType).TypeId), number);//杞﹁疆绫诲瀷
                             Gantry_client.WriteByOrder("W_Wheel_id", SNS[SNS.Length - 1], number);//杞﹁疆SN鍙�
                             Gantry_client.WriteByOrder("W_RequestUnload", true, number);
                             #region 鏃ュ織璁板綍
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 b1b9430..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;
@@ -153,6 +154,7 @@
                                 //}
                                 #endregion
                             }
+                            #endregion
                         }
                     }
                 }
@@ -162,6 +164,5 @@
                 WriteDBLog.Error("鍒涘缓鍑哄簱浠诲姟", $"閿欒淇℃伅锛歿ex.Message}", "PCS");
             }
         }
-
     }
 }

--
Gitblit v1.9.3