| | |
| | | { |
| | | return content.Error($"æ°éè¶
åº"); |
| | | } |
| | | if (checkResult.Result == InspectResultEnum.Return.ToString())//éè´§ |
| | | //夿æ£éªç»æ |
| | | if (checkResult.Result == InspectResultEnum.Return.ToString()) |
| | | { |
| | | checkOrder.DefectedNote = checkResult.Note; |
| | | checkOrder.ReturnQuantity += checkResult.Quantity; |
| | |
| | | } |
| | | else if(checkResult.Quantity< item.StockQuantity) |
| | | { |
| | | checkResult.Quantity = 0; |
| | | item.StockQuantity -= checkResult.Quantity; |
| | | item.OutboundQuantity = 0; |
| | | checkResult.Quantity = 0; |
| | | stockInfoDetails.Add(item); |
| | | } |
| | | else if (checkResult.Quantity >= item.StockQuantity) |
| | |
| | | checkOrder.QualifiedQuantity = checkOrder.ReceivedQuantity; |
| | | } |
| | | checkOrder.CheckUserName = App.User.UserName; |
| | | List<Dt_StockInfoDetail> initialStockDetails = stockInfo.Details.Where(x=> !(stockInfoDetails.Select(v=>v.Id).ToList()).Contains(x.Id)).ToList(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | if (checkOrderResult != null) |
| | |
| | | { |
| | | _stockRepository.StockInfoDetailRepository.UpdateData(stockInfoDetails); |
| | | } |
| | | if (initialStockDetails.Count>0) |
| | | { |
| | | initialStockDetails.ForEach(x => |
| | | { |
| | | x.OutboundQuantity = 0; |
| | | }); |
| | | _stockRepository.StockInfoDetailRepository.UpdateData(initialStockDetails); |
| | | } |
| | | if (DelStockDetails.Count>0) |
| | | { |
| | | _stockRepository.StockInfoDetailRepository.DeleteAndMoveIntoHty(DelStockDetails, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |