From f1d8d7b04a81619cb29457fa88538bbaf37d8c20 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 26 二月 2026 18:22:04 +0800
Subject: [PATCH] 优化WCS跟四向车接口

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs |   35 ++++++++++++++++++++++++++++-------
 1 files changed, 28 insertions(+), 7 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs"
index 1f2367c..5253d68 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs"
@@ -15,8 +15,9 @@
 {
     public partial class TaskService
     {
+        #region 鍑箰澹换鍔″垱寤�
         /// <summary>
-        /// 鍒涘缓鍏ュ簱浠诲姟
+        /// 鍒涘缓鍑箰澹獳GV鍏ュ簱浠诲姟
         /// </summary>
         /// <param name="taskDTO"></param>
         /// <returns></returns>
@@ -26,13 +27,12 @@
             {
                 int containerType = taskDTO.containerCode.Contains("LLM") ? LocationTypeEnum.LargePallet.ObjToInt() : LocationTypeEnum.SmallPallet.ObjToInt();
                 //鑾峰彇璐т綅淇℃伅
-                Dt_KLSLocationInfo? kLSLocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.WarehouseId.ToString() == taskDTO.toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == containerType);
-                if (kLSLocationInfo == null) throw new Exception($"鏈壘鍒扮粓鐐瑰簱鍖恒�恵taskDTO.toAreaCode}銆戝彲鐢ㄧ┖璐т綅锛�");
-                Dt_Task dt_Task = new Dt_Task()
+                Dt_KLSLocationInfo? kLSLocationInfo = _kLSLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode, containerType) ?? throw new Exception($"鏈壘鍒扮粓鐐瑰簱鍖恒�恵taskDTO.toAreaCode}銆戝彲鐢ㄧ┖璐т綅锛�");
+                Dt_Task dt_Task = new()
                 {
                     TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                     WMSTaskNum = taskDTO.taskCode,
-                    WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+                    //WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                     Grade = taskDTO.taskPriority,
                     PalletCode = taskDTO.containerCode,
                     Roadway = kLSLocationInfo.RoadwayNo,
@@ -57,7 +57,12 @@
                 throw new Exception(ex.Message);
             }
         }
-
+        /// <summary>
+        /// 鍒涘缓鍑箰澹獳GV鍑哄簱浠诲姟
+        /// </summary>
+        /// <param name="taskDTO"></param>
+        /// <param name="taskType"></param>
+        /// <returns></returns>
         public WebResponseContent CreateKLSNewOutTask(TaskDTO taskDTO, int taskType)
         {
             try
@@ -69,7 +74,7 @@
                 {
                     TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                     WMSTaskNum = taskDTO.taskCode,
-                    WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+                    //WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                     Grade = taskDTO.taskPriority,
                     PalletCode = taskDTO.containerCode,
                     Roadway = kLSLocationInfo.RoadwayNo,
@@ -94,5 +99,21 @@
                 throw new Exception(ex.Message);
             }
         }
+        #endregion
+
+        #region 5 璺ㄦゼ灞傝繍杈撲换鍔″垱寤�
+        public WebResponseContent CarryTask(TaskDTO taskDTO, int taskType)
+        {
+            return WebResponseContent.Instance.OK();
+        }
+        #endregion
+
+
+        #region 6 瑁佸壀閫佽揣
+        public WebResponseContent CJCarryTaske(TaskDTO taskDTO, int taskType)
+        {
+            return WebResponseContent.Instance.OK();
+        }
+        #endregion
     }
 }

--
Gitblit v1.9.3