From cba2c0ff983f40757aa9840a3bd520c28a9896d9 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期三, 15 四月 2026 17:37:10 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/RuiShengZhiNeng/GaoPuLiTiKu

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs |   76 +++++++++++++++++++++++--------------
 1 files changed, 47 insertions(+), 29 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
index efd9545..24a178f 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
@@ -1,6 +1,7 @@
 锘縰sing Autofac.Core;
 using Magicodes.IE.Core;
 using NetTaste;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -84,7 +85,7 @@
                                 task.TaskState = (int)TaskStatusEnum.HktransportIng;
                                 BaseDal.UpdateData(task);
                             }
-                            else
+                            else if (task.TaskState == (int)TaskStatusEnum.Execut)
                             {
                                 task.TaskState = (int)TaskStatusEnum.Takeing;
                                 TaskFeedback(task, 1);
@@ -293,7 +294,7 @@
                             break;
                         case "leavelift": //绂诲紑鐢垫
                             {
-                                if (task.TaskType == (int)TaskTypeEnum.Q3RK || task.TaskType == (int)TaskTypeEnum.MOVE || task.TaskType == (int)TaskTypeEnum.F01|| task.TaskType == (int)TaskTypeEnum.Q3CK)
+                                if (task.TaskType == (int)TaskTypeEnum.Q3RK || task.TaskType == (int)TaskTypeEnum.MOVE || task.TaskType == (int)TaskTypeEnum.F01 || task.TaskType == (int)TaskTypeEnum.Q3CK)
                                 {
                                     task.TaskState = TaskStatusEnum.HKleavelift.ObjToInt();
                                     BaseDal.UpdateData(task);
@@ -316,31 +317,40 @@
                     var task = BaseDal.QueryFirst(x => x.PalletCode == Rgv.content.podID);
                     if (task == null) throw new Exception($"鏈壘鍒颁换鍔�,浠诲姟缂栧彿銆恵Rgv.content.taskID}銆�");
                     //绉诲簱
-                    if (task.TaskType == TaskTypeEnum.CPMoveInventory.ObjToInt() && Rgv.messageType == 10 && Rgv.content.status == 4)
+                    if (task.TaskType == TaskTypeEnum.CPMoveInventory.ObjToInt())
                     {
-                        deviceName += "绉诲簱";
-                        WMSMoveLocationFeedback wMSMoveLocationFeedback = new WMSMoveLocationFeedback()
+                        if (Rgv.messageType == 72)
                         {
-                            containerCode = task.PalletCode,
-                            fromStationCode = task.SourceAddress,
-                            toLocationCode = task.TargetAddress
-                        };
-                        Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(WMSMoveLocationFeedback));
-                        WMSReturn agvContent = null;
-                        if (apiInfo == null) task.ExceptionMessage = "鏈壘鍒扮Щ搴撳畬鎴愬弽棣圵MS鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�";
-                        else
+                            task.TaskState = TaskStatusEnum.TakeFinish.ObjToInt();
+                            BaseDal.UpdateData(task);
+                            UpdateLocationStatus(task.SourceAddress, task.PalletCode, deviceTypeEnum, LocationStatusEnum.Free);
+                        }
+                        if (Rgv.messageType == 10 && Rgv.content.status == 4)
                         {
-                            task.TaskState = TaskStatusEnum.Finish.ObjToInt();
-                            string response = HttpHelper.Post(apiInfo.ApiAddress, wMSMoveLocationFeedback.Serialize());
-                            agvContent = response.DeserializeObject<WMSReturn>();
-                            content.OK(data: agvContent);
-                            if (agvContent.code != 200)
+                            deviceName += "绉诲簱";
+                            WMSMoveLocationFeedback wMSMoveLocationFeedback = new WMSMoveLocationFeedback()
                             {
-                                task.ExceptionMessage = agvContent.message;
-                                content.Error(agvContent.message);
+                                containerCode = task.PalletCode,
+                                fromStationCode = task.SourceAddress,
+                                toLocationCode = task.TargetAddress
+                            };
+                            Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(WMSMoveLocationFeedback));
+                            WMSReturn agvContent = null;
+                            if (apiInfo == null) task.ExceptionMessage = "鏈壘鍒扮Щ搴撳畬鎴愬弽棣圵MS鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�";
+                            else
+                            {
+                                task.TaskState = TaskStatusEnum.Finish.ObjToInt();
+                                string response = HttpHelper.Post(apiInfo.ApiAddress, wMSMoveLocationFeedback.Serialize());
+                                agvContent = response.DeserializeObject<WMSReturn>();
+                                content.OK(data: agvContent);
+                                if (agvContent.code != 200)
+                                {
+                                    task.ExceptionMessage = agvContent.message;
+                                    content.Error(agvContent.message);
+                                }
+                                UpdateLocationStatus(task.TargetAddress, task.PalletCode, deviceTypeEnum, LocationStatusEnum.InStock);
+                                BaseDal.DeleteAndMoveIntoHty(task, OperateTypeEnum.鑷姩瀹屾垚);
                             }
-                            UpdateLocationStatus(task.TargetAddress, task.PalletCode, deviceTypeEnum, LocationStatusEnum.InStock);
-                            BaseDal.DeleteAndMoveIntoHty(task, OperateTypeEnum.鑷姩瀹屾垚);
                         }
                     }
                     else
@@ -396,16 +406,24 @@
                             {
                                 task.ExceptionMessage = Rgv.content.errorReason;
                                 var Error = _taskErrorMessageService.Repository.QueryFirst(x => x.ErrorCode == Rgv.content.errorCode && x.DeviceType == (int)deviceTypeEnum);
-                                if (Error != null)
+                                if (task.TaskType == (int)TaskTypeEnum.CPOutbound && task.TaskState == (int)TaskStatusEnum.Execut && Rgv.content.errorCode == 1330003)//鎴愬搧鍑哄簱浠诲姟涓嬪彂鍚庡弽棣堟湁闃荤鎵橈紝淇敼浠诲姟鐘舵�佷负鏂板缓閲嶆柊鏌ヨ闃荤鎵樺叧绯�
                                 {
-                                    task.ExceptionMessage = Error.ExceptionMessage;
-                                    MatchCollection matches = Regex.Matches(Rgv.content.errorReason, @"\(([^)]+)\)");
-                                    if (matches.Count > 0)
-                                        task.ExceptionMessage = ReplacePlaceholders(Rgv.content.errorReason, Error.ExceptionMessage);
-                                    ErrorTaskFeedback(task, true, Error.ErrorCode.ToString());
+                                    task.TaskState = (int)TaskStatusEnum.New;
+                                    BaseDal.UpdateData(task);
                                 }
                                 else
-                                    ErrorTaskFeedback(task, true);
+                                {
+                                    if (Error != null)
+                                    {
+                                        task.ExceptionMessage = Error.ExceptionMessage;
+                                        MatchCollection matches = Regex.Matches(Rgv.content.errorReason, @"\(([^)]+)\)");
+                                        if (matches.Count > 0)
+                                            task.ExceptionMessage = ReplacePlaceholders(Rgv.content.errorReason, Error.ExceptionMessage);
+                                        ErrorTaskFeedback(task, true, Error.ErrorCode.ToString());
+                                    }
+                                    else
+                                        ErrorTaskFeedback(task, true);
+                                }
                             }
                         }
                     }

--
Gitblit v1.9.3