1
duhe
2024-08-21 d63bbcbae24d318011ac68cef3955fbaf88c4274
WebAPI/Controllers/Æ·ÖʹÜÀí/ÖÊÁ¿±¨±í/QC_QualityReportsController.cs
@@ -1371,5 +1371,61 @@
        }
        #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 HEquipName = dic["HEquipName"].ToString();
                string HProcName = dic["HProcName"].ToString();
                string HTechParamName = dic["HTechParamName"].ToString();
                string HDate = dic["HDate"].ToString();
                if ((HEquipNumber == null || HEquipNumber == "") && (HEquipName == null || HEquipName == "") && (HProcName == null || HProcName == "") && (HTechParamName == null || HTechParamName == "") && (HDate == null || HDate == ""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询条件!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select HSourceCode è®¾å¤‡ç¼–码,CONVERT(VARCHAR, HDate, 120) é‡‡é›†æ—¥æœŸ,HTechParamName å·¥è‰ºäº§æ•°,HResult æ•°é‡‡å€¼ from Sb_EquipMentCollectionTechParam_Temp where HSourceCode='" + HEquipNumber + "' and HTechParamName='"+ HTechParamName + "' and CONVERT(date, HDate) <='"+HDate+"'", "Sb_EquipMentCollectionTechParam_Temp");
                //添加列名
                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
    }
}