1
duhe
8 天以前 c3b14901031d985ef750027d4952264369a1d7b0
WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs
@@ -539,6 +539,63 @@
            }
        }
        [Route("Gy_ConkType/List_PDA2")]
        [HttpGet]
        public object List_PDA(string sWhere, string user, string Mode)
        {
            if (string.IsNullOrWhiteSpace(Mode))
            {
                return List_PDA(sWhere, user);
            }
            try
            {
                string errRef = "";
                List<object> columnNameList = new List<object>();
                if(oClsXt_SystemParameter.ShowBill(ref errRef))
                {
                    if(oClsXt_SystemParameter.omodel.WMS_CampanyName == "华舟")
                    {
                        if(Mode == "Module")
                        {
                            sWhere += $" and 故障类别代码 like 'MJ%' ";
                        }
                        else if (Mode == "Equip")
                        {
                            sWhere += $" and 故障类别代码 like 'SB%' ";
                        }
                    }
                }
                sWhere += $" and 禁用标志='' ";
                LogService.Write(sWhere);
                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;
            }
        }