dytyqx
5 天以前 9f7b0ecace9c80ff2a1d95f4343058b3b031bd22
WebAPI/Controllers/BaseSet/Gy_SupplierController.cs
@@ -1813,5 +1813,40 @@
        #endregion
        #endregion
        [Route("Gy_Supplier/JD_GysupperList")]
        [HttpGet]
        public object JD_GysupperList(string sWhere)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn(sWhere, "h_v_Gy_SupplierList");
                //添加列名
                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;
            }
        }
    }
}