From 4c7f2d26fd6041d32f4e291559bc443671493246 Mon Sep 17 00:00:00 2001
From: chengsc <11752@DESKTOP-DS49RCP>
Date: 星期四, 19 六月 2025 16:52:45 +0800
Subject: [PATCH] 修改问题

---
 Admin.NET/WCS.Application/Util/FourWayCarUtil.cs |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/Admin.NET/WCS.Application/Util/FourWayCarUtil.cs b/Admin.NET/WCS.Application/Util/FourWayCarUtil.cs
index 596b8d0..0a8fe55 100644
--- a/Admin.NET/WCS.Application/Util/FourWayCarUtil.cs
+++ b/Admin.NET/WCS.Application/Util/FourWayCarUtil.cs
@@ -7,6 +7,7 @@
 using System.Text;
 using System.Threading.Tasks;
 using WCS.Application.Entity;
+using static Elastic.Clients.Elasticsearch.JoinField;
 using static SKIT.FlurlHttpClient.Wechat.Api.Models.CustomServiceKfSessionGetWaitCaseResponse.Types;
 
 namespace WCS.Application.Util;
@@ -25,6 +26,10 @@
     /// <returns></returns>
     public static List<CarModel> GetCarPathUp(List<CarModel> list, int moveType)
     {
+        if (list == null)
+        {
+            return null;
+        }
         for (int i = 0; i < list.Count; i++)
         {
             if (i >= 0 && i < list.Count - 1)
@@ -162,6 +167,15 @@
 
     }
 
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="data">褰撳墠浠诲姟鎬昏矾寰�</param>
+    /// <param name="kXCarList">鎵�鏈夊皬杞�</param>
+    /// <param name="assignCar">褰撳墠鍒嗛厤灏忚溅</param>
+    /// <param name="waitTask">褰撳墠鎬讳换鍔�</param>
+    /// <param name="moveType">0鍘诲彇璐т换鍔�  1鍘绘斁璐�</param>
+    /// <returns></returns>
     public static bool AddCarTask(List<CarModel> data, List<CarInfo> kXCarList, CarInfo assignCar, WcsTask waitTask,int moveType)
     {
         #region 鑾峰彇閫傚悎鎵ц褰撳墠浠诲姟鐨勫皬杞� 鐢熸垚璺緞锛堥渶鑰冭檻灏忚溅闃婚樆鎸★級
@@ -324,7 +338,7 @@
             var lastPath = lastPathList[lastPathList.Length - 2];
             var lastPath2 = lastPath.Substring(0,6);
 
-            //濡傛灉姝ゆ鍒嗛厤璺緞鍖呭惈閱夎垶涓渶缁堣妭鐐硅矾寰勶紝娣诲姞绉昏蛋灏忚溅
+            //濡傛灉姝ゆ鍒嗛厤璺緞鍖呭惈浠诲姟涓渶缁堣妭鐐硅矾寰勶紝娣诲姞绉昏蛋灏忚溅
             if (path.Contains(lastPath2))
             {
                 
@@ -423,7 +437,6 @@
     }
 
 
-
     /// <summary>
     /// 鑾峰彇灏忚溅璺緞
     /// </summary>
@@ -491,7 +504,7 @@
 
                 if (current.Equals(end))
                 {
-                    Log.Error(ReconstructPath(cameFrom, current).ToString());
+                    Log.Error("灏忚溅璺緞鍒嗛厤锛�" +ReconstructPath(cameFrom, current).ToString());
                     return ReconstructPath(cameFrom, current);
                 }
 
@@ -611,6 +624,28 @@
     }
 
     /// <summary>
+    /// 鑾峰彇鎬讳换鍔¤〃涓嬪彂ID涓婚敭
+    /// </summary>
+    /// <returns></returns>
+    public static int GetTaskId()
+    {
+        var list = _db.Queryable<WcsTask>().ToList();
+        var maxNo = list.Max(m => m.TaskId);
+
+        if (maxNo != null && maxNo > 0)
+        {
+            if (maxNo++ > 99999999)
+            {
+                return 1;
+            }
+
+            return (int)maxNo++;
+        }
+
+        return 1;
+    }
+
+    /// <summary>
     /// 璁$畻鏇煎搱椤胯窛绂�
     /// </summary>
     /// <param name="start">璧峰浣嶇疆</param>

--
Gitblit v1.8.0