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 ConstructionView QueryByCellName(string cellName)
        {
            var item = _repository.FirstOrDefault(x => x.CellName == cellName && x.IsInUse);

            return(item == null ? null : item.MapTo <ConstructionView>());
        }