From 29c58a44a8f725637e7b18fbfc2dc826ba430561 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期五, 19 九月 2025 23:15:22 +0800
Subject: [PATCH] 1.委外领料申请(未完成) 2.物料分区

---
 service/Wom/WwGdManager.cs |   78 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 78 insertions(+), 0 deletions(-)

diff --git a/service/Wom/WwGdManager.cs b/service/Wom/WwGdManager.cs
index 0abca21..f21d841 100644
--- a/service/Wom/WwGdManager.cs
+++ b/service/Wom/WwGdManager.cs
@@ -192,6 +192,33 @@
         return result;
     }
 
+
+
+    /// <summary>
+    /// 閫夊彇鍒楄〃
+    /// </summary>
+    /// <param name="unity"></param>
+    /// <param name="RequestInfo"></param>
+    /// <returns></returns>
+    public dynamic GetWWCKsq(dynamic unity, dynamic RequestInfo)
+    {
+        var orgId = RequestInfo.OrgId;
+        var parameters = new List<SugarParameter>
+        {
+            new SugarParameter("@pi_selectKey", unity.selectKey),
+            new SugarParameter("@pi_type", unity.type), // 鍙�夊弬鏁�
+            new SugarParameter("@pi_orgId", orgId), // 鍙�夊弬鏁�
+            new SugarParameter("@inP1", null), // 鍙�夊弬鏁�
+            new SugarParameter("@inP2", null), // 鍙�夊弬鏁�
+            new SugarParameter("@inP3", null), // 鍙�夊弬鏁�
+            new SugarParameter("@inP4", null), // 鍙�夊弬鏁�
+            // ...鍏朵粬鍙�夊弬鏁�
+        };
+        var result = Db.Ado.SqlQuery<dynamic>("EXEC prc_pda_wwcksq_list @pi_selectKey, @pi_type, @pi_orgId , @inP1, @inP2, @inP3, @inP4", parameters);
+        return result;
+    }
+
+
     /// <summary>
     /// 鍒楄〃鏄庣粏
     /// </summary>
@@ -245,6 +272,57 @@
         }
     }
 
+    /// <summary>
+    /// 濮斿鍑哄簱鐢宠鍗曞彿鑾峰彇鏄庣粏
+    /// </summary>
+    /// <param name="query"></param>
+    /// <param name="RequestInfo"></param>
+    /// <returns></returns>
+    /// <exception cref="Exception"></exception>
+    /// <exception cref="ArgumentNullException"></exception>
+    /// <exception cref="ArgumentException"></exception>
+    public dynamic GetItemsByWwckNo(WarehouseQuery query, dynamic RequestInfo)
+    {
+        if (string.IsNullOrEmpty(query.daa001)) throw new Exception("璇烽�夊伐鍗曞彿锛�");
+        if (query == null)
+            throw new ArgumentNullException(nameof(query), "鍙傛暟瀵硅薄涓嶈兘涓簄ull");
+        if (string.IsNullOrEmpty(query.daa001?.ToString()))
+            throw new ArgumentException("宸ュ崟鍙蜂笉瀛樺湪", nameof(query.daa001));
+
+        var orgId = RequestInfo.OrgId;
+        if (orgId == null)
+            throw new Exception("缁勭粐涓嶅瓨鍦紒");
+
+        var parameters = new[]
+        {
+            new SugarParameter("@daa001", query.daa001),
+            new SugarParameter("@pi_orgId", orgId),
+            new SugarParameter("@inP1", null),
+            new SugarParameter("@inP2", null),
+            new SugarParameter("@inP3", null),
+            new SugarParameter("@inP4", null)
+        };
+        try
+        {
+            List<dynamic>? blDetails = Db.Ado.SqlQuery<dynamic>(
+                "EXEC prc_pda_wwll_detailList @daa001,@pi_orgId,@inP1,@inP2,@inP3,@inP4", parameters);
+            var items = blDetails.Where(x => x.DSQty > 0).ToList();    // 寰呮壂鐗╂枡
+            var ysitems = blDetails.Where(x => x.SQty > 0).ToList();   // 宸叉壂鐗╂枡
+            var planNo = blDetails.FirstOrDefault()?.ErpProductionOrderNo?.ToString();// 鑾峰彇宸ュ崟璁″垝鍙�
+            return new
+            {
+                daa001 = query.daa001,
+                PlanNo = planNo,
+                items = items,
+                ysitems = ysitems
+            };
+        }
+        catch (Exception ex)
+        {
+            throw new Exception($"{ex.Message}");
+        }
+    }
+
     #region 濮斿閫�鏂�
 
     /// <summary>

--
Gitblit v1.9.3