From daea1a90c2fa1b5cc2f52e62be15bd95cc4155f6 Mon Sep 17 00:00:00 2001
From: Tiandele <tiandele@hnkhzn.com>
Date: 星期五, 20 三月 2026 17:16:04 +0800
Subject: [PATCH] 优化手动锁车逻辑

---
 项目代码/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_StockInfoService.cs |   47 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 46 insertions(+), 1 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_StockInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_StockInfoService.cs"
index 27ef51c..4e7c8c2 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_StockInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_StockInfoService.cs"
@@ -11,8 +11,53 @@
 
 public class VV_StockInfoService : ServiceBase<VV_StockInfo, IVV_StockInfoRepository>, IVV_StockInfoService
 {
-    public VV_StockInfoService(IVV_StockInfoRepository BaseDal) : base(BaseDal)
+	private readonly IDt_PalletStockInfoRepository _repository;
+    public VV_StockInfoService(IVV_StockInfoRepository BaseDal, IDt_PalletStockInfoRepository repository) : base(BaseDal)
     {
+        _repository = repository;
     }
 
+    public WebResponseContent stockLock(object[] keys)
+    {
+		WebResponseContent content = new WebResponseContent();
+		try
+		{
+			foreach (var item in keys)
+			{
+				var stock = _repository.QueryFirst(x => x.Id == Convert.ToInt32(item));
+                if (stock.LockOrder != 1){
+                    stock.StockStatus = 1;
+                    _repository.UpdateData(stock);
+                }
+
+            }
+			return content.OK("閿佸畾鎴愬姛!");
+		}
+		catch (Exception e)
+		{
+			return content.Error(e.Message);
+		}
+
+    }
+
+    public WebResponseContent stockUnLock(object[] keys)
+    {
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            foreach (var item in keys)
+            {
+                var stock = _repository.QueryFirst(x => x.Id == Convert.ToInt32(item));
+                stock.StockStatus = 0;
+                _repository.UpdateData(stock);
+
+            }
+            return content.OK("瑙i攣鎴愬姛!");
+        }
+        catch (Exception e)
+        {
+            return content.Error(e.Message);
+        }
+
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3