wtt
2025-11-11 170dc25004f6d0a22add0d71fdec602545902999
WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs
@@ -26,6 +26,7 @@
        DataSet ds;
        string fileip = System.Configuration.ConfigurationManager.AppSettings["FileIP"];
        #region 返回职员列表
        /// <summary>
        /// 返回职员列表
        ///参数:string sql。
@@ -84,6 +85,68 @@
            }
        }
        #endregion
        #region 返回职员列表
        /// <summary>
        /// 返回职员列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_Employee/listPage")]
        [HttpGet]
        public object lislistPaget(string sWhere, string user, string Organization, int page, int size)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_Employee_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn($@"exec h_p_IF_EmployeeListPage {page}, {size}, ''", "h_p_IF_StockPlaceListPage");
                }
                else
                {
                    sWhere = sWhere.Replace("'", "''");
                    ds = oCN.RunProcReturn($@"exec h_p_IF_EmployeeListPage {page}, {size}, '{sWhere}'", "h_p_IF_StockPlaceListPage");
                }
                //添加列名
                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 = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                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 职员 树形图
        public class TreeModel
        {