public IEnumerable <TownPreciseView> GetDateView(DateTime statDate) { var beginDate = statDate.Date; var endDate = beginDate.AddDays(1); var colleges = _collegeService.QueryInfos(); return(colleges.Select(college => { var cells = _collegeCellViewService.GetCollegeCells(college.Name); var viewListList = cells.Select(cell => _service.GetTimeSpanStats(cell.ENodebId, cell.SectorId, beginDate, endDate)) .Where(views => views != null && views.Any()).ToList(); if (!viewListList.Any()) { return null; } var viewList = viewListList.Aggregate((x, y) => x.Concat(y).ToList()).ToList(); if (!viewList.Any()) { return null; } var stat = viewList.ArraySum().MapTo <TownPreciseView>(); stat.FrequencyBandType = FrequencyBandType.College; stat.TownId = college.Id; return stat; }).Where(x => x != null)); }
public void Test_GetTimeSpanStats(string[] soureDates, string[] resultDates, string beginDate, string endDate) { _repository.MockPreciseStats(soureDates.Select(x => new PreciseCoverage4G { CellId = 1, SectorId = 1, StatTime = DateTime.Parse(x) }).ToList()); var stats = _service.GetTimeSpanStats(1, 1, DateTime.Parse(beginDate), DateTime.Parse(endDate)); stats.Select(x => x.StatTime).ShouldBe(resultDates.Select(DateTime.Parse)); }
public IEnumerable <TownPreciseStat> GetDatePreciseView(DateTime statDate) { var beginDate = statDate.Date; var endDate = beginDate.AddDays(1); var colleges = _marketService.QueryHotSpotViews("交通枢纽"); var stats = _service.GetTimeSpanStats(beginDate, endDate); return(colleges.Select(college => { var cells = _collegeCellViewService.GetCollegeCells(college.HotspotName); var viewListList = (from c in cells join s in stats on new { c.ENodebId, c.SectorId } equals new { ENodebId = s.CellId, s.SectorId } select s).ToList(); if (!viewListList.Any()) { return null; } var stat = viewListList.ArraySum().MapTo <TownPreciseStat>(); stat.FrequencyBandType = FrequencyBandType.Transportation; stat.TownId = college.Id; return stat; }).Where(x => x != null)); }
public IEnumerable <PreciseCoverage4G> Get(int cellId, byte sectorId, DateTime begin, DateTime end) { return(_service.GetTimeSpanStats(cellId, sectorId, begin, end)); }