Example #1
0
        public async Task <bool> DumpOneStationRru()
        {
            var stat = StationRrus.Pop();

            if (stat == null)
            {
                throw new NullReferenceException("stat is null!");
            }
            await _stationRruRepository
            .UpdateOneInUse <IStationRruRepository, StationRru, StationRruExcel>(stat);

            var cellSerials = stat.CellSerialNum.GetSplittedFields(',');

            foreach (var cellSerial in cellSerials)
            {
                var stationCell = _constructionInformation.FirstOrDefault(x => x.CellSerialNum == cellSerial);
                if (stationCell == null)
                {
                    continue;
                }
                {
                    var cell = _cellRepository.FirstOrDefault(x =>
                                                              x.ENodebId == stationCell.ENodebId && x.SectorId == stationCell.SectorId);
                    if (cell != null)
                    {
                        if (cell.Longtitute < 112 && cell.Lattitute < 22 && stat.Longtitute > 112 && stat.Lattitute > 22)
                        {
                            cell.Longtitute = stat.Longtitute ?? 0;
                            cell.Lattitute  = stat.Lattitute ?? 0;
                        }
                    }

                    _cellRepository.SaveChanges();
                    var rru = _rruRepository.FirstOrDefault(x =>
                                                            x.ENodebId == stationCell.ENodebId && x.LocalSectorId == stationCell.LocalCellId);
                    if (rru == null)
                    {
                        rru = new LteRru
                        {
                            ENodebId      = stationCell.ENodebId,
                            LocalSectorId = stationCell.LocalCellId,
                            RruName       = stat.Address
                        };
                        _rruRepository.Insert(rru);
                    }
                    else
                    {
                        rru.RruName = stat.Address;
                    }
                }
            }

            _rruRepository.SaveChanges();
            return(true);
        }
Example #2
0
        public int ImportStationRrus(string path)
        {
            var repo = new ExcelQueryFactory {
                FileName = path
            };
            var excels = (from c in repo.Worksheet <StationRruExcel>("Sheet1") select c).ToList();

            foreach (var stationRruExcel in excels)
            {
                StationRrus.Push(stationRruExcel);
            }

            return(StationRrus.Count);
        }