Example #1
0
        /// <summary>
        /// 加载测点定义拓展属性
        /// </summary>
        /// <param name="pointDefines"></param>
        private void LoadPointDefineExtendProperty(List <Jc_DefInfo> pointDefines)
        {
            //位置信息
            var positionList = PositionCache.PositionCahceInstance.Query();
            //设备种类信息
            var deviceClassList = DeviceClassCache.DeviceClassCahceInstance.Query();
            //设备性质信息
            var devicePropertyList = DevicePropertyCache.DeviceDefineCahceInstance.Query();
            //设备型号信息
            var deviceTypeList = DeviceTypeCache.DeviceTypeCahceInstance.Query();
            //设备定义信息
            var deviceDefineList = DeviceDefineCache.DeviceDefineCahceInstance.Query();

            //区域信息
            List <AreaInfo>    areaList    = new List <AreaInfo>();
            AreaGetListRequest areaRequest = new AreaGetListRequest();
            var areaResponse = areaServie.GetAreaList(areaRequest);

            if (areaResponse != null && areaResponse.IsSuccess)
            {
                areaList = areaResponse.Data;
            }
            //图形信息,只加载通风系统默认图形对应的测点位置信息  20170829
            var request = new GraphicsbaseinfGetListRequest();

            request.PagerInfo.PageIndex = 1;
            request.PagerInfo.PageSize  = int.MaxValue;
            IGraphicsbaseinfService graphicsbaseinfService = ServiceFactory.Create <IGraphicsbaseinfService>();
            var response = graphicsbaseinfService.GetGraphicsbaseinfList(request);
            GraphicsbaseinfInfo defaultGraphicsbaseinf = response.Data.Find(a => a.Bz3 == "1");

            List <GraphicspointsinfInfo> graphicspointsinfList = new List <GraphicspointsinfInfo>();
            //GraphicspointsinfGetListRequest graphicspointsinfRequest = new GraphicspointsinfGetListRequest();
            var graphicsbaseinfResponse = graphicspointsinfService.GetAllGraphicspointsinfInfo();

            if (graphicsbaseinfResponse != null && graphicsbaseinfResponse.IsSuccess && defaultGraphicsbaseinf != null)
            {
                graphicspointsinfList = graphicsbaseinfResponse.Data.FindAll(g => g.GraphId == defaultGraphicsbaseinf.GraphId);
            }
            //加载识别器限制进入、禁止进入人员信息  20171122
            List <R_RestrictedpersonInfo>    RestrictedpersonInfoList  = new List <R_RestrictedpersonInfo>();
            IR_RestrictedpersonService       r_RestrictedpersonService = ServiceFactory.Create <IR_RestrictedpersonService>();
            R_RestrictedpersonGetListRequest restrictedpersonRequest   = new R_RestrictedpersonGetListRequest();

            RestrictedpersonInfoList = r_RestrictedpersonService.GetRestrictedpersonList(restrictedpersonRequest).Data;

            pointDefines.ForEach(pointDefine =>
            {
                if (positionList.Any())
                {
                    var area             = areaList.FirstOrDefault(a => a.Areaid == pointDefine.Areaid);
                    pointDefine.AreaName = area == null ? string.Empty : area.Areaname;
                    pointDefine.AreaLoc  = area == null ? string.Empty : area.Loc;
                }
                if (positionList.Any())
                {
                    var position   = positionList.FirstOrDefault(p => p.WzID == pointDefine.Wzid);
                    pointDefine.Wz = position == null ? string.Empty : position.Wz;
                }
                if (graphicspointsinfList.Any())
                {
                    //从通风系统默认图形中获取测点的默认坐标信息  20170829
                    var graphicspoint       = graphicspointsinfList.FirstOrDefault(g => g.Point.Contains(pointDefine.Point));
                    pointDefine.XCoordinate = graphicspoint == null ? string.Empty : graphicspoint.XCoordinate;
                    pointDefine.YCoordinate = graphicspoint == null ? string.Empty : graphicspoint.YCoordinate;
                }
                if (deviceDefineList.Any())
                {
                    var deviceDefine          = deviceDefineList.FirstOrDefault(g => g.Devid == pointDefine.Devid);
                    pointDefine.DevName       = deviceDefine == null ? string.Empty : deviceDefine.Name;
                    pointDefine.DevPropertyID = deviceDefine == null ? 0 : deviceDefine.Type;
                    pointDefine.DevClassID    = deviceDefine == null ? 0 : deviceDefine.Bz3;
                    pointDefine.DevModelID    = deviceDefine == null ? 0 : deviceDefine.Bz4;
                    pointDefine.Unit          = deviceDefine == null ? string.Empty : deviceDefine.Xs1;
                    //pointDefine.Sysid = deviceDefine != null ? 0 : deviceDefine.Sysid; //去掉  20171207
                }
                if (deviceClassList.Any())
                {
                    var deviceClass      = deviceClassList.FirstOrDefault(devc => devc.LngEnumValue == pointDefine.DevClassID);
                    pointDefine.DevClass = deviceClass == null ? string.Empty : deviceClass.StrEnumDisplay;
                }
                if (devicePropertyList.Any())
                {
                    var deviceProperty      = devicePropertyList.FirstOrDefault(devc => devc.LngEnumValue == pointDefine.DevPropertyID);
                    pointDefine.DevProperty = deviceProperty == null ? string.Empty : deviceProperty.StrEnumDisplay;
                }
                if (deviceTypeList.Any())
                {
                    var deviceType       = deviceTypeList.FirstOrDefault(devc => devc.LngEnumValue == pointDefine.DevModelID);
                    pointDefine.DevModel = deviceType == null ? string.Empty : deviceType.StrEnumDisplay;
                }
                //加载识别器禁止进入、限制进入人员信息  20171122
                if (RestrictedpersonInfoList.Any())
                {
                    var tempRestrictedpersonInfoList     = RestrictedpersonInfoList.FindAll(a => a.PointId == pointDefine.PointID);
                    pointDefine.RestrictedpersonInfoList = tempRestrictedpersonInfoList;
                }
                //加载识别器类型信息  20171122
                pointDefine.RecognizerTypeDesc = EnumHelper.GetEnumDescription((Recognizer)pointDefine.Bz1);

                //赋值分站识别器的初始状态
                pointDefine.DataState = 46;
                pointDefine.State     = 46;

                pointDefine.ClsCommObj   = new DataContract.CommunicateExtend.CommProperty((uint)pointDefine.Fzh);
                pointDefine.DttStateTime = DateTime.Now;  //2017.11.30 by

                if (pointDefine.DevPropertyID == 0)
                {
                    pointDefine.ClsCommObj.BInit = false;
                    pointDefine.sendIniCount     = 1;
                }
            });
        }
        public BasicResponse <List <R_RestrictedpersonInfo> > GetRestrictedpersonList(R_RestrictedpersonGetListRequest restrictedpersonRequest)
        {
            var restrictedpersonresponse = new BasicResponse <List <R_RestrictedpersonInfo> >();

            restrictedpersonRequest.PagerInfo.PageIndex = restrictedpersonRequest.PagerInfo.PageIndex - 1;
            if (restrictedpersonRequest.PagerInfo.PageIndex < 0)
            {
                restrictedpersonRequest.PagerInfo.PageIndex = 0;
            }
            int rowcount = 0;
            var restrictedpersonModelLists = _Repository.GetRestrictedpersonList(restrictedpersonRequest.PagerInfo.PageIndex, restrictedpersonRequest.PagerInfo.PageSize, out rowcount);
            var restrictedpersonInfoLists  = new List <R_RestrictedpersonInfo>();

            foreach (var item in restrictedpersonModelLists)
            {
                var RestrictedpersonInfo = ObjectConverter.Copy <R_RestrictedpersonModel, R_RestrictedpersonInfo>(item);
                restrictedpersonInfoLists.Add(RestrictedpersonInfo);
            }
            restrictedpersonresponse.Data = restrictedpersonInfoLists;
            return(restrictedpersonresponse);
        }