yusijie
2024-01-12 486f97b7c404ec76904ed89896685b565ac5f6fa
WebAPI/Controllers/BLL/Xt_UserController.cs
@@ -914,6 +914,45 @@
        }
        #endregion
        #region  用户关联用户列表查询
        [Route("Xt_User/Gy_UserByUserList")]
        [HttpGet]
        public object Gy_UserByUserList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql1 = "select * from h_v_Gy_UserByUserRelationList where 1 = 1";
                string sql = sql1 + sWhere + " order by 用户代码 ";
                ds = oCN.RunProcReturn(sql, "h_v_Gy_UserStockRelation");
                //添加列名
                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));//获取到DataColumn列对象的列名
                }
                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/UserGrouplistPlaylist")]
        [HttpGet]