wxw
昨天 13b0b92e981330f3c0dfaf351c203045f90bdb93
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -4308,31 +4308,65 @@
                        var tray2 = Db.Queryable<DataStockDetail>().Where(m => m.SkuNo == item2.SkuNo
                            && m.LotNo == item2.LotNo && !slotList.Contains(m.LocatNo) && m.PalletTags == item2.PalletTags && okLan.Contains(m.RoadwayNo)).ToList();
                        foreach (var s in tray2)
                        if (tray2.Count > 0)
                        {
                            if (string.IsNullOrWhiteSpace(s.RoadwayNo))//判断是否在库外,如是跳过
                            foreach (var s in tray2)
                            {
                                continue;
                            }
                            var lan = Db.Queryable<SysStorageLocat>().Where(m => m.RoadwayNo == s.RoadwayNo).OrderBy(m => m.LocatNo).ToList();
                            //判断是否有入库中、出库中、移入中、移出中
                            if (lan.Count(m => m.Status == "2" || m.Status == "3" || m.Status == "4" || m.Status == "5") > 0)
                            {
                                continue;
                            }
                            if (lan.Count(m => m.Status == "0") > 0)
                            {
                                var bol = GetBecomingLocation(s.RoadwayNo, ref location);
                                if (bol && !string.IsNullOrWhiteSpace(location))
                                if (string.IsNullOrWhiteSpace(s.RoadwayNo))//判断是否在库外,如是跳过
                                {
                                    newAddress = location;
                                    return newAddress;
                                    continue;
                                }
                                var lan = Db.Queryable<SysStorageLocat>().Where(m => m.RoadwayNo == s.RoadwayNo).OrderBy(m => m.LocatNo).ToList();
                                //判断是否有入库中、出库中、移入中、移出中
                                if (lan.Count(m => m.Status == "2" || m.Status == "3" || m.Status == "4" || m.Status == "5") > 0)
                                {
                                    continue;
                                }
                                if (lan.Count(m => m.Status == "0") > 0)
                                {
                                    var bol = GetBecomingLocation(s.RoadwayNo, ref location);
                                    if (bol && !string.IsNullOrWhiteSpace(location))
                                    {
                                        newAddress = location;
                                        return newAddress;
                                    }
                                }
                            }
                        }
                        if(string.IsNullOrEmpty(newAddress))
                        {
                            //已有物品的巷道
                            var roadwayHave = Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.WareHouseNo == "W01").GroupBy(g => g.RoadwayNo).Select(s => s.RoadwayNo).ToList();
                            //查找没有物品的巷道
                            var roadwayNull = Db.Queryable<SysStorageRoadway>().Where(w => w.IsDel == "0" && w.WareHouseNo == "W01" && w.Status == "0" && okLan.Contains(w.RoadwayNo) && !roadwayHave.Contains(w.RoadwayNo)).Select(s => s.RoadwayNo).ToList();
                            if (roadwayNull.Count > 0)
                            {
                                foreach (var itemRoad in roadwayNull)
                                {
                                    var bol = GetBecomingLocation(itemRoad, ref location);
                                    if (bol && !string.IsNullOrWhiteSpace(location))
                                    {
                                        newAddress = location;
                                        return newAddress;
                                    }
                                }
                            }
                            else
                            {
                                foreach (var itemRoad in roadwayHave)
                                {
                                    var bol = GetBecomingLocation(itemRoad, ref location);
                                    if (bol && !string.IsNullOrWhiteSpace(location))
                                    {
                                        newAddress = location;
                                        return newAddress;
                                    }
                                }
                            }
                        }
                    }
                }
@@ -4506,16 +4540,15 @@
                if (slotModel[0].Column > aisleRow)
                {
                    // 取最上面一排
                    location = slotModel[0].LocatNo;
                }
                else
                {
                    // 取最下面一排
                    location = slotModel[slotModel.Count - 1].LocatNo;
                }
                else
                {
                    // 取最上面一排
                    location = slotModel[0].LocatNo;
                }
                bl = true;
            }