From c4b7483bb96d813e4f2f4bccf8bbfe89f3f9b08c Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期日, 29 十二月 2024 10:54:44 +0800
Subject: [PATCH] 更新

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index f7e3c24..7414c6e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -152,6 +152,7 @@
                     }
                     Dt_Task task = _mapper.Map<Dt_Task>(item);
                     task.Creater = "WMS";
+                    task.AgvTaskNum = "AGV-" + item.TaskNum;
                     task.TaskState = (int)TaskStatusEnum.New;
                     task.CurrentAddress = item.SourceAddress;
 
@@ -186,7 +187,7 @@
                     }
                     else
                     {
-                        if(item.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
+                        if (item.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                         {
                             List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.NextPosi);
                             if (routers.FirstOrDefault() == null)
@@ -197,6 +198,7 @@
 
                             task.NextAddress = router?.StartPosi ?? "";
                             task.DeviceCode = item.RoadWay;
+                            task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
                         }
                         else
                         {
@@ -206,9 +208,16 @@
                                 return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢遍厤缃俊鎭�");
                             }
                             router = routers.FirstOrDefault();
+                            string stationCode = router?.NextPosi ?? "";
+                            Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == stationCode);
+                            if (stationManger == null)
+                            {
+                                return WebResponseContent.Instance.Error($"鏈壘鍒扮珯鍙伴厤缃俊鎭�");
+                            }
 
-                            task.NextAddress = router?.NextPosi ?? "";
+                            task.NextAddress = stationManger?.AGVStationCode ?? "";
                             task.DeviceCode = "AGV";
+                            task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt();
                         }
                     }
 

--
Gitblit v1.9.3