wangxinhui
9 小时以前 67348f250a1b7970059698002949a5e0a5f3c52f
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -251,6 +251,22 @@
                                task.NextAddress = router.NextPosi;
                            }
                        }
                        else
                        {
                            if (taskTypeGroup == TaskTypeGroup.InboundGroup && !task.Roadway.Contains("YL"))
                            {
                                task.CurrentAddress = router.StartPosi;
                                task.NextAddress = "";
                                task.DeviceCode = router.ChildPosiDeviceCode;
                            }
                            else
                            {
                                router = routers.FirstOrDefault(x=>x.ChildPosiDeviceCode==task.Roadway);
                                task.CurrentAddress = router.StartPosi;
                                task.NextAddress = router.NextPosi;
                                task.DeviceCode = router.ChildPosi;
                            }
                        }
                    }
                    tasks.Add(task);
                }
@@ -314,14 +330,49 @@
            }
            return content;
        }
        /// <summary>
        ///
        // <summary>
        /// è¯·æ±‚入库任务
        /// </summary>
        /// <param name="palletCode"></param>
        /// <param name="sourceAddress"></param>
        /// <param name="palletCode">托盘号</param>
        /// <param name="sourceAddress">起始地址</param>
        /// /// <param name="roadWay">巷道</param>
        /// <returns></returns>
        public WebResponseContent RequestWMSTaskSimple(string palletCode, string sourceAddress, int taskType=630)
        public WebResponseContent RequestYLWMSTaskSimple(string palletCode, string sourceAddress)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string address = AppSettings.Get("WMSApiAddress");
                if (string.IsNullOrEmpty(address))
                {
                    return WebResponseContent.Instance.Error($"未找到WMSApi地址");
                }
                string responseStr = HttpHelper.Get($"{address}/api/Task/RequestYLWMSTaskSimple?stationCode={sourceAddress}&palletCode={palletCode}");
                WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
                if (responseContent != null && responseContent.Status && responseContent.Data != null)
                {
                    WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString());
                    if (taskDTO != null)
                    {
                        content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
                    }
                }
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
        // <summary>
        /// è¯·æ±‚入库任务
        /// </summary>
        /// <param name="palletCode">托盘号</param>
        /// <param name="sourceAddress">起始地址</param>
        /// /// <param name="roadWay">巷道</param>
        /// <returns></returns>
        public WebResponseContent RequestWMSTaskSimple(string palletCode, string sourceAddress, string roadWay="", int taskType=630)
        {
            WebResponseContent content = new WebResponseContent();
            try
@@ -342,8 +393,8 @@
                {
                    Id = 1,
                    TaskNum = DateTime.Now.ToString("mmss").ObjToInt(),
                    PalletCode="",
                    RoadWay="",
                    PalletCode= palletCode,
                    RoadWay= roadWay ?? "",
                    TaskType= taskType,
                    PalletType=1,
                    TaskStatus=TaskStatusEnum.New.ObjToInt(),