From c2cdf0b95d4c9214646c860609b8c838d6ffa779 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期五, 15 八月 2025 13:42:10 +0800 Subject: [PATCH] AGV,成品库代码更新上传 --- 项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs | 78 +++++++++++++++++++++++++++++++++++---- 1 files changed, 70 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 c3c168d..fbca59f 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,32 @@ 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; + } + } + } + else + { + List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && x.StartPosi=="AGV" && x.ChildPosiDeviceCode==item.RoadWay); + router = routers.FirstOrDefault(); + if (routers.Count == 1) + { + task.NextAddress = router.NextPosi; + task.DeviceCode = router.ChildPosi; + } } tasks.Add(task); } @@ -314,14 +340,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 +403,8 @@ { Id = 1, TaskNum = DateTime.Now.ToString("mmss").ObjToInt(), - PalletCode="", - RoadWay="", + PalletCode= palletCode, + RoadWay= roadWay ?? "", TaskType= taskType, PalletType=1, TaskStatus=TaskStatusEnum.New.ObjToInt(), @@ -631,6 +692,7 @@ /// <returns>杩斿洖浠诲姟瀹炰綋瀵硅薄锛屽彲鑳戒负null</returns> public Dt_Task QueryStackerCraneTask(string deviceNo, string currentAddress = "") { + //鍒ゆ柇鏄惁涓虹┖ if (string.IsNullOrEmpty(currentAddress)) return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && x.TaskState == (int)TaskStatusEnum.SC_Execute, TaskOrderBy); else -- Gitblit v1.9.3