| | |
| | | if (instockInfoDetail != null) instockInfo = _stockService.StockInfoService.Repository.GetStockInfo(instockInfoDetail.StockId); |
| | | if (instockInfo != null) |
| | | { |
| | | locationInfo = _basicService.LocationInfoService.GetLocation(instockInfo.LocationCode);//æ¥è¯¢å·²åå¨åºåè´§ä½ç¶æ |
| | | #region MyRegion |
| | | //if (locationInfo.MaxQty == 12) |
| | | //{ |
| | | // locationInfo.EnableStatus = EnableStatusEnum.OnlyOut.ObjToInt(); |
| | | // _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | // locationInfo = null; |
| | | //} |
| | | //if (locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt()) locationInfo = null; |
| | | #endregion |
| | | if (locationInfo.LocationStatus > LocationStatusEnum.Inbounding.ObjToInt()) locationInfo = null; |
| | | |
| | | else |
| | | Dt_LocationInfo? location = _basicService.LocationInfoService.GetLocation(instockInfo.LocationCode);//æ¥è¯¢å·²åå¨åºåè´§ä½ç¶æ |
| | | if (location?.Row == 1) |
| | | { |
| | | #region å¤æè´§ä½ |
| | | if (locationInfo.Row == 1)//å¤ä¾§è´§ä½ï¼å¤æå
ä¾§è´§ä½ |
| | | var newLocation = Db.Queryable<Dt_LocationInfo>().Where(x => x.Row == 2 && x.Layer == location.Layer && x.Column == location.Column).First(); |
| | | if (newLocation != null && newLocation.LocationStatus == LocationStatusEnum.Free.ObjToInt() && newLocation.CurrentQty == 0 && (newLocation.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || newLocation.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) |
| | | { |
| | | var newLocation = Db.Queryable<Dt_LocationInfo>().Where(x => x.LocationCode != locationInfo.LocationCode && x.Remark == locationInfo.Remark).First(); |
| | | if (newLocation != null) |
| | | { |
| | | if (newLocation.LocationStatus == LocationStatusEnum.Free.ObjToInt() && |
| | | (newLocation.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || |
| | | newLocation.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) |
| | | { |
| | | locationInfo = newLocation; |
| | | } |
| | | } |
| | | locationInfo = newLocation; |
| | | } |
| | | #endregion |
| | | //List<Dt_StockInfoDetail> stockInfoDetails = _stockService.StockInfoDetailService.Get_StockInfoDetails(stockInfoDetail.OrderNo);//è·å工忿已å
¥åºæå
¥åºä¸åºå |
| | | //if (stockInfoDetails.GroupBy(x => x.BatchNo).Count() < 2) locationInfo.EnableStatus = EnableStatusEnum.OnlyOut.ObjToInt(); |
| | | //else locationInfo = null; |
| | | } |
| | | //if (locationInfo?.MaxQty <= locationInfo?.CurrentQty) locationInfo = null; |
| | | } |
| | | } |
| | | |
| | |
| | | task.CurrentAddress = task.NextAddress; |
| | | task.NextAddress = locationInfo.LocationCode;//使ç¨è´§ä½å¤æ³¨å段ï¼å¯¹åºå åæºæåå± |
| | | task.TargetAddress = task.NextAddress; |
| | | task.IsPickPlace = locationInfo.MaxQty - locationInfo.CurrentQty == 1; |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | var Row = Convert.ToInt16(targetCodes[0]); |
| | | task.TargetIsPickPlace = Row > 1 ? locationInfo.MaxQty - locationInfo.CurrentQty == 1 : false; |
| | | task.SourceIsPickPlace = false; |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºä¸.ObjToInt(); |
| | | stockInfoDetail.Status = StockStatusEmun.å
¥åºä¸.ObjToInt(); |
| | | locationInfo.CurrentQty++; |
| | | if (locationInfo.MaxQty < locationInfo.CurrentQty) throw new Exception(); |
| | | if (locationInfo.MaxQty == 12) locationInfo.EnableStatus = EnableStatusEnum.OnlyOut.ObjToInt(); |
| | | /*if (locationInfo.MaxQty == 12)*/ |
| | | locationInfo.EnableStatus = EnableStatusEnum.OnlyOut.ObjToInt(); |
| | | locationInfo.LocationStatus = LocationStatusEnum.Inbounding.ObjToInt(); |
| | | |
| | | Db.Ado.BeginTran(); |
| | |
| | | content.OK(data: new ReceiveWMSInfo() |
| | | { |
| | | TargetAddress = task.TargetAddress, |
| | | IsPickPlace = task.IsPickPlace, |
| | | SourceIsPickPlace = task.SourceIsPickPlace, |
| | | TargetIsPickPlace = task.TargetIsPickPlace, |
| | | }); |
| | | } |
| | | catch (Exception ex) |