From 17bca2d690f283ec110c0c327a8508ed8fba9d21 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期四, 05 六月 2025 09:21:19 +0800 Subject: [PATCH] 最新代码提交 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 75 ++++++++++++++++++++++--------------- 1 files changed, 45 insertions(+), 30 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 5877ad4..5a885e6 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" @@ -263,7 +263,14 @@ { task.NextAddress = router.NextPosi; task.DeviceCode = stationManger.StackerCraneCode; - task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); + if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() && task.TargetAddress== "SCUTL-001") + { + task.TaskState = TaskStatusEnum.MesPending.ObjToInt(); + } + else + { + task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); + } } else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() && item.RoadWay.Contains("ZH")) { @@ -379,7 +386,7 @@ /// <param name="palletCode">鎵樼洏鍙�</param> /// <param name="sourceAddress">璧峰鍦板潃</param> /// <returns></returns> - public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress) + public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string materielBoxCode = "") { WebResponseContent content = new WebResponseContent(); try @@ -394,7 +401,15 @@ { return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃"); } - string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); + string responseStr = ""; + if (!string.IsNullOrEmpty(materielBoxCode)) + { + responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}&materielBoxCode={materielBoxCode}"); + } + else + { + responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); + } WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); if (responseContent != null && responseContent.Status && responseContent.Data != null) { @@ -455,34 +470,34 @@ /// <param name="sourceAddress"></param> /// <param name="roadway"></param> /// <returns></returns> - public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) - { - 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/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 }); - } - } + //public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) + //{ + // 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/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; - } + // } + // catch (Exception ex) + // { + // content = WebResponseContent.Instance.Error(ex.Message); + // } + // return content; + //} /// <summary> /// -- Gitblit v1.9.3