dengjunjie
7 天以前 6d9829c889a826d39cbc911ef5d01825edd1bffc
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/PartialTaskService_Line.cs
@@ -24,45 +24,14 @@
        public WebResponseContent RequestWMSTask(ConveyorLineDTO lineDTO)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                #region å‘WMS申请
                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);
            #region å‘WMS申请
            var ResultData = HttpHelper.PostAsync(WMSInterfaceAddress.ConveyorLineRequestInbound, lineDTO.ToJson(), headers: new Dictionary<string, string>());
            if (ResultData.Result == null) throw new Exception($"向WMS请求入库超时");
                #endregion
            return JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result);
                #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
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
            #endregion
        }
        /// <summary>
@@ -84,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)