yangle
2025-02-25 7b65d5dc4876e07f98b3e5bdc12f6f16be0cbb41
WebAPI/Controllers/Æ·ÖʹÜÀí/»ù´¡×ÊÁÏ/Gy_BaseInformationController.cs
@@ -757,7 +757,83 @@
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #region SPC中心线列表 æŸ¥è¯¢
        [Route("QC_SpcCenterlineList/List")]
        [HttpGet]
        public object List(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_QC_SpcCenterlineList order by HInterID desc", "h_v_QC_SpcCenterlineList");
                }
                else
                {
                    string sql1 = "select * from  h_v_QC_SpcCenterlineList  where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by HInterID desc";
                    ds = oCN.RunProcReturn(sql, "h_v_QC_SpcCenterlineList");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region SPC中心线列表 å¼‚常数据 æ›´æ–°
        [Route("QC_SpcCenterlineList/UpdateData")]
        [HttpGet]
        public object UpdateData(string HInterID, string user)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_QC_SpcCenterlineList order by HInterID desc", "h_v_QC_SpcCenterlineList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}