wtt
2025-01-16 5a3caef6e991f1ee69d8e5dc355468e570805e32
WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs
@@ -1,4 +1,5 @@
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
@@ -19,7 +20,7 @@
        DataSet ds;
        /// <summary>
        /// 返回仓库列表
        /// 返回故障类别列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
@@ -29,6 +30,7 @@
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                //if (!DBUtility.ClsPub.Security_Log_second("Gy_ConkType", 1, false, user))
                //{
@@ -49,11 +51,19 @@
                    ds = oCN.RunProcReturn(sql, "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)
@@ -240,10 +250,7 @@
            }
        }
        /// <summary>
        /// 包装方式列表删除功能
        /// </summary>
        /// <returns></returns>
        [Route("DeltetGy_ConkType")]
        [HttpGet]
        public object DeltetGy_ConkType(string HItemID, string user)
@@ -329,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;
            }
        }
    }
}