chenhaozhe
2025-10-26 1948124877478db58b27841f9398aed97ef13053
WebAPI/Controllers/Æ·ÖʹÜÀí/ÖÊÁ¿±¨±í/QC_QualityReportsController.cs
@@ -293,13 +293,19 @@
        /// </summary>
        [Route("QC_Report/QualityTraceability1")]
        [HttpGet]
        public object QualityTraceability1(string HICMOBillNo, string HType)
        public object QualityTraceability1(string sWhere, string HType)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HICMOInterID = dic["HICMOInterID"].ToString();
                string HICMOEntryID = dic["HICMOEntryID"].ToString();
                string HICMOBillNo = dic["HICMOBillNo"].ToString();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "','"+ HICMOInterID + "','"+ HICMOEntryID + "'", "h_p_Sc_QueryQualityByICMOBill");
               
                //添加列名
@@ -336,13 +342,20 @@
        /// </summary>
        [Route("QC_Report/QualityTraceability2")]
        [HttpGet]
        public object QualityTraceability2(string HICMOBillNo, string HType)
        public object QualityTraceability2(string sWhere, string HType)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HICMOInterID = dic["HICMOInterID"].ToString();
                string HICMOEntryID = dic["HICMOEntryID"].ToString();
                string HICMOBillNo = dic["HICMOBillNo"].ToString();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "','" + HICMOInterID + "','" + HICMOEntryID + "'", "h_p_Sc_QueryQualityByICMOBill");
                //添加列名
@@ -379,13 +392,18 @@
        /// </summary>
        [Route("QC_Report/QualityTraceability3")]
        [HttpGet]
        public object QualityTraceability3(string HICMOBillNo, string HType)
        public object QualityTraceability3(string sWhere, string HType)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
                string HICMOInterID = dic["HICMOInterID"].ToString();
                string HICMOEntryID = dic["HICMOEntryID"].ToString();
                string HICMOBillNo = dic["HICMOBillNo"].ToString();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "','" + HICMOInterID + "','" + HICMOEntryID + "'", "h_p_Sc_QueryQualityByICMOBill");
                //添加列名
@@ -422,13 +440,20 @@
        /// </summary>
        [Route("QC_Report/QualityTraceability4")]
        [HttpGet]
        public object QualityTraceability4(string HICMOBillNo, string HType)
        public object QualityTraceability4(string sWhere, string HType)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HICMOInterID = dic["HICMOInterID"].ToString();
                string HICMOEntryID = dic["HICMOEntryID"].ToString();
                string HICMOBillNo = dic["HICMOBillNo"].ToString();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "','" + HICMOInterID + "','" + HICMOEntryID + "'", "h_p_Sc_QueryQualityByICMOBill");
                //添加列名
@@ -443,6 +468,55 @@
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[1];
                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_Report/QualityTraceability5")]
        [HttpGet]
        public object QualityTraceability5(string sWhere, string HType)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HICMOInterID = dic["HICMOInterID"].ToString();
                string HICMOEntryID = dic["HICMOEntryID"].ToString();
                string HICMOBillNo = dic["HICMOBillNo"].ToString();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "','" + HICMOInterID + "','" + HICMOEntryID + "'", "h_p_Sc_QueryQualityByICMOBill");
                //添加列名
                foreach (DataColumn col in ds.Tables[2].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[4];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
@@ -2074,10 +2148,11 @@
                string HProject = dic["HProject"].ToString();//项目号
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                string HDepartment = dic["HDepartment"].ToString();//车间
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_QC_BadReasonTop3Report '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_BadReasonTop3Report");
                ds = oCN.RunProcReturn("exec h_p_QC_BadReasonTop3Report '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','"+ HDepartment + "','" + HDivisionName + "'", "h_p_QC_BadReasonTop3Report");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)