Ejemplo n.º 1
0
        public IEnumerable <CellMrsRsrpDto> QueryRsrpStats(int eNodebId, byte sectorId, DateTime begin, DateTime end)
        {
            var eNodeb = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);
            var list   = _rsrpRepository.GetList(eNodebId + "-" + sectorId, begin, end).MapTo <List <CellMrsRsrpDto> >();

            list.ForEach(stat => stat.ENodebName = eNodeb?.Name);
            return(list);
        }
Ejemplo n.º 2
0
        private IMongoQuery <CellHuaweiMongo> ConstructQuery(int eNodebId, byte sectorId)
        {
            var eNodeb = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);

            if (eNodeb == null)
            {
                return(null);
            }
            return(eNodeb.Factory == "华为"
                ? (IMongoQuery <CellHuaweiMongo>) new HuaweiCellQuery(_repository, eNodebId, sectorId)
                : new ZteCellQuery(_zteCellRepository, _zteMeasRepository, _ztePrachRepository, eNodebId, sectorId));
        }
Ejemplo n.º 3
0
        private IMongoQuery <ENodebIntraFreqHoView> ConstructENodebQuery(int eNodebId)
        {
            var eNodeb = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);

            if (eNodeb == null)
            {
                return(null);
            }
            return(eNodeb.Factory == "华为"
                ? (IMongoQuery <ENodebIntraFreqHoView>) new HuaweiIntraFreqENodebMongoQuery(_huaweiENodebHoRepository, eNodebId)
                : new ZteIntraFreqENodebQuery(_zteGroupRepository, _zteMeasurementRepository, eNodebId));
        }
Ejemplo n.º 4
0
        public IEnumerable <InterferenceMatrixView> QueryViews(DateTime begin, DateTime end, int cellId, byte sectorId)
        {
            var statList = _repository.GetAllList(begin, end, cellId, sectorId);
            var results  = from stat in statList
                           group stat by new
            {
                stat.ENodebId,
                stat.SectorId,
                stat.NeighborPci,
                stat.NeighborEarfcn,
                stat.DestENodebId,
                stat.DestSectorId,
                stat.Earfcn
            }
            into g
                select new InterferenceMatrixView
            {
                DestPci           = g.Key.NeighborPci,
                DestENodebId      = g.Key.DestENodebId,
                DestSectorId      = g.Key.DestSectorId,
                NeighborEarfcn    = g.Key.NeighborEarfcn,
                Mod3Interferences = g.Key.Earfcn == g.Key.NeighborEarfcn
                        ? g.Average(x =>
                                    x.Pci % 3 == x.NeighborPci % 3 ? (x.Diff0 + x.Diff3 + x.Diff6) : 0)
                        : 0,
                Mod6Interferences = g.Key.Earfcn == g.Key.NeighborEarfcn
                        ? g.Average(x =>
                                    x.Pci % 6 == x.NeighborPci % 6 ? (x.Diff0 + x.Diff3 + x.Diff6) : 0)
                        : 0,
                OverInterferences10Db = g.Average(x => (x.Diff0 + x.Diff3 + x.Diff6 + x.Diff9)),
                OverInterferences6Db  = g.Average(x => (x.Diff0 + x.Diff3 + x.Diff6)),
                InterferenceLevel     =
                    g.Average(
                        x =>
                        (x.Diff0 + x.Diff3 + x.Diff6) *
                        (x?.NeighborRsrpBelow120 ??
                         x.RsrpBelow120 + x?.NeighborRsrpBetween120110 ??
                         x.RsrpBetween120110 + x?.NeighborRsrpBetween110105 ?? x.RsrpBetween110105)),
                NeighborCellName = "未匹配小区"
            };
            var views = results as InterferenceMatrixView[] ?? results.ToArray();

            foreach (var result in views.Where(x => x.DestENodebId > 0))
            {
                var eNodeb = _eNodebRepository.FirstOrDefault(x => x.ENodebId == result.DestENodebId);
                result.NeighborCellName = eNodeb?.Name + "-" + result.DestSectorId;
            }
            return(views);
        }
Ejemplo n.º 5
0
        private IMongoQuery <List <NeighborCellMongo> > ConstructNeighborQuery(int eNodebId, byte sectorId)
        {
            var eNodeb = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);

            if (eNodeb == null)
            {
                return(null);
            }
            return(eNodeb.Factory == "华为"
                ? (IMongoQuery <List <NeighborCellMongo> >)
                   new HuaweiNeighborQuery(_cellRepository, _eNodebRepository, _huaweiCellRepository,
                                           _huaweiNeighborRepository, _huaweiInterFreqNCellRepository, eNodebId, sectorId)
                : new ZteNeighborQuery(_cellRepository, _zteNeighborRepository, _zteExternalRepository, eNodebId,
                                       sectorId));
        }
Ejemplo n.º 6
0
        public List <NeighborCellMongo> Query()
        {
            var huaweiCell      = _huaweiCellRepository.GetRecent(_eNodebId, _sectorId);
            var localCellId     = huaweiCell?.LocalCellId ?? _sectorId;
            var huaweiNeighbors = _huaweiNeighborRepository.GetRecentList(_eNodebId, (byte)localCellId);
            var interNeighbors  = _interNeighborRepository.GetRecentList(_eNodebId, (byte)localCellId);
            var results         = Mapper.Map <List <EutranIntraFreqNCell>, List <NeighborCellMongo> >(huaweiNeighbors);

            results.AddRange(Mapper.Map <List <EutranInterFreqNCell>, IEnumerable <NeighborCellMongo> >(interNeighbors));
            results.ForEach(x =>
            {
                x.SectorId       = _sectorId;
                var neighborCell = _cellRepository.GetBySectorId(x.NeighborCellId, x.NeighborSectorId);
                if (neighborCell != null)
                {
                    x.NeighborPci = neighborCell.Pci;
                }
                var neighborENodeb = _eNodebRepository.FirstOrDefault(e => e.ENodebId == x.NeighborCellId);
                if (neighborENodeb != null)
                {
                    x.NeighborCellName = neighborENodeb.Name + "-" + x.NeighborSectorId;
                }
            });
            return(results);
        }
Ejemplo n.º 7
0
        public List <NeighborCellMongo> Query()
        {
            var neighborCell     = _cellRepository.GetBySectorId(_destENodebId, _destSectorId);
            var neighborPci      = neighborCell?.Pci;
            var neighborENodeb   = _eNodebRepository.FirstOrDefault(x => x.ENodebId == _destENodebId);
            var neighborCellName = neighborENodeb?.Name ?? "未知基站" + "-" + _destSectorId;
            var huaweiNeighbors  = _huaweiNeighborRepository.GetAllReverseList(_destENodebId, _destSectorId);
            var interNeighbors   = _interNeighborRepository.GetAllReverseList(_destENodebId, _destSectorId);
            var results          = huaweiNeighbors.Select(x =>
            {
                var result              = Mapper.Map <EutranIntraFreqNCell, NeighborCellMongo>(x);
                result.NeighborPci      = neighborPci ?? 0;
                result.NeighborCellName = neighborCellName;
                result.NeighborCellId   = _destENodebId;
                result.NeighborSectorId = _destSectorId;
                var huaweiCell          = _huaweiCellRepository.GetByLocal(x.eNodeB_Id, x.LocalCellId);
                result.SectorId         = (byte?)(huaweiCell?.CellId) ?? 255;
                return(result);
            }).ToList();

            results.AddRange(interNeighbors.Select(x =>
            {
                var result              = Mapper.Map <EutranInterFreqNCell, NeighborCellMongo>(x);
                result.NeighborPci      = neighborPci ?? 0;
                result.NeighborCellName = neighborCellName;
                result.NeighborCellId   = _destENodebId;
                result.NeighborSectorId = _destSectorId;
                var huaweiCell          = _huaweiCellRepository.GetByLocal(x.eNodeB_Id, x.LocalCellId);
                result.SectorId         = (byte?)(huaweiCell?.CellId) ?? 255;
                return(result);
            }));
            return(results);
        }
Ejemplo n.º 8
0
        public static NearestPciCellView ConstructView(this NearestPciCell stat, IENodebRepository repository)
        {
            var view   = Mapper.Map <NearestPciCell, NearestPciCellView>(stat);
            var eNodeb = repository.FirstOrDefault(x => x.ENodebId == stat.NearestCellId);

            view.NearestENodebName = eNodeb == null ? "Undefined" : eNodeb.Name;
            return(view);
        }
Ejemplo n.º 9
0
        public static TopMrsTadvView ConstructView(TopMrsTadv stat, IENodebRepository repository)
        {
            var view   = Mapper.Map <TopMrsTadv, TopMrsTadvView>(stat);
            var eNodeb = repository.FirstOrDefault(x => x.ENodebId == stat.ENodebId);

            view.ENodebName = eNodeb?.Name;
            return(view);
        }
Ejemplo n.º 10
0
        public static CoverageStatView ConstructView(CoverageStat stat, IENodebRepository repository)
        {
            var view   = Mapper.Map <CoverageStat, CoverageStatView>(stat);
            var eNodeb = repository.FirstOrDefault(x => x.ENodebId == stat.ENodebId);

            view.ENodebName = eNodeb?.Name;
            return(view);
        }
Ejemplo n.º 11
0
        public static Precise4GView ConstructView(PreciseCoverage4G stat, IENodebRepository repository)
        {
            var view   = Mapper.Map <PreciseCoverage4G, Precise4GView>(stat);
            var eNodeb = repository.FirstOrDefault(x => x.ENodebId == stat.CellId);

            view.ENodebName = eNodeb?.Name;
            return(view);
        }
Ejemplo n.º 12
0
        public static CellMrsTadvDto ConstructView(MrsTadvStat stat, IENodebRepository repository)
        {
            var view   = Mapper.Map <MrsTadvStat, CellMrsTadvDto>(stat);
            var eNodeb = repository.FirstOrDefault(x => x.ENodebId == stat.ENodebId);

            view.ENodebName = eNodeb?.Name;
            return(view);
        }
Ejemplo n.º 13
0
        public static CellView ConstructView(Cell cell, IENodebRepository repository)
        {
            var view   = Mapper.Map <Cell, CellView>(cell);
            var eNodeb = repository.FirstOrDefault(x => x.ENodebId == cell.ENodebId);

            view.ENodebName = eNodeb?.Name;
            return(view);
        }
Ejemplo n.º 14
0
        public int DumpNewEnodebExcels(IEnumerable <ENodebExcel> infos)
        {
            var containers = (from info in infos
                              join town in _townRepository.GetAllList()
                              on new { info.CityName, info.DistrictName, info.TownName } equals
                              new { town.CityName, town.DistrictName, town.TownName }
                              select new ENodebExcelWithTownIdContainer
            {
                ENodebExcel = info,
                TownId = town.Id
            }).ToArray();

            if (!containers.Any())
            {
                return(0);
            }
            var items =
                Mapper.Map <IEnumerable <ENodebExcelWithTownIdContainer>, List <ENodebWithTownIdContainer> >(containers);

            items.ForEach(x => { x.ENodeb.TownId = x.TownId; });

            var count = 0;

            foreach (var eNodeb in items.Select(x => x.ENodeb).ToList())
            {
                var item = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodeb.ENodebId);
                if (item == null)
                {
                    var result = _eNodebRepository.Insert(eNodeb);
                    if (result != null)
                    {
                        count++;
                    }
                }
                else
                {
                    item.IsInUse = true;
                    item.Name    = eNodeb.Name;
                    item.Address = eNodeb.Address;
                    item.Factory = eNodeb.Factory;
                    _eNodebRepository.SaveChanges();
                }
            }
            _eNodebRepository.SaveChanges();
            return(count);
        }
Ejemplo n.º 15
0
        public Tuple <string, string, string> GetTownNamesByENodebId(int eNodebId)
        {
            var item = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);
            var town = item == null ? null : _repository.Get(item.TownId);

            return(town == null
                ? null
                : new Tuple <string, string, string>(town.CityName, town.DistrictName, town.TownName));
        }
Ejemplo n.º 16
0
        public static CellRruView ConstructCellRruView(this Cell cell, IENodebRepository repository, LteRru rru)
        {
            var view   = Mapper.Map <Cell, CellRruView>(cell);
            var eNodeb = repository.FirstOrDefault(x => x.ENodebId == cell.ENodebId);

            view.ENodebName = eNodeb?.Name;
            rru?.MapTo(view);
            return(view);
        }
Ejemplo n.º 17
0
 public CellPreciseKpiView(Cell cell, IENodebRepository repository)
 {
     cell.CloneProperties(this);
     ENodeb eNodeb = repository.FirstOrDefault(x => x.ENodebId == cell.ENodebId);
     ENodebName = eNodeb == null ? "Undefined" : eNodeb.Name;
     Indoor = cell.IsOutdoor ? "室外" : "室内";
     DownTilt = cell.ETilt + cell.MTilt;
     PreciseRate = 100;
 }
Ejemplo n.º 18
0
        public IEnumerable <CellRruView> GetByStationNum(string stationNum)
        {
            var station =
                _stationDictionaryRepository.FirstOrDefault(x => x.StationNum == stationNum);

            if (station == null)
            {
                return(null);
            }
            var item = _eNodebRepository.FirstOrDefault(x => x.ENodebId == station.ENodebId) ??
                       _eNodebRepository.FirstOrDefault(x => x.PlanNum == station.PlanNum);

            if (item == null)
            {
                return(new List <CellRruView>());
            }
            return(GetCellViews(item.ENodebId));
        }
Ejemplo n.º 19
0
        public IEnumerable <CoverageStatView> GetDateSpanViews(int eNodebId, byte sectorId, DateTime begin, DateTime end)
        {
            var eNodeb = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);
            var list   =
                _repository.GetAllList(
                    x => x.ENodebId == eNodebId && x.SectorId == sectorId && x.StatDate >= begin && x.StatDate < end)
                .MapTo <List <CoverageStatView> >();

            list.ForEach(stat => stat.ENodebName = eNodeb?.Name);
            return(list);
        }
Ejemplo n.º 20
0
        public IEnumerable <HourCqiView> QueryHourCqiViews(int eNodebId, byte sectorId, DateTime begin, DateTime end)
        {
            var eNodeb = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);
            var list   = _usersRepository
                         .GetAllList(x =>
                                     x.StatTime >= begin && x.StatTime < end && x.ENodebId == eNodebId && x.SectorId == sectorId)
                         .MapTo <List <HourCqiView> >();

            list.ForEach(stat => stat.ENodebName = eNodeb?.Name);
            return(list);
        }
Ejemplo n.º 21
0
        protected IDateSpanQuery <List <T> > ConstructQuery(int eNodebId, byte sectorId)
        {
            var eNodeb = ENodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);

            if (eNodeb == null)
            {
                return(null);
            }
            return(eNodeb.Factory == "华为"
                ? GenerateHuaweiQuery(eNodebId, sectorId)
                : GenerateZteQuery(eNodebId, sectorId));
        }
Ejemplo n.º 22
0
        private IMongoQuery <CellOpenLoopPcView> ConstructCellQuery(int eNodebId, byte sectorId)
        {
            var eNodeb = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);

            if (eNodeb == null)
            {
                return(null);
            }
            return(eNodeb.Factory == "华为"
                ? (IMongoQuery <CellOpenLoopPcView>)
                   new HuaweiUlOlPcQuery(_huaweiCellRepository, _huaweiPcRepository, eNodebId, sectorId)
                : new ZteUlOlPcQuery(_ztePcRepository, eNodebId, sectorId));
        }
Ejemplo n.º 23
0
        public IEnumerable <College4GTestView> GetViews(DateTime begin, DateTime end)
        {
            var results = _repository.GetAllList(x => x.TestTime >= begin && x.TestTime < end);

            if (!results.Any())
            {
                return(new List <College4GTestView>());
            }
            return(results.Select(x =>
            {
                var college = _collegeRepository.Get(x.CollegeId);
                var eNodeb = _eNodebRepository.FirstOrDefault(e => e.ENodebId == x.ENodebId);
                var cell = eNodeb == null
                    ? null
                    : _cellRepository.GetBySectorId(x.ENodebId, x.SectorId);
                var view = x.MapTo <College4GTestView>();
                view.CollegeName = college?.Name;
                view.CellName = eNodeb?.Name + "-" + x.SectorId;
                view.Pci = cell?.Pci ?? -1;
                return view;
            }));
        }
Ejemplo n.º 24
0
        private IMongoQuery <CellPower> ConstructQuery(int eNodebId, byte sectorId)
        {
            var eNodeb = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);

            if (eNodeb == null)
            {
                return(null);
            }
            return(eNodeb.Factory == "华为"
                ? (IMongoQuery <CellPower>)
                   new HuaweiCellPowerQuery(_huaweiCellRepository, _huaweiPbRepository, _huaweiPaRepository, eNodebId,
                                            sectorId)
                : new ZteCellPowerQuery(_ztePbRepository, _ztePaRepository, eNodebId, sectorId));
        }
Ejemplo n.º 25
0
        public IEnumerable <ENodebView> Query(string collegeName)
        {
            var ids =
                _repository.GetAllList(
                    x =>
                    x.HotspotName == collegeName && x.HotspotType == HotspotType.College &&
                    x.InfrastructureType == InfrastructureType.ENodeb);

            return((from id in ids
                    select _eNodebRepository.FirstOrDefault(x => x.ENodebId == id.ENodebId)
                    into eNodeb
                    where eNodeb != null
                    select Mapper.Map <ENodeb, ENodebView>(eNodeb)).ToList());
        }
Ejemplo n.º 26
0
        public void UpdateTown(IENodebRepository eNodebRepository, ITownRepository townRepository)
        {
            var eNodeb = eNodebRepository.FirstOrDefault(x => x.ENodebId == ENodebId);

            if (eNodeb == null)
            {
                return;
            }
            ENodebName = eNodeb.Name;
            var town = eNodeb.TownId == -1 ? null : townRepository.Get(eNodeb.TownId);

            if (town == null)
            {
                return;
            }
            City     = town.CityName;
            District = town.DistrictName;
            Town     = town.TownName;
        }
Ejemplo n.º 27
0
        public ENodebView GetByENodebId(int eNodebId)
        {
            var item = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);

            return(GenerateENodebView(item));
        }
Ejemplo n.º 28
0
        public ENodebView GetByENodebId(int eNodebId)
        {
            var item = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId);

            return(ENodebView.ConstructView(item, _townRepository));
        }