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/GG_NoticeController.cs |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/GG_NoticeController.cs b/WebAPI/Controllers/GG_NoticeController.cs
index 6d253d8..35c2687 100644
--- a/WebAPI/Controllers/GG_NoticeController.cs
+++ b/WebAPI/Controllers/GG_NoticeController.cs
@@ -306,5 +306,52 @@
         }
         #endregion
 
+        /// <summary>
+        /// 鏍规嵁鐢ㄦ埛鍚嶈幏鍙栧叕鍛婂垪琛�
+        /// </summary>
+        /// <param name="user"></param>
+        /// <returns></returns>
+        [Route("GG_Notice/notices")]
+        [HttpGet]
+        public object getNotices(string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                var sql = "select top(10) m.HMakeDate as 鏃ユ湡, m.HLevel as 鐘跺喌, m.HContext as 涓婚 " +
+                           ", m.HContext as 鍐呭" +
+                           ", m.HSendMan as 鍙戦�佷汉, s.HReceiveMan as 鎺ユ敹浜�, d.HName as 鍙戦�侀儴闂� " +
+                           " from OA_InformBillMain as m" +
+                           " inner join OA_InformBillSub as s on m.HInterID = s.HInterID" +
+                           " left join Gy_Department d on m.HDeptID = d.HItemID" +
+                           " where 1 = 1 and" + " s.HReceiveMan =" + "'" + user + "'" +
+                           " order by m.HMakeDate desc";
+
+                ds = new SQLHelper.ClsCN().RunProcReturn(sql, "OA_InformBillMain");
+
+                //娣诲姞鍒楀悕
+                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 = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch(Exception ex)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
     }
 }

--
Gitblit v1.9.1