From c944d37fcf25d9c217949a171fde868078049f02 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期二, 20 五月 2025 16:32:09 +0800
Subject: [PATCH] 修改设置检修权限接口

---
 project/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs |   88 ++++++++++++++++++++++++++++++++------------
 1 files changed, 64 insertions(+), 24 deletions(-)

diff --git a/project/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs b/project/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs
index 0c52ddb..a6a16eb 100644
--- a/project/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs
+++ b/project/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs
@@ -5,6 +5,7 @@
 using System.Text;
 using System.Threading.Tasks;
 using AutoMapper;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
 using SqlSugar;
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.BaseRepository;
@@ -255,6 +256,68 @@
         }
 
 
+        /// <summary>
+        /// 鑾峰彇褰撳墠绋嬪簭鏈�鏂扮殑浼哥缉鏉嗛�熷害
+        /// </summary>
+        /// <returns></returns>
+        public WebResponseContent BackfillSpeed()
+        {
+            try
+            {
+                if (!int.TryParse(AppSettings.Get("DepartmentID"), out int deid))
+                {
+                    return new WebResponseContent { Status = false, Message = "閰嶇疆椤� DepartmentID 鏃犳硶杞崲涓烘暣鏁�" };
+
+                }
+                var para = BaseDal.QueryData().Where(x => x.Deptid == deid).OrderByDescending(x => x.CreateDate).FirstOrDefault();
+                if (para == null)
+                {
+                    return new WebResponseContent { Message = "浣犺繕娌℃湁閰嶇疆閫熷害" };
+                }
+                return new WebResponseContent { Status = true, Data = para };
+            }
+            catch (Exception ex)
+            {
+
+                return new WebResponseContent { Status = false, Message = ex.Message };
+            }
+        }
+
+        /// <summary>
+        /// 鑾峰彇褰撳墠浼哥缉鏉嗙殑浣嶇疆(鑷姩)
+        /// </summary>
+        /// <param name="ExtendedState"></param>
+        /// <returns></returns>
+        public WebResponseContent CurrentLocation()
+        {
+            try
+            {
+                if (!int.TryParse(AppSettings.Get("DepartmentID"), out int deid))
+                {
+                    return new WebResponseContent { Status = false, Message = "閰嶇疆椤� DepartmentID 鏃犳硶杞崲涓烘暣鏁�" };
+
+                }
+                var devices = GetDevicesByDeptId(deid);
+                
+            
+                    var deviceslift = devices.Value.left.Communicator.Read<float>("D80");
+                    var devicesright = devices.Value.right.Communicator.Read<float>("D80");
+                    Console.WriteLine($"褰撳墠宸﹀彸浼哥缉鏉嗚繑鍥為�熷害鍒嗗埆涓轰负{deviceslift}");
+             
+
+                return new WebResponseContent
+                {
+                    Status = true,
+                    Data = new { lift = deviceslift, Right = devicesright }
+                };
+                }
+            catch (Exception ex)
+            {
+
+                return new WebResponseContent { Status = false, Message = ex.Message };
+            }
+        }
+
 
         /// <summary>
         /// 鑾峰彇璁惧鍙�
@@ -277,30 +340,7 @@
             return (left, right);
         }
 
-
-
-        public WebResponseContent BackfillSpeed()
-        {
-            try
-            {
-                if (!int.TryParse(AppSettings.Get("DepartmentID"), out int deid))
-                {
-                    return new WebResponseContent { Status = false, Message = "閰嶇疆椤� DepartmentID 鏃犳硶杞崲涓烘暣鏁�" };
-
-                }
-                var para = BaseDal.QueryData().Where(x => x.Deptid == deid).OrderByDescending(x => x.CreateDate).FirstOrDefault();
-                if (para==null)
-                {
-                    return new WebResponseContent { Message = "浣犺繕娌℃湁閰嶇疆閫熷害" };
-                }
-                return new WebResponseContent { Status = true, Data = para };
-            }
-            catch (Exception ex)
-            {
-
-                return new WebResponseContent { Status = false, Message = ex.Message };
-            }
-        }
+      
 
      
     }

--
Gitblit v1.9.3