yuyou_x
2024-02-21 1c2113e154faacedebfb1f00a29bb26127ed1b73
Wms/WMS.BLL/SysServer/StorageLocatServer.cs
@@ -755,5 +755,64 @@
                throw new Exception(e.Message);
            }
        }
        #region 平库图例
        /// <summary>
        /// 获取储位信息(平库图例)
        /// </summary>
        /// <param name="wareHouseNo">仓库</param>
        /// <param name="row">排</param>
        /// <returns></returns>
        public List<SysStorageLocat> GetFlatLibraryLegend(string wareHouseNo, string row)
        {
            try
            {
                //一楼区域
                //List<string> row1 = new List<string>()
                //{
                //    "B01",
                //    "B02",
                //    "B03",
                //    "B04",
                //    "B05",
                //    "B06",
                //    "B07",
                //};
                ////二楼区域
                //List<string> row3 = new List<string>()
                //{
                //    "B11",
                //    "B12",
                //    "B13",
                //    "B14",
                //    "B15",
                //};
                string row1 = "'B01','B02','B03','B04','B05','B06','B07'";
                string row3 = "'B11','B12','B13','B14','B15'";
                string str = $"select * from SysStorageLocat where IsDel = '0' and WareHouseNo = '{wareHouseNo}' and ";
                if (row == "1")
                {
                    str += $" AreaNo in ({row1})";
                }
                else if (row == "3")
                {
                    str += $" AreaNo in ({row3})";
                }
                var list = Db.Ado.SqlQuery<SysStorageLocat>(str);
                //var list = Db.Queryable<SysStorageLocat>().Where(m => m.IsDel == "0" && m.WareHouseNo == wareHouseNo && row == "1" ? row1.Contains(m.AreaNo) : row3.Contains(m.AreaNo)).ToList();
                return list;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
        #endregion
    }
}