From 8d88e4d037aa5b6ce032f0b71417baa2845bb5d6 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 26 二月 2026 14:49:25 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs                   |    3 +--
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/KLSLocationInfoService.cs |   11 +++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/KLSLocationInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/KLSLocationInfoService.cs"
index 8db1ac2..124ba42 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/KLSLocationInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/KLSLocationInfoService.cs"
@@ -1,4 +1,5 @@
 锘縰sing OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
+using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -21,7 +22,13 @@
         public KLSLocationInfoService(IRepository<Dt_KLSLocationInfo> BaseDal) : base(BaseDal)
         {
         }
-
+        private Dictionary<string, OrderByType> _emptyAssignOrderBy = new Dictionary<string, OrderByType>()
+        {
+            { nameof(Dt_KLSLocationInfo.Depth), OrderByType.Desc },
+            { nameof(Dt_KLSLocationInfo.Layer), OrderByType.Asc },
+            { nameof(Dt_KLSLocationInfo.Column), OrderByType.Asc },
+            { nameof(Dt_KLSLocationInfo.Row), OrderByType.Asc },
+        };
         public IRepository<Dt_KLSLocationInfo> Repository => BaseDal;
         /// <summary>
         /// 鑾峰彇鍙敤绌鸿揣浣�
@@ -31,7 +38,7 @@
         /// <returns></returns>
         public Dt_KLSLocationInfo GetFreeLocationInfo(string AreaCode, int containerType)
         {
-            Dt_KLSLocationInfo? kLSLocationInfo = BaseDal.QueryFirst(x => x.WarehouseId.ToString() == AreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == containerType);
+            Dt_KLSLocationInfo? kLSLocationInfo = BaseDal.QueryFirst(x => x.WarehouseId.ToString() == AreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == containerType,_emptyAssignOrderBy);
             return kLSLocationInfo;
         }
 
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs"
index ab1a799..45158be 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs"
@@ -77,8 +77,7 @@
                     };
                     gALAXISTaskInfo.tasks.Add(gALAXISTask);
                 }
-                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(GALAXISTaskInfo));
-                if (apiInfo == null) throw new Exception("鏈壘鍒板嚡涔愬+AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
+                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(GALAXISTaskInfo)) ?? throw new Exception("鏈壘鍒板嚡涔愬+AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
                 string response = HttpHelper.Post(apiInfo.ApiAddress, gALAXISTaskInfo.Serialize());
                 GALAXISReturn agvContent = response.DeserializeObject<GALAXISReturn>();
                 if (agvContent.success)

--
Gitblit v1.9.3