From c33a7f5ea8310813b82b3d5118e5dc444a990bc2 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 10 四月 2026 14:48:31 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs"
index 5c7d346..71c5c1c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs"
@@ -32,10 +32,8 @@
             try
             {
                 Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(FOURBOTnewMovePodTask)) ?? throw new Exception("鏈壘鍒板洓鍚戣溅浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
-                int i = 0;
                 foreach (var task in tasks)
                 {
-                    i++;
                     fOURBOTnewMovePodTask = new()
                     {
                         priority = task.Grade,
@@ -65,11 +63,16 @@
                         task.RGVTaskId = fOURBO.taskID;
                         task.ExceptionMessage = "";
                         task.TaskState = (int)TaskStatusEnum.Execut;
-                        task.Dispatchertime=DateTime.Now;
+                        task.Dispatchertime = DateTime.Now;
                     }
                     catch (Exception ex)
                     {
                         task.ExceptionMessage = ex.Message;
+                        content.Error(ex.Message);
+                    }
+                    finally
+                    {
+                        _trackloginfoService.AddTrackLog(fOURBOTnewMovePodTask, content, "涓嬪彂鍥涘悜杞︽柊寤哄叆搴撲换鍔�", "", "");
                     }
                 }
                 var uptasks = tasks.Where(task => string.IsNullOrEmpty(task.ExceptionMessage)).ToList();
@@ -79,6 +82,7 @@
                 {
                     foreach (var item in errortasks)
                     {
+                        Thread.Sleep(500);
                         _taskService.ErrorTaskFeedback(item, true);
                     }
                 }
@@ -87,10 +91,6 @@
             catch (Exception ex)
             {
                 content.Error(ex.Message);
-            }
-            finally
-            {
-                _trackloginfoService.AddTrackLog(fOURBOTnewMovePodTask, content, "涓嬪彂鍥涘悜杞︽柊寤哄叆搴撲换鍔�", "", "");
             }
         }
 
@@ -183,6 +183,8 @@
                 };
                 requestData = request;  // 淇濆瓨璇锋眰鏁版嵁鐢ㄤ簬鏃ュ織
                 //content.candidatePodIDs = tasks.Select(x => x.PalletCode).ToList();
+                //string response = HttpHelper.Post("http://127.0.0.1:4523/m2/6165241-5857331-default/440906899?apifoxApiId=440906899", request.Serialize());
+
                 string response = HttpHelper.Post(apiInfo.ApiAddress, request.Serialize());
                 FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
                 content.OK(data: fOURBOTReturn);
@@ -300,12 +302,12 @@
                                 locationsToUpdate.Add(rGVLocationInfo);
 
                                 #region 閲婃斁鍏ュ簱绔欏彴
-                                //var stationManger = _stationMangerService.GetInStationInfo(item.SourceAddress);
-                                //if (stationManger != null)
-                                //{
-                                //    stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt();
-                                //    stationsToUpdate.Add(stationManger);
-                                //}
+                                var stationManger = _stationMangerService.GetInStationInfo(item.SourceAddress);
+                                if (stationManger != null)
+                                {
+                                    stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt();
+                                    stationsToUpdate.Add(stationManger);
+                                }
                                 content.OK();
                                 #endregion
                             }
@@ -412,8 +414,8 @@
                             _taskService.UpdateData(tasksToUpdate);
                         if (locationsToUpdate.Any())
                             _rGVLocationInfoService.UpdateData(locationsToUpdate);
-                        //if (stationsToUpdate.Any())
-                        //    _stationMangerService.UpdateData(stationsToUpdate);
+                        if (stationsToUpdate.Any())
+                            _stationMangerService.UpdateData(stationsToUpdate);
 
                         _unitOfWorkManage.CommitTran();
                     }
@@ -608,7 +610,7 @@
             {
                 foreach (var item in tasks)
                 {
-                    var takes = _taskService.Repository.QueryFirst(x => x.Roadway == item.Roadway && x.TaskType == (int)TaskTypeEnum.CPMoveInventory);
+                    var takes = _taskService.Repository.QueryFirst(x => x.Roadway == item.Roadway && x.TaskType == (int)TaskTypeEnum.CPMoveInventory && (x.TaskState == (int)TaskStatusEnum.RGV_NewMoveTask || x.TaskState == (int)TaskStatusEnum.RGV_MoveTaskSend));
                     if (takes == null)
                     {
                         item.TaskState = (int)TaskStatusEnum.RGV_WaitSend;

--
Gitblit v1.9.3