From be28a6a14688557cd12b3fdb97b117cd4cb52fde Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 09 九月 2024 17:06:07 +0800
Subject: [PATCH] 乔一:中检单

---
 WebAPI/Controllers/BLL/Xt_UserController.cs |  162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 162 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/BLL/Xt_UserController.cs b/WebAPI/Controllers/BLL/Xt_UserController.cs
index bfdcfd2..48f8432 100644
--- a/WebAPI/Controllers/BLL/Xt_UserController.cs
+++ b/WebAPI/Controllers/BLL/Xt_UserController.cs
@@ -1552,6 +1552,168 @@
         }
         #endregion
 
+        #region 鐢ㄦ埛鍏宠仈閮ㄩ棬鏌ヨ
+        /// <summary>
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_User/UserRelationDeptlist")]
+        [HttpGet]
+        public object UserRelationDeptlist(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_UserRelationDept_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                string sql = "";
+
+
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    sql = "select * from h_v_Gy_UserDeptRelationList_Query order by 鐢ㄦ埛浠g爜 asc,閮ㄩ棬浠g爜 asc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_UserDeptRelationList_Query");
+                }
+                else
+                {
+                    sql = "select * from h_v_Gy_UserDeptRelationList_Query where 1=1 ";
+                    sql = sql + sWhere + " order by 鐢ㄦ埛浠g爜 asc,閮ㄩ棬浠g爜 asc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_UserDeptRelationList_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 = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐢ㄦ埛鍏宠仈閮ㄩ棬 鏍规嵁鐢ㄦ埛ID鏌ユ壘
+        /// <summary>
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_User/UserRelationDeptlist_EditInit")]
+        [HttpGet]
+        public object UserRelationDeptlist_EditInit(int HItemID, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_UserRelationDept_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                string sql = "select * from h_v_Gy_UserDeptRelationList_Query where HItemID = " + HItemID;
+                ds = oCN.RunProcReturn(sql, "h_v_Gy_UserDeptRelationList_Query");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐢ㄦ埛鍏宠仈閮ㄩ棬 鍒犻櫎
+        /// <summary>
+        ///鍙傛暟锛歴tring HInterID銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_User/UserRelationDeptlist_Drop")]
+        [HttpGet]
+        public object UserRelationDeptlist_Drop(string HInterID, string user)
+        {
+            try
+            {
+                string s = "";
+
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_UserRelationDept_Drop", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (HInterID == null || HInterID.Equals(""))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID涓嶈兘涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.BeginTran();
+
+                string sql = "delete from Gy_UserDeptRelation where HItemID = " + HInterID;
+                oCN.RunProc(sql);
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region  鏍规嵁鐢ㄦ埛缂栫爜鏌ユ壘宸插垎閰嶅伐浣滀腑蹇冨垪琛�
         [Route("Xt_User/UserWorkCenterlistPlaylist")]
         [HttpGet]

--
Gitblit v1.9.1