From 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期三, 09 七月 2025 22:55:27 +0800
Subject: [PATCH] 增加质检出入库逻辑

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index f667a95..740ecd1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -119,6 +119,10 @@
                             task.NextAddress = routers.FirstOrDefault().ChildPosi;
                         }
                     }
+                    else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
+                    {
+                        task.TaskState = item.SourceIsPickPlace ? TaskRelocationStatusEnum.CarSource_Finish.ObjToInt() : TaskRelocationStatusEnum.RelocationNew.ObjToInt();
+                    }
                     tasks.Add(task);
                 }
                 BaseDal.AddData(tasks);
@@ -318,14 +322,14 @@
             {
                 Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
                 if (task == null) return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅,浠诲姟鍙�:銆恵taskNum}銆�");
-                if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
-                {
-                    task.TaskState = (int)TaskOutStatusEnum.OutPending;
-                }
-                else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
-                {
-                    task.TaskState = (int)TaskInStatusEnum.InPending;
-                }
+                //if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
+                //{
+                //    task.TaskState = (int)TaskOutStatusEnum.OutPending;
+                //}
+                //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
+                //{
+                //    task.TaskState = (int)TaskInStatusEnum.InPending;
+                //}
                 task.ExceptionMessage = message;
                 task.ModifyDate = DateTime.Now;
                 BaseDal.UpdateData(task);
@@ -619,9 +623,9 @@
         /// <param name="TaskState"></param>
         /// <param name="TaskType"></param>
         /// <returns></returns>
-        public Dt_Task GetTaskState(int TaskState, int TaskType)
+        public Dt_Task? GetTaskState(int TaskState, int TaskType)
         {
-            Dt_Task task = null;
+            Dt_Task? task = null;
             if (TaskState > 0 && TaskType > 0)
                 task = BaseDal.QueryFirst(x => x.TaskState == TaskState && x.TaskType == TaskType);
             else if (TaskState > 0)
@@ -646,12 +650,17 @@
             {
                 if (!string.IsNullOrEmpty(SourceAddress) && SourceAddress != "")
                 {
-                    Dt_Task? task = BaseDal.QueryFirst(x => x.SourceAddress == SourceAddress && (x.TaskType == TaskOtherTypeEnum.RelocationCar.ObjToInt() || x.TaskType == TaskOtherTypeEnum.RelocationCarCharging.ObjToInt()));
+                    Dt_Task? task = BaseDal.QueryFirst(x => x.SourceAddress == SourceAddress &&
+                    x.ShuttleCarCode == ShuttleCarCode &&
+                    (x.TaskType == TaskOtherTypeEnum.RelocationCar.ObjToInt() ||
+                    x.TaskType == TaskOtherTypeEnum.RelocationCarCharging.ObjToInt()));
                     if (task != null) return;
                 }
                 if (!string.IsNullOrEmpty(TargetAddress) && TargetAddress != "")
                 {
-                    Dt_Task? task = BaseDal.QueryFirst(x => x.TargetAddress == TargetAddress && (x.TaskType == TaskOtherTypeEnum.RelocationCar.ObjToInt() || x.TaskType == TaskOtherTypeEnum.RelocationCarCharging.ObjToInt()));
+                    Dt_Task? task = BaseDal.QueryFirst(x => x.TargetAddress == TargetAddress &&
+                    (x.TaskType == TaskOtherTypeEnum.RelocationCar.ObjToInt() ||
+                    x.TaskType == TaskOtherTypeEnum.RelocationCarCharging.ObjToInt()));
                     if (task != null) return;
                 }
                 #region 鍒涘缓鍫嗗灈鏈虹Щ杞︿换鍔�

--
Gitblit v1.9.3