From 28aac1b84d301b79a0ca784e812561422fbac4a5 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期三, 19 二月 2025 09:00:14 +0800 Subject: [PATCH] 干膜优化,盘点,MES退库优化 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 84 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 83 insertions(+), 1 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 7940d31..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" @@ -198,7 +198,7 @@ task.NextAddress = router.NextPosi; task.DeviceCode = router.ChildPosi; } - else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt()) + else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt()) { task.NextAddress = router.NextPosi; task.DeviceCode = stationManger.StackerCraneCode; @@ -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