| | |
| | | //{ nameof(Dt_RGVLocationInfo.Column), OrderByType.Asc }, |
| | | { nameof(Dt_RGVLocationInfo.Row), OrderByType.Asc }, |
| | | }; |
| | | private Dictionary<string, OrderByType> _DepthAscOrderBy = new Dictionary<string, OrderByType>() |
| | | { |
| | | { nameof(Dt_RGVLocationInfo.Depth), OrderByType.Asc }, |
| | | }; |
| | | public IRepository<Dt_RGVLocationInfo> Repository => BaseDal; |
| | | |
| | | public List<Dt_RGVLocationInfo> GetFreeLocationInfos() |
| | | { |
| | | return BaseDal.QueryData(x => x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt(), _emptyAssignOrderBy); |
| | | } |
| | | |
| | | public Dt_RGVLocationInfo GetFreeLocationInfo(string AreaCode) |
| | | /// <summary> |
| | | /// 鏌ユ壘鍏ュ簱鍙敤璐т綅 |
| | | /// </summary> |
| | | /// <param name="AreaCode"></param> |
| | | /// <returns></returns> |
| | | public Dt_RGVLocationInfo GetInFreeLocationInfo(string AreaCode) |
| | | { |
| | | Dt_RGVLocationInfo? rGVLocationInfo = BaseDal.QueryFirst(x => x.WarehouseId.ToString() == AreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt(), _emptyAssignOrderBy); |
| | | #region 鍒ゆ柇宸烽亾鏄惁鏈夎揣 |
| | | if (rGVLocationInfo != null) |
| | | { |
| | | List<string> NoRoadwayNos = new List<string>(); |
| | | while (true) |
| | | { |
| | | Dt_RGVLocationInfo dt_RGVLocationInfo = BaseDal.QueryFirst(x => x.RoadwayNo == rGVLocationInfo.RoadwayNo && x.Depth < rGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt(), _emptyAssignOrderBy); |
| | | if (dt_RGVLocationInfo == null) return rGVLocationInfo; |
| | | |
| | | rGVLocationInfo = BaseDal.QueryFirst(x => x.RoadwayNo == dt_RGVLocationInfo.RoadwayNo && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.Depth > dt_RGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.Free.ObjToInt(), _DepthAscOrderBy); |
| | | dt_RGVLocationInfo = BaseDal.QueryFirst(x => x.RoadwayNo == rGVLocationInfo.RoadwayNo && x.Depth > rGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt(), _emptyAssignOrderBy); |
| | | if (dt_RGVLocationInfo == null) return rGVLocationInfo; |
| | | |
| | | } |
| | | } |
| | | #endregion |
| | | return rGVLocationInfo; |
| | | } |
| | | } |