1
yangle
2024-07-31 92218ec56cad397211bad16cbfd53d436c82b1b7
WebAPI/Controllers/Æ·ÖʹÜÀí/ÖÊÁ¿±¨±í/QC_QualityReportsController.cs
@@ -632,6 +632,144 @@
        }
        #endregion
        #region è´¨é‡æ¨¡å—    å„工序质量趋势图 æŸ¥è¯¢
        [Route("QC_CustomerAppealReport/getSc_StationOutBill_HProc")]
        [HttpGet]
        public object getSc_HMaterYieldStatistics(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sc_StationOutBillQuery_HProc order by æ—¥æœŸ desc", "h_v_Sc_StationOutBillQuery_HProc");
                }
                else
                {
                    string sql1 = "select * from h_v_Sc_StationOutBillQuery_HProc where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by æ—¥æœŸ ";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_StationOutBillQuery_HProc");
                }
                //添加列名
                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 user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("select distinct b.HInterID HItemID,b.HName HName  from SB_EquipICMOTechParamBillMain a left join Gy_EquipFileBillMain  b on a.HEquipID=b.HInterID where HProcExchBillNo='" + HProcExchBillNo + "'", "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/SB_EquipICMOTechParamList")]
        [HttpGet]
        public object SB_EquipICMOTechParamList(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 HTechParamName = dic["HTechParamName"].ToString();
                string HEquipName = dic["HEquipName"].ToString();
                if ((HProcExchBillNo == null || HProcExchBillNo == "")&&(HProcName == null || HProcName == "") && (HTechParamName == null || HTechParamName == "") && (HEquipName == null || HEquipName == ""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询条件!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("exec h_p_SB_EquipICMOTechParamBillList '" + HProcExchBillNo + "','" + HProcName + "','" + HTechParamName + "',"+HEquipName, "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 è´¨é‡æ¨¡å— æ€§èƒ½æŠ¥åºŸå°è´¦
        /// <summary>
        /// è¿”回直通率报表列表