yusijie
2024-08-07 8843f2669746aeac909b7d5345ad85a0cd6f87f6
异常管理台账图形分析报表
1个文件已修改
168 ■■■■■ 已修改文件
WebAPI/Controllers/品质管理/质量报表/QC_QualityReportsController.cs 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Æ·ÖʹÜÀí/ÖÊÁ¿±¨±í/QC_QualityReportsController.cs
@@ -1149,5 +1149,173 @@
        }
        #endregion
        #region è´¨é‡æ¨¡å— çº¿åˆ«å¼‚常管理台账
        /// <summary>
        /// è¿”回线别异常管理台账
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/QC_ErrManagerLedgerReport_Source")]
        [HttpGet]
        public object QC_ErrManagerLedgerReport_Source(string HYear, string HMonth, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_Source '" + HYear + "','" + HMonth + "'", "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 HYear, string HMonth, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_Issue '" + HYear + "','" + HMonth + "'", "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 HYear, string HMonth, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_SourceOfTheProblem '" + HYear + "','" + HMonth + "'", "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 HYear, string HMonth, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_EquipTop3Issue '" + HYear + "','" + HMonth + "'", "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
    }
}