wtt
2025-01-16 5a3caef6e991f1ee69d8e5dc355468e570805e32
WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs
@@ -250,10 +250,7 @@
            }
        }
        /// <summary>
        /// 包装方式列表删除功能
        /// </summary>
        /// <returns></returns>
        [Route("DeltetGy_ConkType")]
        [HttpGet]
        public object DeltetGy_ConkType(string HItemID, string user)
@@ -339,5 +336,52 @@
            }
        }
        [Route("Gy_ConkType/List_PDA")]
        [HttpGet]
        public object List_PDA(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere != "" && sWhere != null)
                {
                    sWhere = " and 禁用标志=''  and ( 故障类别代码 like '%" + sWhere + "%' or 故障类别 like '%" + sWhere + "%' ) ";
                }
                else
                {
                    sWhere = " and 禁用标志='' ";
                }
                string sql1 = string.Format(@"select * from h_v_Gy_ConkTypeList where 1=1 ");
                ds = oCN.RunProcReturn(sql1 + sWhere + " order by 故障类别代码 ", "h_v_Gy_ConkTypeList");
                //添加列名
                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;
            }
        }
    }
}