dengjunjie
2025-03-13 90a0c4e0ab42a3574cfb6f9fd3b031dac9e7fb0d
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/PartialTaskService_Line.cs
@@ -29,34 +29,9 @@
            var ResultData = HttpHelper.PostAsync(WMSInterfaceAddress.ConveyorLineRequestInbound, lineDTO.ToJson(), headers: new Dictionary<string, string>());
            if (ResultData.Result == null) throw new Exception($"向WMS请求入库超时");
            content = JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result);
            return JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result);
            #endregion
            #region äº§çº¿ç”³è¯·å…¥åº“任务
            if (content != null && content.Status)//任务转换
            {
                var task = JsonConvert.DeserializeObject<Dt_Task>(content.Data.ToJson());
                if (task != null)
                {
                    List<int> TaskNums = new List<int>();
                    List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.TargetAddress);
                    if (routers.Count > 0)
                    {
                        task.NextAddress = routers.FirstOrDefault().ChildPosi;
                    }
                    task.WMSId = task.TaskId;
                    task.Creater = "WMS";
                    task.Dispatchertime = null;
                    task.CreateDate = DateTime.Now;
                    BaseDal.AddData(task);
                    TaskNums.Add(task.TaskNum);
                    _taskExecuteDetailService.AddTaskExecuteDetail(TaskNums, "接收WMS任务");
                }
            }
            #endregion
            return content;
        }
        /// <summary>
@@ -78,12 +53,18 @@
                var ResultData = HttpHelper.PostAsync(WMSInterfaceAddress.StackerCraneRequestInbound, lineDTO.ToJson(), headers: new Dictionary<string, string>());
                if (ResultData.Result == null) throw new Exception($"向WMS请求入库分配货位超时!任务号:{task.TaskNum}");
                content = JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result);
                if (!content.Status) throw new Exception(content.Message);
                if (content.Status)
                {
                    var receiveWMSInfo = JsonConvert.DeserializeObject<ReceiveWMSInfo>(content.Data.ToJson());
                    task.SourceIsPickPlace = receiveWMSInfo.SourceIsPickPlace;
                    task.TargetIsPickPlace = receiveWMSInfo.TargetIsPickPlace;
                    task.TargetAddress = receiveWMSInfo.TargetAddress;
                    task.NextAddress = task.TargetAddress;
                    task.ExceptionMessage = null;
                }
                else
                    task.ExceptionMessage = content.Message;
                var receiveWMSInfo = JsonConvert.DeserializeObject<ReceiveWMSInfo>(content.Data.ToJson());
                task.IsPickPlace = receiveWMSInfo.IsPickPlace;
                task.TargetAddress = receiveWMSInfo.TargetAddress;
                task.NextAddress = task.TargetAddress;
                BaseDal.UpdateData(task);
            }
            catch (Exception ex)