1
huangxiaoqiang
2025-12-03 d292487812b280e7f484a5cdf6e8a994baa486fd
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_AllocateOutboundOrderService.cs
@@ -162,8 +162,7 @@
                    else
                        return content.Error("请选择调拨仓库");
                        List<RequestTaskDto> taskDtos = new List<RequestTaskDto>();
                    List<RequestTaskDto> taskDtos = new List<RequestTaskDto>();
                    Dt_AllocateOutboundOrderDetail allocateoutboundOrderdetail = _allocateoutboundOrderDetailRepository.QueryFirst(x => x.Id == orderId);
                    Dt_AllocateOutboundOrder outboundOrder = BaseDal.QueryFirst(x => x.Id == allocateoutboundOrderdetail.OrderId);
@@ -188,7 +187,6 @@
                                MaterielCode = allocateoutboundOrderdetail.MaterielCode,
                                Position = item.LocationCode,
                                PalletCode = item.PalletCode,
                                //AreaId = Convert.ToInt32(requestOut.AreaId),
                                AreaId = Convert.ToInt32(2),
                            };
                            taskDtos.Add(task);
@@ -221,19 +219,22 @@
                        }
                        List<DtLocationStatusChangeRecord> locationStatusChangeRecords = new List<DtLocationStatusChangeRecord>();
                        List<DtLocationInfo> locations = new List<DtLocationInfo>();
                        if(taskNews.Count <= 0)
                        if (taskNews.Count <= 0)
                        {
                            throw new Exception($"{allocateoutboundOrderdetail.MaterielCode}未找到可出库托盘");
                        }
                        foreach (var item in taskNews)
                        {
                            taskDTOs.Add(CreateTaskDTO(item));
                            var result1 = _taskService.UpdateLocationStatus(item.SourceAddress, LocationEnum.InStockDisable, item.TaskNum.Value, (int)StatusChangeTypeEnum.AutomaticOutbound);
                            var result2 = _taskService.UpdateLocationStatus(item.TargetAddress, LocationEnum.Lock, item.TaskNum.Value, (int)StatusChangeTypeEnum.AutomaticOutbound);
                            var result1 = _taskService.UpdateLocationStatus(item.SourceAddress, LocationEnum.InStockDisable, item.TaskNum.Value,(int)StatusChangeTypeEnum.AutomaticOutbound);
                            locationStatusChangeRecords.AddRange(result1.Item1);
                            locationStatusChangeRecords.AddRange(result2.Item1);
                            locations.AddRange(result1.Item2);
                            locations.AddRange(result2.Item2);
                            var result2 = _taskService.UpdateEndLocationStatus(item.TargetAddress, LocationEnum.Lock, item.TaskNum.Value, StatusChangeTypeEnum.AutomaticOutbound);
                            if (result2.Item1 != null && result2.Item2 != null)
                            {
                                locationStatusChangeRecords.AddRange(result2.Item1);
                                locations.AddRange(result2.Item2);
                            }
                        }
                        outboundOrder.OrderStatus = (int)OrderStateEmun.开始;
                        await _unitOfWorkManage.UseTranAsync(async () =>
@@ -273,6 +274,7 @@
                AGVTaskNum = task.AGVTaskNum,
                Remark = task.Remark,
                Floor = task.Floor,
                DoubleTray = task.DoubleTray,
            };
        }
        public (List<DtStockInfo>, Dt_AllocateOutboundOrderDetail) AssignStockOutbound(Dt_AllocateOutboundOrderDetail allocateoutboundOrderdetail, List<StockSelectViewDTO> stockSelectViews)