From 4c6cf4c5bb9491dd98743f11fd3e657c2559523a Mon Sep 17 00:00:00 2001 From: zhanghonglin <zhanghonglin@hnkhzn.com> Date: 星期五, 11 七月 2025 10:19:18 +0800 Subject: [PATCH] 注释 --- 项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs | 65 ++++++++++++++++++++------------ 1 files changed, 40 insertions(+), 25 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 5a885e6..8b55db4 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" @@ -23,6 +23,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; @@ -198,7 +199,7 @@ List<Dt_Task> tasks = new List<Dt_Task>(); foreach (var item in taskDTOs) { - if (BaseDal.QueryFirst(x => x.TaskNum == item.TaskNum || x.PalletCode == item.PalletCode) != null) + if (BaseDal.QueryFirst(x => x.TaskNum == item.TaskNum) != null) { flag = true; continue; @@ -217,14 +218,14 @@ if (taskTypeGroup == TaskTypeGroup.InboundGroup) { stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StationDeviceCode == item.SourceAddress); - if (stationManger==null && task.TaskType==TaskTypeEnum.InProduct.ObjToInt()) - { - stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode==task.SourceAddress); - //杞崲鎴愬搧浠撹捣鐐圭珯鍙� - item.SourceAddress = stationManger.StationCode; - task.CurrentAddress = stationManger.StationCode; - task.SourceAddress = stationManger.StationCode; - } + //if (stationManger==null && task.TaskType==TaskTypeEnum.InProduct.ObjToInt()) + //{ + // stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode==task.SourceAddress); + // //杞崲鎴愬搧浠撹捣鐐圭珯鍙� + // item.SourceAddress = stationManger.StationCode; + // task.CurrentAddress = stationManger.StationCode; + // task.SourceAddress = stationManger.StationCode; + //} } else { @@ -244,10 +245,11 @@ if (routers.Count == 1) { - if (taskTypeGroup == TaskTypeGroup.InboundGroup && item.TargetAddress == stationManger.StackerCraneCode) + if (taskTypeGroup == TaskTypeGroup.InboundGroup) { + task.CurrentAddress = router.StartPosi; task.NextAddress = router.NextPosi; - task.DeviceCode = stationManger.StationDeviceCode; + task.DeviceCode = router.ChildPosiDeviceCode; } else if (item.TaskType == TaskTypeEnum.MesMatReturn.ObjToInt() && !router.IsEnd) { @@ -439,21 +441,34 @@ WebResponseContent content = new WebResponseContent(); try { - string address = AppSettings.Get("WMSApiAddress"); - if (string.IsNullOrEmpty(address)) + //string address = AppSettings.Get("WMSApiAddress"); + //if (string.IsNullOrEmpty(address)) + //{ + // return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃"); + //} + //string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTaskSimple?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) + // { + WMSTaskDTO? taskDTO = new WMSTaskDTO() { - return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃"); - } - string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTaskSimple?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 }); - } - } + Id = 1, + TaskNum = DateTime.Now.ToString("mmss").ObjToInt(), + PalletCode="", + RoadWay="", + TaskType=TaskTypeEnum.InProduct.ObjToInt(), + TaskStatus=TaskStatusEnum.New.ObjToInt(), + SourceAddress= sourceAddress, + TargetAddress="", + WarehouseId=1, + Grade=0, + }; + content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); + // } + //} } catch (Exception ex) -- Gitblit v1.9.3