From dc101e87dc0df99cf8c984eeeac7ded48bbb0135 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 16 十二月 2024 09:41:09 +0800
Subject: [PATCH] 器具采购入库单的列表 分页改为 数据库分页;

---
 WebAPI/Controllers/CGGL/YF_PayMentBillController.cs |  146 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 144 insertions(+), 2 deletions(-)

diff --git a/WebAPI/Controllers/CGGL/YF_PayMentBillController.cs b/WebAPI/Controllers/CGGL/YF_PayMentBillController.cs
index e707ccb..c62ac51 100644
--- a/WebAPI/Controllers/CGGL/YF_PayMentBillController.cs
+++ b/WebAPI/Controllers/CGGL/YF_PayMentBillController.cs
@@ -8,6 +8,7 @@
 using System.Data.SqlClient;
 using System.Web.Http;
 using WebAPI.Models;
+using SyntacticSugar.constant;
 
 namespace WebAPI.Controllers
 {
@@ -23,6 +24,62 @@
         private json objJsonResult = new json();
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         DataSet ds;
+
+        #region 浠樻鍗曞垎椤靛垪琛�
+        [Route("YF_PayMentBill/page")]
+        [HttpGet]
+        public object YF_PayMentBillPage(string sWhere, string user, int page, int size)
+        {
+            DataSet ds;
+            json res = new json();
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍒ゆ柇鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log("Kf_POStockInBillList", 1, false, user))
+                //{
+                //    objJsonResult.code = CodeConstant.FAIL;
+                //    objJsonResult.count = CountConstant.FAIL;
+                //    objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                sWhere = sWhere.Replace("'", "''");
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("exec h_p_YF_PayMentBillList_New " + page + "," + size + ",''", "h_p_YF_PayMentBillList_New");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec h_p_YF_PayMentBillList_New " + page + "," + size + ",'" + sWhere + "'", "h_p_YF_PayMentBillList_New");
+                }
+
+                //娣诲姞鍒楀悕
+                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鍒楀璞$殑鍒楀悕
+                }
+
+                res.code = CodeConstant.SUCCEED;
+                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+                res.Message = "Sucess锛�";
+                res.list = columnNameList;
+                res.data = ds.Tables[0];
+                return res;
+            }
+            catch (Exception e)
+            {
+                res.code = CodeConstant.FAIL;
+                res.count = CountConstant.FAIL;
+                res.Message = "Exception锛�" + e.ToString();
+                res.data = null;
+                return res;
+            }
+        }
+        #endregion
 
         #region 浠樻鍗曞垪琛� 鏌ヨ
         /// <summary>
@@ -345,7 +402,7 @@
         {
             try
             {
-                ds = oCN.RunProcReturn("select * from h_v_YF_PayMentBillList where hmainid=" + HInterID, "h_v_YF_PayMentBillList");
+                ds = oCN.RunProcReturn("select * from h_v_YF_PayMentBillEdit where hmainid=" + HInterID, "h_v_YF_PayMentBillList");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -903,7 +960,6 @@
         }
         #endregion
 
-
         #region 浠樻鍗� 浣滃簾/鍙嶄綔搴熷姛鑳�
         [Route("YF_PayMentBill/DropYF_PayMentBill")]
         [HttpGet]
@@ -1050,6 +1106,92 @@
         }
         #endregion
 
+        #region 浠樻鍗曟煡璇㈠垪琛�
+        [Route("YF_PayMentBill/QueryList")]
+        [HttpGet]
+        public object QueryList(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                
+                string sql = "select * from h_v_YF_PayMentBillQuery where 1 = 1 ";
+
+                if (sWhere == "" || sWhere == null)
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_YF_PayMentBillQuery  order by hmainid desc", "h_v_YF_PayMentBillQuery");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn(sql + sWhere + " order by hmainid desc", "h_v_YF_PayMentBillQuery");
+                }
+
+
+
+                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 = CodeConstant.SUCCEED;
+                objJsonResult.count = CountConstant.SUCCEED;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = CodeConstant.FAIL;
+                objJsonResult.count = CountConstant.FAIL;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 浠樻鍗曟煡璇㈠瓙鍒楄〃
+        [Route("YF_PayMentBill/QuerySubList")]
+        [HttpGet]
+        public object QuerySubList(string hmainid, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                
+                string sql = "select * from h_v_YF_PayMentBillQuerySub where hmainid =  " + hmainid;
+
+                ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_YF_PayMentBillQuerySub");
+
+
+                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 = CodeConstant.SUCCEED;
+                objJsonResult.count = CountConstant.SUCCEED;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = CodeConstant.FAIL;
+                objJsonResult.count = CountConstant.FAIL;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region 搴斾粯鍗曢┏鍥�
         [Route("YF_PayMentBill/RejectCheckFlow_POOrderBill")]
         [HttpGet]

--
Gitblit v1.9.1