public List <ENodeb> GetDistrictENodebs(string city, string district) { var towns = _townRepository.GetAllList(x => x.CityName == city && x.DistrictName == district); var eNodebs = _eNodebRepository.GetAllList(); return((from t in towns join e in eNodebs on t.Id equals e.TownId select e).ToList()); }
public List <DistrictBandClassStat> QueryDistrictBandStats(string city) { var eNodebTownIds = _eNodebRepository.GetAllList().Select(x => new { x.TownId, x.ENodebId }); var allCells = _cellRepository.GetAllInUseList(); return((from district in GetDistricts(city) let townList = _repository.GetAllList().Where(x => x.CityName == city && x.DistrictName == district) let cells = (from t in townList join e in eNodebTownIds on t.Id equals e.TownId join c in allCells on e.ENodebId equals c.ENodebId select c) select new DistrictBandClassStat { District = district, Band1Cells = cells.Count(x => x.BandClass == 1), Band3Cells = cells.Count(x => x.BandClass == 3), Band5Cells = cells.Count(x => x.BandClass == 5 && x.Frequency != 2506), NbIotCells = cells.Count(x => x.BandClass == 5 && x.Frequency == 2506), Band41Cells = cells.Count(x => x.BandClass == 41) }).ToList()); }
public IEnumerable <ENodeb> GetENodebsByDistrict(string city, string district) { var towns = _townRepository.GetAllList(city, district); return(from town in towns join eNodeb in _eNodebRepository.GetAllList() on town.Id equals eNodeb.TownId select eNodeb); }
public ViewResult TopDrop2G(TopDrop2GViewModel postedModel) { TopDrop2GViewModel viewModel = topDrop2GRepository.Stats.GenerateView <TopDrop2GViewModel, TopDrop2GCell, TopDrop2GCellView>( postedModel.StatDate, regionNamesService.Query().ToList(), btsRepository.GetAllList(), eNodebRepository.GetAllList()); return(View(viewModel)); }
public static IEnumerable <TTownStat> GetTownFrequencyItems <TStat, TTownStat>(this List <TStat> stats, FrequencyBandType bandType, ICellRepository cellRepository, IENodebRepository eNodebRepository) where TStat : ILteCellQuery where TTownStat : ITownId { var cells = cellRepository.GetAllList(bandType); var query = from stat in stats join cell in cells on new { stat.ENodebId, stat.SectorId } equals new { cell.ENodebId, cell.SectorId } join eNodeb in eNodebRepository.GetAllList() on cell.ENodebId equals eNodeb.ENodebId select new { Stat = stat, eNodeb.TownId }; var townStats = query.Select(x => { var townStat = Mapper.Map <TStat, TTownStat>(x.Stat); townStat.TownId = x.TownId; return(townStat); }); return(townStats); }
public JsonResult CoverageAdjust(CoverageStatChart chart) { List <ENodeb> eNodebList = eNodebRepository.GetAllList(); IEnumerable <CoverageAdjustment> adjustments = chart.StatList.GenerateAdjustmentList(cellRepository, eNodebList); var result = from a in adjustments join e in eNodebList on a.ENodebId equals e.ENodebId select new { N = e.Name + "-" + a.SectorId, F = a.Frequency, F165m = (int)(100 * a.Factor165m) / (double)(100), F135m = (int)(100 * a.Factor135m) / (double)(100), F105m = (int)(100 * a.Factor105m) / (double)(100), F75m = (int)(100 * a.Factor75m) / (double)(100), F45m = (int)(100 * a.Factor45m) / (double)(100), F15m = (int)(100 * a.Factor15m) / (double)(100), F15 = (int)(100 * a.Factor15) / (double)(100), F45 = (int)(100 * a.Factor45) / (double)(100), F75 = (int)(100 * a.Factor75) / (double)(100), F105 = (int)(100 * a.Factor105) / (double)(100), F135 = (int)(100 * a.Factor135) / (double)(100), F165 = (int)(100 * a.Factor165) / (double)(100) }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public void ImportTownENodebStats(ITownRepository townRepository, IENodebRepository eNodebRepository, IRegionRepository regionRepository) { IEnumerable <ENodeb> eNodebs = eNodebRepository.GetAllList(); TownENodebStats = townRepository.GetAllList().Select( x => new TownENodebStat(x, eNodebs, regionRepository)).ToList(); }
public IEnumerable <TopCoverageStatView> GetAllTopViews(DateTime begin, DateTime end, int topCount, OrderMrsRsrpPolicy policy) { return(GetTopViews(begin, end, topCount, policy, _eNodebRepository.GetAllList(), (beginDate, endDate) => _repository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate && x.TelecomAbove110 < x.TelecomMrs * 0.6 && x.TelecomMrs > 20000))); }
private IEnumerable <TownPreciseCoverage4GStat> GetTownStats(List <PreciseCoverage4G> stats) { var query = from stat in stats join eNodeb in _eNodebRepository.GetAllList() on stat.CellId equals eNodeb.ENodebId select new { Stat = stat, eNodeb.TownId }; var townStats = query.Select(x => { var townStat = Mapper.Map <PreciseCoverage4G, TownPreciseCoverage4GStat>(x.Stat); townStat.TownId = x.TownId; return(townStat); }); return(townStats); }
public IEnumerable <ENodebFlowView> GetENodebFlowViews(DateTime begin, DateTime end, FrequencyBandType frequency = FrequencyBandType.All) { var eNodebStatList = new List <ENodebFlowView>(); var zteFlows = _zteRepository.QueryZteFlows <FlowZte, IFlowZteRepository>(frequency, begin, end); var huaweiFlows = QueryHuaweiFlows(begin, end, frequency); var eNodebs = _eNodebRepository.GetAllList(); return(GenerateENodebFlowViews(eNodebStatList, huaweiFlows, eNodebs, zteFlows)); }
public IEnumerable <ENodebView> GetByTownNames(string city, string district, string town) { var townItem = _townRepository.GetAllList() .FirstOrDefault(x => x.CityName == city && x.DistrictName == district && x.TownName == town); if (townItem == null) { return(new List <ENodebView>()); } var list = _eNodebRepository.GetAllList(x => x.TownId == townItem.Id).MapTo <List <ENodebView> >(); list.ForEach(x => { x.CityName = city; x.DistrictName = district; x.TownName = town; }); return(list); }
private void OpenMro_OnClick(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(DirectoryPath.Content.ToString())) { return; } DirectoryInfo dir = new DirectoryInfo(DirectoryPath.Content.ToString()); List <ENodeb> eNodebs = _eNodebRepository.GetAllList(); ImportMrFilesAsync(dir, eNodebs); }
public static List <ENodeb> QueryENodebs(this ITownRepository townRepository, IENodebRepository eNodebRepository, string city, string district) { var towns = townRepository.GetAllList(x => x.CityName == city && x.DistrictName == district); if (!towns.Any()) { return(new List <ENodeb>()); } return((from eNodeb in eNodebRepository.GetAllList() join town in towns on eNodeb.TownId equals town.Id select eNodeb).ToList()); }
public ENodebBaseRepository(IENodebRepository inputRepository) { eNodebBaseList.Clear(); foreach (ENodeb eNodeb in inputRepository.GetAllList()) { eNodebBaseList.Add(new ENodebBase { ENodebId = eNodeb.ENodebId, Name = eNodeb.Name, TownId = eNodeb.TownId }); } }
public ENodebBaseRepository(IENodebRepository inputRepository) { eNodebBaseList.Clear(); foreach (ENodeb eNodeb in inputRepository.GetAllList()) { eNodebBaseList.Add(new ENodebBase { ENodebId = eNodeb.ENodebId, Name = eNodeb.Name, TownId = eNodeb.TownId }); } }
public IEnumerable <ENodebAlarmWorkItemGroup> QueryENodebAlarmGroups(DateTime begin, DateTime end, int count) { var alarms = _repository.GetAllList( x => x.HappenTime >= begin && x.HappenTime < end && x.NetworkType == NetworkType.With4G); var groups = alarms.Where(x => x.SectorId == 255).ToList().GroupBy(x => x.ENodebId); var eNodebs = _eNodebRepository.GetAllList(); var results = groups.Select(g => new ENodebAlarmWorkItemGroup { ENodebId = g.Key, AlarmCounts = g.Count(), ItemList = g.Select(x => x.MapTo <AlarmWorkItemView>()).ToList() }).OrderByDescending(x => x.AlarmCounts).Take(count).ToList(); results.ForEach(result => { var eNodeb = eNodebs.FirstOrDefault(x => x.ENodebId == result.ENodebId); if (eNodeb != null) { eNodeb.MapTo(result); } }); return(results); }
public IEnumerable <AgpsCoverageTown> QueryAgpsCoverageTowns(List <AgpsMongo> stats, string type, DateTime statDate) { return((from town in _townRepository.GetAllList() let eNodebs = _eNodebRepository.GetAllList(x => x.TownId == town.Id) let townStats = (from s in stats join e in eNodebs on s.ENodebId equals e.ENodebId select s).ToList() select new AgpsCoverageTown { District = town.DistrictName, Town = town.TownName, Operator = type, StatDate = statDate, Count = townStats.Sum(x => x.Count), GoodCount = townStats.Sum(x => x.GoodCount), GoodCount105 = townStats.Sum(x => x.GoodCount105), GoodCount100 = townStats.Sum(x => x.GoodCount100) }).ToList()); }
public ActionResult Import(int page = 1) { IEnumerable <ENodebBase> eNodebBases = _eNodebRepository.GetAllList().Select(x => new ENodebBase { ENodebId = x.ENodebId, Name = x.Name }); MrInterferenceViewModel model = new MrInterferenceViewModel { StartDate = DateTime.Today.AddDays(-7), EndDate = DateTime.Today }; model.InitializeTownList(_townRepository, model); model.UpdateStats(RutraceStatContainer.MrsStats, eNodebBases, PageSize, page); return(View(model)); }
public static IEnumerable <TView> QueryAllFlowViews <TView, TZte, THuawei>(this ICellRepository huaweiCellRepository, List <TZte> zteStats, List <THuawei> huaweiStats, IENodebRepository eNodebRepository) where TZte : ILteCellQuery where THuawei : ILocalCellQuery where TView : class, IENodebName, ILteCellQuery, new() { var eNodebs = eNodebRepository.GetAllList(); if (!eNodebs.Any()) { return(new List <TView>()); } var zteViews = eNodebs.QueryZteViews <TView, TZte>(zteStats); var huaweiViews = eNodebs.QueryHuaweiViews <TView, THuawei>(huaweiStats, huaweiCellRepository); return(zteViews.Concat(huaweiViews).ToList()); }
public static IEnumerable <TopCellContainer <TTopCell> > QueryContainers <TTopCell>(this List <TTopCell> topCells, IBtsRepository btsRepository, IENodebRepository eNodebRepository) where TTopCell : IBtsIdQuery { return(from stat in topCells join bts in btsRepository.GetAllList() on stat.BtsId equals bts.BtsId into btsQuery from bq in btsQuery.DefaultIfEmpty() join eNodeb in eNodebRepository.GetAllList() on bq?.ENodebId ?? -1 equals eNodeb.ENodebId into query from q in query.DefaultIfEmpty() select new TopCellContainer <TTopCell> { TopCell = stat, LteName = q == null ? "无匹配LTE基站" : q.Name, CdmaName = bq == null ? "无匹配CDMA基站" : bq.Name }); }
public static IEnumerable <TTownStat> GetTownStats <TStat, TTownStat>(this IEnumerable <TStat> stats, IENodebRepository eNodebRepository) where TStat : IENodebId where TTownStat : ITownId { var query = from stat in stats join eNodeb in eNodebRepository.GetAllList() on stat.ENodebId equals eNodeb.ENodebId select new { Stat = stat, eNodeb.TownId }; var townStats = query.Select(x => { var townStat = Mapper.Map <TStat, TTownStat>(x.Stat); townStat.TownId = x.TownId; return(townStat); }); return(townStats); }
public IEnumerable <CellIdPair> QueryUnmatchedHuaweis(int townId, DateTime date) { var eNodebs = _eNodebRepository.GetAllList(x => x.TownId == townId); var cells = from cell in _cellRepository.GetAllList() join eNodeb in eNodebs on cell.ENodebId equals eNodeb.ENodebId select cell; var stats = _huaweiRepository.GetAllList(x => x.StatTime >= date); var townStats = from stat in stats join eNodeb in eNodebs on stat.ENodebId equals eNodeb.ENodebId select stat; return(from stat in townStats join cell in cells on new { stat.ENodebId, stat.LocalCellId } equals new { cell.ENodebId, LocalCellId = cell.LocalSectorId } into match from m in match.DefaultIfEmpty() where m == null select new CellIdPair { CellId = stat.ENodebId, SectorId = stat.LocalCellId }); }
public static IEnumerable <TENodebStat> GetENodebStats <TStat, TENodebStat>(this IEnumerable <TStat> stats, IENodebRepository eNodebRepository) where TStat : IENodebId where TENodebStat : IENodebId, IGeoPoint <double> { var query = from stat in stats join eNodeb in eNodebRepository.GetAllList() on stat.ENodebId equals eNodeb.ENodebId select new { Stat = stat, eNodeb.Longtitute, eNodeb.Lattitute }; var eNodebStats = query.Select(x => { var eNodebStat = Mapper.Map <TStat, TENodebStat>(x.Stat); eNodebStat.Longtitute = x.Longtitute; eNodebStat.Lattitute = x.Lattitute; return(eNodebStat); }); return(eNodebStats); }
public JsonResult Query(DateTime begin, DateTime end, string city, int topCounts = 20) { DateTime endDate = end.AddDays(1); IEnumerable <TopConnection3GCell> stats = statRepository.Stats.QueryTimeStats(begin, endDate, city).ToList(); if (stats.Any()) { CdmaLteNamesService <TopConnection3GCell> service = new CdmaLteNamesService <TopConnection3GCell>( stats, btsRepository.GetAllList(), eNodebRepository.GetAllList()); IEnumerable <TopConnection3GCellView> cellViews = service.Clone <TopConnection3GCellView>(); var statCounts = from v in cellViews group v by new { v.CdmaName, v.SectorId } into g select new { CarrierName = g.Key.CdmaName + "-" + g.Key.SectorId, TopDates = g.Count(), SumOfTimes = g.Sum(v => v.ConnectionFails) }; return(Json(statCounts.OrderByDescending(x => x.SumOfTimes).Take(topCounts), JsonRequestBehavior.AllowGet)); } return(Json(new List <int>(), JsonRequestBehavior.AllowGet)); }
public static IEnumerable <TTownStat> GetTownDateStats <TStat, TTownStat>(this IEnumerable <TStat> stats, IENodebRepository eNodebRepository, Action <TStat, TTownStat> patchAction) where TStat : IENodebId, IStatTime where TTownStat : ITownId, IStatDate { var query = from stat in stats join eNodeb in eNodebRepository.GetAllList() on stat.ENodebId equals eNodeb.ENodebId select new { Stat = stat, eNodeb.TownId }; var townStats = query.Select(x => { var townStat = Mapper.Map <TStat, TTownStat>(x.Stat); townStat.TownId = x.TownId; townStat.StatDate = x.Stat.StatTime.Date; patchAction(x.Stat, townStat); return(townStat); }); return(townStats); }
public void ImportTownENodebStats(ITownRepository townRepository, IENodebRepository eNodebRepository, IRegionRepository regionRepository) { IEnumerable<ENodeb> eNodebs = eNodebRepository.GetAllList(); TownENodebStats = townRepository.GetAllList().Select( x => new TownENodebStat(x, eNodebs, regionRepository)).ToList(); }
public IEnumerable <ENodeb> Get() { return(_repository.GetAllList()); }
public static IEnumerable <TopStatCount> QueryTopCounts <TCell, TView>(this IEnumerable <TCell> stats, IBtsRepository btsRepository, IENodebRepository eNodebRepository, int topCounts) where TCell : class, ICdmaCell, new() where TView : class, IGetTopCellView, new() { CdmaLteNamesService <TCell> service = new CdmaLteNamesService <TCell>(stats, btsRepository.GetAllList(), eNodebRepository.GetAllList()); IEnumerable <TView> cellViews = service.Clone <TView>(); IEnumerable <TopStatCount> statCounts = from v in cellViews group v by new { v.CdmaName, v.SectorId, v.Frequency } into g select new TopStatCount { CarrierName = g.Key.CdmaName + "-" + g.Key.SectorId + "-" + g.Key.Frequency, TopDates = g.Count(), SumOfTimes = g.Sum(v => v.Drops) }; return(statCounts.OrderByDescending(x => x.SumOfTimes).Take(topCounts)); }
public void Save(IEnumerable <BtsExcel> btsInfoList, bool updateBts) { IEnumerable <Town> townList = _townRepository.GetAllList(); List <ENodeb> eNodebList = (_lteRepository == null) ? null : _lteRepository.GetAllList(); TownIdAssignedSaveOneBtsService service = new TownIdAssignedSaveOneBtsService( _repository, _baseRepository, 0, eNodebList); foreach (BtsExcel btsExcel in btsInfoList.Distinct(new BtsExcelComparer())) { var town = townList.FirstOrDefault(x => x.DistrictName == btsExcel.DistrictName && x.TownName == btsExcel.TownName); var townId = (town == null) ? -1 : town.Id; service.TownId = townId; if (service.SaveOneBts(btsExcel, updateBts)) { _infrastructure.CdmaBtsUpdated++; } } }
public void ResetENodebList() { eNodebList = eNodebRepository.GetAllList(); }