wankeda
2 天以前 734f49c3f74e4a46cfb5892ce60dbf1bb86e74ab
WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
@@ -61,17 +61,18 @@
                        Dt_Task task = new()
                        {
                            OrderNo = stockInfoDetail.OrderNo,
                            CurrentAddress = "0",
                            CurrentAddress = locationInfo.LocationCode,
                            Grade = 0,
                            Creater = "WMS",
                            PalletCode = stockInfo.PalletCode,
                            NextAddress = "",
                            NextAddress = roadwayInfo.OutSCStationCode,
                            Roadway = locationInfo.RoadwayNo,
                            SourceAddress = stockInfo.LocationCode,
                            TargetAddress = roadwayInfo.OutStationCode,
                            SourceAddress = locationInfo.LocationCode,
                            TargetAddress = "",
                            TaskStatus = OutTaskStatusEnum.OutNew.ObjToInt(),
                            TaskType = TaskTypeEnum.Outbound.ObjToInt(),
                            Depth = locationInfo.Depth,
                            WarehouseId=stockInfo.WarehouseId,
                            TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum))
                        };
                        tasks.Add(task);
@@ -80,7 +81,6 @@
                }
            }
            BaseDal.AddData(tasks);
            return tasks;
        }
@@ -190,7 +190,7 @@
                            OrderQuantity = details.OrderQuantity,
                            OrderId = oldOuboundOrder.Id,
                            Creater = "WMS",
                            CreateDate= DateTime.Now,
                            CreateDate = DateTime.Now,
                        };
                        _outboundOrderDetailRepository.AddData(outboundOrderDetail);
                        //_outboundOrderDetailRepository.AddData(outboundOrderDetail);
@@ -217,8 +217,8 @@
                    inboundOrder.OrderStatus = InboundStatusEnum.未开始.ObjToInt();
                    inboundOrder.Creater = "WMS";
                    inboundOrder.CreateDate = DateTime.Now;
                    _unitOfWorkManage.BeginTran();
                    bool a = BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand();
                    Dt_OutboundOrder oldOutboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == 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>();
@@ -232,10 +232,11 @@
                        LinId = outboundOrderDetail.LinId,
                        PalletCode = outboundOrderDetail.LPNNo,
                    };
                    _unitOfWorkManage.BeginTran();
                    stockSelectViews.Add(stockSelectViewDTO);
                    GenerateOutboundTasks(oldOutboundOrder.Id, stockSelectViews);
                    _unitOfWorkManage.CommitTran();
                }
@@ -382,6 +383,8 @@
            {
                WebResponseContent content = new WebResponseContent();
                _unitOfWorkManage.BeginTran();
                BaseDal.AddData(tasks);
                //判断移库
                //content = RelocationTasks(tasks.OrderBy(x => x.Depth).ToList());
                //if (content.Status)
@@ -398,15 +401,11 @@
                {
                    content = _outboundService.OutboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks);
                    if (content.Status)
                    {
                        _unitOfWorkManage.CommitTran();
                    }
                    else
                    if (!content.Status)
                    {
                        _unitOfWorkManage.RollbackTran();
                        return content;
                    }
                    return content;
                }
                else if (outboundOrderDetails != null && outboundOrderDetails.Count > 0)
                {
@@ -418,6 +417,8 @@
                    _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails);
                }
                _unitOfWorkManage.CommitTran();
                //将任务推送到WCS
                PushTasksToWCS(tasks);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
@@ -522,7 +523,7 @@
                                    {
                                        PalletCode = dt_StockInfo.PalletCode,
                                        Roadway = locationInfos.RoadwayNo,
                                        TaskType = TaskTypeEnum.RelocationIn.ObjToInt(),
                                        //TaskType = TaskTypeEnum.RelocationIn.ObjToInt(),
                                        TaskStatus = OutTaskStatusEnum.OutNew.ObjToInt(),
                                        SourceAddress = locationInfos.LocationCode,
                                        TargetAddress = newLocation.LocationCode,
@@ -636,7 +637,7 @@
            Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
            if (task != null)
            {
                if (task.TaskType == (int)TaskTypeEnum.Outbound || task.TaskType == (int)TaskTypeEnum.PalletOutbound)
                if (task.TaskType == (int)TaskTypeEnum.Outbound || task.TaskType == (int)TaskTypeEnum.EmptyProductBack)
                {
                    //处理出库的逻辑
                    Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
@@ -664,7 +665,7 @@
                    return content = WebResponseContent.Instance.Error($"出库任务取消成功");
                }
                else if (task.TaskType == (int)TaskTypeEnum.Inbound || task.TaskType == (int)TaskTypeEnum.PalletInbound)
                else if (task.TaskType == (int)TaskTypeEnum.Inbound || task.TaskType == (int)TaskTypeEnum.Inbound)
                {
                    //处理出库的逻辑
                    Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);