From 67348f250a1b7970059698002949a5e0a5f3c52f Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期四, 14 八月 2025 08:51:04 +0800 Subject: [PATCH] 上传最新代码 --- 项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs | 67 +++++++++++++++++++++++++++++---- 1 files changed, 59 insertions(+), 8 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs" index 17eb286..c4a7efe 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/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($"鏈壘鍒癢MSApi鍦板潃"); + } + 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(), -- Gitblit v1.9.3