WebAPI/Controllers/Æ·ÖʹÜÀí/ÖÊÁ¿±¨±í/QC_QualityReportsController.cs
@@ -1939,5 +1939,102 @@
            }
        }
        #endregion
        #region è´¨é‡æ¨¡å—    æœˆåº¦æŠ¥å‘Š æŸ¥è¯¢
        [Route("QC_CustomerAppealReport/GetQC_QualityMonthReportList")]
        [HttpGet]
        public object GetQC_QualityMonthReportList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HYear = dic["HYear"].ToString();
                string HMonth = dic["HMonth"].ToString();
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                ds = oCN.RunProcReturn("exec h_p_QC_QualityMonthReport '" + HYear + "','" + HMonth + "','" + HDivisionName + "','" + HProject + "','" + HBatchWork + "'", "h_p_QC_QualityMonthReport");
                //添加列名
                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 è´¨é‡æ¨¡å— è®¾å¤‡TOP3问题
        /// <summary>
        /// è¿”回设备TOP3问题
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/GetQC_BadReasonTop3ReportList")]
        [HttpGet]
        public object GetQC_BadReasonTop3ReportList(string sWhere, string user)
        {
            try
            {
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HYear = dic["HYear"].ToString();
                string HMonth = dic["HMonth"].ToString();
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_QC_BadReasonTop3Report '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_BadReasonTop3Report");
                //添加列名
                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
    }
}