From 7086c88c6c080aa9ff15664c5c97aee7bbcdc55b Mon Sep 17 00:00:00 2001
From: wankeda <Administrator@DESKTOP-HAU3ST3>
Date: 星期三, 05 三月 2025 16:56:11 +0800
Subject: [PATCH] 阻焊仓堆垛机对接

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs"
index a56bf1b..f1f81ec 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs"
@@ -11,6 +11,7 @@
 using WIDESEAWCS_Model.Models;
 using static Dm.net.buffer.ByteArrayBuffer;
 using WIDESEAWCS_QuartzJob;
+using WIDESEAWCS_DTO.Agv;
 
 namespace WIDESEAWCS_Tasks
 {
@@ -46,7 +47,7 @@
                             }
                         },
                             TaskCode = agvTask.AgvTaskNum,
-                            PodTyp = agvTask.PalletType < 3 ? "XX" : "DD",
+                            PodTyp = agvTask.PalletType < 3 ? "ZC" : "DX",
                         };
                         WebResponseContent content = _taskService.AgvSendTask(taskDTO);
                         if (content.Status)
@@ -71,6 +72,24 @@
                     }
                 }
                 _taskService.UpdateData(newTasks);
+                //鍑哄簱缁戝畾鏌ヨ
+                Dt_Task outBound = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.Exception.ObjToInt() && nameof(AGV_CSJJob).Contains(x.DeviceCode) && x.TaskType==TaskTypeEnum.Outbound.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x=>x.CreateDate).First();
+                if (outBound != null)
+                {
+                    AgvPodBerthAndMatDTO andMatDTO = new AgvPodBerthAndMatDTO()
+                    {
+                        ReqCode = Guid.NewGuid().ToString().Replace("-", ""),
+                        PositionCode=outBound.TargetAddress
+                    };
+                    WebResponseContent content = _taskService.AgvPodBerthAndMat(andMatDTO);
+                    if (content.Status)
+                    {
+                        outBound.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt();
+                        outBound.ExceptionMessage = "";
+                        //agvTask.Remark = content.Data.ObjToString();
+                        _taskService.UpdateTask(outBound, TaskStatusEnum.AGV_Execute);
+                    }
+                }
             }
             catch (Exception ex)
             {

--
Gitblit v1.9.3