| | |
| | | if (stockInfo != null) |
| | | { |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode); |
| | | if (locationInfo==null) |
| | | if (locationInfo == null) |
| | | { |
| | | throw new Exception("未找到出库库位"); |
| | | } |
| | |
| | | } |
| | | tasks.Add(task); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | (int)OrderTypeEnum.反拣出库单 => TaskTypeEnum.ReverseOut, |
| | | _ => new TaskTypeEnum() |
| | | }; |
| | | tasks = GetTasks(result.Item1,typeEnum); |
| | | tasks = GetTasks(result.Item1, typeEnum); |
| | | tasks.ForEach(x => |
| | | { |
| | | x.OrderNo = outboundOrder.OrderNo; |
| | |
| | | CreateDate = DateTime.Now, |
| | | Remark = details.Remark, |
| | | SupplierBatch = details.SupplierBatch, |
| | | OrinalLocation=details.OrinalLocation, |
| | | OrinalLocation = details.OrinalLocation, |
| | | }; |
| | | _newOutboundOrderDetailRepository.AddData(outboundOrderDetail); |
| | | foreach (var item in orderAddDTO1.Details) |
| | |
| | | inboundOrder.OrderType = OutOrderTypeEnum.OutInventory.ObjToInt(); |
| | | inboundOrder.Creater = "WMS"; |
| | | inboundOrder.CreateDate = DateTime.Now; |
| | | |
| | | Dt_OutboundOrder oldOutboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == orderAddDTO1.OrderNo).Includes(x => x.Details).First(); |
| | | Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.OrderId == oldOutboundOrder.Id); |
| | | List<StockSelectViewDTO> stockSelectViews = new List<StockSelectViewDTO>(); |
| | | StockSelectViewDTO stockSelectViewDTO = new() |
| | | foreach (var item in inboundOrder.Details) |
| | | { |
| | | OrderNo = orderAddDTO1.OrderNo, |
| | | MaterielCode = outboundOrderDetail.MaterielCode, |
| | | MaterielName = outboundOrderDetail.MaterielName, |
| | | UseableQuantity = outboundOrderDetail.OrderQuantity, |
| | | BatchNo = outboundOrderDetail.BatchNo, |
| | | LinId = outboundOrderDetail.LinId, |
| | | }; |
| | | |
| | | StockSelectViewDTO stockSelectViewDTO = new() |
| | | { |
| | | OrderNo = orderAddDTO1.OrderNo, |
| | | MaterielCode = item.MaterielCode, |
| | | MaterielName = item.MaterielName, |
| | | UseableQuantity = item.OrderQuantity, |
| | | BatchNo = item.BatchNo, |
| | | LinId = item.LinId, |
| | | }; |
| | | stockSelectViews.Add(stockSelectViewDTO); |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | bool a = BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand(); |
| | | stockSelectViews.Add(stockSelectViewDTO); |
| | | GenerateOutboundTasks(oldOutboundOrder.Id, stockSelectViews); |
| | | |
| | | GenerateOutboundTasks(inboundOrder.Id, stockSelectViews); |
| | | _unitOfWorkManage.CommitTran(); |
| | | content = WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | //将任务推送到WCS |
| | | |
| | | |
| | | if (tasks.FirstOrDefault().Roadway.Contains("SC01_BC")) |
| | | { |
| | | PushTasksToWCS(tasks); |
| | |
| | | { |
| | | return content.Error($"未找到{item.PalletCode}库存明细数据"); |
| | | } |
| | | if (item.System.Contains("SMOM")) |
| | | { |
| | | return content.Error($"SMOM系统库存数据不可手动盘点,托盘号{item.PalletCode}"); |
| | | } |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.LocationCode == item.LocationCode); |
| | | if (locationInfo != null && (locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && item.StockStatus == StockStatusEmun.入库完成.ObjToInt()) |
| | | { |