From 994dced313b956180f1b95e68760290c5ed931ba Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期三, 15 一月 2025 19:12:47 +0800 Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 82 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 82 insertions(+), 0 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" index fe70f82..ebdb88a 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" @@ -326,6 +326,12 @@ return content; } + /// <summary> + /// + /// </summary> + /// <param name="palletCode"></param> + /// <param name="sourceAddress"></param> + /// <returns></returns> public WebResponseContent RequestWMSTaskSimple(string palletCode, string sourceAddress) { WebResponseContent content = new WebResponseContent(); @@ -355,6 +361,13 @@ return content; } + /// <summary> + /// + /// </summary> + /// <param name="palletCode"></param> + /// <param name="sourceAddress"></param> + /// <param name="roadway"></param> + /// <returns></returns> public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) { WebResponseContent content = new WebResponseContent(); @@ -366,6 +379,43 @@ return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃"); } string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={roadway}&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="sourceAddress"></param> + /// <param name="palletCode"></param> + /// <param name="heightType"></param> + /// <param name="roadways"></param> + /// <returns></returns> + public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, int heightType, List<string> roadways) + { + WebResponseContent content = new WebResponseContent(); + try + { + string address = AppSettings.Get("WMSApiAddress"); + if (string.IsNullOrEmpty(address)) + { + return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃"); + } + string responseStr = HttpHelper.Post($"{address}/api/Task/DeviceRequestInboundTaskByRoadways?stationCode={sourceAddress}&palletCode={palletCode}&heightType={heightType}", roadways.Serialize()); WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); if (responseContent != null && responseContent.Status && responseContent.Data != null) { @@ -416,6 +466,38 @@ } /// <summary> + /// + /// </summary> + /// <param name="roadwayNos"></param> + /// <param name="palletCode"></param> + /// <param name="heightType"></param> + /// <returns></returns> + public WebResponseContent RequestWMSAssignRoadway(List<string> roadwayNos, string palletCode, int heightType) + { + WebResponseContent content = new WebResponseContent(); + try + { + string address = AppSettings.Get("WMSApiAddress"); + if (string.IsNullOrEmpty(address)) + { + return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃"); + } + string responseStr = HttpHelper.Post($"{address}/api/Task/AssignRoadwayByHeightAndCode?palletCode={palletCode}&heightType={heightType}", roadwayNos.Serialize()); + WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); + if (responseContent != null && responseContent.Status && responseContent.Data != null) + { + return responseContent; + } + + } + catch (Exception ex) + { + content = WebResponseContent.Instance.Error(ex.Message); + } + return content; + } + + /// <summary> /// 鍒嗛厤宸烽亾 /// </summary> /// <param name="roadwayNos"></param> -- Gitblit v1.9.3