Esempio n. 1
0
        public async Task <IEnumerable <FlowHistory> > GetFlowHistories(DateTime begin, DateTime end)
        {
            var results = new List <FlowHistory>();

            while (begin < end.AddDays(1))
            {
                var beginDate   = begin;
                var endDate     = begin.AddDays(1);
                var huaweiItems = await _huaweiRepository.CountAsync(x => x.StatTime >= beginDate && x.StatTime < endDate);

                var huaweiRrcs =
                    await _rrcHuaweiRepository.CountAsync(x => x.StatTime >= beginDate && x.StatTime < endDate);

                var zteItems = await _zteRepository.CountAsync(x => x.StatTime >= beginDate && x.StatTime < endDate);

                var zteRrcs = await _rrcZteRepository.CountAsync(x => x.StatTime >= beginDate && x.StatTime < endDate);

                var townItems =
                    await _townFlowRepository.CountAsync(
                        x =>
                        x.StatTime >= beginDate && x.StatTime < endDate &&
                        x.FrequencyBandType == FrequencyBandType.All);;
                var townItems2100 =
                    await _townFlowRepository.CountAsync(
                        x =>
                        x.StatTime >= beginDate && x.StatTime < endDate &&
                        x.FrequencyBandType == FrequencyBandType.Band2100);

                var townItems1800 =
                    await _townFlowRepository.CountAsync(
                        x =>
                        x.StatTime >= beginDate && x.StatTime < endDate &&
                        x.FrequencyBandType == FrequencyBandType.Band1800);

                var townItems800 =
                    await _townFlowRepository.CountAsync(
                        x =>
                        x.StatTime >= beginDate && x.StatTime < endDate &&
                        x.FrequencyBandType == FrequencyBandType.Band800VoLte);

                var townRrcs = await _townRrcRepository.CountAsync(x => x.StatTime >= beginDate && x.StatTime < endDate);

                var townQcis = await _townQciRepository.CountAsync(x => x.StatTime >= beginDate && x.StatTime < endDate);

                var townPrbs = await _townPrbRepository.CountAsync(x => x.StatTime >= beginDate && x.StatTime < endDate);

                results.Add(new FlowHistory
                {
                    DateString        = begin.ToShortDateString(),
                    HuaweiItems       = huaweiItems,
                    HuaweiRrcs        = huaweiRrcs,
                    ZteItems          = zteItems,
                    ZteRrcs           = zteRrcs,
                    TownStats         = townItems,
                    TownStats2100     = townItems2100,
                    TownStats1800     = townItems1800,
                    TownStats800VoLte = townItems800,
                    TownRrcs          = townRrcs,
                    TownQcis          = townQcis,
                    TownPrbs          = townPrbs
                });
                begin = begin.AddDays(1);
            }
            return(results);
        }