From 0e860de56fbf7ac66b9563fb946055207f09f9d6 Mon Sep 17 00:00:00 2001
From: lg <999544862qq.com>
Date: 星期四, 15 八月 2024 10:25:43 +0800
Subject: [PATCH] Merge branch 'master' of http://43.142.96.171:8080/r/~tjx/StandardPda

---
 MES.Service/service/Warehouse/MesDepotSectionsManager.cs |   63 +++++++++++++++++++++++++++++++
 1 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/MES.Service/service/Warehouse/MesDepotSectionsManager.cs b/MES.Service/service/Warehouse/MesDepotSectionsManager.cs
new file mode 100644
index 0000000..3a02a02
--- /dev/null
+++ b/MES.Service/service/Warehouse/MesDepotSectionsManager.cs
@@ -0,0 +1,63 @@
+锘縰sing MES.Service.DB;
+using MES.Service.Dto.service;
+using MES.Service.Modes;
+using SqlSugar;
+
+namespace MES.Service.service.Warehouse;
+
+public class MesDepotSectionsManager : Repository<MesDepotSections>
+{
+    //褰撳墠绫诲凡缁忕户鎵夸簡 Repository 澧炪�佸垹銆佹煡銆佹敼鐨勬柟娉�
+
+    public string GetSectionName(WarehouseQuery query)
+    {
+        var sectionName = Db.Queryable<MesDepotSections, MesDepots>((a, b) =>
+                new JoinQueryInfos(JoinType.Inner, a.DepotId == b.DepotId))
+            .Where((a, b) => a.DepotSectionCode == query.sectionCode)
+            .Select((a, b) => a.DepotSectionName).Single();
+
+        if (sectionName == null)
+        {
+            throw new Exception("搴撲綅缂栫爜 " + query.sectionCode + " 涓嶅瓨鍦紝璇风‘璁わ紒");
+        }
+
+        return sectionName;
+    }
+
+    public MesDepotSections ScanInDepotSectionsName(WarehouseQuery query)
+    {
+        
+        if (string.IsNullOrEmpty(query.sectionCode))
+        {
+            throw new Exception("璇锋壂搴撲綅鏉$爜!");
+        }
+        
+        var mesDepotSections = Db.Queryable<MesDepotSections, MesDepots>(
+                (a, b) =>
+                    new JoinQueryInfos(JoinType.Inner, a.DepotId == b.DepotId))
+            .Where((a, b) => a.DepotSectionCode == query.sectionCode)
+            .Select((a, b) => new MesDepotSections
+            {
+                DepotSectionName = a.DepotSectionName,
+                DepotCode = b.DepotCode,
+                DepotName = b.DepotName
+            }).First();
+
+        if (mesDepotSections == null)
+        {
+            throw new Exception("搴撲綅缂栫爜" + query.sectionCode + " 涓嶅瓨鍦紝璇风‘璁�!");
+        }
+
+        return mesDepotSections;
+    }
+
+    public MesInvItemStocks ScanEditBarcode(WarehouseQuery entity)
+    {
+        if (string.IsNullOrEmpty(entity.sectionCode))
+        {
+            throw new Exception("璇锋壂搴撲綅鏉$爜!");
+        }
+
+        return null;
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.3