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); }
public async Task <bool> DumpOneStationDistribution() { var stat = StationDistributions.Pop(); if (stat == null) { throw new NullReferenceException("stat is null!"); } await _distributionRepository .UpdateOneInUse <IDistributionRepository, IndoorDistribution, IndoorDistributionExcel>(stat); var stationCell = _constructionInformation.FirstOrDefault(x => x.AntennaSerial == stat.IndoorSerialNum); if (stationCell != null) { 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; cell.Lattitute = stat.Lattitute; _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); }
public static CellRruView ConstructCellRruView(this Cell cell, IENodebRepository repository, LteRru rru) { var view = Mapper.Map <Cell, CellRruView>(cell); var eNodeb = repository.FirstOrDefault(x => x.ENodebId == cell.ENodebId); view.ENodebName = eNodeb?.Name; rru?.MapTo(view); return(view); }
public async Task <bool> DumpOneStationAntenna() { var stat = StationAntennas.Pop(); if (stat == null) { throw new NullReferenceException("stat is null!"); } await _stationAntennaRepository .UpdateOneInUse <IStationAntennaRepository, StationAntenna, StationAntennaExcel>(stat); var stationCell = _constructionInformation.FirstOrDefault(x => x.CellSerialNum == stat.AntennaNum); if (stationCell != null) { 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; cell.Lattitute = stat.Lattitute; cell.ETilt = stat.ETilt; cell.MTilt = stat.MTilt; cell.Height = stat.Height; cell.Azimuth = stat.Azimuth; var antennaGainArray = string.IsNullOrEmpty(stat.AntennaGain) ? new string[] { } : stat.AntennaGain.GetSplittedFields('/'); cell.AntennaGain = cell.BandClass == 5 ? (antennaGainArray.Length > 1 ? antennaGainArray[1].ConvertToDouble(17.5) : (antennaGainArray.Length > 0 ? antennaGainArray[0].ConvertToDouble(17.5) : 17.5)) : (antennaGainArray.Length > 0 ? antennaGainArray[0].ConvertToDouble(15) : 15); _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, AntennaModel = stat.AntennaModel, AntennaFactory = stat.AntennaFactoryDescription.GetEnumType <AntennaFactory>(), AntennaInfo = stat.AntennaPorts + "端口天线;" + (stat.CommonAntennaWithCdma == "是" ? "与C网共用天线" : "独立天线"), CanBeTilt = stat.ElectricAdjustable == "是", RruName = stat.AntennaAddress }; _rruRepository.Insert(rru); } else { rru.AntennaModel = stat.AntennaModel; rru.AntennaFactory = stat.AntennaFactoryDescription.GetEnumType <AntennaFactory>(); rru.AntennaInfo = stat.AntennaPorts + "端口天线;" + (stat.CommonAntennaWithCdma == "是" ? "与C网共用天线" : "独立天线"); rru.CanBeTilt = stat.ElectricAdjustable == "是"; rru.RruName = stat.AntennaAddress; } _rruRepository.SaveChanges(); } return(true); }