From a23b0dc904a0af0fcfd9716b3dd69fa8147b0a71 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 22 一月 2024 12:43:36 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/BLL/Xt_UserController.cs |  242 ++++++++++++++++++++++++++++++++++++++++
 WebAPI/Controllers/LMESController.cs        |    2 
 WebAPI/Controllers/WebAPIController.cs      |   25 ++++
 WebAPI/Service/LuBaoSevice.cs               |   42 ++++++
 4 files changed, 307 insertions(+), 4 deletions(-)

diff --git a/WebAPI/Controllers/BLL/Xt_UserController.cs b/WebAPI/Controllers/BLL/Xt_UserController.cs
index bffc0f6..99b3bb0 100644
--- a/WebAPI/Controllers/BLL/Xt_UserController.cs
+++ b/WebAPI/Controllers/BLL/Xt_UserController.cs
@@ -681,7 +681,7 @@
                 return objJsonResult;
             }
         }
-        #endregion
+        #endregion       
 
         #region 鐢ㄦ埛鍏宠仈缁勭粐淇濆瓨
         [Route("Xt_User/SaveUserByOrg")]
@@ -990,6 +990,69 @@
         }
         #endregion
 
+        #region 鐢ㄦ埛鍏宠仈鐝粍缁存姢鍒楄〃
+        /// <summary>
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_User/Gy_UserGroupRelationList")]
+        [HttpGet]
+        public object Gy_UserGroupRelationList(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_Group_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_UserGroupRelationList_Query order by 鐢ㄦ埛浠g爜 asc,鐝粍浠g爜 asc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_UserGroupRelationList_Query");
+                }
+                else
+                {
+                    sql = "select * from h_v_Gy_UserGroupRelationList_Query where 1=1 ";
+                    sql = sql + sWhere + " order by 鐢ㄦ埛浠g爜 asc,鐝粍浠g爜 asc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_UserGroupRelationList_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/SaveUserGroup")]
         [HttpPost]
@@ -1030,6 +1093,62 @@
                 objJsonResult.count = 0;
                 objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
                 objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐢ㄦ埛鍏宠仈鐝粍缁存姢 鍒犻櫎
+        /// <summary>
+        ///鍙傛暟锛歴tring HInterID銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_User/UserGroupRelationList_Drop")]
+        [HttpGet]
+        public object UserGroupRelationList_Drop(string HInterID, string user)
+        {
+            try
+            {
+                string s = "";
+
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_Group_Delete", 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_UserGroupRelation 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;
             }
         }
@@ -1366,7 +1485,7 @@
                     return objJsonResult;
                 }
 
-                string sql = "select * from h_v_Gy_UserByWorkStationRelationList_Query where HItemID = " + HItemID;
+                string sql = "select * from h_v_Gy_UserByWorkStationRelationList_Query where 鐢ㄦ埛浠g爜 = '" + HItemID + "'";
                 ds = oCN.RunProcReturn(sql, "h_v_Gy_UserByWorkStationRelationList_Query");
 
                 objJsonResult.code = "1";
@@ -3378,5 +3497,124 @@
             }
         }
         #endregion
+
+        #region 鐢ㄦ埛鍏宠仈渚涘簲鍟嗙淮鎶ゅ垪琛�
+        /// <summary>
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_User/Gy_UserSupplierRelationList")]
+        [HttpGet]
+        public object Gy_UserSupplierRelationList(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_UserSupplierRelationList", 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_UserSupplierRelationList_Query order by 鐢ㄦ埛浠g爜 asc,渚涘簲鍟嗕唬鐮� asc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_UserSupplierRelationList_Query");
+                }
+                else
+                {
+                    sql = "select * from h_v_Gy_UserSupplierRelationList_Query where 1=1 ";
+                    sql = sql + sWhere + " order by 鐢ㄦ埛浠g爜 asc,渚涘簲鍟嗕唬鐮� asc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_UserSupplierRelationList_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 鐢ㄦ埛鍏宠仈渚涘簲鍟嗙淮鎶� 鍒犻櫎
+        /// <summary>
+        ///鍙傛暟锛歴tring HInterID銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_User/UserSupplierRelationList_Drop")]
+        [HttpGet]
+        public object UserSupplierRelationList_Drop(string HInterID, string user)
+        {
+            try
+            {
+                string s = "";
+
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_UserSupplierRelation_Delete", 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_UserSupplierRelation 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
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index bdbd9bf..fbacc0b 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -592,7 +592,7 @@
 
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                ds = oCN.RunProcReturn("select " + Count + " * from h_v_Sc_ProcessExchangeIssueBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeIssueBillQuery");
+                ds = oCN.RunProcReturn("select " + Count + " * from h_v_Sc_ProcessExchangeIssueBillQuery where 1 = 1 " + sWhere + " order by hmainid desc,CONVERT(int,娴佹按鍙�) asc", "h_v_Sc_ProcessExchangeIssueBillQuery");
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "Sucess锛�";
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 6cca359..f50621d 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -7974,6 +7974,31 @@
         }
 
         /// <summary>
+        /// 鐢ㄦ埛鍏宠仈鐝粍鑾峰彇淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("GetGy_UserGroupDetail")]
+        [HttpGet]
+        public ApiResult<DataSet> GetGy_UserGroupDetail(string HID)
+        {
+            var model = LuBaoSevice.GetGy_UserGroupBillDetail(HID);
+            return model;
+        }
+
+        /// <summary>
+        /// 鐢ㄦ埛鍏宠仈渚涘簲鍟嗚幏鍙栦俊鎭�
+        /// </summary>
+        /// <returns></returns>
+        [Route("GetGy_UserSupplierDetail")]
+        [HttpGet]
+        public ApiResult<DataSet> GetGy_UserSupplierDetail(string HID)
+        {
+            var model = LuBaoSevice.GetGy_UserSupplierBillDetail(HID);
+            return model;
+        }
+
+
+        /// <summary>
         /// 鎶ュ簾鍘熷洜
         /// </summary>
         /// <returns></returns>
diff --git a/WebAPI/Service/LuBaoSevice.cs b/WebAPI/Service/LuBaoSevice.cs
index a2956c3..953b68a 100644
--- a/WebAPI/Service/LuBaoSevice.cs
+++ b/WebAPI/Service/LuBaoSevice.cs
@@ -322,7 +322,7 @@
             if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                 return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ敤鎴峰叧鑱斿伐搴忔暟鎹�" };
             return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
-        }
+        }        
         public static DataSet GetGy_InspectBasisDb(string HID)
         {
             SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
@@ -331,6 +331,46 @@
         }
 
         /// <summary>
+        /// 鐢ㄦ埛鍏宠仈鐝粍鏍规嵁id鑾峰彇淇℃伅
+        /// </summary>
+        public static ApiResult<DataSet> GetGy_UserGroupBillDetail(string HID)
+        {
+            if (string.IsNullOrEmpty(HID))
+                return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
+            var dataSet = GetGy_UserGroupBasisDb(HID);
+            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
+                return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ敤鎴峰叧鑱旂彮缁勬暟鎹�" };
+            return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
+        }
+
+        public static DataSet GetGy_UserGroupBasisDb(string HID)
+        {
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+            var dataSet = oCN.RunProcReturn("select  * from h_v_Gy_UserGroupRelationList_Query  where 鐢ㄦ埛浠g爜= '" + HID + "' ", "h_v_Gy_UserGroupRelationList_Query");
+            return dataSet;
+        }
+
+        /// <summary>
+        /// 鐢ㄦ埛鍏宠仈渚涘簲鍟嗘牴鎹甶d鑾峰彇淇℃伅
+        /// </summary>
+        public static ApiResult<DataSet> GetGy_UserSupplierBillDetail(string HID)
+        {
+            if (string.IsNullOrEmpty(HID))
+                return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
+            var dataSet = GetGy_UserSupplierBasisDb(HID);
+            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
+                return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ敤鎴峰叧鑱斾緵搴斿晢鏁版嵁" };
+            return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
+        }
+
+        public static DataSet GetGy_UserSupplierBasisDb(string HID)
+        {
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+            var dataSet = oCN.RunProcReturn("select  * from h_v_Gy_UserSupplierRelationList_Query  where 鐢ㄦ埛浠g爜= '" + HID + "' ", "h_v_Gy_UserSupplierRelationList_Query");
+            return dataSet;
+        }
+
+        /// <summary>
         /// 鐢ㄦ埛鍏宠仈浠撳簱鏍规嵁id鑾峰彇淇℃伅
         /// </summary>
         public static ApiResult<DataSet> GetGy_UserStockRelationDetail(string HID)

--
Gitblit v1.9.1