예제 #1
0
 public static Precise4GSector ConstructSector(Precise4GView view, ICellRepository repository)
 {
     var sector = Mapper.Map<Precise4GView, Precise4GSector>(view);
     var cell = repository.GetBySectorId(view.CellId, view.SectorId);
     if (cell == null)
     {
         sector.Height = -1;
     }
     else
     {
         Mapper.Map(cell, sector);
         sector.DownTilt = cell.MTilt + cell.ETilt;
     }
     return sector;
 }
예제 #2
0
        public static Precise4GSector ConstructSector(Precise4GView view, ICellRepository repository)
        {
            var sector = Mapper.Map <Precise4GView, Precise4GSector>(view);
            var cell   = repository.GetBySectorId(view.CellId, view.SectorId);

            if (cell == null)
            {
                sector.Height = -1;
            }
            else
            {
                cell.CloneProperties(sector);
                sector.DownTilt = cell.MTilt + cell.ETilt;
            }
            return(sector);
        }
 public int Post(Precise4GView view)
 {
     return _service.UpdateNeighborPcis(view.CellId, view.SectorId);
 }
예제 #4
0
 public async Task<string> ConstructPreciseWorkItem(Precise4GView view, DateTime begin, DateTime end, string userName)
 {
     var existedItem = await _repository.GetPreciseExistedAsync(view.CellId, view.SectorId);
     if (existedItem != null) return null;
     var serialNumber = "SELF-FS-Precise-" + view.CellId + "-" + view.SectorId + "-" + begin.ToString("yyyyMMdd") +
                        "-" + end.ToString("yyyyMMdd");
     existedItem = await _repository.FirstOrDefaultAsync(x => x.SerialNumber == serialNumber);
     if (existedItem != null) return null;
     var item = new WorkItem
     {
         BeginTime = end,
         Cause = WorkItemCause.WeakCoverage,
         SerialNumber = serialNumber,
         ENodebId = view.CellId,
         SectorId = view.SectorId,
         Deadline = end.AddMonths(1),
         StaffName = userName,
         Type = WorkItemType.SelfConstruction,
         Subtype = WorkItemSubtype.PreciseRate,
         State = WorkItemState.ToBeSigned,
         Comments =
             "[" + DateTime.Now + "]" + userName + ": 创建工单" + serialNumber + ";精确覆盖率=" + view.SecondRate +
             ";MR总数=" + view.TotalMrs + ";TOP天数=" + view.TopDates
     };
     var result = await _repository.InsertAsync(item);
     _repository.SaveChanges();
     return result?.SerialNumber;
 }