| | |
| | | } |
| | | else |
| | | { |
| | | if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"托盘号重复"); |
| | | } |
| | | beforeQuantity = stockInfo.Details.Sum(x => x.StockQuantity); |
| | | //if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt()) |
| | | //{ |
| | | return WebResponseContent.Instance.Error($"托盘号重复,该托盘已组过物料"); |
| | | //} |
| | | //beforeQuantity = stockInfo.Details.Sum(x => x.StockQuantity); |
| | | } |
| | | |
| | | if (warehouse.WarehouseCode == WarehouseEnum.SC01_BC.ToString()) |
| | |
| | | |
| | | if (inboundOrderOld != null) |
| | | { |
| | | if (inboundOrderOld.OrderStatus != OrderDetailStatusEnum.New.ObjToInt()) |
| | | if (inboundOrderOld.OrderStatus == InOrderStatusEnum.入库完成.ObjToInt()) |
| | | { |
| | | return content.Error($"{model.AsnNo}单据已开始!"); |
| | | inboundOrderOld.OrderStatus = InOrderStatusEnum.入库中.ObjToInt(); |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrderOld); |
| | | } |
| | | Dt_InboundOrderDetail orderDetail1 = BaseDal.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.OrderId == inboundOrderOld.Id).First(); |
| | | Dt_InboundOrderDetail? inboundOrderDetailOld = inboundOrderOld.Details?.FirstOrDefault(x => x.LinId == item.LinId && x.MaterielCode == item.MaterielCode); |
| | |
| | | .Db.Queryable<Dt_InboundOrderDetail>() |
| | | .Where(d => d.OrderId == inboundOrder.Id) |
| | | .Count(); |
| | | |
| | | //检查明细完成的个数 |
| | | int overCount = _inboundRepository.InboundOrderDetailRepository |
| | | .Db.Queryable<Dt_InboundOrderDetail>() |
| | | .Where(d => d.OrderId == inboundOrder.Id && d.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()) |
| | | .Count(); |
| | | // 如果没有剩余明细,再删除主订单 |
| | | if (remainingDetailsCount == 0) |
| | | { |
| | | _inboundRepository.InboundOrderRepository.DeleteAndMoveIntoHty(inboundOrder, OperateType.人工取消); |
| | | } |
| | | //如果取消以后明细已经全部完成 |
| | | if (remainingDetailsCount == overCount) |
| | | { |
| | | inboundOrder.OrderStatus = InOrderStatusEnum.入库完成.ObjToInt(); |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | } |
| | | |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |