From 1d521ea0a9dbb49ed018cb0c13455ebdf5c73206 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期三, 08 一月 2025 17:48:42 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/CGGL/Cg_PayableBillController.cs |  252 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 251 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/CGGL/Cg_PayableBillController.cs b/WebAPI/Controllers/CGGL/Cg_PayableBillController.cs
index 319c480..eb29396 100644
--- a/WebAPI/Controllers/CGGL/Cg_PayableBillController.cs
+++ b/WebAPI/Controllers/CGGL/Cg_PayableBillController.cs
@@ -25,6 +25,63 @@
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         DataSet ds;
 
+        #region 搴斾粯鍗曞垎椤靛垪琛�
+        [Route("Cg_PayableBill/page")]
+        [HttpGet]
+        public object Cg_PayableBillPage(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_Cg_PayableBillList " + page + "," + size + ",''", "h_p_Cg_PayableBillList");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec h_p_Cg_PayableBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Cg_PayableBillList");
+                }
+
+                //娣诲姞鍒楀悕
+                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>
         /// 杩斿洖搴旀敹鍗曞垪琛�
@@ -1627,7 +1684,7 @@
                 //}
                 string sql = "select * from h_v_Cg_PayableBillQuerySub where hmainid =  " + hmainid;
 
-                ds = oCN.RunProcReturn(sql + " order by hsubid desc", "h_v_Cg_PayableBillQuerySub");
+                ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_Cg_PayableBillQuerySub");
 
 
                 foreach (DataColumn col in ds.Tables[0].Columns)
@@ -1654,5 +1711,198 @@
             }
         }
         #endregion
+
+        #region 搴斾粯鍗曢渶瑕佹垜瀹℃壒娴佸鎵圭殑
+        [Route("Cg_PayableBill/NeedChecklist")]
+        [HttpGet]
+        public object NeedChecklist(string user, string userid)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+
+                //if (!DBUtility.ClsPub.Security_Log("Cg_PayableBillQuery", 1, false, user))
+                //{
+                //    objJsonResult.code = CodeConstant.FAIL;
+                //    objJsonResult.count = CountConstant.FAIL;
+                //    objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //鎼滅储闇�瑕佸鏍哥殑
+                string sql = "select * from h_v_Cg_PayableBillQuery_NeedCheck where HCheckUserID = '" + userid + "' ORDER BY hmainid DESC,hsubid ASC";
+                ds = oCN.RunProcReturn(sql, "h_v_Cg_PayableBillQuery_NeedCheck");
+                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("Cg_PayableBill/Checkedlist")]
+        [HttpGet]
+        public object Checkedlist(string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+
+                //if (!DBUtility.ClsPub.Security_Log("Cg_PayableBillQuery", 1, false, user))
+                //{
+                //    objJsonResult.code = CodeConstant.FAIL;
+                //    objJsonResult.count = CountConstant.FAIL;
+                //    objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //鎼滅储闇�瑕佸鏍哥殑
+                string sql = "select TOP 1000 * from h_v_Cg_PayableBillQuery_Checked where 椤圭洰瀹℃牳浜� = '" + user + "'" +
+                    " ORDER BY hmainid DESC,hsubid ASC";
+                ds = oCN.RunProcReturn(sql, "h_v_Cg_PayableBillList_Query");
+                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("Cg_PayableBill/CheckAllFlow")]
+        [HttpGet]
+        public object CheckAll(string HInterIDS, int IsAudit, string CurUserName, string CurUserID)
+        {
+            try
+            {
+                //澶勭悊瀛楃涓�
+                if (!string.IsNullOrEmpty(HInterIDS))
+                {
+                    int[] idArray = Array.ConvertAll(HInterIDS.Split(','), int.Parse);
+                    // 澶勭悊idArray...
+                    for (int i = 0; i < idArray.Length; i++)
+                    {
+                        objJsonResult = (json)AuditCg_PayableBill_Flow(idArray[i], IsAudit, CurUserName, CurUserID);//瀹℃牳鎵ц
+                        if (objJsonResult.count == 0)
+                        {
+                            objJsonResult.Message += "绗�" + (i + 1) + "琛屽嚭鐜伴棶棰樻棤娉曠户缁畬鎴�";
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "璇烽�夋嫨姝g‘琛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                objJsonResult.code = CodeConstant.SUCCEED;
+                objJsonResult.count = CountConstant.SUCCEED;
+                objJsonResult.Message = "鎵ц鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "瀹℃牳鎴栧弽瀹℃牳搴斾粯鍗曞け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 搴斾粯鍗� 鎵归噺椹冲洖
+        [Route("Cg_PayableBill/RejectAllCheckFlow")]
+        [HttpGet]
+        public object RejectAllCheckFlow(string HInterIDS, string CurUserID)
+        {
+            try
+            {
+                //澶勭悊瀛楃涓�
+                if (!string.IsNullOrEmpty(HInterIDS))
+                {
+                    int[] idArray = Array.ConvertAll(HInterIDS.Split(','), int.Parse);
+                    // 澶勭悊idArray...
+                    for (int i = 0; i < idArray.Length; i++)
+                    {
+                        objJsonResult = (json)RejectCheckFlow_POOrderBill(idArray[i].ToString(), CurUserID);//瀹℃牳鎵ц
+                        if (objJsonResult.count == 0)
+                        {
+                            objJsonResult.Message += "绗�" + (i + 1) + "琛屽嚭鐜伴棶棰樻棤娉曠户缁畬鎴�";
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "璇烽�夋嫨姝g‘琛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                objJsonResult.code = CodeConstant.SUCCEED;
+                objJsonResult.count = CountConstant.SUCCEED;
+                objJsonResult.Message = "鎵ц鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "椹冲洖搴斾粯鍗曞け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1