From cab67144217d6f42fa63cc8b88a30dd5621f69cb Mon Sep 17 00:00:00 2001
From: cnf <3283105747@qq.com>
Date: 星期一, 15 十二月 2025 16:07:28 +0800
Subject: [PATCH] 修改工单合并查询,增加仓管员读取

---
 WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-shm      |    0 
 WebApi/Gs.Warehouse/Services/MesDepotsManager.cs                              |  109 ++++++++++++++++++++++++------------------------------
 WebApi/Gs.Wom/Service/WomdaaManager.cs                                        |    3 +
 WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-shm |    0 
 WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db     |    0 
 WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db          |    0 
 WebApi/Gs.Wom/Service/WomdaahbManager.cs                                      |    4 +-
 WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-wal      |    0 
 WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-wal |    0 
 9 files changed, 53 insertions(+), 63 deletions(-)

diff --git a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db
index 5fbbedf..7fdf5fc 100644
--- a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db
+++ b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db
Binary files differ
diff --git a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-shm b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-shm
index bea0149..aa6b261 100644
--- a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-shm
+++ b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-shm
Binary files differ
diff --git a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-wal b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-wal
index 9315cc8..99b5852 100644
--- a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-wal
+++ b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-wal
Binary files differ
diff --git a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db
index 82b633a..a982634 100644
--- a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db
+++ b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db
Binary files differ
diff --git a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-shm b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-shm
index 3237d7a..a757a12 100644
--- a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-shm
+++ b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-shm
Binary files differ
diff --git a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-wal b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-wal
index fcfb1d5..ed1690c 100644
--- a/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-wal
+++ b/WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-wal
Binary files differ
diff --git a/WebApi/Gs.Warehouse/Services/MesDepotsManager.cs b/WebApi/Gs.Warehouse/Services/MesDepotsManager.cs
index 3a50b6a..59e1d2e 100644
--- a/WebApi/Gs.Warehouse/Services/MesDepotsManager.cs
+++ b/WebApi/Gs.Warehouse/Services/MesDepotsManager.cs
@@ -1,4 +1,5 @@
 锘縰sing System.Data;
+using System.Data.SqlClient;
 using System.Text;
 using Gs.Entity.BaseInfo;
 using Gs.Entity.Sys;
@@ -401,74 +402,62 @@
     ///     鏌ヨ鍒楄〃锛屾敮鎸佸垎椤碉紙淇濇寔杈撳嚭鍙傛暟鏂瑰紡锛�
     /// </summary>
     [RequestMethod(RequestMethods.POST)]
-    public ReturnDto<PageList<MesStaff>> GetListCgy(PageQuery query)
+    public ReturnDto<PageList<dynamic>> GetListCgy(PageQuery model)
     {
-        var pageList = new PageList<MesStaff>();
+        string currentId = "";//榛樿閲囪喘鍛�
+        int currentPage = model.currentPage;
+        int everyPageSize = model.everyPageSize;
+        string sortName = model.sortName;
+        string keyWhere = model.keyWhere;
+        SqlParameter[] parameters =
+        {
+                new("@inCurrentPage", currentPage),
+                new("@inEveryPageSize", everyPageSize),
+                new("@inSortName", sortName),
+                new("@inSortOrder", ""),
+                new("@inQueryWhere", keyWhere),
+                new("@inFid", ""),
+                new("@inP1", ""),
+                new("@inP2", ""),
+                new("@inP3", ""),
+                new("@inP4", _userGuid)//褰撳墠鐧诲綍鐢ㄦ埛guid锛屽皢鏍规嵁浠栬鍙栦粨绠″憳
+            };
+        var dset = new DataSet();
+        var _pglist = new PageList<dynamic>
+        {
+            total = 0,
+            everyPageSize = 0,
+            pages = 0,
+            list = new List<dynamic>()
+        };
         try
         {
-            // 妫�鏌ュ熀鏈璞�
-            if (query == null) throw new ArgumentNullException(nameof(query));
-            if (Db?.Ado == null) throw new InvalidOperationException("鏁版嵁搴撹繛鎺ヤ笉鍙敤");
-
-            // 瀛樺偍杩囩▼鍙傛暟 - 娉ㄦ剰鐜板湪鏈夎緭鍑哄弬鏁颁簡
-            var parameters = new[]
+            dset = DbHelperSQL.RunProcedure("prc_cgy_lst", parameters, "0");
+            if (dset != null && dset.Tables.Count > 0 &&
+                dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
             {
-        new SugarParameter("@PageIndex", query.currentPage),
-        new SugarParameter("@PageSize", query.everyPageSize),
-        new SugarParameter("@SortField", string.IsNullOrEmpty(query.sortName) ? "staff_no" : query.sortName),
-        new SugarParameter("@SortOrder", string.IsNullOrEmpty(query.sortOrder) ? "DESC" : query.sortOrder),
-        new SugarParameter("@WhereCondition", query.keyWhere ?? ""),
-        new SugarParameter("@Fid", DBNull.Value),
-        new SugarParameter("@P1", DBNull.Value),
-        new SugarParameter("@P2", DBNull.Value),
-        new SugarParameter("@P3", DBNull.Value),
-        new SugarParameter("@P4", DBNull.Value),
-        // 娉ㄦ剰锛氳緭鍑哄弬鏁板繀椤绘寚瀹� ParameterDirection.Output
-        new SugarParameter("@outTotalCount", 0, System.Data.DbType.Int32, ParameterDirection.Output)
-    };
-
-            // 娉ㄦ剰锛氳皟鐢ㄨ鍙ュ繀椤诲寘鍚� OUTPUT 鍏抽敭瀛�
-            var itemsList = Db.Ado.SqlQuery<MesStaff>(
-                "EXEC prc_cgy_lst @PageIndex, @PageSize, @SortField, @SortOrder, @WhereCondition, @Fid, @P1, @P2, @P3, @P4, @outTotalCount OUTPUT",
-                parameters
-            );
-
-            // 鑾峰彇杈撳嚭鍙傛暟 - 绛夊緟鎵ц瀹屾垚鍚庡啀鑾峰彇
-            var totalCountParam = parameters.FirstOrDefault(p => p.ParameterName == "@outTotalCount");
-            if (totalCountParam != null && totalCountParam.Value != null)
-            {
-                try
-                {
-                    // 纭繚鍊兼槸鏁存暟绫诲瀷
-                    var totalCount = Convert.ToInt32(totalCountParam.Value);
-                    pageList = new PageList<MesStaff>(itemsList ?? new List<MesStaff>(), totalCount, query.everyPageSize);
-                    return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Success, "璇诲彇鎴愬姛");
-                }
-                catch (FormatException)
-                {
-                    // 濡傛灉杞崲澶辫触锛屼娇鐢ㄩ粯璁ゅ��
-                    pageList = new PageList<MesStaff>(itemsList ?? new List<MesStaff>(), itemsList?.Count ?? 0, query.everyPageSize);
-                    return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Success, "璇诲彇鎴愬姛锛堟�绘暟鑾峰彇澶辫触锛�");
-                }
+                var intTotal = int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+                var pages = intTotal % everyPageSize != 0
+                    ? intTotal / everyPageSize + 1
+                    : intTotal / everyPageSize;
+                _pglist.total = intTotal;
+                _pglist.everyPageSize = everyPageSize;
+                _pglist.pages = pages;
+                var _dy = dset.Tables[0].TableToDynamicList();
+                _pglist.list = _dy;
+                currentId = dset.Tables[1].Rows[0]["mrCgy"].ToString();
             }
-            else
-            {
-                // 杈撳嚭鍙傛暟涓嶅瓨鍦紝浣跨敤鍒楄〃闀垮害
-                pageList = new PageList<MesStaff>(itemsList ?? new List<MesStaff>(), itemsList?.Count ?? 0, query.everyPageSize);
-                return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Success, "璇诲彇鎴愬姛");
-            }
-        }
-        catch (ArgumentNullException argEx)
-        {
-            return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Default, $"鍙傛暟閿欒: {argEx.Message}");
-        }
-        catch (InvalidOperationException opEx)
-        {
-            return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Default, $"鎿嶄綔閿欒: {opEx.Message}");
         }
         catch (Exception ex)
         {
-            return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Default, $"绯荤粺閿欒: {ex.Message}");
+            LogHelper.Debug(ToString(), ex.Message);
+            return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+          ReturnCode.Exception,"-1");
         }
+
+        return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+            ReturnCode.Success, currentId);
+
+
     }
 }
\ No newline at end of file
diff --git a/WebApi/Gs.Wom/Service/WomdaaManager.cs b/WebApi/Gs.Wom/Service/WomdaaManager.cs
index 9f83ac7..05c7cef 100644
--- a/WebApi/Gs.Wom/Service/WomdaaManager.cs
+++ b/WebApi/Gs.Wom/Service/WomdaaManager.cs
@@ -600,6 +600,7 @@
         string keyWhere = model.keyWhere;
         string workId = model.workId;
         string lineId = model.lineId;
+        string cgyId = model.cgyId;
         var dset = new DataSet();
         try
         {
@@ -618,7 +619,7 @@
                         new("@inQueryWhere", keyWhere),
                         new("@workId", workId),
                         new("@inP1", lineId),
-                        new("@inP2", "")
+                        new("@inP2", cgyId)
                     };
                     foreach (var parameter in parameters)
                         cmd.Parameters.Add(parameter);
diff --git a/WebApi/Gs.Wom/Service/WomdaahbManager.cs b/WebApi/Gs.Wom/Service/WomdaahbManager.cs
index 98840c8..2636877 100644
--- a/WebApi/Gs.Wom/Service/WomdaahbManager.cs
+++ b/WebApi/Gs.Wom/Service/WomdaahbManager.cs
@@ -146,7 +146,7 @@
         string bz = model.bz; //澶囨敞
         string cjId = model.cjId; //杞﹂棿
         string xtId = model.xtId;
-        string cxId = ""; //浜х嚎,鐢ㄤ笉鍒颁簡
+        string cgyId = model.cgyId; //浠撶鍛�
         string jhrs = ""; //璁″垝浜烘暟,鐢ㄤ笉鍒颁簡
         var _sb = new StringBuilder();
         var _split = "|";
@@ -194,7 +194,7 @@
                         new("@inBz", bz),
                         new("@inCjId", cjId),
                         new("@inLineId", xtId),
-                        new("@inJhrs", jhrs),
+                        new("@inCgyId", cgyId),
                         new("@inEdtUserGuid", _userGuid),
                         new("@inLineList", _sb.ToString())
                     };

--
Gitblit v1.9.3