From e11e9f587dd58f06df076b4b95141d50019e0ba0 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 18 十一月 2024 16:38:08 +0800
Subject: [PATCH] 钉钉OA导入异常工时单

---
 WebAPI/Controllers/WebAPIController.cs |  105 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 103 insertions(+), 2 deletions(-)

diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index f9ff323..ece6a5d 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -1537,6 +1537,52 @@
         }
 
         /// <summary>
+        /// 鑾峰彇鐝粍鍒楄〃  鏍规嵁鐢ㄦ埛瀵瑰簲鐝粍鍏崇郴锛岃幏鍙栫敤鎴峰搴旂殑鐝粍
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Web/GetGroupListByUser_Json")]
+        [HttpGet]
+        public object GetGroupListByUser_Json(string sWhere, string user)
+        {
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                //鏍规嵁鐢ㄦ埛瀵瑰簲鐝粍鐨勫叧绯伙紝杩囨护鏉′欢涓鍔犲彧鏄剧ず瀵瑰簲鐨勭彮缁�
+                DataSet dsHitemID = oCN.RunProcReturn("exec h_p_Gy_GetSQLGroupByUser '" + user + "'", "h_p_Gy_GetSQLGroupByUser");
+                sWhere = sWhere + DBUtility.ClsPub.isStrNull(dsHitemID.Tables[0].Rows[0]["HBack"]);
+
+                DataSet ds = oCN.RunProcReturn("Select HItemID,鐝粍浠g爜 鐝粍浠g爜,鐝粍鍚嶇О 鐝粍 from h_v_GroupList where 1=1 " + sWhere + " Order by HItemID ", "h_v_GroupList");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触";
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "0";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception e)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + e.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+        /// <summary>
         /// 鑾峰彇閮ㄩ棬鍒楄〃
         /// </summary>
         /// <returns></returns>
@@ -14171,7 +14217,7 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn(" select * from h_v_Sc_ProcessExchangeBillList where 1=1 and 鏃ユ湡>=DATEADD(MONTH,-2,GETDATE()) order by 鍗曟嵁鍙� desc,hsubid", "h_v_Sc_ProcessExchangeBillList");
+                    ds = oCN.RunProcReturn("select top 500 * from h_v_Sc_ProcessExchangeBillList where 1=1  order by 鍗曟嵁鍙� desc,hsubid", "h_v_Sc_ProcessExchangeBillList");
                 }
                 else
                 {
@@ -14722,6 +14768,61 @@
                 return objjson;
             }
         }
+
+        #region 鏉$爜涓绘。鍒嗛〉鍒楄〃
+        [Route("Gy_BarCodeBillList/page")]
+        [HttpGet]
+        public json Gy_BarCodeBillListPage(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("Gy_BarCodeBill_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_IF_BarCodeBillList " + page + "," + size + ",''", "h_p_IF_BarCodeBillList");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec h_p_IF_BarCodeBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_IF_BarCodeBillList");
+                }
+
+                //娣诲姞鍒楀悕
+                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
+
         /// <summary>
         /// 鏍规嵁璁惧淇濆吇瑙勭▼鏄剧ず璁惧淇濆吇瑙勭▼椤圭洰
         /// </summary>
@@ -14882,7 +14983,7 @@
                 if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                 {
                     objjson.code = "0";
-                    objjson.count = 1;
+                    objjson.count = 0;
                     objjson.Message = "璇ヨ澶囨湁澶氫釜璁″垝鍗曟垨鐐规瑙勭▼,鎵嬪姩閫夌潃" ;
                     objjson.data = null;
                     return objjson;

--
Gitblit v1.9.1