From 6b74e1dcf5642c8f56975471e27780d695953989 Mon Sep 17 00:00:00 2001
From: 陈勇 <竞男@ASUNA>
Date: 星期日, 26 四月 2026 15:48:01 +0800
Subject: [PATCH] 同步代码

---
 项目代码/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_MesLockInfoService.cs |   87 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 85 insertions(+), 2 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_MesLockInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_MesLockInfoService.cs"
index 245f1c5..72d3b7b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_MesLockInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_MesLockInfoService.cs"
@@ -7,15 +7,22 @@
 using System.Linq.Expressions;
 using WIDESEA_Core;
 using WIDESEA_DTO.Basic;
+using WIDESEA_IStoragIntegrationServices;
 
 namespace WIDESEA_StorageBasicService;
 
 public class VV_MesLockInfoService : ServiceBase<VV_MesLockInfo, IVV_MesLockInfoRepository>, IVV_MesLockInfoService
 {
     private readonly IVV_StockInfoRepository _stockInfoRepository;
-    public VV_MesLockInfoService(IVV_MesLockInfoRepository BaseDal, IVV_StockInfoRepository stockInfoRepository) : base(BaseDal)
+    private readonly IDt_MESLockInfoRepository _MESLockInfoRepository;
+    private readonly IDt_CarBodyInfoRepository _carBodyInfoRepository;
+    private readonly IMESService _MESService;
+    public VV_MesLockInfoService(IVV_MesLockInfoRepository BaseDal, IVV_StockInfoRepository stockInfoRepository, IDt_MESLockInfoRepository MESLockInfoRepository, IDt_CarBodyInfoRepository carBodyInfoRepository, IMESService MESService) : base(BaseDal)
     {
         _stockInfoRepository = stockInfoRepository;
+        _MESLockInfoRepository = MESLockInfoRepository;
+        _carBodyInfoRepository = carBodyInfoRepository;
+        _MESService = MESService;
     }
 
     public WebResponseContent GetMesLockInfo()
@@ -46,7 +53,6 @@
                     carBodyCharacteristic = x.carBodyCharacteristic
                 });
             });
-
             return content.OK(data: mesLockDTOs);
         }
         catch (Exception ex)
@@ -69,4 +75,81 @@
             return content.Error(ex.Message);
         }
     }
+
+    public WebResponseContent MesLock(object[] keys)
+    {
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            List<Dt_CarBodyInfo> bodyInfos = new List<Dt_CarBodyInfo>();
+            List<Dt_MESLockInfo> lockinfo = new List<Dt_MESLockInfo>();
+            foreach (var item in keys)
+            {
+
+            }
+
+            if (!bodyInfos.Any()) throw new Exception("閿佽溅涓婃姤澶辫触:鏃犻攣杞︽暟鎹�");
+
+            var mesLock = _MESLockInfoRepository.QueryFirst(x => x.Id == Convert.ToInt32(keys));
+            mesLock.LockStatue = 3; //寮傚父閿佽溅
+            var carInfo = _carBodyInfoRepository.QueryFirst(x => x.Id == mesLock.carBodyID);
+            if (carInfo != null)
+            {
+                bodyInfos.Add(carInfo);
+                lockinfo.Add(mesLock);
+            }
+
+            WebResponseContent webResponse = _MESService.LockRequest(carInfo, 1);
+            if (webResponse.Status)
+            {
+                _MESLockInfoRepository.UpdateData(lockinfo);
+                content.OK();
+            }
+            else
+            {
+                content.Error();
+            }
+        }
+        catch (Exception ex)
+        {
+            content.Error(ex.Message);
+        }
+        return content;
+    }
+
+    public WebResponseContent MesUnLock(object[] keys)
+    {
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            List<Dt_CarBodyInfo> bodyInfos = new List<Dt_CarBodyInfo>();
+            foreach (var item in keys)
+            {
+
+            }
+
+            if (!bodyInfos.Any()) throw new Exception("閿佽溅涓婃姤澶辫触:鏃犻攣杞︽暟鎹�");
+
+            var mesLock = _MESLockInfoRepository.QueryFirst(x => x.Id == Convert.ToInt32(keys));
+
+            var carInfo = _carBodyInfoRepository.QueryFirst(x => x.Id == mesLock.carBodyID);
+            if (carInfo != null) bodyInfos.Add(carInfo);
+
+            WebResponseContent webResponse = _MESService.LockRequest(carInfo, 1);
+            if (webResponse.Status)
+            {
+                content.OK();
+            }
+            else
+            {
+                content.Error();
+            }
+        }
+        catch (Exception ex)
+        {
+            content.Error(ex.Message);
+        }
+        return content;
+    }
+
 }
\ No newline at end of file

--
Gitblit v1.9.3