客诉单报表(总报表,客户维度,部门维度,责任人维度,编码维度,问题类型维度)
2个文件已修改
262 ■■■■■ 已修改文件
DAL/质检管理/ClsQC_ProcessCheckBill.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/客诉处理单/Crm_CustomerAppealBillController.cs 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/Öʼì¹ÜÀí/ClsQC_ProcessCheckBill.cs
@@ -143,7 +143,7 @@
            try
            {
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //主表
WebAPI/Controllers/Æ·ÖʹÜÀí/¿ÍËß´¦Àíµ¥/Crm_CustomerAppealBillController.cs
@@ -832,6 +832,57 @@
        }
        #endregion
        #region å®¢è¯‰å¤„理单 æ±‡æ€»æŠ¥è¡¨æŸ¥è¯¢
        /// <summary>
        /// è¿”回客诉处理单汇总报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/Sum")]
        [HttpGet]
        public object Sum(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_CustomerAppealReport_Sum '" + sWhere + "'", "h_p_QC_CustomerAppealReport_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 å®¢è¯‰å¤„理单 å®¢æˆ·ç»´åº¦æŠ¥è¡¨æŸ¥è¯¢
        /// <summary>
@@ -884,5 +935,214 @@
            }
        }
        #endregion
        #region å®¢è¯‰å¤„理单 éƒ¨é—¨ç»´åº¦æŠ¥è¡¨æŸ¥è¯¢
        /// <summary>
        /// è¿”回客诉处理单部门维度报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/Dept")]
        [HttpGet]
        public object Dept(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_CustomerAppealReport_Dept '" + sWhere + "'", "h_p_QC_CustomerAppealReport_Dept");
                }
                //添加列名
                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/Emp")]
        [HttpGet]
        public object Emp(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_CustomerAppealReport_Emp '" + sWhere + "'", "h_p_QC_CustomerAppealReport_Emp");
                }
                //添加列名
                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/Material")]
        [HttpGet]
        public object Material(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_CustomerAppealReport_Material '" + sWhere + "'", "h_p_QC_CustomerAppealReport_Material");
                }
                //添加列名
                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/ProblemType")]
        [HttpGet]
        public object ProblemType(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_CustomerAppealReport_BadClass '" + sWhere + "'", "h_p_QC_CustomerAppealReport_BadClass");
                }
                //添加列名
                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
    }
}