yusijie
2024-07-29 97267e65bbdef1192a075401a18beea13f7676ea
WebAPI/Controllers/Éú²ú¹ÜÀí/ÖÊÁ¿»ã±¨µ¥/Sc_QualityReportBillController.cs
@@ -1825,6 +1825,117 @@
        }
        #endregion
        #region ç‰©æ–™ç”Ÿäº§è‰¯çŽ‡ç»Ÿè®¡(斯莫尔) æŸ¥è¯¢
        [Route("Sc_QualityReportBill/getSc_HMaterYieldStatistics")]
        [HttpGet]
        public object getSc_HMaterYieldStatistics(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sc_HMater_Yield_Statistics_Query order by å•据号 desc", "h_v_Sc_HMater_Yield_Statistics_Query");
                }
                else
                {
                    string sql1 = "select * from h_v_Sc_HMater_Yield_Statistics_Query where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by æ—¥æœŸ desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_HMater_Yield_Statistics_Query");
                }
                //添加列名
                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("Sc_QualityReportBill/getSc_HICMMaterStatistics")]
        [HttpGet]
        public object getSc_HICMMaterStatistics(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sc_HICMMater_Statistics_Query order by å•据号 desc", "h_v_Sc_HICMMater_Statistics_Query");
                }
                else
                {
                    string sql1 = "select * from h_v_Sc_HICMMater_Statistics_Query where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by æ—¥æœŸ desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_HICMMater_Statistics_Query");
                }
                //添加列名
                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
    }
}