From 41a1dfc3a2b29c79585f5cb6e7d79cfcdfd044a9 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期四, 24 十月 2024 14:43:50 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/工资管理/Pay_GroupBalBillController.cs |  130 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 130 insertions(+), 0 deletions(-)

diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_GroupBalBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_GroupBalBillController.cs"
index c5ecf76..837b3c5 100644
--- "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_GroupBalBillController.cs"
+++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_GroupBalBillController.cs"
@@ -9,6 +9,7 @@
 using System.Web.Http;
 using WebAPI.Models;
 using System.Windows.Forms;
+using SyntacticSugar.constant;
 
 namespace WebAPI.Controllers
 {
@@ -78,6 +79,75 @@
                 objJsonResult.Message = "鏌ヨ鍒楄〃淇℃伅澶辫触锛�" + e.ToString();
                 objJsonResult.data = null;
                 return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ヨ祫缁撶畻鍗�(闆嗕綋)鍒嗛〉鍒楄〃
+        [Route("Pay_GroupBalBillController/page")]
+        [HttpGet]
+        public json Pay_GroupBalBillPage(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(ModRightNameList, 3, false, user))
+                {
+                    objJsonResult.code = CodeConstant.FAIL;
+                    objJsonResult.count = CountConstant.FAIL;
+                    objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //鍒ゆ柇鏄惁鏈夋煡鐪嬪叏閮ㄧ彮缁勭殑鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_Group_AllQuery", 3, false, user))
+                {
+                    //濡傛灉娌℃湁杩欎釜鏉冮檺
+                    //鏍规嵁鐢ㄦ埛瀵瑰簲鐝粍鐨勫叧绯伙紝杩囨护鏉′欢涓鍔犲彧鏄剧ず瀵瑰簲鐨勭彮缁�
+                    DataSet dsHitemID = oCn.RunProcReturn("exec h_p_Gy_GetSQLGroupByUser '" + user + "'", "h_p_Gy_GetSQLGroupByUser");
+                    string sqlGroupID = DBUtility.ClsPub.isStrNull(dsHitemID.Tables[0].Rows[0]["HBack"]);
+                    if (sqlGroupID == "" || sqlGroupID == null)//濡傛灉娌℃湁缁戝畾鐝粍鍒欒浠栫湅涓嶅埌鎵�鏈�
+                    {
+                        sqlGroupID = "and 1 = 2";
+                    }
+                    sqlGroupID = sqlGroupID.Replace("HitemID", "HGroupID");//鏇挎崲sql璇彞涓殑HitemID
+                    sWhere = sWhere + sqlGroupID;
+                }
+                sWhere = sWhere.Replace("'", "''");
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCn.RunProcReturn("exec h_p_Pay_GroupBalBillList " + page + "," + size + ",''", "h_p_Pay_GroupBalBillList");
+                }
+                else
+                {
+                    ds = oCn.RunProcReturn("exec h_p_Pay_GroupBalBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Pay_GroupBalBillList");
+                }
+
+                //娣诲姞鍒楀悕
+                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
@@ -354,6 +424,66 @@
         }
         #endregion
 
+        #region 宸ヨ祫缁撶畻鍗�(闆嗕綋) 鎵归噺瀹℃牳
+        /// <summary>
+        /// 瀹℃牳/鍙嶅鏍稿伐璧勭粨绠楀崟(闆嗕綋)
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="Type">瀹℃牳(1),鍙嶅鏍�(2)</param>
+        /// <param name="HMaker">瀹℃牳浜�</param>
+        /// <returns></returns>
+        [Route("Pay_GroupBalBillController/CheckAll")]
+        [HttpGet]
+        public object CheckAll(string ids, int Type, string HMaker)
+        {
+            try
+            {
+                //澶勭悊瀛楃涓�
+                if (!string.IsNullOrEmpty(ids))
+                {
+                    long[] idArray = Array.ConvertAll(ids.Split(','), long.Parse);
+                    // 澶勭悊idArray...
+                    oCn.BeginTran();
+                    for (int i = 0; i < idArray.Length; i++)
+                    {
+                        objJsonResult = (json)GetPay_GroupBalBill_Check_Json(idArray[i], Type, HMaker);//瀹℃牳鎵ц
+                        if (objJsonResult.count == 0)
+                        {
+                            oCn.RollBack();
+                            objJsonResult.Message += "绗�" + (i + 1) + "琛屽嚭鐜伴棶棰樻棤娉曠户缁畬鎴�";
+                            return objJsonResult;
+                        }
+                    }
+                    oCn.Commit();
+                }
+                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 宸ヨ祫缁撶畻鍗曪紙闆嗕綋锛� 鍏抽棴/鍙嶅叧闂�
         /// <summary>
         /// 鍏抽棴/鍙嶅叧闂伐璧勭粨绠楀崟锛堥泦浣擄級

--
Gitblit v1.9.1