yangle
2024-08-28 6b5d94e8697f0e73ea7430b1d7041cca18e76de7
WebAPI/Controllers/Æ·ÖʹÜÀí/ÖÊÁ¿±¨±í/QC_QualityReportsController.cs
@@ -678,7 +678,7 @@
        }
        #endregion
        #region è´¨é‡æ¨¡å—    è®¾å¤‡å·¥è‰ºå‚数趋势图 æ ¹æ®æµè½¬å¡èŽ·å–è®¾å¤‡
        #region è´¨é‡æ¨¡å—    è®¾å¤‡å·¥è‰ºå‚数趋势图 æ ¹æ®æµè½¬å¡èŽ·å–è®¾å¤‡+模具
        [Route("QC_CustomerAppealReport/Get_EquipList")]
        [HttpGet]
@@ -688,7 +688,10 @@
            {   
                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");
                ds = oCN.RunProcReturn("select distinct b.HInterID HItemID,b.HEquipFileNumber HEquipFileNumber,b.HName HName,d.HMouldNo HMouldNumber,d.HName HMouldName " +
                    " from SB_EquipICMOTechParamBillMain a left join Gy_EquipFileBillMain  b on a.HEquipID=b.HInterID" +
                    " left join Sc_ICMOBillStatus_Tmp c on a.HProcExchInterID = c.HSourceInterID and a.HProcExchEntryID = c.HSourceEntryID and a.HProcID = c.HProcID" +
                    " left join Gy_MouldFileMain d on c.HMouldID = d.HInterID where HProcExchBillNo='" + HProcExchBillNo + "'", "SB_EquipICMOTechParamBillMain");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -949,16 +952,19 @@
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_QC_ProcessPerformanceFirstPassList order by æœˆä»½ desc", "h_v_QC_ProcessPerformanceFirstPassList");
                }
                else
                {
                    string sql1 = "select * from h_v_QC_ProcessPerformanceFirstPassList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by æœˆä»½ ";
                    ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessPerformanceFirstPassList");
                }
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HYear = dic["HYear"].ToString();//å¹´
                string HDeptName = dic["HDeptName"].ToString();//部门
                string HProject = dic["HProject"].ToString();//项目号
                string HMaterNumber = dic["HMaterNumber"].ToString();//物料代码
                string HMaterName = dic["HMaterName"].ToString();//物料名称
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                ds = oCN.RunProcReturn("exec h_p_QC_ProcessPerformanceFirstPassList   '" + HYear + "','"+ HDeptName + "','" + HProject + "','" + HMaterNumber + "','" + HMaterName + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ProcessPerformanceFirstPassList");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -986,7 +992,6 @@
        }
        #endregion
        #region è´¨é‡æ¨¡å—   åˆ¶ç¨‹ç»©æ•ˆè¶‹åŠ¿å›¾(合格率)  æŸ¥è¯¢
        [Route("QC_CustomerAppealReport/getQC_ProcessPerformancePass")]
@@ -996,16 +1001,19 @@
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_QC_ProcessPerformancePassList order by æœˆä»½ desc", "h_v_QC_ProcessPerformancePassList");
                }
                else
                {
                    string sql1 = "select * from h_v_QC_ProcessPerformancePassList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by æœˆä»½ ";
                    ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessPerformancePassList");
                }
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HYear = dic["HYear"].ToString();//å¹´
                string HDeptName = dic["HDeptName"].ToString();//部门
                string HProject = dic["HProject"].ToString();//项目号
                string HMaterNumber = dic["HMaterNumber"].ToString();//物料代码
                string HMaterName = dic["HMaterName"].ToString();//物料名称
                string HBatchWork = dic["HBatchWork"].ToString();//是否量产
                string HDivisionName = dic["HDivisionName"].ToString();//事业部
                ds = oCN.RunProcReturn("exec h_p_QC_ProcessPerformancePassList  '" + HYear + "','" + HDeptName + "','" + HProject + "','" + HMaterNumber + "','" + HMaterName + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ProcessPerformancePassList");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -1381,25 +1389,16 @@
            {
                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 == ""))
                if (sWhere == null || sWhere.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询条件!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    ds = oCN.RunProcReturn("select * from h_v_Sb_EquipMentCollectionTechParam order by é‡‡é›†æ—¥æœŸ desc", "h_v_Sb_EquipMentCollectionTechParam");
                }
                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");
                else
                {
                    string sql1 = "select * from h_v_Sb_EquipMentCollectionTechParam where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by é‡‡é›†æ—¥æœŸ ";
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMentCollectionTechParam");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -1427,6 +1426,57 @@
        }
        #endregion
        #region è´¨é‡æ¨¡å— å…¨ç¨‹è´¨é‡è¿½æº¯
        /// <summary>
        /// è¿”回异常问题来源
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_CustomerAppealReport/Get_QC_FiveMenOneRingList")]
        [HttpGet]
        public object Get_QC_FiveMenOneRingList(string SN, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_QC_FiveMenOneRingList '" + SN + "'", "h_p_QC_FiveMenOneRingList");
                // éåŽ†æ‰€æœ‰è¡¨
                foreach (DataTable table in ds.Tables)
                {
                    List<object> tableColumnList = new List<object>();
                    // æ·»åŠ åˆ—å
                    foreach (DataColumn col in table.Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        tableColumnList.Add(JsonConvert.DeserializeObject(ColmString));
                    }
                    // å°†æ¯ä¸ªè¡¨çš„列名列表添加到总列名列表
                    columnNameList.Add(new { TableName = table.TableName, Columns = tableColumnList });
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds;
                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>