1
yangpeixing
2026-01-22 93ec15196294abce031a86e24f4cee643b3b1c8a
WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
@@ -47,7 +47,7 @@
                if (stockInfo != null)
                {
                    Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
                    if (locationInfo==null)
                    if (locationInfo == null)
                    {
                        throw new Exception("未找到出库库位");
                    }
@@ -116,7 +116,7 @@
                            }
                            tasks.Add(task);
                        }
                    }
                }
@@ -152,7 +152,16 @@
            List<Dt_LocationInfo>? locationInfos = null;
            //if (outboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt())
            {
                (List<Dt_StockInfo>, List<Dt_OutboundOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetails);
                Dt_OutboundOrder dt_OutboundOrder = _outboundService.OutboundOrderService.Repository.QueryData(x => x.Id == outboundOrderDetails.First().OrderId).First();
                (List<Dt_StockInfo>, List<Dt_OutboundOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = new();
                if (dt_OutboundOrder.OutWareHouse.Contains("DW") || dt_OutboundOrder.OutWareHouse.Contains("YS"))
                {
                   result = _outboundService.OutboundOrderDetailService.DWANDYSAssignStockOutbound(outboundOrderDetails);
                }
                else
                {
                   result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetails);
                }
                if (result.Item1 != null && result.Item1.Count > 0)
                {
                    Dt_OutboundOrder outboundOrder = _outboundService.OutboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetails.FirstOrDefault().OrderId);
@@ -163,7 +172,7 @@
                        (int)OrderTypeEnum.反拣出库单 => TaskTypeEnum.ReverseOut,
                        _ => new TaskTypeEnum()
                    };
                    tasks = GetTasks(result.Item1,typeEnum);
                    tasks = GetTasks(result.Item1, typeEnum);
                    tasks.ForEach(x =>
                    {
                        x.OrderNo = outboundOrder.OrderNo;
@@ -316,7 +325,7 @@
                                CreateDate = DateTime.Now,
                                Remark = details.Remark,
                                SupplierBatch = details.SupplierBatch,
                                OrinalLocation=details.OrinalLocation,
                                OrinalLocation = details.OrinalLocation,
                            };
                            _newOutboundOrderDetailRepository.AddData(outboundOrderDetail);
                            foreach (var item in orderAddDTO1.Details)
@@ -827,7 +836,7 @@
                }
                _unitOfWorkManage.CommitTran();
                //将任务推送到WCS
                if (tasks.FirstOrDefault().Roadway.Contains("SC01_BC"))
                {
                    PushTasksToWCS(tasks);
@@ -1008,7 +1017,7 @@
                foreach (int key in keys)
                {
                    (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(keys);
                   (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(keys);
                    if (result.Item2 != null && result.Item2.Count > 0)
                    {
                        stockInfos.AddRange(result.Item2);
@@ -1019,17 +1028,27 @@
                    }
                    if (result.Item4 != null && result.Item4.Count > 0)
                    {
                        outStockLockInfos.AddRange(result.Item4);
                        outStockLockInfos.AddRange(result.Item4);
                    }
                    if (result.Item5 != null && result.Item5.Count > 0)
                    {
                        locationInfos.AddRange(result.Item5);
                        if (locationInfos.First().RoadwayNo.Contains("DW") || locationInfos.First().RoadwayNo.Contains("YS"))
                        {
                            locationInfos.AddRange(result.Item5.Distinct());
                        }
                        else
                        {
                            locationInfos.AddRange(result.Item5);
                        }
                    }
                    if (result.Item1 != null && result.Item1.Count > 0)
                    {
                        tasks.AddRange(result.Item1);
                    }
                    if(locationInfos.First().RoadwayNo.Contains("DW") || locationInfos.First().RoadwayNo.Contains("YS"))
                    {
                        break;
                    }
                }
@@ -1157,6 +1176,10 @@
                    {
                        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())
                    {