From 1d685ca799f0b50ad63336963511cbbf21ab2e4c Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期四, 18 十二月 2025 09:41:53 +0800
Subject: [PATCH] 需求优化

---
 项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 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 820e628..202738c 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"
@@ -18,6 +18,7 @@
 using Newtonsoft.Json;
 using SqlSugar;
 using System.Diagnostics.CodeAnalysis;
+using System.Net.Http.Headers;
 using WIDESEA_DTO.Agv;
 using WIDESEAWCS_Common;
 using WIDESEAWCS_Common.APIEnum;
@@ -266,12 +267,24 @@
                     {
                         //鎴愬搧鍏ュ簱
                         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)
+                        if (routers.Count==0)
                         {
+                            router = _routerRepository.QueryFirst(x => x.InOutType == item.TaskType && x.StartPosi == "AGV");
+                            if (router==null)
+                                return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢遍厤缃俊鎭�");
                             task.NextAddress = router.NextPosi;
                             task.DeviceCode = router.ChildPosi;
                         }
+                        else
+                        {
+                            router = routers.FirstOrDefault();
+                            if (routers.Count == 1)
+                            {
+                                task.NextAddress = router.NextPosi;
+                                task.DeviceCode = router.ChildPosi;
+                            }
+                        }
+                        
                     }
                     tasks.Add(task);
                 }
@@ -432,7 +445,7 @@
         /// 璇锋眰鍘熸枡鍏ュ簱宸烽亾
         /// </summary>
         /// <returns></returns>
-        public WebResponseContent AssignYLRoadwayNo(string palletCode)
+        public WebResponseContent AssignYLRoadwayNo(string palletCode, int wide = 0, int thickness = 0, int weight = 0)
         {
             WebResponseContent content = new WebResponseContent();
             try
@@ -442,7 +455,7 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃");
                 }
-                string responseStr = HttpHelper.Get($"{address}/api/Task/AssignYLRoadwayNo?palletCode={palletCode}");
+                string responseStr = HttpHelper.Get($"{address}/api/Task/AssignYLRoadwayNo?palletCode={palletCode}&wide={wide}&thickness={thickness}&weight={weight}");
                 WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
                 if (responseContent != null && responseContent.Status && responseContent.Data != null)
                 {

--
Gitblit v1.9.3