From e496d3bb93fe09092e8dfce929d228ded5378755 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 16 一月 2024 09:42:21 +0800
Subject: [PATCH] 报废原因,处理方案 基础资料,用户关联工位列表

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

diff --git a/WebAPI/Controllers/BLL/Xt_UserController.cs b/WebAPI/Controllers/BLL/Xt_UserController.cs
index 1ee4d5b..bffc0f6 100644
--- a/WebAPI/Controllers/BLL/Xt_UserController.cs
+++ b/WebAPI/Controllers/BLL/Xt_UserController.cs
@@ -1236,6 +1236,69 @@
         }
         #endregion
 
+        #region 鐢ㄦ埛鍏宠仈宸ヤ綅缁存姢鍒楄〃
+        /// <summary>
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_User/UserByWorkStationRelationList")]
+        [HttpGet]
+        public object UserByWorkStationRelationList(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_UserWorkStationList_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_UserByWorkStationRelationList_Query order by 鐢ㄦ埛浠g爜 asc,宸ヤ綅浠g爜 asc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_UserByWorkStationRelationList_Query");
+                }
+                else
+                {
+                    sql = "select * from h_v_Gy_UserByWorkStationRelationList_Query where 1=1 ";
+                    sql = sql + sWhere + " order by 鐢ㄦ埛浠g爜 asc,宸ヤ綅浠g爜 asc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_UserByWorkStationRelationList_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 鐢ㄦ埛鍏宠仈宸ヤ綅淇濆瓨
         [Route("Xt_User/SaveUserByWorkStation")]
         [HttpPost]
@@ -1276,6 +1339,105 @@
                 objJsonResult.count = 0;
                 objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
                 objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐢ㄦ埛鍏宠仈宸ヤ綅缁存姢 缂栬緫鍒濆鍖�
+        /// <summary>
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_User/UserByWorkStationRelationList_EditInit")]
+        [HttpGet]
+        public object UserByWorkStationRelationList_EditInit(int HItemID, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_UserWorkStationList_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                string sql = "select * from h_v_Gy_UserByWorkStationRelationList_Query where HItemID = " + HItemID;
+                ds = oCN.RunProcReturn(sql, "h_v_Gy_UserByWorkStationRelationList_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/UserByWorkStationRelationList_Drop")]
+        [HttpGet]
+        public object UserByWorkStationRelationList_Drop(string HInterID, string user)
+        {
+            try
+            {
+                string s = "";
+
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_UserWorkStationList_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_UserByWorkStationRelation 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;
             }
         }
@@ -2544,6 +2706,7 @@
             }
         }
         #endregion
+        
         #region 鐢ㄦ埛鍏宠仈瀹㈡埛缁存姢 鍒犻櫎
         /// <summary>
         ///鍙傛暟锛歴tring HInterID銆�

--
Gitblit v1.9.1