duheng
2024-06-19 64c0604d9a7d2460f6bf1b6cc7df02d769db3a15
BLL/IStation.BLL.Connect/ReservoirWaterLevel.cs
@@ -4,28 +4,27 @@
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text;
namespace IStation.BLL
{
    /// <summary>
    /// 水库水位
    /// 水库水位
    /// </summary>
    public class ReservoirWaterLevel
    {
        public static double GetRealValue()
        {
            if(!ServiceParas.IsRemote)
            if (!ServiceParas.IsRemote)
            {
                return -100;
            }
            if (string.IsNullOrEmpty(ServiceParas.ApiServiceUrl))
            {
                return -100;
            }
            string url = string.Format(@"{0}/ReservoirWaterLevel/GetRealValue", ServiceParas.ApiServiceUrl);
            //先根据用户请求的uri构造请求地址
            //string serviceUrl = string.Format("{0}/{1}", this.BaseUri, uri);
@@ -38,7 +37,7 @@
            myRequest.Method = "GET";
            //myRequest.Accept = "application/json";
            //myRequest.ContentType = "application/json";  // //Content-Type: application/x-www-form-urlencoded
            //myRequest.ContentType = "application/json";  // //Content-Type: application/x-www-form-urlencoded
            myRequest.AutomaticDecompression = DecompressionMethods.GZip;
            myRequest.Accept = Accept;
            //myRequest.ContentType = ContentType;
@@ -71,13 +70,12 @@
            reader.Close();
            myResponse.Close();
            return ret.Data;
        }
        /// <summary>
        /// 获取 预测值
        /// </summary>
        /// 获取 预测值
        /// </summary>
        /// <returns></returns>
        public static List<IStation.Model.WaterPredictRecord> GetPredictRecordByHourRange(DateTime start_time, DateTime end_time)
        {
@@ -86,11 +84,10 @@
            {
                return null;
            }
            string url = string.Format(@"{0}/ReservoirWaterLevel/GetPredictRecordByHourRange?start_time={1}&end_time={2}",
            string url = string.Format(@"{0}/ReservoirWaterLevel/GetPredictRecordByHourRange?start_time={1}&end_time={2}",
                apiServiceUrl,
                start_time.ToString("yyyy-MM-dd HH:mm:00"),
                end_time.ToString("yyyy-MM-dd HH:mm:00"));
            //先根据用户请求的uri构造请求地址
            //string serviceUrl = string.Format("{0}/{1}", this.BaseUri, uri);
@@ -103,7 +100,7 @@
            myRequest.Method = "GET";
            //myRequest.Accept = "application/json";
            //myRequest.ContentType = "application/json";  // //Content-Type: application/x-www-form-urlencoded
            //myRequest.ContentType = "application/json";  // //Content-Type: application/x-www-form-urlencoded
            myRequest.AutomaticDecompression = DecompressionMethods.GZip;
            myRequest.Accept = Accept;
            //myRequest.ContentType = ContentType;
@@ -136,13 +133,12 @@
            reader.Close();
            myResponse.Close();
            return ret.Data;
        }
        ///// <summary>
        ///// 获取今日预测值(24点时)
        ///// </summary>
        ///// 获取今日预测值(24点时)
        ///// </summary>
        ///// <returns></returns>
        //public static double GetTodayEndPredictiveValue()
        //{
@@ -152,7 +148,6 @@
        //        return -100;
        //    }
        //    string url = string.Format(@"{0}/ReservoirWaterLevel/GetTodayEndPredictiveValue", apiServiceUrl);
        //    //先根据用户请求的uri构造请求地址
        //    //string serviceUrl = string.Format("{0}/{1}", this.BaseUri, uri);
@@ -165,7 +160,7 @@
        //    myRequest.Method = "GET";
        //    //myRequest.Accept = "application/json";
        //    //myRequest.ContentType = "application/json";  // //Content-Type: application/x-www-form-urlencoded
        //    //myRequest.ContentType = "application/json";  // //Content-Type: application/x-www-form-urlencoded
        //    myRequest.AutomaticDecompression = DecompressionMethods.GZip;
        //    myRequest.Accept = Accept;
        //    //myRequest.ContentType = ContentType;
@@ -198,8 +193,7 @@
        //    reader.Close();
        //    myResponse.Close();
        //    return ret.Data;
        //}
    }
}
}