From c570f80289bd9b04f02b861f2a91d47b3e1aec72 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <1247017146@qq.com>
Date: 星期三, 21 五月 2025 09:16:13 +0800
Subject: [PATCH] 1

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/AGVService.cs |  122 +++++++++++++++++++++++++++++++++-------
 1 files changed, 100 insertions(+), 22 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/AGVService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/AGVService.cs"
index ed96e28..3c643e1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/AGVService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/AGVService.cs"
@@ -319,30 +319,108 @@
                 return content.Error(ex.Message);
             }
         }
-        //public WebResponseContent Add()
-        //{
-        //    try
-        //    {
-        //        var x = BaseDal.GetTaskNo().Result;
+        public WebResponseContent RequestOutTask(string PalletCode, string SourceAddress, string TargetAddress)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                //var tasks = BaseDal.QueryFirst(x => x.PalletCode == PalletCode);
+                //if (tasks != null)
+                //{
+                //    return content.Error("璇ユ墭鐩樺凡瀛樺湪浠诲姟");
+                //}
+                Dt_Task newTask = new Dt_Task()
+                {
+                    TaskNum = BaseDal.GetTaskNo().Result,
+                    SourceAddress = SourceAddress,
+                    CurrentAddress = SourceAddress,
+                    TargetAddress = TargetAddress,
+                    NextAddress = TargetAddress,
+                    Grade = 1,
+                    PalletCode = PalletCode,
+                    TaskType = (int)TaskOutboundTypeEnum.Outbound,
+                    TaskState = (int)TaskOutStatusEnum.OutNew,
+                    Dispatchertime = DateTime.Now,
+                    SeqNo = Convert.ToInt32(1),
+                    CommandID = Convert.ToInt32(101)
+                };
+                task_call task_Call = new task_call()
+                {
+                    d_task_type = newTask.TaskType == (int)TaskTypeEnum.Inbound ? 1 : 2,
+                    d_floor = 1,
+                    d_involed1 = newTask.SourceAddress,
+                    d_involed2 = newTask.TargetAddress,
+                    d_involed5 = newTask.TaskNum,
+                };
+                SqlSugarHelper.DbAGV.Insertable(task_Call).ExecuteCommand();
+                return content.OK();
 
-        //        task_call task_Call = new task_call()
-        //        {
-        //            d_task_type = 1,
-        //            d_floor = 1,
-        //            d_involed1 = "480101",
-        //            d_involed2 = "B001::1",
-        //            d_involed5 = x,
-        //        };
-        //        var y=SqlSugarHelper.DbAGV.Insertable(task_Call).ExecuteCommand();
-        //        return WebResponseContent.Instance.OK(data: y);
-        //    }
-        //    catch (Exception ex)
-        //    {
-        //        return WebResponseContent.Instance.Error(ex.Message);
-        //    }
-        //}
+            }
+            catch (Exception ex)
+            {
+                return content.Error(ex.Message);
+            }
+        }
+
+        public WebResponseContent InTask(string PalletCode, string SourceAddress, string TargetAddress)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                Dt_Task newTask = new Dt_Task()
+                {
+                    TaskNum = BaseDal.GetTaskNo().Result,
+                    SourceAddress = SourceAddress,
+                    TargetAddress = TargetAddress,
+                    PalletCode = PalletCode,
+                    TaskType = (int)TaskInboundTypeEnum.Inbound,
+                    TaskState = (int)TaskInStatusEnum.InNew,
+                    Dispatchertime = DateTime.Now,
+                    SeqNo = Convert.ToInt32(1),
+                    CommandID = Convert.ToInt32(101)
+                };
+                task_call task_Call = new task_call()
+                {
+                    d_task_type = newTask.TaskType == (int)TaskTypeEnum.Inbound ? 1 : 2,
+                    d_floor = 1,
+                    d_involed1 = newTask.SourceAddress,
+                    d_involed2 = newTask.TargetAddress,
+                    d_involed5 = newTask.TaskNum,
+                };
+                SqlSugarHelper.DbAGV.Insertable(task_Call).ExecuteCommand();
+                return content.OK();
+            }
+            catch (Exception ex)
+            {
+                return content.Error(ex.Message);
+            }
+        }
+        public WebResponseContent GetAGVStatus()
+        {
+            try
+            {
+                var x = _Socket.GetAGVStatus();
+                return WebResponseContent.Instance.OK(data: x);
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+        public WebResponseContent GetStationStatus(string StationName)
+        {
+            try
+            {
+                var x = _Socket.GetStationStatus(StationName);
+                return WebResponseContent.Instance.OK(data: x);
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
         #endregion 澶栭儴鎺ュ彛鏂规硶
 
-        
+
     }
 }

--
Gitblit v1.9.3