From 6a2a02e183b0c0a8b01bebd0452bd0ac0bbed445 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 03 十一月 2025 16:26:34 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/BaseSet/Gy_SourceController.cs |   70 ++++++++++++++++++++++++++++++++++
 1 files changed, 69 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_SourceController.cs b/WebAPI/Controllers/BaseSet/Gy_SourceController.cs
index 0ba8333..988e157 100644
--- a/WebAPI/Controllers/BaseSet/Gy_SourceController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_SourceController.cs
@@ -94,6 +94,62 @@
             }
         }
 
+        #region 鐢熶骇璧勬簮鍒楄〃-鍒嗛〉
+        [Route("Gy_Source/list_byPage")]
+        [HttpGet]
+        public object GetSourceList_byPage(string sWhere, string user, string Organization, int page, int size)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();  //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Gy_Source_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("exec h_p_Gy_SourceList " + page + "," + size + ",'" + Organization + "'," + "''", "h_p_Gy_SourceList");
+                }
+                else
+                {
+                    sWhere = sWhere.Replace("'", "''");
+
+                    ds = oCN.RunProcReturn("exec h_p_Gy_SourceList " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_Gy_SourceList");
+                }
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.list = columnNameList;
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         /// <summary>
         /// 淇濆瓨鐢熶骇璧勬簮
         /// </summary>
@@ -216,6 +272,18 @@
                     }
                     else//缂栬緫鏃跺垽鏂�
                     {
+                        //宸插鏍镐笉鍏佽淇敼
+                        DataSet dss;
+                        dss = oCN.RunProcReturn("select * from Gy_Source where HItemID=" + oItem.HItemID, "Gy_Source");
+                        //鍒ゆ柇鏄惁鍙紪杈�
+                        if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "姝ゅ崟鎹姸鎬佸凡缁忓鏍革紝涓嶅厑璁镐慨鏀癸紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
                         //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
                         string sParent;
                         sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -296,7 +364,7 @@
                 return objJsonResult;
             }
         }
-   
+
         /// <summary>
         /// 鐢熶骇璧勬簮鑾峰彇淇℃伅
         /// </summary>

--
Gitblit v1.9.1