public BasicResponse <List <B_CallInfo> > GetAllCache() { return(_bcallService.GetAllCache()); }
/// <summary> /// 广播实时值刷新 /// </summary> /// <param name="pointsdt"></param> /// <param name="rowindex"></param> /// <param name="pointsszdt"></param> /// <returns></returns> private string BroadCastHandle(DataTable pointsdt, int rowindex, List <Jc_DefInfo> bdefinfos) { string pointssz = string.Empty; try { string tempstate = "", tempdatastate = "", tempssz = "", tempdatatext = "", tempstatetext = ""; DataRow[] drdata, drstate; //if (pointsdt.Rows[rowindex]["Point"].ToString().Contains(" ̄")) //{ // tempPoint = pointsdt.Rows[rowindex]["Point"].ToString().Substring(0, pointsdt.Rows[rowindex]["Point"].ToString().IndexOf(' ̄')); // //tempPoint = pointsdt.Rows[i]["Point"].ToString(); //} //else //{ // tempPoint = pointsdt.Rows[rowindex]["Point"].ToString(); //} //dr = pointsszdt.Select("point='" + tempPoint + "'"); var bdefinfo = bdefinfos.FirstOrDefault(o => o.Point == pointsdt.Rows[rowindex]["Point"].ToString()); if (bdefinfo != null) { var bcallinfos = _bcallService.GetAllCache().Data; var defcallinfos = bcallinfos.Where(o => o.CallType != 2 && o.CallPointList != null && o.CallPointList.Select(c => c.CalledPointId).Contains(bdefinfo.PointID)).ToList(); //实时值 tempssz = bdefinfo.Ssz; pointssz += tempssz + ","; //设备状态值 tempstate = bdefinfo.State.ToString(); pointssz += tempstate + ","; //数据状态值 if (defcallinfos.Count > 0) { tempdatastate = "49"; } else { tempdatastate = bdefinfo.DataState.ToString(); } pointssz += tempdatastate + ","; //报警状态 pointssz += "0,";//设置不报警 //数据状态 drdata = dtStateVal.Select("lngEnumValue='" + tempdatastate + "'"); if (drdata.Length > 0) { tempdatatext = drdata[0]["strEnumDisplay"].ToString(); } else { tempdatatext = "未知"; } pointssz += tempdatatext + ","; //设备状态 drstate = dtStateVal.Select("lngEnumValue='" + tempstate + "'"); if (drstate.Length > 0) { tempstatetext = drstate[0]["strEnumDisplay"].ToString(); } else { tempstatetext = "未知"; } pointssz += tempstatetext; } else { pointssz += "无数据,0,0,0,未知,未知"; } return(pointssz); } catch (Exception ex) { LogHelper.Info("加载广播设备出错!" + ex.Message); pointssz += "无数据,0,46,0,未知,未知"; return(pointssz); } }