yangle
9 天以前 f314ea2477d0c8d439c96f91a4ae3fcada2a7add
WebAPI/Controllers/Æ·ÖʹÜÀí/ÖÊÁ¿±¨±í/QC_QualityReportsController.cs
@@ -483,12 +483,14 @@
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                string HDeptID = dic["HDeptID"].ToString();
                int limit = int.Parse(dic["limit"].ToString());
                int HQCCheckItemID = int.Parse(dic["HQCCheckItemID"].ToString());
                int HMaterID = int.Parse(dic["HMaterID"].ToString());
                string HMouldNum = dic["HMouldNum"].ToString();
                string HSourceID = dic["HSourceID"].ToString();
                ds = oCN.RunProcReturn("exec h_p_QC_InspectionFormReport '" + HBeginDate + "','" + HEndDate + "'," + limit + "," + HQCCheckItemID + "," + HMaterID + ",'" + HMouldNum + "'", "h_p_QC_InspectionFormReport");
                ds = oCN.RunProcReturn("exec h_p_QC_InspectionFormReport '" + HBeginDate + "','" + HEndDate + "'," + limit + "," + HQCCheckItemID + "," + HMaterID + ",'" + HMouldNum + "','"+ HSourceID + "','"+ HDeptID + "'", "h_p_QC_InspectionFormReport");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -545,8 +547,13 @@
                string HMonth = dic["HMonth"].ToString();
                int HDeptName = int.Parse(dic["HDeptName"].ToString());
                int HOrgID = int.Parse(dic["HOrgID"].ToString());
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                string HResult = dic["HResult"].ToString();//判断结果
                string HProcName = dic["HProcName"].ToString();//工序名称
                ds = oCN.RunProcReturn("exec h_p_QC_QualityStatisticsDailyReport '" + HYear + "','" + HMonth + "'," + HDeptName + "," + HOrgID, "h_p_QC_QualityStatisticsDailyReport");
                ds = oCN.RunProcReturn("exec h_p_QC_QualityStatisticsDailyReport '" + HYear + "','" + HMonth + "'," + HDeptName + "," + HOrgID+ ",'" + HProject + "','" + HBatchWork + "','" + HDivisionName + "','" + HResult + "','" + HProcName + "'", "h_p_QC_QualityStatisticsDailyReport");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -603,8 +610,11 @@
                string HEndDate = dic["HEndDate"].ToString();
                string HResult = dic["HResult"].ToString();
                int HSourceID = int.Parse(dic["HSourceID"].ToString());
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                ds = oCN.RunProcReturn("exec h_p_QC_MoistureContentDataLedger '" + HBeginDate + "','" + HEndDate + "','" + HResult + "'," + HSourceID, "h_p_QC_MoistureContentDataLedger");
                ds = oCN.RunProcReturn("exec h_p_QC_MoistureContentDataLedger '" + HBeginDate + "','" + HEndDate + "','" + HResult + "'," + HSourceID+ ",'" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_MoistureContentDataLedger");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -632,5 +642,1565 @@
        }
        #endregion
        #region è´¨é‡æ¨¡å—    å„工序质量趋势图 æŸ¥è¯¢
        [Route("QC_CustomerAppealReport/getSc_StationOutBill_HProc")]
        [HttpGet]
        public object getSc_HMaterYieldStatistics(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 HProcName = dic["HProcName"].ToString();
                string HMaterName = dic["HMaterName"].ToString();
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDeptID = dic["HDeptID"].ToString();//部门
                ds = oCN.RunProcReturn("exec h_p_Sc_StationOutBillQuery_HProc '" + HYear + "','" + HMonth + "','" + HDivisionName + "','" + HProcName + "','" + HMaterName + "','" + HProject + "','" + HBatchWork + "','"+ HDeptID + "'", "h_p_SB_EquipICMOTechParamBillList");
                //添加列名
                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 è´¨é‡æ¨¡å—    è®¾å¤‡å·¥è‰ºå‚数趋势图 æ ¹æ®æµè½¬å¡+工序 èŽ·å–è®¾å¤‡
        [Route("QC_CustomerAppealReport/Get_EquipList")]
        [HttpGet]
        public object Get_EquipList(string HProcExchBillNo,string HProcID, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("select  isnull(c.HInterID,0)设备id,isnull(c.HEquipFileNumber,'') è®¾å¤‡ä»£ç ,isnull(c.HName,'') è®¾å¤‡åç§°,b.HRelBeginDate å¼€å§‹æ—¶é—´,b.HRelEndDate ç»“束时间 from Sc_ProcessExchangeBillMain a " +
                        " inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID" +
                        " left join Gy_EquipFileBillMain c on b.HSourceID=c.HSourceID" +
                        "  where a.HBillNo='" + HProcExchBillNo + "'and b.HProcID='"+ HProcID + "'  and b.HSourceID !=0 ", "Sc_ProcessExchangeBillMain");
                //添加列名
                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 è´¨é‡æ¨¡å— è®¾å¤‡å·¥è‰ºå‚数趋势图
        [Route("QC_CustomerAppealReport/SB_EquipICMOTechParamList")]
        [HttpGet]
        public object SB_EquipICMOTechParamList(string sWhere, string user,string Type)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HProcExchBillNo = dic["HProcExchBillNo"].ToString();
                string HProcID = dic["HProcID"].ToString();
                string HTechParamName = dic["HTechParamName"].ToString();
                string HEquipID = dic["HEquipID"].ToString();
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                if ((HProcExchBillNo == null || HProcExchBillNo == "")&&(HProcID == null || HProcID == "") && (HTechParamName == null || HTechParamName == "") && (HEquipID == null || HEquipID == ""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询条件!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("exec h_p_SB_EquipICMOTechParamBillList '" + HProcExchBillNo + "','" + HProcID + "','" + HTechParamName + "','"+ HEquipID + "','" + HBeginDate + "','" + HEndDate + "','" + Type+"'", "h_p_SB_EquipICMOTechParamBillList");
                //添加列名
                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 è´¨é‡æ¨¡å— å·¥è‰ºå‚数大类分析报表
        [Route("QC_CustomerAppealReport/GtetQc_TechnologyParameterClassList")]
        [HttpGet]
        public object GtetQc_TechnologyParameterClassList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HProcExchBillNo = dic["HProcExchBillNo"].ToString();
                string HProcName = dic["HProcName"].ToString();
                string HTechParamClass = dic["HTechParamName"].ToString();
                string HEquipName = dic["HEquipName"].ToString();
                if ((HProcExchBillNo == null || HProcExchBillNo == "") && (HProcName == null || HProcName == "") && (HTechParamClass == null || HTechParamClass == "") && (HEquipName == null || HEquipName == ""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询条件!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("exec h_p_SB_EquipICMOTechParamBillList_Class '" + HProcExchBillNo + "','" + HProcName + "','" + HTechParamClass + "'," + HEquipName, "h_p_SB_EquipICMOTechParamBillList_Class");
                //添加列名
                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 è´¨é‡æ¨¡å— æ€§èƒ½æŠ¥åºŸå°è´¦
        /// <summary>
        /// è¿”回直通率报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/QC_PerformanceScrapLedger")]
        [HttpGet]
        public object QC_PerformanceScrapLedger(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere == "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询条件!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                string HBatchNo = dic["HBatchNo"].ToString();
                int HMaterID = int.Parse(dic["HMaterID"].ToString());
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                ds = oCN.RunProcReturn("exec h_p_QC_PerformanceScrapLedger '" + HBeginDate + "','" + HEndDate + "','" + HMaterID + "','" + HBatchNo+ "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_PerformanceScrapLedger");
                //添加列名
                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 è´¨é‡æ¨¡å— é€æµ‹ç™»è®°æ•°æ®å°è´¦
        /// <summary>
        /// è¿”回直通率报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/QC_RegistrationForTestingReport")]
        [HttpGet]
        public object QC_RegistrationForTestingReport(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere == "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询条件!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                string HBatchNo = dic["HBatchNo"].ToString();
                int HMaterID = int.Parse(dic["HMaterID"].ToString());
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                ds = oCN.RunProcReturn("exec h_p_QC_RegistrationForTestingReport '" + HBeginDate + "','" + HEndDate + "','" + HMaterID + "','" + HBatchNo + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_RegistrationForTestingReport");
                //添加列名
                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 è´¨é‡æ¨¡å—   åˆ¶ç¨‹ç»©æ•ˆè¶‹åŠ¿å›¾(一次合格率)  æŸ¥è¯¢
        [Route("QC_CustomerAppealReport/getQC_ProcessPerformanceFirstPass")]
        [HttpGet]
        public object getQC_ProcessPerformanceFirstPass(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 HProject = dic["HProject"].ToString();//项目号
                string HMaterNumber = dic["HMaterNumber"].ToString();//物料代码
                string HMaterName = dic["HMaterName"].ToString();//物料名称
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                ds = oCN.RunProcReturn("exec h_p_QC_ProcessPerformanceFirstPassList   '" + HYear + "','" + HProject + "','" + HMaterNumber + "','" + HMaterName + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ProcessPerformanceFirstPassList");
                //添加列名
                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 è´¨é‡æ¨¡å—   åˆ¶ç¨‹ç»©æ•ˆè¶‹åŠ¿å›¾(合格率)  æŸ¥è¯¢
        [Route("QC_CustomerAppealReport/getQC_ProcessPerformancePass")]
        [HttpGet]
        public object getQC_ProcessPerformancePass(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 HProject = dic["HProject"].ToString();//项目号
                string HMaterNumber = dic["HMaterNumber"].ToString();//物料代码
                string HMaterName = dic["HMaterName"].ToString();//物料名称
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                ds = oCN.RunProcReturn("exec h_p_QC_ProcessPerformancePassList  '" + HYear + "','" + HProject + "','" + HMaterNumber + "','" + HMaterName + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ProcessPerformancePassList");
                //添加列名
                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 è´¨é‡æ¨¡å—   å¼‚常反馈分析报表  æŸ¥è¯¢
        [Route("QC_CustomerAppealReport/getOA_ErrMsgBackBillList_Query")]
        [HttpGet]
        public object getOA_ErrMsgBackBillList_Query(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_OA_ErrMsgBackBillList_Query order by æ—¥æœŸ desc", "h_v_OA_ErrMsgBackBillList_Query");
                }
                else
                {
                    string sql1 = "select * from h_v_OA_ErrMsgBackBillList_Query where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by æ—¥æœŸ desc ";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackBillList_Query");
                }
                //添加列名
                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 è´¨é‡æ¨¡å— å¼‚常管理台账
        /// <summary>
        /// è¿”回异常管理台账
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/QC_ErrManagerLedgerReport")]
        [HttpGet]
        public object QC_ErrManagerLedgerReport(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere == "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询条件!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                int HDeptID = int.Parse(dic["HDeptID"].ToString());
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport '" + HBeginDate + "','" + HEndDate + "'," + HDeptID + ",'" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ErrManagerLedgerReport");
                //添加列名
                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 è´¨é‡æ¨¡å— ä¸è‰¯å“å°è´¦
        /// <summary>
        /// è¿”回异常管理台账
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/QC_BadProductsReport")]
        [HttpGet]
        public object QC_BadProductsReport(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere == "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询条件!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                string HMaterNumber = dic["HMaterNumber"].ToString();//物料代码
                string HMaterName = dic["HMaterName"].ToString();//物料名称
                string HBatchNo = dic["HBatchNo"].ToString();//批次号
                string HProjectNum = dic["HProjectNum"].ToString();//项目号
                string HProcName = dic["HProcName"].ToString();//工序名称
                ds = oCN.RunProcReturn("exec h_p_QC_BadProductsReport '" + HBeginDate + "','" + HEndDate + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "','" + HMaterNumber + "','" + HMaterName + "','" + HBatchNo + "','" + HProjectNum + "','"+ HProcName + "'", "h_p_QC_BadProductsReport");
                //添加列名
                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 è´¨é‡æ¨¡å— çº¿åˆ«å¼‚常管理台账
        /// <summary>
        /// è¿”回线别异常管理台账
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/QC_ErrManagerLedgerReport_Source")]
        [HttpGet]
        public object QC_ErrManagerLedgerReport_Source(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_ErrManagerLedgerReport_Source '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ErrManagerLedgerReport_Source");
                //添加列名
                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 è´¨é‡æ¨¡å— å¼‚常管理台账数
        /// <summary>
        /// è¿”回异常管理台账数
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/QC_ErrManagerLedgerReport_Issue")]
        [HttpGet]
        public object QC_ErrManagerLedgerReport_Issue(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_ErrManagerLedgerReport_Issue '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ErrManagerLedgerReport_Issue");
                //添加列名
                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 è´¨é‡æ¨¡å— å¼‚常问题来源
        /// <summary>
        /// è¿”回异常问题来源
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/QC_ErrManagerLedgerReport_SourceOfTheProblem")]
        [HttpGet]
        public object QC_ErrManagerLedgerReport_SourceOfTheProblem(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_ErrManagerLedgerReport_SourceOfTheProblem '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ErrManagerLedgerReport_SourceOfTheProblem");
                //添加列名
                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/QC_ErrManagerLedgerReport_EquipTop3Issue")]
        [HttpGet]
        public object QC_ErrManagerLedgerReport_EquipTop3Issue(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_ErrManagerLedgerReport_EquipTop3Issue '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ErrManagerLedgerReport_EquipTop3Issue");
                //添加列名
                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 è´¨é‡æ¨¡å— è®¾å¤‡å·¥è‰ºå‚数趋势分析图
        [Route("QC_CustomerAppealReport/Get_QC_EquipMentCollectionTechParamList")]
        [HttpGet]
        public object Get_QC_EquipMentCollectionTechParamList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HEquipNumber = dic["HEquipNumber"].ToString();//设备编码
                string HTechParamName = dic["HTechParamName"].ToString();//工艺产数
                string HDate = dic["HDate"].ToString();//采集日期
                string HDate1 = dic["HDate1"].ToString();//采集日期
                string HEquipType = dic["HEquipType"].ToString();//查询类型
                ds = oCN.RunProcReturn("exec h_p_Sb_EquipMentCollectionTechParam '"+ HEquipNumber + "','"+ HTechParamName + "','"+ HDate + "','"+ HDate1 + "','"+ HEquipType + "'", "h_p_Sb_EquipMentCollectionTechParam");
                //添加列名
                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 è´¨é‡æ¨¡å— å…¨ç¨‹è´¨é‡è¿½æº¯
        //SN码追溯
        [Route("QC_CustomerAppealReport/Get_QC_FiveMenOneRingList")]
        [HttpGet]
        public object Get_QC_FiveMenOneRingList(string SN, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_QC_FiveMenOneRingList '" + SN + "'", "h_p_QC_FiveMenOneRingList");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此条码查无数据!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                // éåŽ†æ‰€æœ‰è¡¨
                foreach (DataTable table in ds.Tables)
                {
                    List<object> tableColumnList = new List<object>();
                    // æ·»åŠ åˆ—å
                    foreach (DataColumn col in table.Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        tableColumnList.Add(JsonConvert.DeserializeObject(ColmString));
                    }
                    // å°†æ¯ä¸ªè¡¨çš„列名列表添加到总列名列表
                    columnNameList.Add(new { TableName = table.TableName, Columns = tableColumnList });
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds;
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        //黑白标查询
        [Route("QC_CustomerAppealReport/Get_QC_FiveMenOneRingList_HB")]
        [HttpGet]
        public object Get_QC_FiveMenOneRingList_HB(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("select * from h_v_QC_FiveMenOneRingList_HB where 1=1 "+sWhere+" order by æ—¥æœŸ desc", "h_v_QC_FiveMenOneRingList_HB");
                // éåŽ†æ‰€æœ‰è¡¨
                foreach (DataTable table in ds.Tables)
                {
                    List<object> tableColumnList = new List<object>();
                    // æ·»åŠ åˆ—å
                    foreach (DataColumn col in table.Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        tableColumnList.Add(JsonConvert.DeserializeObject(ColmString));
                    }
                    // å°†æ¯ä¸ªè¡¨çš„列名列表添加到总列名列表
                    columnNameList.Add(new { TableName = table.TableName, Columns = tableColumnList });
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds;
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        //镭雕码页签-流转卡号查询返回流转卡id
        [Route("QC_CustomerAppealReport/Get_QC_FiveMenOneRingList_HProcHBillNoID")]
        [HttpGet]
        public object Get_QC_FiveMenOneRingList_HProcHBillNoID(string HProcHBillNo, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("select top 1 hmainid from h_v_Sc_ProcessExchangeBillList_Query where å•据号= '"+ HProcHBillNo +"'", "h_v_Sc_ProcessExchangeBillList_Query");
                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;
            }
        }
        //点击主表格的流转卡,查询子表格数据
        [Route("QC_CustomerAppealReport/Get_QC_FiveMenOneRingList_Right")]
        [HttpGet]
        public object Get_QC_FiveMenOneRingList_Right(string linterid,string HProcID,string SNs, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_QC_FiveMenOneRingList_Query '" + linterid + "','"+ HProcID + "','" + SNs + "'", "h_p_QC_FiveMenOneRingList_Query");
                // éåŽ†æ‰€æœ‰è¡¨
                foreach (DataTable table in ds.Tables)
                {
                    List<object> tableColumnList = new List<object>();
                    // æ·»åŠ åˆ—å
                    foreach (DataColumn col in table.Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        tableColumnList.Add(JsonConvert.DeserializeObject(ColmString));
                    }
                    // å°†æ¯ä¸ªè¡¨çš„列名列表添加到总列名列表
                    columnNameList.Add(new { TableName = table.TableName, Columns = tableColumnList });
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds;
                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 è´¨é‡æ¨¡å— åˆ¶ç¨‹é™·é˜±æµ‹è¯•趋势图报表
        /// <summary>
        /// åˆ¶ç¨‹é™·é˜±æµ‹è¯•趋势图报表
        /// </summary>
        /// <returns></returns>
        [Route("QC_QualityReportsController/GetQC_SkillExamMonthSumReport_Json")]
        [HttpGet]
        public object GetQC_SkillExamMonthSumReport_Json(string sWhere)
        {
            try
            {
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HYear = dic["HYear"].ToString();//å¹´
                string HDeptID = dic["HDeptID"].ToString();//部门
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                ds = oCN.RunProcReturn("exec h_p_QC_SkillExamMonthSumReport '" + HYear.ToString() + "'," + HDeptID.ToString()+",'" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_SkillExamMonthSumReport");
                List<object> columnNameList = new List<object>();
                //添加列名
                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 = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回报表信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region è´¨é‡æ¨¡å— åˆ¶ç¨‹è´¨é‡é—¨é€ƒé€¸è¶‹åŠ¿å›¾æŠ¥è¡¨
        /// <summary>
        /// åˆ¶ç¨‹è´¨é‡é—¨é€ƒé€¸è¶‹åŠ¿å›¾æŠ¥è¡¨
        /// </summary>
        /// <returns></returns>
        [Route("QC_QualityReportsController/GetQC_QualityMonthSumReport_Json")]
        [HttpGet]
        public object GetQC_QualityMonthSumReport_Json(string sWhere)
        {
            try
            {
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HYear = dic["HYear"].ToString();//å¹´
                string HDeptID = dic["HDeptID"].ToString();//部门
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                ds = oCN.RunProcReturn("exec h_p_QC_QualityMonthSumReport '" + HYear.ToString() + "'," + HDeptID.ToString() + ",'" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_QualityMonthSumReport");
                List<object> columnNameList = new List<object>();
                //添加列名
                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 = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回报表信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region è´¨é‡æ¨¡å— PPM绩效趋势图报表
        /// <summary>
        /// PPM绩效趋势图报表
        /// </summary>
        /// <returns></returns>
        [Route("QC_CustomerAppealReport/GetQC_PPMReport_Json")]
        [HttpGet]
        public object GetQC_PPMReport_Json(string sWhere)
        {
            try
            {
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HYear = dic["HYear"].ToString();//å¹´
                string HMonth = dic["HMonth"].ToString();//月
                string HSupID = dic["HSupID"].ToString();//供应商
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDeptID = dic["HDeptID"].ToString();//部门
                ds = oCN.RunProcReturn("exec h_p_QC_PPMReport  '" + HYear + "','" + HMonth + "','" + HDivisionName + "','" + HProject + "','" + HBatchWork + "','" + HDeptID + "','" + HSupID + "'", "h_p_QC_PPMReport");
                List<object> columnNameList = new List<object>();
                //添加列名
                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 = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回报表信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region è´¨é‡æ¨¡å—    å…¨ç¨‹è´¨é‡è¿½æº¯ æ ¹æ®å…¨ç¨‹è¿½æº¯æŠ¥è¡¨ æ³• èŽ·å–ç‰©æ–™+流转卡+设备+工序
        [Route("QC_CustomerAppealReport/Get_EquipICMOTechParamList")]
        [HttpGet]
        public object Get_EquipICMOTechParamList(string linterid, string HProcID, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("select a.HBillNo å·¥åºæµè½¬å¡å·,e.HInterID è®¾å¤‡id,e.HEquipFileNumber è®¾å¤‡ä»£ç ,e.HName è®¾å¤‡åç§°,d.HName ç”Ÿäº§èµ„源,a.HMaterID ç‰©æ–™id,c.HName ç‰©æ–™åç§°,b.HProcID å·¥åºid,f.HName å·¥åºåç§°,b.HRelBeginDate å¼€å§‹æ—¶é—´,b.HRelEndDate ç»“束时间 " +
                    "from Sc_ProcessExchangeBillMain a inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID " +
                    "left join Gy_Material c on a.HMaterID = c.HItemID  left join Gy_Source d on b.HSourceID = d.HItemID " +
                    "left join Gy_EquipFileBillMain e on b.HSourceID = e.HSourceID and b.HSourceID<>0 left join Gy_Process f on b.HProcID = f.HItemID where a.HInterID='" + linterid+ "' and b.HProcID='"+HProcID+"'", "SB_EquipICMOTechParamBillMain");
                //添加列名
                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 è´¨é‡æ¨¡å—    è®¾å¤‡å·¥è‰ºå‚数趋势图 æ ¹æ®ç‰©æ–™+设备+工序  èŽ·å– äº§å“å·¥è‰ºå‚数清单 å·¥è‰ºå‚æ•°
        [Route("QC_CustomerAppealReport/Get_TechParamList")]
        [HttpGet]
        public object Get_TechParamList(string HMaterID, string HProID, string HEquId, string HTeachName, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (HTeachName=="")
                {
                    ds = oCN.RunProcReturn("select c.HName å·¥è‰ºå‚æ•°,b.HDataForm é‡‡é›†æ¥æº from Gy_MaterialTechParamBillMain a " +
                    "inner join Gy_MaterialTechParamBillSub b on a.HInterID = b.HInterID " +
                    "left join Gy_TechnologyParameter c on b.HTechParamID = c.HItemID where a.HMaterID='" + HMaterID + "' and a.HProcID='" + HProID + "' and a.HEquipID='" + HEquId + "'", "SB_EquipICMOTechParamBillMain");
                }
                else
                {
                    ds = oCN.RunProcReturn("select c.HName å·¥è‰ºå‚æ•°,b.HDataForm é‡‡é›†æ¥æº from Gy_MaterialTechParamBillMain a " +
                    "inner join Gy_MaterialTechParamBillSub b on a.HInterID = b.HInterID " +
                    "left join Gy_TechnologyParameter c on b.HTechParamID = c.HItemID where a.HMaterID='" + HMaterID + "' and a.HProcID='" + HProID + "' and a.HEquipID='" + HEquId + "' and c.HName ='" + HTeachName + "'", "SB_EquipICMOTechParamBillMain");
                }
                //添加列名
                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 è´¨é‡æ¨¡å— ç”Ÿäº§è´¨é‡æ—¥æŠ¥
        [Route("QC_CustomerAppealReport/GetQC_QualityDailyReprot")]
        [HttpGet]
        public object GetQC_QualityDailyReprot(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere == "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询条件!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                string HBatchNo = dic["HBatchNo"].ToString();//批次号
                string HBatchNo1 = dic["HBatchNo1"].ToString();//ID号
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                string HProcName = dic["HProcName"].ToString();//工序名称
                string HReceiveMan = dic["HReceiveMan"].ToString();//操作员
                string HEquipNumber = dic["HEquipNumber"].ToString();//设备编码
                string HMaterName = dic["HMaterName"].ToString();//物料名称
                string HBachNO_BCP = dic["HBachNO_BCP"].ToString();//半成品批次
                string HBachNO_CP = dic["HBachNO_CP"].ToString();//成品批次
                ds = oCN.RunProcReturn("exec h_p_QC_QualityDailyReprot '" + HBeginDate + "','" + HEndDate + "','" + HBatchNo + "','" + HBatchNo1 + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "','" + HProcName + "','" + HReceiveMan + "','" + HEquipNumber + "','" + HMaterName + "','" + HBachNO_BCP + "','" + HBachNO_CP + "'", "h_p_QC_QualityDailyReprot");
                //添加列名
                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 è´¨é‡æ¨¡å— æ¯æ—¥æ—¥æŠ¥
        [Route("QC_CustomerAppealReport/GetQC_QualityDailyReprot_Sum")]
        [HttpGet]
        public object GetQC_QualityDailyReprot_Sum(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere == "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询条件!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                string HProcName = dic["HProcName"].ToString();//工序名称
                ds = oCN.RunProcReturn("exec h_p_QC_QualityDailyReprot_Sum '" + HBeginDate + "','" + HEndDate + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "','" + HProcName + "'", "h_p_QC_QualityDailyReprot_Sum");
                //添加列名
                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 è´¨é‡æ¨¡å—    æœˆåº¦æŠ¥å‘Š æŸ¥è¯¢
        [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
        #region è´¨é‡æ¨¡å—    æ€§èƒ½æ£€æµ‹æŠ¥è¡¨ æŸ¥è¯¢
        [Route("QC_CustomerAppealReport/getQC_TechParamReport")]
        [HttpGet]
        public object getQC_TechParamReport(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                string HProject = dic["HProject"].ToString();//项目号
                string HProcId = dic["HProcId"].ToString(); //工序
                string Frequency = dic["Frequency"].ToString();//频次
                string HSourceID= dic["HSourceID"].ToString();//生产资源
                ds = oCN.RunProcReturn("exec h_p_TechParamReportList '" + Frequency + "','" + HProject + "','" + HProcId + "','" + HBeginDate + "','" + HEndDate + "','"+ HSourceID + "'", "h_p_TechParamReportList");
                //添加列名
                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 è´¨é‡æ¨¡å—    è¿”工登记表格 æŸ¥è¯¢
        [Route("QC_CustomerAppealReport/getQC_BackWorkReport")]
        [HttpGet]
        public object getQC_BackWorkReport(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                string HMaterName = dic["HMaterName"].ToString();//物料名称
                string HProcName = dic["HProcName"].ToString();//工序名称
                string HBadReasonID = dic["HBadReasonID"].ToString();//不良原因
                ds = oCN.RunProcReturn("exec h_p_QC_BackWorkReport '" + HBeginDate + "','" + HEndDate + "','" + HProject + "','" + HDivisionName + "','" + HBatchWork + "','" + HMaterName + "','" + HProcName + "','" + HBadReasonID + "'", "h_p_QC_BackWorkReport");
                //添加列名
                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
    }
}