| | |
| | | foreach (var item in items) |
| | | { |
| | | List<Dt_RGVLocationInfo> dt_RGVLocationInfos = BaseDal.QueryData(x => x.RoadwayNo == items.Key);//æ¥æ¾å½åå··éå·è´§ä½ |
| | | if (item.LocationType == 1) |
| | | { |
| | | rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.Depth < item.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()).FirstOrDefault();//夿æµ
æ·±åº¦è´§ä½æ¯å¦æè´§ |
| | | if (rGVLocationInfo != null)//æµ
æ·±åº¦è´§ä½æè´§ï¼æ¾æ·±æ·±åº¦è´§ä½æ¯å¦æè´§ |
| | | { |
| | | if (item.LocationType == 1) break;//å··éç±»å为ååï¼ç´æ¥è·³è¿ |
| | | foreach (var locationInfo in rGVLocationInfos.Where(x => x.RoadwayNo == items.Key).OrderBy(x => x.Depth)) |
| | | { |
| | | if (!dt_RGVLocationInfos.Where(x => x.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && x.Depth > locationInfo.Depth).Any()) return locationInfo; |
| | | if (rGVLocationInfo != null) break; |
| | | return item; |
| | | } |
| | | //rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt()).OrderBy(x => x.Depth).FirstOrDefault();//æ¾æµ
æ·±åº¦ç©ºè´§ä½ |
| | | //if (rGVLocationInfo != null) |
| | | else |
| | | { |
| | | rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.Depth < item.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()).OrderByDescending(x => x.Depth).FirstOrDefault();//夿æµ
æ·±åº¦è´§ä½æ¯å¦æè´§ |
| | | if (rGVLocationInfo != null) |
| | | { |
| | | rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.Depth > rGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.Free.ObjToInt()).OrderBy(x => x.Depth).FirstOrDefault(); |
| | | if (rGVLocationInfo != null) |
| | | { |
| | | if (dt_RGVLocationInfos.Where(x => x.Depth > rGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()).Any()) rGVLocationInfo = null; |
| | | else return rGVLocationInfo; |
| | | } |
| | | //var Depth = 0; |
| | | //while (item.Depth - rGVLocationInfo.Depth != 0) |
| | | //{ |
| | | // if (dt_RGVLocationInfos.Where(x => x.Depth > rGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()).FirstOrDefault() == null)//å¤ææ·±æ·±åº¦è´§ä½æ¯å¦æè´§ |
| | | // return rGVLocationInfo; |
| | | // if (rGVLocationInfo.Depth < item.Depth) Depth = rGVLocationInfo.Depth - 1; |
| | | // else Depth = rGVLocationInfo.Depth + 1; |
| | | // rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.Depth == Depth).FirstOrDefault(); |
| | | // if (rGVLocationInfo != null && rGVLocationInfo.LocationStatus == (int)LocationStatusEnum.Free) return rGVLocationInfo; |
| | | //} |
| | | } |
| | | }//夿æµ
æ·±åº¦è´§ä½æ¯å¦æè´§ |
| | | else return item; |
| | | } |
| | | |
| | | //if (rGVLocationInfo != null)//æµ
æ·±åº¦è´§ä½æè´§ï¼æ¾æ·±æ·±åº¦è´§ä½æ¯å¦æè´§ |
| | | //{ |
| | | // if (item.LocationType == 1) break;//å··éç±»å为ååï¼ç´æ¥è·³è¿ |
| | | // foreach (var locationInfo in rGVLocationInfos.Where(x => x.RoadwayNo == items.Key).OrderByDescending(x => x.Depth)) |
| | | // { |
| | | // if (!dt_RGVLocationInfos.Where(x => x.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && x.Depth < locationInfo.Depth).Any()) return locationInfo; |
| | | // } |
| | | // //rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt()).OrderBy(x => x.Depth).FirstOrDefault();//æ¾æµ
æ·±åº¦ç©ºè´§ä½ |
| | | // //if (rGVLocationInfo != null) |
| | | // //{ |
| | | // // if (dt_RGVLocationInfos.Where(x => x.Depth > rGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()).FirstOrDefault() == null)//å¤ææ·±æ·±åº¦è´§ä½æ¯å¦æè´§ |
| | | // // return rGVLocationInfo; |
| | | // //} |
| | | //} |
| | | //if (rGVLocationInfo == null) |
| | | //{ |
| | | // rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.Depth > item.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()).FirstOrDefault();//夿æµ
æ·±åº¦è´§ä½æ¯å¦æè´§ |
| | | // if (item.LocationType == 1) break;//å··éç±»å为ååï¼ç´æ¥è·³è¿ |
| | | // foreach (var locationInfo in rGVLocationInfos.Where(x => x.RoadwayNo == items.Key).OrderByDescending(x => x.Depth)) |
| | | // { |
| | | // if (!dt_RGVLocationInfos.Where(x => x.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && x.Depth < locationInfo.Depth).Any()) return locationInfo; |
| | | // } |
| | | //} |
| | | //else return item; |
| | | } |
| | | } |
| | | #endregion |
| | | return FreerGVLocationInfo; |