public BasicResponse <DataTable> GetPointList(GetPointListRequest request)
        {
            var responseStr = HttpClientHelper.Post(Webapi + "/v1/Chart/GetPointList?token=" + Token,
                                                    JSONHelper.ToJSONString(request));
            var res   = JSONHelper.ParseJSONString <BasicResponse <string> >(responseStr);
            var resZh = ObjectConverter.FromBase64String <DataTable>(res.Data);

            return(new BasicResponse <DataTable>
            {
                Data = resZh
            });
        }
Esempio n. 2
0
        /// <summary>
        ///     返回历史测点列表信息
        /// </summary>
        /// <param name="SzNameS">开始时间</param>
        /// <param name="SzNameE">结束时间</param>
        /// <param name="Wzid">位置ID</param>
        /// <param name="DevId">设备类型ID</param>
        /// <param name="Type">1:模拟量,2:开关量,3:所有测点</param>
        /// <returns></returns>
        public List <string> GetPointList(DateTime SzNameS, DateTime SzNameE, int Type, ref List <string> PointIDList,
                                          ref List <string> DevList, ref List <string> WzList)
        {
            var ReturnStr = new List <string>();
            var dt        = new DataTable();

            SzNameS = Convert.ToDateTime(SzNameS.ToShortDateString());
            SzNameE = Convert.ToDateTime(SzNameE.ToShortDateString() + " 23:59:59");
            try
            {
                PointIDList.Clear();
                DevList.Clear();
                WzList.Clear();
                //dt = ServiceFactory.CreateService<IChartService>().GetPointList(SzNameS, SzNameE, Type);
                var req = new GetPointListRequest
                {
                    SzNameS = SzNameS,
                    SzNameE = SzNameE,
                    Type    = Type
                };
                var res = _chartService.GetPointList(req);
                if (!res.IsSuccess)
                {
                    throw new Exception(res.Message);
                }
                dt = res.Data;
                DataView dv = dt.DefaultView;
                dv.Sort = "point asc";
                dt      = dv.ToTable();
                foreach (DataRow Dr in dt.Rows)
                {
                    if (DateTime.Parse(Dr["DeleteTime"].ToString()) != DateTime.Parse("1900-01-01"))
                    {
                        ReturnStr.Add(Dr["point"] + "." + Dr["wz"] + "[" + Dr["name"] + "]" + "-" + Dr["DeleteTime"]);
                    }
                    else
                    {
                        ReturnStr.Add(Dr["point"] + "." + Dr["wz"] + "[" + Dr["name"] + "]");
                    }
                    PointIDList.Add(Dr["PointID"].ToString());
                    DevList.Add(Dr["devid"].ToString());
                    WzList.Add(Dr["wzid"].ToString());
                }
            }
            catch (Exception Ex)
            {
                LogHelper.Error("QueryConditions_GetPointList" + Ex.Message + Ex.StackTrace);
            }
            return(ReturnStr);
        }