杨前锦
2025-07-07 c8f338feee0b6003d8f069b1d37fd9b90dd1b7f4
HH.WCS.Mobox3/HH.WCS.Mobox3.HD/wms/WMSHelper.cs
@@ -676,8 +676,9 @@
        /// <param name="itemCode"></param>
        /// <param name="roadway">接驳位所在巷道</param>
        /// <param name="row">接驳位所在排</param>
        /// <param name="thresholdValue">库容阈值</param>
        /// <returns></returns>
        public static Location GetEndLocation(string areaCode, string itemCode ,int roadway ,int row)
        public static Location GetEndLocation(string areaCode, string itemCode ,int roadway ,int row ,int thresholdValue = 1)
        {
            Location loc = null;
            try
@@ -718,7 +719,7 @@
                                .LeftJoin<WCSTask>((a,b) => a.S_CODE == b.S_OP_CODE)
                              .LeftJoin<Location>((a, b ,c) => b.S_END_LOC == c.S_CODE)
                              .Where((a, b, c) => b.S_END_AREA == storeAreaInfo.accessArea && c.N_ROADWAY == roadway && a.N_B_STATE < 2 && b.S_TYPE.Contains("入库")).Count();
                        if (locList.Count - 2 > taskNum)
                        if (locList.Count - thresholdValue > taskNum)
                        {
                            // 【1.2】查询深度 N_DEEP = 2 ,位置 N_POS = 1 且 物料相同 的货位
                            var sameItemLocList = db.Queryable<Location>()
@@ -764,7 +765,7 @@
                }
            }
            catch (Exception ex) {
                LogHelper.Error("GetEndLocation:" + ex.Message, ex);
                LogHelper.Info("获取入库终点报错,错误信息:" + ex.Message,"WMS");
            }
            return loc;
        }