From fd7fa01f87026b9db4cc6d44c0f93987b9bc27f2 Mon Sep 17 00:00:00 2001
From: Admin <Admin@ADMIN>
Date: 星期一, 15 十二月 2025 20:16:29 +0800
Subject: [PATCH] 最新

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs |   91 ++++++++++++++++++++++++++++-----------------
 1 files changed, 56 insertions(+), 35 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
index 18299f0..db1cef8 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
@@ -929,7 +929,7 @@
                 return content.Error("鏈壘鍒颁换鍔′俊鎭�!");
             }
 
-            if (task.TaskState != (int)TaskInStatusEnum.InNew && task.TaskState != (int)TaskOutStatusEnum.OutNew && task.TaskState != (int)TaskStatus.Created)
+            if (task.TaskState != (int)TaskInStatusEnum.InNew && task.TaskState != (int)TaskOutStatusEnum.OutNew && task.TaskState != (int)TaskStatus.Created && task.TaskState != (int)TaskInStatusEnum.InAbnormalCompletion && task.TaskState != (int)TaskOutStatusEnum.OutAbnormalCompletion)
             {
                 return content.Error("浠诲姟涓嶅浜庢柊寤虹姸鎬�,绂佹鍒犻櫎!");
             }
@@ -944,48 +944,69 @@
             // 鏍规嵁浠诲姟绫诲瀷璋冪敤鐩稿簲鐨勫畬鎴愪换鍔℃柟娉�
 
             // 楠岃瘉搴撳瓨鏄惁瀛樺湪
-            var stock = _WheelsStockRepository.QueryFirstNavAsync(x => x.Wheels_Num.Contains(task.PalletCode) && x.Wheels_Location == task.SourceAddress);
-            var ZdpStock = _ZdpStockRepository.QueryFirstNavAsync(x => x.Zdp_code == task.PalletCode && x.Zdp_Location == task.SourceAddress);
-            bool res = false;
-            switch (task.TaskType)
+            if(task.TaskState== (int)TaskInStatusEnum.InAbnormalCompletion || task.TaskState == (int)TaskOutStatusEnum.OutAbnormalCompletion)
             {
-                case (int)TaskInboundTypeEnum.Inbound:
-                case (int)TaskInboundTypeEnum.InWheels:
-                case (int)TaskInboundTypeEnum.InBrake:
-                    LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍏ュ簱浠诲姟", "");
-                        res = SellectLocationInfo(task,1);
-                    break;
+                var taskHtyNG2 = CreateHistoricalTask(task, true);
 
-                case (int)TaskOutboundTypeEnum.Outbound:
-                case (int)TaskOutboundTypeEnum.OutWheels:
-                    LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍑哄簱浠诲姟", "");
-                        res = SellectLocationInfo(task,2);
-                    break;
+                //if (task.TaskState == (int)TaskInStatusEnum.InNew || task.TaskState == (int)TaskOutStatusEnum.OutNew)
+                //{
+                //    //if(task.TaskType ==  )
+                //}
 
-                case (int)TaskOutboundTypeEnum.OutBrake:
-                    LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍒跺姩鐩樺嚭搴撲换鍔�", "");
-                        res = SellectLocationInfo(task,3);
-                    break;
+                // 娣诲姞鍘嗗彶浠诲姟
+                var isTaskHtyAdd2 = _task_HtyRepository.AddData(taskHtyNG2) > 0;
 
-                case (int)TaskRelocationTypeEnum.Relocation:
-                    if (stock != null)
-                    {
-                        res = SellectLocationInfo(task,4);
-                    }
-                    else 
-                    {
-                        res = SellectLocationInfo(task,5);
-                    }
-                    break;
+                // 鍒犻櫎浠诲姟鏁版嵁
+                var isTaskDelete2 = BaseDal.Delete(task.TaskId);
 
-                default:
-                    return content.Error("浠诲姟绫诲瀷涓嶅瓨鍦�");
+                return content.OK("鍒犻櫎鎴愬姛!");
             }
-
-            if (!res)
+            else
             {
-                return content.Error("鍦ㄦ墽琛屼换鍔″垎绫荤殑鏃跺�欏嚭鐜伴敊璇紒");
+                var stock = _WheelsStockRepository.QueryFirstNavAsync(x => x.Wheels_Num.Contains(task.PalletCode) && x.Wheels_Location == task.SourceAddress);
+                var ZdpStock = _ZdpStockRepository.QueryFirstNavAsync(x => x.Zdp_code == task.PalletCode && x.Zdp_Location == task.SourceAddress);
+                bool res = false;
+                switch (task.TaskType)
+                {
+                    case (int)TaskInboundTypeEnum.Inbound:
+                    case (int)TaskInboundTypeEnum.InWheels:
+                    case (int)TaskInboundTypeEnum.InBrake:
+                        LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍏ュ簱浠诲姟", "");
+                        res = SellectLocationInfo(task, 1);
+                        break;
+
+                    case (int)TaskOutboundTypeEnum.Outbound:
+                    case (int)TaskOutboundTypeEnum.OutWheels:
+                        LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍑哄簱浠诲姟", "");
+                        res = SellectLocationInfo(task, 2);
+                        break;
+
+                    case (int)TaskOutboundTypeEnum.OutBrake:
+                        LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍒跺姩鐩樺嚭搴撲换鍔�", "");
+                        res = SellectLocationInfo(task, 3);
+                        break;
+
+                    case (int)TaskRelocationTypeEnum.Relocation:
+                        if (stock != null)
+                        {
+                            res = SellectLocationInfo(task, 4);
+                        }
+                        else
+                        {
+                            res = SellectLocationInfo(task, 5);
+                        }
+                        break;
+
+                    default:
+                        return content.Error("浠诲姟绫诲瀷涓嶅瓨鍦�");
+                }
+
+                if (!res)
+                {
+                    return content.Error("鍦ㄦ墽琛屼换鍔″垎绫荤殑鏃跺�欏嚭鐜伴敊璇紒");
+                }
             }
+            
 
             var taskHtyNG = CreateHistoricalTask(task, true);
 

--
Gitblit v1.9.3