From a18249404f0b3003a6b7c3df7775805edc06f756 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期四, 27 六月 2024 17:46:27 +0800 Subject: [PATCH] 添加货位查询条件 --- 代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/新文件夹/GetLocation.cs | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/\346\226\260\346\226\207\344\273\266\345\244\271/GetLocation.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/\346\226\260\346\226\207\344\273\266\345\244\271/GetLocation.cs" index 3759cb7..969cf14 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/\346\226\260\346\226\207\344\273\266\345\244\271/GetLocation.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/\346\226\260\346\226\207\344\273\266\345\244\271/GetLocation.cs" @@ -123,18 +123,6 @@ //} #endregion - #region 瀵绘壘瀵瑰簲搴撳尯绌鸿揣浣� - - var TargetLocations = area1 == "4" ? stationinfoRepository.Find(x => x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "4").OrderBy(x => x.line).ThenBy(x => x.column).ToList() - : stationinfoRepository.Find(x => x.location_state == LocationStateEnum.Empty.ToString() && x.enable && (x.area == "2" || x.area == "3")).OrderBy(x => x.line).ThenBy(x => x.column).ToList(); - foreach (var Location in TargetLocations) - { - //if (stationinfoRepository.Find(x => x.line == Location.line && x.area == Location.area && x.stationType == agvtask.agv_materielid).Any()) - if (stationinfoRepository.Find(x => x.line == Location.line && x.area == Location.area && x.Number == agvtask.jobID).Any()) - if (!stationinfoRepository.Find(x => x.line == Location.line && x.area == Location.area && x.location_state == LocationStateEnum.OutBusy.ToString()).Any()) return Location; - } - #endregion - #region 鏈壘鍒板簱瀛樻垨褰撳墠搴撳瓨琛屽凡婊�,瀵绘壘鏂扮殑涓�琛� var area = GetArea(mesinfo.quantity, agvtask.agv_Traytype); TargetLocation = stationinfoRepository.Find(x => x.column == (area == "2" ? 1 : 2) && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).FirstOrDefault(); @@ -146,12 +134,24 @@ #region 鏌ョ湅褰撳墠绌鸿揣浣嶅悗鏄惁瀛樺湪鏈夋枡 if (TargetLocation != null) - if (GetStation.QueueStation(TargetLocation.stationCode)) TargetLocation = null; + //if (GetStation.QueueStation(TargetLocation.stationCode)) TargetLocation = null; + if (!GetStation.QueueStation(TargetLocation.stationCode)) return TargetLocation; #endregion #endregion - if (TargetLocation == null) throw new Exception("搴撲綅宸叉弧"); + #region 瀵绘壘瀵瑰簲搴撳尯绌鸿揣浣� + + var TargetLocations = area1 == "4" ? stationinfoRepository.Find(x => x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "4").OrderBy(x => x.line).ThenBy(x => x.column).ToList() + : stationinfoRepository.Find(x => x.location_state == LocationStateEnum.Empty.ToString() && x.enable && (x.area == "2" || x.area == "3")).OrderBy(x => x.line).ThenBy(x => x.column).ToList(); + foreach (var Location in TargetLocations) + { + if (stationinfoRepository.Find(x => x.line == Location.line && x.area == Location.area && x.Number == agvtask.jobID).Any()) + if (!stationinfoRepository.Find(x => x.line == Location.line && x.area == Location.area && x.location_state == LocationStateEnum.OutBusy.ToString()).Any() && !GetStation.QueueStation(Location.stationCode)) return Location; + } + #endregion + + //if (TargetLocation == null) throw new Exception("搴撲綅宸叉弧"); return TargetLocation; } catch (Exception ex) -- Gitblit v1.9.3