Пример #1
0
        public static List <ShowDataInfo> GetReleaseAlarmRecords(long id)
        {
            List <ShowDataInfo> list = new List <ShowDataInfo>();

            try
            {
                if (ClientAlarmConfig.getsererconnectstate())
                {
                    var request = new GetReleaseAlarmRecordsRequest()
                    {
                        Id = id
                    };
                    var response = alarmService.GetReleaseAlarmRecords(request);
                    if (response.Data != null)
                    {
                        list = response.Data;
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error("ClientAlarmModle-GetReleaseAlarmRecords-发生异常 " + ex.Message);
            }
            return(list);
        }
Пример #2
0
        public BasicResponse <List <ShowDataInfo> > GetReleaseAlarmRecords(GetReleaseAlarmRecordsRequest alarmRequest)
        {
            var response = new BasicResponse <List <ShowDataInfo> >();
            var runLogCacheGetAllRequest  = new RunLogCacheGetAllRequest();
            var runLogCacheGetAllResponse = runLogCacheService.GetAllRunLogCache(runLogCacheGetAllRequest);
            //var pointDefineCacheGetAllRequest = new PointDefineCacheGetAllRequest();
            var pointDefineCacheGetAllResponse = pointDefineCacheService.GetAllPointDefineCache();//从多系统缓存中查找  20171213

            if (runLogCacheGetAllResponse.Data != null && runLogCacheGetAllResponse.Data.Count > 0)
            {
                //跨天0点的记录不查询
                var listR    = runLogCacheGetAllResponse.Data.Where(a => a.Counter > alarmRequest.Id && a.Timer > DateTime.Parse(DateTime.Now.ToShortDateString() + " 00:00:00")).ToList();
                var listData = new List <ShowDataInfo>();
                try
                {
                    foreach (var item in listR)
                    {
                        if (item.Point == "000000")
                        {
                            continue;
                        }
                        ShowDataInfo sd      = new ShowDataInfo();
                        var          defInfo = pointDefineCacheGetAllResponse.Data.Find(x => x.Point == item.Point && x.Wzid == item.Wzid && x.Devid == item.Devid);
                        if (defInfo == null)
                        {
                            continue;
                        }
                        sd.ID       = long.Parse(item.ID);
                        sd.Counter  = item.Counter;
                        sd.Fzh      = item.Fzh;
                        sd.Kh       = item.Kh;
                        sd.Devid    = item.Devid;
                        sd.Wzid     = item.Wzid;
                        sd.Property = defInfo.DevPropertyID;
                        sd.Class    = defInfo.DevClassID;
                        sd.Type     = item.Type;
                        sd.Point    = item.Point;
                        sd.Devname  = defInfo.DevName;
                        sd.Wz       = defInfo.Wz;
                        sd.Ssz      = item.Val;
                        sd.Unit     = defInfo.Unit;
                        sd.State    = item.State;
                        sd.Timer    = item.Timer;
                        sd.Flag     = 0;
                        listData.Add(sd);
                    }
                    response.Data = listData;
                }
                catch (Exception ex)
                {
                    response.Code    = -100;
                    response.Message = ex.Message;
                    this.ThrowException("GetReleaseAlarmRecords-发生异常", ex);;
                }
            }

            return(response);
        }
        public BasicResponse <List <ShowDataInfo> > GetReleaseAlarmRecords(GetReleaseAlarmRecordsRequest alarmRequest)
        {
            var responsestr = HttpClientHelper.Post(Webapi + "/v1/alarm/getreleasealarmrecords?token=" + Token, JSONHelper.ToJSONString(alarmRequest));

            return(JSONHelper.ParseJSONString <BasicResponse <List <ShowDataInfo> > >(responsestr));
        }
Пример #4
0
 public BasicResponse <List <ShowDataInfo> > GetReleaseAlarmRecords(GetReleaseAlarmRecordsRequest alarmRequest)
 {
     return(alarmService.GetReleaseAlarmRecords(alarmRequest));
 }