yxj
2024-06-18 d3473e15fd14ea84a1378f3d3841bcad16c2d9f3
WebAPI/Controllers/Æ·ÖʹÜÀí/ÖÊÁ¿±¨±í/QC_QualityReportsController.cs
@@ -457,5 +457,47 @@
        }
        #endregion
        #region è´¨é‡æ¨¡å— SPC检验单分析
        /// <summary>
        /// è¿”回直通率报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/QC_InspectionFormReport")]
        [HttpGet]
        public object QC_InspectionFormReport(string sWhere)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //ds = oCN.RunProcReturn("exec h_p_QC_InspectionFormReport '" + Year + "','" + DeptName + "'", "h_p_QC_InspectionFormReport");
                //添加列名
                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
    }
}