From 9723ee3b9e9f3296806168d8914f9f786660e479 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 18 Mar 2024 10:05:20 +0500 Subject: [PATCH 01/31] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=82=D0=B8=D0=BF=D0=B0=20=D0=B4=D0=B0=D1=82=20=D0=B2=20WellOp?= =?UTF-8?q?erationRequestBase=20=D1=81=20=20DateTime=20=D0=BD=D0=B0=20Date?= =?UTF-8?q?TimeOffset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Requests/WellOperationRequest.cs | 6 ++-- .../Repository/WellOperationRepository.cs | 28 +++++++++---------- .../DailyReport/DailyReportService.cs | 4 +-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/AsbCloudApp/Requests/WellOperationRequest.cs b/AsbCloudApp/Requests/WellOperationRequest.cs index 1d190018..b2e0fc26 100644 --- a/AsbCloudApp/Requests/WellOperationRequest.cs +++ b/AsbCloudApp/Requests/WellOperationRequest.cs @@ -11,12 +11,12 @@ namespace AsbCloudApp.Requests /// /// фильтр по дате начала операции /// - public DateTime? GeDate { get; set; } + public DateTimeOffset? GeDate { get; set; } /// /// фильтр по дате окончания операции /// - public DateTime? LtDate { get; set; } + public DateTimeOffset? LeDate { get; set; } /// /// фильтр. Больше или равно глубины скважины на начало операции. @@ -60,7 +60,7 @@ namespace AsbCloudApp.Requests GeDepth = request.GeDepth; LeDepth = request.LeDepth; GeDate = request.GeDate; - LtDate = request.LtDate; + LeDate = request.LeDate; OperationCategoryIds = request.OperationCategoryIds; OperationType = request.OperationType; diff --git a/AsbCloudInfrastructure/Repository/WellOperationRepository.cs b/AsbCloudInfrastructure/Repository/WellOperationRepository.cs index 329d2502..c75ab4fd 100644 --- a/AsbCloudInfrastructure/Repository/WellOperationRepository.cs +++ b/AsbCloudInfrastructure/Repository/WellOperationRepository.cs @@ -57,7 +57,7 @@ public class WellOperationRepository : IWellOperationRepository .ToArrayAsync(token); var dateLastAssosiatedPlanOperation = await GetDateLastAssosiatedPlanOperationAsync(idWell, currentDate, timezone.Hours, token); - + var result = new WellOperationPlanDto() { WellOperationsPlan = dtos.Select(Convert), @@ -199,9 +199,9 @@ public class WellOperationRepository : IWellOperationRepository { var query = BuildQuery(request) .AsNoTracking(); - + var dtos = await query.ToArrayAsync(token); - + return dtos.Select(Convert); } @@ -222,7 +222,7 @@ public class WellOperationRepository : IWellOperationRepository CancellationToken token) { var query = BuildQuery(request); - + var result = new PaginationContainer { Skip = request.Skip ?? 0, @@ -390,7 +390,7 @@ public class WellOperationRepository : IWellOperationRepository { var timezone = wellService.GetTimezone(request.IdWell); var timeZoneOffset = timezone.Hours; - + var query = db.WellOperations .Include(s => s.WellSectionType) .Include(s => s.OperationCategory) @@ -413,14 +413,14 @@ public class WellOperationRepository : IWellOperationRepository if (request.GeDate.HasValue) { - var geDateOffset = request.GeDate.Value.ToUtcDateTimeOffset(timeZoneOffset); - query = query.Where(e => e.DateStart >= geDateOffset); + //var geDateOffset = request.GeDate.Value.ToUtcDateTimeOffset(timeZoneOffset); + query = query.Where(e => e.DateStart >= request.GeDate); } - if (request.LtDate.HasValue) + if (request.LeDate.HasValue) { - var ltDateOffset = request.LtDate.Value.ToUtcDateTimeOffset(timeZoneOffset); - query = query.Where(e => e.DateStart < ltDateOffset); + //var leDateOffset = request.LeDate.Value.ToUtcDateTimeOffset(timeZoneOffset); + query = query.Where(e => e.DateStart <= request.LeDate); } var currentWellOperations = db.WellOperations @@ -468,7 +468,7 @@ public class WellOperationRepository : IWellOperationRepository { dtos = dtos.SortBy(request.SortFields); } - + dtos = dtos .OrderBy(e => e.DateStart) .ThenBy(e => e.DepthEnd) @@ -533,7 +533,7 @@ public class WellOperationRepository : IWellOperationRepository var timezoneOffset = TimeSpan.FromHours(timezone.Hours); var dtoWithRemoteDateTime = dto.Adapt(); - + dtoWithRemoteDateTime.DateStart = dto.DateStart.ToOffset(TimeSpan.FromHours(timezoneOffset.Hours)); dtoWithRemoteDateTime.LastUpdateDate = dto.LastUpdateDate?.ToOffset(TimeSpan.FromHours(timezoneOffset.Hours)); @@ -605,11 +605,11 @@ public class WellOperationRepository : IWellOperationRepository var geDateUtc = geDate.Value.ToUniversalTime(); query = query.Where(e => e.DateStart >= geDateUtc); } - + var groups = await query .GroupBy(o => new { o.IdWell, o.IdType }) .Select(g => new{ - MaxDate = g.Max(o => o.DateStart), + MaxDate = g.Max(o => o.DateStart), g.Key.IdWell, g.Key.IdType, }) diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs index 43fb0abf..6a4cfba5 100644 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs +++ b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs @@ -114,7 +114,7 @@ public class DailyReportService : IDailyReportService IdWell = idWell, OperationType = WellOperation.IdOperationTypeFact, GeDate = geDate, - LtDate = ltDate + LeDate = ltDate }; var factWellOperations = (await wellOperationRepository.GetAsync(factOperationRequest, cancellationToken)) @@ -191,7 +191,7 @@ public class DailyReportService : IDailyReportService IdWell = idWell, OperationType = WellOperation.IdOperationTypeFact, GeDate = geDateFactWellOperation, - LtDate = ltDateFactWellOperation + LeDate = ltDateFactWellOperation }; var factWellOperations = await wellOperationRepository.GetAsync(factWellOperationRequest, cancellationToken); From 616cb242d6a4512dd866e293792558027f8a3da1 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Tue, 19 Mar 2024 17:21:05 +0500 Subject: [PATCH 02/31] =?UTF-8?q?=D0=A3=D0=BD=D0=B8=D1=84=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20DailyReport=20+=20=D0=B2=D1=81=D1=91,=20=D1=87=D1=82?= =?UTF-8?q?=D0=BE=20=D0=BF=D1=80=D0=B8=D1=88=D0=BB=D0=BE=D1=81=D1=8C=20?= =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D1=82=D1=8C,=20?= =?UTF-8?q?=D1=87=D1=82=D0=BE=D0=B1=D1=8B=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=20=D1=81=D0=BE=D0=B1=D1=80=D0=B0=D0=BB=D1=81=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data/DailyReport/DailyReportDto.cs | 2 +- AsbCloudApp/Data/DatesRangeDto.cs | 4 +- AsbCloudApp/Data/StatWellDto.cs | 2 +- AsbCloudApp/Data/WellDto.cs | 2 +- AsbCloudApp/Services/IWellService.cs | 2 +- .../AsbCloudDbContextModelSnapshot.cs | 2 +- AsbCloudDb/Model/DailyReports/DailyReport.cs | 2 +- .../Repository/DailyReportRepository.cs | 111 +++++++++--------- .../Repository/DepositRepository.cs | 4 +- .../Repository/WellOperationRepository.cs | 18 +-- .../DailyReport/DailyReportService.cs | 46 ++++---- .../Services/SAUB/TelemetryDataBaseService.cs | 2 +- .../OperationsStatService.cs | 9 +- .../Services/WellService.cs | 6 +- .../Services/WellboreServiceTest.cs | 4 +- 15 files changed, 110 insertions(+), 106 deletions(-) diff --git a/AsbCloudApp/Data/DailyReport/DailyReportDto.cs b/AsbCloudApp/Data/DailyReport/DailyReportDto.cs index d8d9d4c8..c31dd73c 100644 --- a/AsbCloudApp/Data/DailyReport/DailyReportDto.cs +++ b/AsbCloudApp/Data/DailyReport/DailyReportDto.cs @@ -74,7 +74,7 @@ public class DailyReportDto : IId, /// /// Дата последнего обновления /// - public DateTime? DateLastUpdate { get; set; } + public DateTimeOffset? DateLastUpdate { get; set; } /// /// Блок фактической траектории diff --git a/AsbCloudApp/Data/DatesRangeDto.cs b/AsbCloudApp/Data/DatesRangeDto.cs index 3f12acb7..a61034b6 100644 --- a/AsbCloudApp/Data/DatesRangeDto.cs +++ b/AsbCloudApp/Data/DatesRangeDto.cs @@ -12,12 +12,12 @@ namespace AsbCloudApp.Data /// Дата начала диапазона /// [Required] - public DateTime From { get; set; } + public DateTimeOffset From { get; set; } /// /// Дата окончания диапазона /// [Required] - public DateTime To { get; set; } + public DateTimeOffset To { get; set; } } } diff --git a/AsbCloudApp/Data/StatWellDto.cs b/AsbCloudApp/Data/StatWellDto.cs index ece9756c..9cf27fe4 100644 --- a/AsbCloudApp/Data/StatWellDto.cs +++ b/AsbCloudApp/Data/StatWellDto.cs @@ -42,7 +42,7 @@ namespace AsbCloudApp.Data /// дата прихода последней телеметрии /// [Required] - public DateTime LastTelemetryDate { get; set; } + public DateTimeOffset LastTelemetryDate { get; set; } /// /// Статистика по секциям diff --git a/AsbCloudApp/Data/WellDto.cs b/AsbCloudApp/Data/WellDto.cs index 30f524c2..d9a67431 100644 --- a/AsbCloudApp/Data/WellDto.cs +++ b/AsbCloudApp/Data/WellDto.cs @@ -72,7 +72,7 @@ namespace AsbCloudApp.Data /// /// Дата/время кода приходили данные последний раз /// - public DateTime LastTelemetryDate { get; set; } + public DateTimeOffset LastTelemetryDate { get; set; } /// /// ID телеметрии diff --git a/AsbCloudApp/Services/IWellService.cs b/AsbCloudApp/Services/IWellService.cs index edea98ae..4279f587 100644 --- a/AsbCloudApp/Services/IWellService.cs +++ b/AsbCloudApp/Services/IWellService.cs @@ -72,7 +72,7 @@ namespace AsbCloudApp.Services /// /// /// - DateTime GetLastTelemetryDate(int idWell); + DateTimeOffset GetLastTelemetryDate(int idWell); //TODO: выяснить и удалить отсюда /// diff --git a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs index 9957e235..8f326f19 100644 --- a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs +++ b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs @@ -282,7 +282,7 @@ namespace AsbCloudDb.Migrations .HasColumnName("date") .HasComment("Дата формирования отчёта"); - b.Property("DateLastUpdate") + b.Property("DateLastUpdate") .HasColumnType("timestamp with time zone") .HasColumnName("date_last_update") .HasComment("Дата последнего обновления"); diff --git a/AsbCloudDb/Model/DailyReports/DailyReport.cs b/AsbCloudDb/Model/DailyReports/DailyReport.cs index c521ca54..8bc99470 100644 --- a/AsbCloudDb/Model/DailyReports/DailyReport.cs +++ b/AsbCloudDb/Model/DailyReports/DailyReport.cs @@ -18,7 +18,7 @@ public class DailyReport : IId public int IdWell { get; set; } [Column("date_last_update", TypeName = "timestamp with time zone"), Comment("Дата последнего обновления")] - public DateTime? DateLastUpdate { get; set; } + public DateTimeOffset? DateLastUpdate { get; set; } [Column("date", TypeName = "date"), Comment("Дата формирования отчёта")] public DateOnly Date { get; set; } diff --git a/AsbCloudInfrastructure/Repository/DailyReportRepository.cs b/AsbCloudInfrastructure/Repository/DailyReportRepository.cs index b82b0ce1..f7f582fa 100644 --- a/AsbCloudInfrastructure/Repository/DailyReportRepository.cs +++ b/AsbCloudInfrastructure/Repository/DailyReportRepository.cs @@ -1,80 +1,85 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using AsbCloudApp.Data.DailyReport; using AsbCloudApp.Data.DailyReport.Blocks.Sign; using AsbCloudApp.Data.DailyReport.Blocks.Subsystems; using AsbCloudApp.Data.DailyReport.Blocks.TimeBalance; using AsbCloudApp.Repositories; using AsbCloudApp.Requests; +using AsbCloudApp.Services; using AsbCloudDb; using AsbCloudDb.Model; using AsbCloudDb.Model.DailyReports; using Mapster; using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; namespace AsbCloudInfrastructure.Repository; public class DailyReportRepository : CrudRepositoryBase, - IDailyReportRepository + IDailyReportRepository { - public DailyReportRepository(IAsbCloudDbContext dbContext) - : base(dbContext) - { - } + private IWellService wellService; - public async Task> GetAsync(int idWell, FileReportRequest request, CancellationToken cancellationToken) - { - var skip = request.Skip ?? 0; - var take = request.Take ?? 10; + public DailyReportRepository(IAsbCloudDbContext dbContext, IWellService wellService) + : base(dbContext) + { + this.wellService = wellService; + } - var query = GetQuery().Where(d => d.IdWell == idWell); + public async Task> GetAsync(int idWell, FileReportRequest request, CancellationToken cancellationToken) + { + var skip = request.Skip ?? 0; + var take = request.Take ?? 10; - if (request.GeDate.HasValue) - query = query.Where(d => d.Date >= request.GeDate.Value); - - if (request.LeDate.HasValue) - query = query.Where(d => d.Date <= request.LeDate.Value); + var query = GetQuery().Where(d => d.IdWell == idWell); - query = request.SortFields?.Any() == true ? - query.SortBy(request.SortFields) : - query.OrderBy(d => d.Date); + if (request.GeDate.HasValue) + query = query.Where(d => d.Date >= request.GeDate.Value); - var entities = await query - .Skip(skip) - .Take(take) - .AsNoTracking() - .ToArrayAsync(cancellationToken); + if (request.LeDate.HasValue) + query = query.Where(d => d.Date <= request.LeDate.Value); - var dtos = entities.Select(Convert); + query = request.SortFields?.Any() == true ? + query.SortBy(request.SortFields) : + query.OrderBy(d => d.Date); - return dtos; - } + var entities = await query + .Skip(skip) + .Take(take) + .AsNoTracking() + .ToArrayAsync(cancellationToken); - public async Task GetOrDefaultAsync(int idWell, DateOnly date, CancellationToken cancellationToken) - { - var entity = await GetQuery() - .AsNoTracking() - .SingleOrDefaultAsync(d => d.IdWell == idWell && d.Date == date, cancellationToken); + var timezoneOffset = wellService.GetTimezone(idWell).Offset; + var dtos = entities.Select(entity => Convert(entity, timezoneOffset)); - return entity is null ? null : Convert(entity); - } + return dtos; + } - protected override DailyReportDto Convert(DailyReport src) - { - var dto = new DailyReportDto - { - Id = src.Id, - IdWell = src.IdWell, - DateLastUpdate = src.DateLastUpdate, - Date = src.Date, - SignBlock = src.SignBlock?.Adapt(), - TimeBalanceBlock = src.TimeBalanceBlock?.Adapt(), - SubsystemBlock = src.SubsystemBlock?.Adapt() - }; - - return dto; - } + public async Task GetOrDefaultAsync(int idWell, DateOnly date, CancellationToken cancellationToken) + { + var entity = await GetQuery() + .AsNoTracking() + .SingleOrDefaultAsync(d => d.IdWell == idWell && d.Date == date, cancellationToken); + + return entity is null ? null : Convert(entity); + } + + protected DailyReportDto Convert(DailyReport src, TimeSpan timezoneOffset) + { + var dto = new DailyReportDto + { + Id = src.Id, + IdWell = src.IdWell, + DateLastUpdate = src.DateLastUpdate?.ToOffset(timezoneOffset), + Date = src.Date, + SignBlock = src.SignBlock?.Adapt(), + TimeBalanceBlock = src.TimeBalanceBlock?.Adapt(), + SubsystemBlock = src.SubsystemBlock?.Adapt() + }; + + return dto; + } } \ No newline at end of file diff --git a/AsbCloudInfrastructure/Repository/DepositRepository.cs b/AsbCloudInfrastructure/Repository/DepositRepository.cs index 7f19f1d7..804d130e 100644 --- a/AsbCloudInfrastructure/Repository/DepositRepository.cs +++ b/AsbCloudInfrastructure/Repository/DepositRepository.cs @@ -4,6 +4,7 @@ using AsbCloudApp.Services; using AsbCloudDb.Model; using Mapster; using Microsoft.EntityFrameworkCore; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; @@ -111,7 +112,8 @@ namespace AsbCloudInfrastructure.Repository { var dto = well.Adapt(); dto.WellType = well.WellType.Caption; - dto.LastTelemetryDate = wellService.GetLastTelemetryDate(well.Id); + dto.LastTelemetryDate = wellService.GetLastTelemetryDate(well.Id) + .ToOffset(TimeSpan.FromHours(well.Timezone.Hours)); dto.Cluster = gCluster.Key.Caption; dto.Deposit = gDeposit.Key.Caption; return dto; diff --git a/AsbCloudInfrastructure/Repository/WellOperationRepository.cs b/AsbCloudInfrastructure/Repository/WellOperationRepository.cs index c75ab4fd..1c3f6fdc 100644 --- a/AsbCloudInfrastructure/Repository/WellOperationRepository.cs +++ b/AsbCloudInfrastructure/Repository/WellOperationRepository.cs @@ -177,8 +177,8 @@ public class WellOperationRepository : IWellOperationRepository return new DatesRangeDto { - From = minDate.ToRemoteDateTime(timezone.Hours), - To = maxDate.ToRemoteDateTime(timezone.Hours) + From = minDate.ToOffset(timezone.Offset), + To = maxDate.ToOffset(timezone.Offset) }; } @@ -197,12 +197,12 @@ public class WellOperationRepository : IWellOperationRepository WellOperationRequest request, CancellationToken token) { - var query = BuildQuery(request) + var query = BuildQuery(request) .AsNoTracking(); - var dtos = await query.ToArrayAsync(token); + var dtos = await query.ToArrayAsync(token); - return dtos.Select(Convert); + return dtos.Select(Convert); } public async Task> GetAsync( @@ -413,14 +413,14 @@ public class WellOperationRepository : IWellOperationRepository if (request.GeDate.HasValue) { - //var geDateOffset = request.GeDate.Value.ToUtcDateTimeOffset(timeZoneOffset); - query = query.Where(e => e.DateStart >= request.GeDate); + var geDateOffset = request.GeDate.Value.ToUniversalTime(); + query = query.Where(e => e.DateStart >= geDateOffset); } if (request.LeDate.HasValue) { - //var leDateOffset = request.LeDate.Value.ToUtcDateTimeOffset(timeZoneOffset); - query = query.Where(e => e.DateStart <= request.LeDate); + var leDateOffset = request.LeDate.Value.ToUniversalTime(); + query = query.Where(e => e.DateStart <= leDateOffset); } var currentWellOperations = db.WellOperations diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs index 6a4cfba5..fba35c59 100644 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs +++ b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs @@ -83,7 +83,7 @@ public class DailyReportService : IDailyReportService editableBlock.IdUser = idUser; editableBlock.LastUpdateDate = DateTime.UtcNow; - dailyReport.DateLastUpdate = DateTime.UtcNow; + dailyReport.DateLastUpdate = DateTimeOffset.UtcNow; if (dailyReport.Id == 0) return await dailyReportRepository.InsertAsync(dailyReport, cancellationToken); @@ -158,28 +158,27 @@ public class DailyReportService : IDailyReportService return result; var dailyReports = new List(); - - if (request.GeDate.HasValue) - { - var startDate = new DateTime(request.GeDate.Value.Year, request.GeDate.Value.Month, - request.GeDate.Value.Day); + TimeSpan offset = wellService.GetTimezone(idWell).Offset; - if (startDate.Date >= datesRange.From.Date) + if (request.GeDate.HasValue) + { + var startDate = new DateTimeOffset(request.GeDate.Value, TimeOnly.MinValue, offset); + + if (startDate >= datesRange.From) datesRange.From = startDate; } if (request.LeDate.HasValue) { - var finishDate = new DateTime(request.LeDate.Value.Year, request.LeDate.Value.Month, - request.LeDate.Value.Day); + var finishDate = new DateTimeOffset(request.LeDate.Value, TimeOnly.MinValue, offset); - if (finishDate.Date <= datesRange.To.Date) + if (finishDate <= datesRange.To) datesRange.To = finishDate; } if (datesRange.From.AddDays(result.Skip) <= datesRange.To) - result.Count = (int)(Math.Ceiling((datesRange.To - DateTime.UnixEpoch).TotalDays) - - Math.Floor((datesRange.From - DateTime.UnixEpoch).TotalDays)) + 1; + result.Count = (int)(Math.Ceiling((datesRange.To - DateTimeOffset.UnixEpoch).TotalDays) - + Math.Floor((datesRange.From - DateTimeOffset.UnixEpoch).TotalDays)) + 1; var existingDailyReports = await dailyReportRepository.GetAsync(idWell, request, cancellationToken); @@ -200,16 +199,16 @@ public class DailyReportService : IDailyReportService { for (var day = result.Skip; day - result.Skip < result.Take && datesRange.To.AddDays(-day) >= datesRange.From; day++) { - var dateDailyReport = DateOnly.FromDateTime(datesRange.To.AddDays(-day)); + var dateDailyReport = DateOnly.FromDateTime(datesRange.To.AddDays(-day).DateTime); - AddDailyReport(dateDailyReport); + AddDailyReport(dateDailyReport); } } else { for (var day = result.Skip; day - result.Skip < result.Take && datesRange.From.AddDays(day) <= datesRange.To; day++) { - var dateDailyReport = DateOnly.FromDateTime(datesRange.From.AddDays(day)); + var dateDailyReport = DateOnly.FromDateTime(datesRange.From.AddDays(day).DateTime); AddDailyReport(dateDailyReport); } @@ -243,7 +242,7 @@ public class DailyReportService : IDailyReportService public async Task GetDatesRangeAsync(int idWell, CancellationToken cancellationToken) { var timezone = wellService.GetTimezone(idWell); - var currentDate = DateTimeOffset.UtcNow.ToRemoteDateTime(timezone.Hours); + var currentDate = DateTimeOffset.UtcNow.ToOffset(TimeSpan.FromHours(timezone.Hours)); var factOperationDatesRange = await wellOperationRepository.GetDatesRangeAsync(idWell, WellOperation.IdOperationTypeFact, cancellationToken); @@ -251,15 +250,13 @@ public class DailyReportService : IDailyReportService if (factOperationDatesRange is null) return null; - var from = (factOperationDatesRange.From.AddDays(1) <= DateTime.UtcNow ? + var from = (factOperationDatesRange.From.AddDays(1) <= DateTimeOffset.UtcNow.ToOffset(TimeSpan.FromHours(timezone.Hours)) ? factOperationDatesRange.From : - currentDate.AddDays(-1)) - .Date; + currentDate.AddDays(-1)); - var to = (factOperationDatesRange.To.AddDays(1) <= DateTime.UtcNow ? + var to = (factOperationDatesRange.To.AddDays(1) <= DateTimeOffset.UtcNow.ToOffset(TimeSpan.FromHours(timezone.Hours)) ? factOperationDatesRange.To : - currentDate.AddDays(-1)) - .Date; + currentDate.AddDays(-1)); return new DatesRangeDto { @@ -417,9 +414,8 @@ public class DailyReportService : IDailyReportService if (datesRange is null) return false; - - var from = DateOnly.FromDateTime(datesRange.From); - var to = DateOnly.FromDateTime(datesRange.To); + var from = DateOnly.FromDateTime(datesRange.From.ToUniversalTime().DateTime); + var to = DateOnly.FromDateTime(datesRange.To.ToUniversalTime().DateTime); return dateDailyReport >= from && dateDailyReport <= to; } diff --git a/AsbCloudInfrastructure/Services/SAUB/TelemetryDataBaseService.cs b/AsbCloudInfrastructure/Services/SAUB/TelemetryDataBaseService.cs index f9cc64ee..52966fad 100644 --- a/AsbCloudInfrastructure/Services/SAUB/TelemetryDataBaseService.cs +++ b/AsbCloudInfrastructure/Services/SAUB/TelemetryDataBaseService.cs @@ -102,7 +102,7 @@ namespace AsbCloudInfrastructure.Services.SAUB if (dateBegin == default) { var dateRange = telemetryDataCache.GetOrDefaultDataDateRange(telemetry.Id); - dateBeginUtc = (dateRange?.To.ToUtcDateTimeOffset(timezone.Hours) ?? DateTime.UtcNow) + dateBeginUtc = (dateRange?.To.ToOffset(timezone.Offset) ?? DateTimeOffset.UtcNow) .AddSeconds(-intervalSec); } else diff --git a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs index c9018051..4bf326e7 100644 --- a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs +++ b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs @@ -145,6 +145,8 @@ public class OperationsStatService : IOperationsStatService private async Task CalcWellStatAsync(Well well, CancellationToken token) { + var timezone = wellService.GetTimezone(well.Id); + var wellType = (await memoryCache .GetOrCreateBasicAsync(db.Set(), token)) .FirstOrDefault(t => t.Id == well.IdWellType); @@ -155,7 +157,7 @@ public class OperationsStatService : IOperationsStatService WellType = wellType?.Caption ?? "", IdState = well.IdState, State = wellService.GetStateText(well.IdState), - LastTelemetryDate = wellService.GetLastTelemetryDate(well.Id), + LastTelemetryDate = wellService.GetLastTelemetryDate(well.Id).ToOffset(timezone.Offset), Companies = await wellService.GetCompaniesAsync(well.Id, token) }; @@ -169,9 +171,8 @@ public class OperationsStatService : IOperationsStatService if (!wellOperations.Any()) return statWellDto; - var timezoneOffsetH = wellService.GetTimezone(well.Id).Hours; - statWellDto.Sections = CalcSectionsStats(wellOperations, timezoneOffsetH); - statWellDto.Total = GetStatTotal(wellOperations, well.IdState, timezoneOffsetH); + statWellDto.Sections = CalcSectionsStats(wellOperations, timezone.Hours); + statWellDto.Total = GetStatTotal(wellOperations, well.IdState, timezone.Hours); statWellDto.TvdLagDays = CalcTvdLagDays(wellOperations); statWellDto.TvdDrillingDays = CalcDrillingDays(wellOperations); diff --git a/AsbCloudInfrastructure/Services/WellService.cs b/AsbCloudInfrastructure/Services/WellService.cs index 4d6ec10a..2c579140 100644 --- a/AsbCloudInfrastructure/Services/WellService.cs +++ b/AsbCloudInfrastructure/Services/WellService.cs @@ -63,12 +63,12 @@ namespace AsbCloudInfrastructure.Services private void DropCacheRelationCompanyWell() => memoryCache.DropBasic(); - public DateTime GetLastTelemetryDate(int idWell) + public DateTimeOffset GetLastTelemetryDate(int idWell) { var well = GetOrDefault(idWell); if (well?.IdTelemetry is null) - return DateTime.MinValue; + return DateTimeOffset.MinValue; var datesRange = telemetryService.GetDatesRange(well.IdTelemetry.Value); return datesRange.To; @@ -278,7 +278,7 @@ namespace AsbCloudInfrastructure.Services dto.Cluster = entity.Cluster.Caption; dto.Deposit = entity.Cluster.Deposit.Caption; if (entity.IdTelemetry is not null) - dto.LastTelemetryDate = telemetryService.GetDatesRange(entity.IdTelemetry.Value).To; + dto.LastTelemetryDate = telemetryService.GetDatesRange(entity.IdTelemetry.Value).To.ToOffset(dto.Timezone.Offset); dto.Companies = entity.RelationCompaniesWells .Select(r => Convert(r.Company)) .ToList(); diff --git a/AsbCloudWebApi.Tests/Services/WellboreServiceTest.cs b/AsbCloudWebApi.Tests/Services/WellboreServiceTest.cs index 7f647158..f256c384 100644 --- a/AsbCloudWebApi.Tests/Services/WellboreServiceTest.cs +++ b/AsbCloudWebApi.Tests/Services/WellboreServiceTest.cs @@ -21,7 +21,7 @@ public class WellboreServiceTest Id = 1, IdState = 1, IdTelemetry = 1, - LastTelemetryDate = DateTime.Now, + LastTelemetryDate = DateTimeOffset.Now, Caption = "well 1" }; @@ -30,7 +30,7 @@ public class WellboreServiceTest Id = 2, IdState = 1, IdTelemetry = 100, - LastTelemetryDate = DateTime.Now, + LastTelemetryDate = DateTimeOffset.Now, Caption = "well 2" }; From 0df79ee0fc80699d51b3fe75692619fd7560d965 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Tue, 19 Mar 2024 17:52:45 +0500 Subject: [PATCH 03/31] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=8F=20DateDownload=20=D0=B2=20Manual=20?= =?UTF-8?q?=D0=B8=20ManualDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/Manuals/ManualDto.cs | 2 +- AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs | 2 +- AsbCloudDb/Model/Manuals/Manual.cs | 4 ++-- AsbCloudInfrastructure/Services/ManualCatalogService.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AsbCloudApp/Data/Manuals/ManualDto.cs b/AsbCloudApp/Data/Manuals/ManualDto.cs index bb89dfbe..c5aa92c4 100644 --- a/AsbCloudApp/Data/Manuals/ManualDto.cs +++ b/AsbCloudApp/Data/Manuals/ManualDto.cs @@ -18,7 +18,7 @@ public class ManualDto : IId /// /// Дата загрузки /// - public DateTime DateDownload { get; set; } + public DateTimeOffset DateDownload { get; set; } /// /// Id автора diff --git a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs index 8f326f19..8bd03355 100644 --- a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs +++ b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs @@ -1390,7 +1390,7 @@ namespace AsbCloudDb.Migrations NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateDownload") + b.Property("DateDownload") .HasColumnType("timestamp with time zone") .HasColumnName("date_download") .HasComment("Дата загрузки"); diff --git a/AsbCloudDb/Model/Manuals/Manual.cs b/AsbCloudDb/Model/Manuals/Manual.cs index 35b091b5..8ab64735 100644 --- a/AsbCloudDb/Model/Manuals/Manual.cs +++ b/AsbCloudDb/Model/Manuals/Manual.cs @@ -15,8 +15,8 @@ public class Manual : IId [Column("name"), Comment("Название")] public string Name { get; set; } = null!; - [Column("date_download"), Comment("Дата загрузки")] - public DateTime DateDownload { get; set; } + [Column("date_download", TypeName = "timestamp with time zone"), Comment("Дата загрузки")] + public DateTimeOffset DateDownload { get; set; } [Column("id_directory"), Comment("Id директории")] public int IdDirectory { get; set; } diff --git a/AsbCloudInfrastructure/Services/ManualCatalogService.cs b/AsbCloudInfrastructure/Services/ManualCatalogService.cs index c8713ab1..8c779bc7 100644 --- a/AsbCloudInfrastructure/Services/ManualCatalogService.cs +++ b/AsbCloudInfrastructure/Services/ManualCatalogService.cs @@ -57,7 +57,7 @@ public class ManualCatalogService : IManualCatalogService var manual = new ManualDto { Name = name, - DateDownload = DateTime.UtcNow, + DateDownload = DateTimeOffset.UtcNow, IdDirectory = idDirectory, IdCategory = IdFileCategory, IdAuthor = idAuthor From ec2abd224ebd9c9a7fef4b44a01a660f944e54f9 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Wed, 20 Mar 2024 16:29:25 +0500 Subject: [PATCH 04/31] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=82=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D1=81=20?= =?UTF-8?q?DateTime=20=D0=BD=D0=B0=20DateTimeOffset=20=D0=B2=20Notificatio?= =?UTF-8?q?n=20=D0=B8=20NotificationDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/NotificationDto.cs | 12 ++++++------ AsbCloudApp/Requests/NotificationDeleteRequest.cs | 4 ++-- .../Services/Notifications/NotificationService.cs | 8 ++++---- .../Migrations/AsbCloudDbContextModelSnapshot.cs | 6 +++--- AsbCloudDb/Model/Notification.cs | 6 +++--- AsbCloudInfrastructure/Background/WorkToSendEmail.cs | 2 +- .../Repository/NotificationRepository.cs | 4 ++-- .../EmailNotificationTransportServiceTests.cs | 2 +- .../SignalR/Services/NotificationPublisher.cs | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/AsbCloudApp/Data/NotificationDto.cs b/AsbCloudApp/Data/NotificationDto.cs index ee42f8d7..0fd8b673 100644 --- a/AsbCloudApp/Data/NotificationDto.cs +++ b/AsbCloudApp/Data/NotificationDto.cs @@ -42,17 +42,17 @@ public class NotificationDto : IId /// Дата регистрации уведомления /// [Required] - public DateTime RegistrationDate { get; set; } + public DateTimeOffset RegistrationDate { get; set; } /// /// Дата отправки уведомления /// - public DateTime? SentDate { get; set; } + public DateTimeOffset? SentDate { get; set; } /// /// Дата прочтения уведомления /// - public DateTime? ReadDate { get; set; } + public DateTimeOffset? ReadDate { get; set; } /// /// Состояние уведомления @@ -82,12 +82,12 @@ public class NotificationDto : IId ReadDate = null; break; case 1: - SentDate = DateTime.UtcNow; + SentDate = DateTimeOffset.UtcNow; ReadDate = null; break; case 2: - SentDate = DateTime.UtcNow; - ReadDate = DateTime.UtcNow; + SentDate = DateTimeOffset.UtcNow; + ReadDate = DateTimeOffset.UtcNow; break; } } diff --git a/AsbCloudApp/Requests/NotificationDeleteRequest.cs b/AsbCloudApp/Requests/NotificationDeleteRequest.cs index ec2026f3..56921d70 100644 --- a/AsbCloudApp/Requests/NotificationDeleteRequest.cs +++ b/AsbCloudApp/Requests/NotificationDeleteRequest.cs @@ -15,10 +15,10 @@ public class NotificationDeleteRequest /// /// Меньше или равно дате отправки /// - public DateTime? LtSentDate { get; set; } + public DateTimeOffset? LtSentDate { get; set; } /// /// Меньше или равно дате прочтения /// - public DateTime? LtReadDate { get; set; } + public DateTimeOffset? LtReadDate { get; set; } } \ No newline at end of file diff --git a/AsbCloudApp/Services/Notifications/NotificationService.cs b/AsbCloudApp/Services/Notifications/NotificationService.cs index d703ffb4..97b8bfb5 100644 --- a/AsbCloudApp/Services/Notifications/NotificationService.cs +++ b/AsbCloudApp/Services/Notifications/NotificationService.cs @@ -49,7 +49,7 @@ public class NotificationService var notification = new NotificationDto { IdUser = request.IdUser, - RegistrationDate = DateTime.UtcNow, + RegistrationDate = DateTimeOffset.UtcNow, IdNotificationCategory = notificationCategory.Id, Title = request.Title, Message = request.Message, @@ -71,7 +71,7 @@ public class NotificationService Console.WriteLine(ex.Message); } - notification.SentDate = DateTime.UtcNow; + notification.SentDate = DateTimeOffset.UtcNow; await notificationRepository.UpdateAsync(notification, cancellationToken); } @@ -92,7 +92,7 @@ public class NotificationService if(isRead && !notification.SentDate.HasValue) throw new ArgumentInvalidException(nameof(isRead), "Уведомление не может быть прочитано"); - notification.ReadDate = isRead ? DateTime.UtcNow : null; + notification.ReadDate = isRead ? DateTimeOffset.UtcNow : null; await notificationRepository.UpdateAsync(notification, cancellationToken); @@ -119,7 +119,7 @@ public class NotificationService var tasks = notifications.Select(notification => { - notification.SentDate = DateTime.UtcNow; + notification.SentDate = DateTimeOffset.UtcNow; return notificationRepository.UpdateAsync(notification, cancellationToken); }); diff --git a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs index 8bd03355..9c6590fb 100644 --- a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs +++ b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs @@ -1581,17 +1581,17 @@ namespace AsbCloudDb.Migrations .HasColumnName("message") .HasComment("Сообщение уведомления"); - b.Property("ReadDate") + b.Property("ReadDate") .HasColumnType("timestamp with time zone") .HasColumnName("read_date") .HasComment("Дата прочтения уведомления"); - b.Property("RegistrationDate") + b.Property("RegistrationDate") .HasColumnType("timestamp with time zone") .HasColumnName("registration_date") .HasComment("Дата регистрации уведомления"); - b.Property("SentDate") + b.Property("SentDate") .HasColumnType("timestamp with time zone") .HasColumnName("sent_date") .HasComment("Дата отправки уведомления"); diff --git a/AsbCloudDb/Model/Notification.cs b/AsbCloudDb/Model/Notification.cs index 09f718b1..bed84a2b 100644 --- a/AsbCloudDb/Model/Notification.cs +++ b/AsbCloudDb/Model/Notification.cs @@ -25,13 +25,13 @@ public class Notification : IId public string Message { get; set; } = null!; [Column("registration_date"), Comment("Дата регистрации уведомления")] - public DateTime RegistrationDate { get; set; } + public DateTimeOffset RegistrationDate { get; set; } [Column("sent_date"), Comment("Дата отправки уведомления")] - public DateTime? SentDate { get; set; } + public DateTimeOffset? SentDate { get; set; } [Column("read_date"), Comment("Дата прочтения уведомления")] - public DateTime? ReadDate { get; set; } + public DateTimeOffset? ReadDate { get; set; } [Column("id_transport_type"), Comment("Id типа доставки уведомления")] public int IdTransportType { get; set; } diff --git a/AsbCloudInfrastructure/Background/WorkToSendEmail.cs b/AsbCloudInfrastructure/Background/WorkToSendEmail.cs index 57605438..ef8048e9 100644 --- a/AsbCloudInfrastructure/Background/WorkToSendEmail.cs +++ b/AsbCloudInfrastructure/Background/WorkToSendEmail.cs @@ -27,7 +27,7 @@ namespace AsbCloudInfrastructure.Background await notificationService.SendAsync(notification, token); - notification.SentDate = DateTime.UtcNow; + notification.SentDate = DateTimeOffset.UtcNow; await notificationRepository.UpdateAsync(notification, token); } diff --git a/AsbCloudInfrastructure/Repository/NotificationRepository.cs b/AsbCloudInfrastructure/Repository/NotificationRepository.cs index 6f1e4a98..7e184f02 100644 --- a/AsbCloudInfrastructure/Repository/NotificationRepository.cs +++ b/AsbCloudInfrastructure/Repository/NotificationRepository.cs @@ -110,10 +110,10 @@ public class NotificationRepository : CrudRepositoryBase n.IdNotificationCategory == request.IdCategory.Value); if (request.LtSentDate.HasValue) - query = query.Where(n => n.SentDate <= request.LtSentDate.Value); + query = query.Where(n => n.SentDate <= request.LtSentDate.Value.ToUniversalTime()); if (request.LtReadDate.HasValue) - query = query.Where(n => n.ReadDate <= request.LtReadDate.Value); + query = query.Where(n => n.ReadDate <= request.LtReadDate.Value.ToUniversalTime()); dbContext.Notifications.RemoveRange(query); diff --git a/AsbCloudWebApi.Tests/Services/Notification/EmailNotificationTransportServiceTests.cs b/AsbCloudWebApi.Tests/Services/Notification/EmailNotificationTransportServiceTests.cs index 724f1e7b..5b6bcb1d 100644 --- a/AsbCloudWebApi.Tests/Services/Notification/EmailNotificationTransportServiceTests.cs +++ b/AsbCloudWebApi.Tests/Services/Notification/EmailNotificationTransportServiceTests.cs @@ -26,7 +26,7 @@ namespace AsbCloudWebApi.Tests.Services.Notification IdUser = 1, IdTransportType = 1, IdState = 0, - RegistrationDate = DateTime.Now, + RegistrationDate = DateTimeOffset.Now, IdNotificationCategory = 10000, }; private readonly UserExtendedDto user = new UserExtendedDto() diff --git a/AsbCloudWebApi/SignalR/Services/NotificationPublisher.cs b/AsbCloudWebApi/SignalR/Services/NotificationPublisher.cs index 6799e71d..05c93a29 100644 --- a/AsbCloudWebApi/SignalR/Services/NotificationPublisher.cs +++ b/AsbCloudWebApi/SignalR/Services/NotificationPublisher.cs @@ -35,7 +35,7 @@ public class NotificationPublisher { foreach (var notification in groupedNotifications) { - notification.SentDate = DateTime.UtcNow; + notification.SentDate = DateTimeOffset.UtcNow; } var notifications = groupedNotifications.Select(n => n); From 2ae1cd2e3dbbceef1e264851a421edcf2797f1bf Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Wed, 20 Mar 2024 17:34:03 +0500 Subject: [PATCH 05/31] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B8=D0=BF=D0=B0=20=D0=B4=D0=B0?= =?UTF-8?q?=D1=82=D1=8B=20=D0=B2=20FileRequest=20=D0=B8=20FileRepository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Requests/FileRequest.cs | 4 ++-- AsbCloudInfrastructure/Repository/FileRepository.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AsbCloudApp/Requests/FileRequest.cs b/AsbCloudApp/Requests/FileRequest.cs index 7ea84c7e..403c0655 100644 --- a/AsbCloudApp/Requests/FileRequest.cs +++ b/AsbCloudApp/Requests/FileRequest.cs @@ -33,12 +33,12 @@ namespace AsbCloudApp.Requests /// /// Дата начала периода /// - public DateTime? Begin { get; set; } + public DateTimeOffset? Begin { get; set; } /// /// Дата окончания периода /// - public DateTime? End { get; set; } + public DateTimeOffset? End { get; set; } /// /// Признак удаления diff --git a/AsbCloudInfrastructure/Repository/FileRepository.cs b/AsbCloudInfrastructure/Repository/FileRepository.cs index cafc5649..391f5201 100644 --- a/AsbCloudInfrastructure/Repository/FileRepository.cs +++ b/AsbCloudInfrastructure/Repository/FileRepository.cs @@ -53,13 +53,13 @@ namespace AsbCloudInfrastructure.Repository if (request.Begin is not null) { - var beginUtc = request.Begin.Value.ToUtcDateTimeOffset(timezoneOffsetHours); + var beginUtc = request.Begin.Value.ToUniversalTime(); query = query.Where(e => e.UploadDate >= beginUtc); } if (request.End is not null) { - var endUtc = request.End.Value.ToUtcDateTimeOffset(timezoneOffsetHours); + var endUtc = request.End.Value.ToUniversalTime(); query = query.Where(e => e.UploadDate <= endUtc); } From 25138ec3ffbc2527d48e7083108822f47af28ba5 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 21 Mar 2024 10:52:23 +0500 Subject: [PATCH 06/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=B0=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?FileInfoDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/FileInfoDto.cs | 2 +- AsbCloudInfrastructure/Repository/FileRepository.cs | 2 +- .../Services/DrillingProgram/DrillingProgramService.cs | 2 +- AsbCloudInfrastructure/Services/ReportService.cs | 2 +- AsbCloudWebApi.Tests/Services/FileServiceTest.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AsbCloudApp/Data/FileInfoDto.cs b/AsbCloudApp/Data/FileInfoDto.cs index 8e006661..ab44b317 100644 --- a/AsbCloudApp/Data/FileInfoDto.cs +++ b/AsbCloudApp/Data/FileInfoDto.cs @@ -43,7 +43,7 @@ namespace AsbCloudApp.Data /// дата загрузки /// [Required] - public DateTime UploadDate { get; set; } + public DateTimeOffset UploadDate { get; set; } /// /// размер в байтах diff --git a/AsbCloudInfrastructure/Repository/FileRepository.cs b/AsbCloudInfrastructure/Repository/FileRepository.cs index 391f5201..dd6cc8ea 100644 --- a/AsbCloudInfrastructure/Repository/FileRepository.cs +++ b/AsbCloudInfrastructure/Repository/FileRepository.cs @@ -278,7 +278,7 @@ namespace AsbCloudInfrastructure.Repository private static FileInfoDto Convert(FileInfo entity, double timezoneOffset) { var dto = entity.Adapt(); - dto.UploadDate = entity.UploadDate.ToRemoteDateTime(timezoneOffset); + dto.UploadDate = entity.UploadDate.ToOffset(TimeSpan.FromHours(timezoneOffset)); dto.FileMarks = entity.FileMarks.Select(m => { var mark = m.Adapt(); diff --git a/AsbCloudInfrastructure/Services/DrillingProgram/DrillingProgramService.cs b/AsbCloudInfrastructure/Services/DrillingProgram/DrillingProgramService.cs index 3e8349ad..644a62cb 100644 --- a/AsbCloudInfrastructure/Services/DrillingProgram/DrillingProgramService.cs +++ b/AsbCloudInfrastructure/Services/DrillingProgram/DrillingProgramService.cs @@ -480,7 +480,7 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram IdWell = fileEntity.IdWell, Name = fileEntity.Name, Size = fileEntity.Size, - UploadDate = fileEntity.UploadDate.ToRemoteDateTime(timezoneOffset), + UploadDate = fileEntity.UploadDate.ToOffset(TimeSpan.FromHours(timezoneOffset)), }; var marks = fileEntity.FileMarks?.Where(m => !m.IsDeleted); diff --git a/AsbCloudInfrastructure/Services/ReportService.cs b/AsbCloudInfrastructure/Services/ReportService.cs index fd7d86a3..e1c75d62 100644 --- a/AsbCloudInfrastructure/Services/ReportService.cs +++ b/AsbCloudInfrastructure/Services/ReportService.cs @@ -106,7 +106,7 @@ public class ReportService : IReportService IdWell = p.File.IdWell, Name = p.File.Name, Size = p.File.Size, - UploadDate = p.File.UploadDate.ToRemoteDateTime(timezoneOffset), + UploadDate = p.File.UploadDate.ToOffset(TimeSpan.FromHours(timezoneOffset)), }, IdWell = p.IdWell, Date = p.File.UploadDate.ToRemoteDateTime(timezoneOffset), diff --git a/AsbCloudWebApi.Tests/Services/FileServiceTest.cs b/AsbCloudWebApi.Tests/Services/FileServiceTest.cs index 311e483f..b1200160 100644 --- a/AsbCloudWebApi.Tests/Services/FileServiceTest.cs +++ b/AsbCloudWebApi.Tests/Services/FileServiceTest.cs @@ -39,7 +39,7 @@ public class FileServiceTest IdCategory = idCategory, Name = fileName, Size = 0, - UploadDate = DateTime.Now + UploadDate = DateTimeOffset.Now }; private static FileMarkDto fileMark = new() From 62e30b0e8b49927701ce25d47e39fd9b382b7723 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 21 Mar 2024 10:54:41 +0500 Subject: [PATCH 07/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B0=20=D0=B4=D0=B0=D1=82=D1=8B?= =?UTF-8?q?=20=D0=B2=20DrillTestReportDataDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/DrillTestReport/DrillTestReportDataDto.cs | 2 +- .../Services/DrillTestReport/DrillTestReportService.cs | 2 +- AsbCloudInfrastructure/XLExtentions.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AsbCloudApp/Data/DrillTestReport/DrillTestReportDataDto.cs b/AsbCloudApp/Data/DrillTestReport/DrillTestReportDataDto.cs index ee63bf9b..b45783e6 100644 --- a/AsbCloudApp/Data/DrillTestReport/DrillTestReportDataDto.cs +++ b/AsbCloudApp/Data/DrillTestReport/DrillTestReportDataDto.cs @@ -21,6 +21,6 @@ namespace AsbCloudApp.Data.DrillTestReport /// /// Дата отчета /// - public DateTime Date { get; set; } = DateTime.Now; + public DateTimeOffset Date { get; set; } = DateTimeOffset.Now; } } diff --git a/AsbCloudInfrastructure/Services/DrillTestReport/DrillTestReportService.cs b/AsbCloudInfrastructure/Services/DrillTestReport/DrillTestReportService.cs index 983d1f7c..897e8724 100644 --- a/AsbCloudInfrastructure/Services/DrillTestReport/DrillTestReportService.cs +++ b/AsbCloudInfrastructure/Services/DrillTestReport/DrillTestReportService.cs @@ -49,7 +49,7 @@ namespace AsbCloudInfrastructure.Services.DrillTestReport well.Deposit ?? "-", well.Cluster ?? "-", well.Caption ?? "-"), - Date = DateTime.Now, + Date = DateTimeOffset.Now, }; var fileName = string.Format("Drill_test_{0}.xlsx", dto.TimeStampStart.ToString("dd.mm.yyyy_HH_MM_ss")); diff --git a/AsbCloudInfrastructure/XLExtentions.cs b/AsbCloudInfrastructure/XLExtentions.cs index e9cf11f5..0a784e9a 100644 --- a/AsbCloudInfrastructure/XLExtentions.cs +++ b/AsbCloudInfrastructure/XLExtentions.cs @@ -17,7 +17,7 @@ public static class XLExtentions public static IXLCell SetCellValue(this IXLCell cell, T value, string? format = null) { - if (typeof(T) == typeof(DateTime)) + if (typeof(T) == typeof(DateTime) || typeof(T) == typeof(DateTimeOffset)) { cell.Style.DateFormat.Format = format ?? "DD.MM.YYYY HH:MM:SS"; } From b66ca5a51525076cb08c3e5521082877d478353e Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 21 Mar 2024 11:08:48 +0500 Subject: [PATCH 08/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D0=B4?= =?UTF-8?q?=D0=B0=D1=82=D1=8B=20=D0=B4=D0=BB=D1=8F=20DrillTestReportInfoDt?= =?UTF-8?q?o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/DrillTestReport/DrillTestReportInfoDto.cs | 2 +- .../Services/DrillTestReport/DrillTestReportService.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AsbCloudApp/Data/DrillTestReport/DrillTestReportInfoDto.cs b/AsbCloudApp/Data/DrillTestReport/DrillTestReportInfoDto.cs index 39d37a11..a178e6fe 100644 --- a/AsbCloudApp/Data/DrillTestReport/DrillTestReportInfoDto.cs +++ b/AsbCloudApp/Data/DrillTestReport/DrillTestReportInfoDto.cs @@ -24,6 +24,6 @@ namespace AsbCloudApp.Data.DrillTestReport /// Дата и время /// [Required] - public DateTime DateTime { get; set; } + public DateTimeOffset DateTime { get; set; } } } diff --git a/AsbCloudInfrastructure/Services/DrillTestReport/DrillTestReportService.cs b/AsbCloudInfrastructure/Services/DrillTestReport/DrillTestReportService.cs index 897e8724..ff29ed0f 100644 --- a/AsbCloudInfrastructure/Services/DrillTestReport/DrillTestReportService.cs +++ b/AsbCloudInfrastructure/Services/DrillTestReport/DrillTestReportService.cs @@ -78,15 +78,15 @@ namespace AsbCloudInfrastructure.Services.DrillTestReport var dtos = await drillTestRepository.GetAllAsync(telemetry.Id, request, cancellationToken); foreach (var dto in dtos) { - var remoteDateTime = dto.TimeStampStart.ToRemoteDateTime(timezone.Hours); + var remoteDateTime = dto.TimeStampStart.ToOffset(TimeSpan.FromHours(timezone.Hours)); reports.Add(new DrillTestReportInfoDto { - FileName = string.Format("Drill_test_{0}", dto.TimeStampStart.DateTime), + FileName = string.Format("Drill_test_{0}", remoteDateTime), DrillDepth = (dto.Params .Where(p => p.DepthDrillStep.HasValue) .Sum(x => x.DepthDrillStep) ?? 0) + dto.DepthStart, - DateTime = dto.TimeStampStart.DateTime, + DateTime = remoteDateTime, Id = dto.Id, }); } From 593183ec87fd9e782d338f402db09de47c3453cf Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 21 Mar 2024 11:33:43 +0500 Subject: [PATCH 09/31] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B8=D0=BF=D0=B0=20=D0=B4=D0=B0?= =?UTF-8?q?=D1=82=20=D0=B4=D0=BB=D1=8F=20FileMarkDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/FileMarkDto.cs | 2 +- AsbCloudInfrastructure/Repository/FileRepository.cs | 2 +- .../Services/DrillingProgram/DrillingProgramService.cs | 2 +- .../Services/DrillingProgram/TitleListSheet.cs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AsbCloudApp/Data/FileMarkDto.cs b/AsbCloudApp/Data/FileMarkDto.cs index 7329821b..305fad5c 100644 --- a/AsbCloudApp/Data/FileMarkDto.cs +++ b/AsbCloudApp/Data/FileMarkDto.cs @@ -33,7 +33,7 @@ namespace AsbCloudApp.Data /// . /// [Required] - public DateTime DateCreated { get; set; } + public DateTimeOffset DateCreated { get; set; } /// /// diff --git a/AsbCloudInfrastructure/Repository/FileRepository.cs b/AsbCloudInfrastructure/Repository/FileRepository.cs index dd6cc8ea..c4560116 100644 --- a/AsbCloudInfrastructure/Repository/FileRepository.cs +++ b/AsbCloudInfrastructure/Repository/FileRepository.cs @@ -282,7 +282,7 @@ namespace AsbCloudInfrastructure.Repository dto.FileMarks = entity.FileMarks.Select(m => { var mark = m.Adapt(); - mark.DateCreated = m.DateCreated.ToRemoteDateTime(timezoneOffset); + mark.DateCreated = m.DateCreated.ToOffset(TimeSpan.FromHours(timezoneOffset)); return mark; }); return dto; diff --git a/AsbCloudInfrastructure/Services/DrillingProgram/DrillingProgramService.cs b/AsbCloudInfrastructure/Services/DrillingProgram/DrillingProgramService.cs index 644a62cb..18e6acf2 100644 --- a/AsbCloudInfrastructure/Services/DrillingProgram/DrillingProgramService.cs +++ b/AsbCloudInfrastructure/Services/DrillingProgram/DrillingProgramService.cs @@ -489,7 +489,7 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram part.File.FileMarks = marks.Select(m => { var mark = m.Adapt(); - mark.DateCreated = m.DateCreated.ToRemoteDateTime(timezoneOffset); + mark.DateCreated = m.DateCreated.ToOffset(TimeSpan.FromHours(timezoneOffset)); return mark; }); var hasReject = marks.Any(m => m.IdMarkType == idMarkTypeReject); diff --git a/AsbCloudInfrastructure/Services/DrillingProgram/TitleListSheet.cs b/AsbCloudInfrastructure/Services/DrillingProgram/TitleListSheet.cs index 3d6482a7..7c9355d8 100644 --- a/AsbCloudInfrastructure/Services/DrillingProgram/TitleListSheet.cs +++ b/AsbCloudInfrastructure/Services/DrillingProgram/TitleListSheet.cs @@ -11,7 +11,7 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram { private const string directionDirectorPositionName = "Руководитель направления по ТСБ"; - private readonly DateTime totalDate; + private readonly DateTimeOffset totalDate; private readonly FileMarkDto? acceptDirectionDirector; private readonly List acceptsOthers; private readonly WellDto well; @@ -157,7 +157,7 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram .Alignment.SetHorizontal(XLAlignmentHorizontalValues.Left); } - private static string FormatDate(DateTime dateTime) + private static string FormatDate(DateTimeOffset dateTime) => $"{dateTime.Day:00}.{dateTime.Month:00}.{dateTime.Year:00}"; } From ef9466f90d925a692fd13791079cc6c698297ead Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 21 Mar 2024 11:42:07 +0500 Subject: [PATCH 10/31] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B0=D1=82=D1=8B=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20MeasureDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/MeasureDto.cs | 2 +- AsbCloudInfrastructure/Services/MeasureService.cs | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/AsbCloudApp/Data/MeasureDto.cs b/AsbCloudApp/Data/MeasureDto.cs index 9f823a91..4eddd78f 100644 --- a/AsbCloudApp/Data/MeasureDto.cs +++ b/AsbCloudApp/Data/MeasureDto.cs @@ -36,7 +36,7 @@ namespace AsbCloudApp.Data /// отметка времени замера /// [Required] - public DateTime Timestamp { get; set; } + public DateTimeOffset Timestamp { get; set; } /// /// данные замера diff --git a/AsbCloudInfrastructure/Services/MeasureService.cs b/AsbCloudInfrastructure/Services/MeasureService.cs index 58c5c295..7a349450 100644 --- a/AsbCloudInfrastructure/Services/MeasureService.cs +++ b/AsbCloudInfrastructure/Services/MeasureService.cs @@ -87,8 +87,7 @@ namespace AsbCloudInfrastructure.Services throw new ArgumentInvalidException(nameof(dto), "wrong idCategory"); if (!dto.Data.Any()) throw new ArgumentInvalidException(nameof(dto), "data.data is not optional"); - var timezone = wellService.GetTimezone(idWell); - var entity = Convert(dto, timezone.Hours); + var entity = Convert(dto); entity.IdWell = idWell; db.Measures.Add(entity); return db.SaveChangesAsync(token); @@ -110,7 +109,7 @@ namespace AsbCloudInfrastructure.Services var timezone = wellService.GetTimezone(idWell); entity.IdWell = idWell; - entity.Timestamp = dto.Timestamp.ToUtcDateTimeOffset(timezone.Hours); + entity.Timestamp = dto.Timestamp.ToOffset(TimeSpan.FromHours(timezone.Hours)); entity.Data = dto.Data.Adapt(); return await db.SaveChangesAsync(token).ConfigureAwait(false); @@ -142,13 +141,13 @@ namespace AsbCloudInfrastructure.Services { var dto = entity.Adapt(); dto.CategoryName = entity.Category?.Name ?? String.Empty; - dto.Timestamp = entity.Timestamp.ToRemoteDateTime(hours); + dto.Timestamp = entity.Timestamp.ToOffset(TimeSpan.FromHours(hours)); return dto; } - private Measure Convert(MeasureDto dto, double hours) + private Measure Convert(MeasureDto dto) { var entity = dto.Adapt(); - entity.Timestamp = dto.Timestamp.ToUtcDateTimeOffset(hours); + entity.Timestamp = dto.Timestamp.ToUniversalTime(); return entity; } } From 0bbbb438020c583a079674660a84bc27289efcdc Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 21 Mar 2024 13:58:28 +0500 Subject: [PATCH 11/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=B0=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?MessageRequestBase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Requests/MessageRequest.cs | 4 ++-- AsbCloudInfrastructure/Services/SAUB/MessageService.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AsbCloudApp/Requests/MessageRequest.cs b/AsbCloudApp/Requests/MessageRequest.cs index 1bfba1a2..a474c7b9 100644 --- a/AsbCloudApp/Requests/MessageRequest.cs +++ b/AsbCloudApp/Requests/MessageRequest.cs @@ -17,12 +17,12 @@ namespace AsbCloudApp.Requests /// /// начальная дата /// - public DateTime? Begin { get; set; } + public DateTimeOffset? Begin { get; set; } /// /// конечная дата /// - public DateTime? End { get; set; } + public DateTimeOffset? End { get; set; } /// /// строка поиска diff --git a/AsbCloudInfrastructure/Services/SAUB/MessageService.cs b/AsbCloudInfrastructure/Services/SAUB/MessageService.cs index 350829e1..a4d1f841 100644 --- a/AsbCloudInfrastructure/Services/SAUB/MessageService.cs +++ b/AsbCloudInfrastructure/Services/SAUB/MessageService.cs @@ -72,13 +72,13 @@ namespace AsbCloudInfrastructure.Services.SAUB if (request.Begin is not null) { - var beginUtc = request.Begin.Value.ToUtcDateTimeOffset(timezone.Hours); + var beginUtc = request.Begin.Value.ToUniversalTime(); query = query.Where(m => m.DateTime >= beginUtc); } if (request.End is not null) { - var endUtc = request.End.Value.ToUtcDateTimeOffset(timezone.Hours); + var endUtc = request.End.Value.ToUniversalTime(); query = query.Where(m => m.DateTime <= endUtc); } From 820e383e5b6aa6cf779657e4d8d925160353eee5 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 21 Mar 2024 17:16:16 +0500 Subject: [PATCH 12/31] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=82=D0=B8=D0=BF=D0=B0=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20ReportParametersRequest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Requests/ReportParametersRequest.cs | 6 +++--- AsbCloudApp/Services/IReportService.cs | 2 +- AsbCloudInfrastructure/Services/ReportService.cs | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/AsbCloudApp/Requests/ReportParametersRequest.cs b/AsbCloudApp/Requests/ReportParametersRequest.cs index 57b83e4d..74bc358a 100644 --- a/AsbCloudApp/Requests/ReportParametersRequest.cs +++ b/AsbCloudApp/Requests/ReportParametersRequest.cs @@ -24,12 +24,12 @@ public class ReportParametersRequest: IValidatableObject /// /// Дата начала интервала /// - public DateTime Begin { get; set; } = default; + public DateTimeOffset Begin { get; set; } = default; /// /// Дата окончания интервала /// - public DateTime End { get; set; } = default; + public DateTimeOffset End { get; set; } = default; /// public IEnumerable Validate(ValidationContext validationContext) @@ -37,7 +37,7 @@ public class ReportParametersRequest: IValidatableObject if (End < Begin) yield return new("End mast be less then begin"); - if (Begin < new DateTime(2000, 1, 1)) + if (Begin < new DateTimeOffset(2000, 1, 1, 0, 0, 0, TimeSpan.Zero)) yield return new("Begin mast be > 2000-1-1"); } } \ No newline at end of file diff --git a/AsbCloudApp/Services/IReportService.cs b/AsbCloudApp/Services/IReportService.cs index 5f992a20..4b259240 100644 --- a/AsbCloudApp/Services/IReportService.cs +++ b/AsbCloudApp/Services/IReportService.cs @@ -46,7 +46,7 @@ namespace AsbCloudApp.Services /// /// /// - int GetReportPagesCount(int idWell, DateTime begin, DateTime end, + int GetReportPagesCount(int idWell, DateTimeOffset begin, DateTimeOffset end, int stepSeconds, int format); /// diff --git a/AsbCloudInfrastructure/Services/ReportService.cs b/AsbCloudInfrastructure/Services/ReportService.cs index e1c75d62..04d7c63b 100644 --- a/AsbCloudInfrastructure/Services/ReportService.cs +++ b/AsbCloudInfrastructure/Services/ReportService.cs @@ -64,11 +64,11 @@ public class ReportService : IReportService return work.Id; } - public int GetReportPagesCount(int idWell, DateTime begin, DateTime end, int stepSeconds, int format) + public int GetReportPagesCount(int idWell, DateTimeOffset begin, DateTimeOffset end, int stepSeconds, int format) { var timezoneOffset = wellService.GetTimezone(idWell).Hours; - var beginRemote = begin.ToTimeZoneOffsetHours(timezoneOffset); - var endRemote = end.ToTimeZoneOffsetHours(timezoneOffset); + var beginRemote = begin.DateTime.ToTimeZoneOffsetHours(timezoneOffset); + var endRemote = end.DateTime.ToTimeZoneOffsetHours(timezoneOffset); var generator = GetReportGenerator(idWell, beginRemote, endRemote, stepSeconds, format, db); var pagesCount = generator.GetPagesCount(); @@ -127,10 +127,10 @@ public class ReportService : IReportService CancellationToken token) { var timezoneOffset = wellService.GetTimezone(idWell).Hours; - var beginRemote = request.Begin.ToTimeZoneOffsetHours(timezoneOffset); - var endRemote = request.End.ToTimeZoneOffsetHours(timezoneOffset); - var beginUtc = request.Begin.ToUtcDateTimeOffset(timezoneOffset); - var endUtc = request.End.ToUtcDateTimeOffset(timezoneOffset); + var beginRemote = request.Begin.DateTime; + var endRemote = request.End.DateTime; + var beginUtc = request.Begin.ToUniversalTime(); + var endUtc = request.End.ToUniversalTime(); var tempDir = Path.Combine(Path.GetTempPath(), "report"); From d78209fa0b5d3b66718e9b7626da146a9ad07448 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 22 Mar 2024 11:01:12 +0500 Subject: [PATCH 13/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20LimitingParameterDataDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/LimitingParameterDataDto.cs | 4 ++-- AsbCloudApp/Requests/LimitingParameterRequest.cs | 4 ++-- .../Repository/LimitingParameterRepository.cs | 8 ++++---- .../Services/LimitingParameterService.cs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/AsbCloudApp/Data/LimitingParameterDataDto.cs b/AsbCloudApp/Data/LimitingParameterDataDto.cs index 1bf982dc..c5692729 100644 --- a/AsbCloudApp/Data/LimitingParameterDataDto.cs +++ b/AsbCloudApp/Data/LimitingParameterDataDto.cs @@ -20,12 +20,12 @@ namespace AsbCloudApp.Data /// /// Дата начала ограничения /// - public DateTime DateStart { get; set; } + public DateTimeOffset DateStart { get; set; } /// /// Дата окончания ограничения /// - public DateTime DateEnd { get; set; } + public DateTimeOffset DateEnd { get; set; } /// /// Глубина начала ограничения diff --git a/AsbCloudApp/Requests/LimitingParameterRequest.cs b/AsbCloudApp/Requests/LimitingParameterRequest.cs index 31fb02f0..4e1b5d98 100644 --- a/AsbCloudApp/Requests/LimitingParameterRequest.cs +++ b/AsbCloudApp/Requests/LimitingParameterRequest.cs @@ -17,12 +17,12 @@ namespace AsbCloudApp.Requests /// /// Больше или равно дате /// - public DateTime? GtDate { get; set; } + public DateTimeOffset? GtDate { get; set; } /// /// Меньше или равно дате /// - public DateTime? LtDate { get; set; } + public DateTimeOffset? LtDate { get; set; } /// /// Больше или равно глубины забоя diff --git a/AsbCloudInfrastructure/Repository/LimitingParameterRepository.cs b/AsbCloudInfrastructure/Repository/LimitingParameterRepository.cs index 8f3c42c1..67fc5960 100644 --- a/AsbCloudInfrastructure/Repository/LimitingParameterRepository.cs +++ b/AsbCloudInfrastructure/Repository/LimitingParameterRepository.cs @@ -39,8 +39,8 @@ namespace AsbCloudInfrastructure.Repository IdWell = request.IdWell, IdTelemetry = x.IdTelemetry, IdFeedRegulator = x.IdFeedRegulator, - DateStart = DateTime.SpecifyKind(x.DateStart.UtcDateTime + timezoneSpan, DateTimeKind.Unspecified), - DateEnd = DateTime.SpecifyKind(x.DateEnd.UtcDateTime + timezoneSpan, DateTimeKind.Unspecified), + DateStart = x.DateStart.ToOffset(timezoneSpan), + DateEnd = x.DateEnd.ToOffset(timezoneSpan), DepthStart = x.DepthStart, DepthEnd = x.DepthEnd }); @@ -56,13 +56,13 @@ namespace AsbCloudInfrastructure.Repository if (request.GtDate.HasValue) { - var gtDate = request.GtDate.Value.ToUtcDateTimeOffset(timezoneHours); + var gtDate = request.GtDate.Value.ToUniversalTime(); query = query.Where(x => x.DateEnd >= gtDate); } if (request.LtDate.HasValue) { - var ltDate = request.LtDate.Value.ToUtcDateTimeOffset(timezoneHours); + var ltDate = request.LtDate.Value.ToUniversalTime(); query = query.Where(x => x.DateStart <= ltDate); } diff --git a/AsbCloudInfrastructure/Services/LimitingParameterService.cs b/AsbCloudInfrastructure/Services/LimitingParameterService.cs index c4323597..5dee9f53 100644 --- a/AsbCloudInfrastructure/Services/LimitingParameterService.cs +++ b/AsbCloudInfrastructure/Services/LimitingParameterService.cs @@ -106,7 +106,7 @@ namespace AsbCloudInfrastructure.Services return (float)result; } - private DateTime GetDate(double depth, LimitingParameterDataDto dto) + private DateTimeOffset GetDate(double depth, LimitingParameterDataDto dto) { var a = depth - dto.DepthStart; var b = dto.DepthEnd - dto.DepthStart; From 533ddd29cf02089bd9bb0434727e00c228d10b81 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 22 Mar 2024 11:09:21 +0500 Subject: [PATCH 14/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=B0=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?ProcessMapPlanRequest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Requests/ProcessMapPlanRequest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsbCloudApp/Requests/ProcessMapPlanRequest.cs b/AsbCloudApp/Requests/ProcessMapPlanRequest.cs index b614b8c3..6a7fa14b 100644 --- a/AsbCloudApp/Requests/ProcessMapPlanRequest.cs +++ b/AsbCloudApp/Requests/ProcessMapPlanRequest.cs @@ -20,5 +20,5 @@ public class ProcessMapPlanRequest /// /// Дата обновления /// - public DateTime? UpdateFrom { get; set; } + public DateTimeKind? UpdateFrom { get; set; } } \ No newline at end of file From dde34dad19926609471c231966bf8a222a3f8942 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 22 Mar 2024 11:15:10 +0500 Subject: [PATCH 15/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=B0=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?MessageDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/MessageDto.cs | 2 +- AsbCloudInfrastructure/Services/SAUB/MessageService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AsbCloudApp/Data/MessageDto.cs b/AsbCloudApp/Data/MessageDto.cs index 071967d9..7234db7a 100644 --- a/AsbCloudApp/Data/MessageDto.cs +++ b/AsbCloudApp/Data/MessageDto.cs @@ -16,7 +16,7 @@ namespace AsbCloudApp.Data /// дата появления события /// [Required] - public DateTime DateTime { get; set; } + public DateTimeOffset DateTime { get; set; } /// /// категория события diff --git a/AsbCloudInfrastructure/Services/SAUB/MessageService.cs b/AsbCloudInfrastructure/Services/SAUB/MessageService.cs index a4d1f841..10b71093 100644 --- a/AsbCloudInfrastructure/Services/SAUB/MessageService.cs +++ b/AsbCloudInfrastructure/Services/SAUB/MessageService.cs @@ -111,7 +111,7 @@ namespace AsbCloudInfrastructure.Services.SAUB WellDepth = message.WellDepth }; - messageDto.DateTime = message.DateTime.ToRemoteDateTime(timezone.Hours); + messageDto.DateTime = message.DateTime.ToOffset(TimeSpan.FromHours(timezone.Hours)); if (message.IdTelemetryUser is not null) { From 8ef37600c7be551ee95604b8fc8876996952f2b2 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 22 Mar 2024 17:15:11 +0500 Subject: [PATCH 16/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20ScheduleDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/ScheduleDto.cs | 4 ++-- AsbCloudInfrastructure/Repository/ScheduleRepository.cs | 9 ++++----- .../DetectOperations/DetectedOperationService.cs | 2 +- AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/AsbCloudApp/Data/ScheduleDto.cs b/AsbCloudApp/Data/ScheduleDto.cs index 84cbe515..a8c8d652 100644 --- a/AsbCloudApp/Data/ScheduleDto.cs +++ b/AsbCloudApp/Data/ScheduleDto.cs @@ -39,13 +39,13 @@ namespace AsbCloudApp.Data /// Начало бурения /// [Required] - public DateTime DrillStart { get; set; } + public DateTimeOffset DrillStart { get; set; } /// /// Конец бурения /// [Required] - public DateTime DrillEnd { get; set; } + public DateTimeOffset DrillEnd { get; set; } /// /// Бурильщик diff --git a/AsbCloudInfrastructure/Repository/ScheduleRepository.cs b/AsbCloudInfrastructure/Repository/ScheduleRepository.cs index e7c2aa1f..7c7e6491 100644 --- a/AsbCloudInfrastructure/Repository/ScheduleRepository.cs +++ b/AsbCloudInfrastructure/Repository/ScheduleRepository.cs @@ -82,10 +82,9 @@ namespace AsbCloudInfrastructure.Repository protected override Schedule Convert(ScheduleDto dto) { - var hoursOffset = wellService.GetTimezone(dto.IdWell).Hours; var entity = base.Convert(dto); - entity.DrillStart = dto.DrillStart.ToUtcDateTimeOffset(hoursOffset); - entity.DrillEnd = dto.DrillEnd.ToUtcDateTimeOffset(hoursOffset); + entity.DrillStart = dto.DrillStart.ToUniversalTime(); + entity.DrillEnd = dto.DrillEnd.ToUniversalTime(); return entity; } @@ -93,8 +92,8 @@ namespace AsbCloudInfrastructure.Repository { var hoursOffset = wellService.GetTimezone(entity.IdWell).Hours; var dto = base.Convert(entity); - dto.DrillStart = entity.DrillStart.ToRemoteDateTime(hoursOffset); - dto.DrillEnd = entity.DrillEnd.ToRemoteDateTime(hoursOffset); + dto.DrillStart = entity.DrillStart.ToOffset(TimeSpan.FromHours(hoursOffset)); + dto.DrillEnd = entity.DrillEnd.ToOffset(TimeSpan.FromHours(hoursOffset)); return dto; } } diff --git a/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationService.cs b/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationService.cs index b53b1cd0..b645f567 100644 --- a/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationService.cs +++ b/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationService.cs @@ -264,7 +264,7 @@ public class DetectedOperationService : IDetectedOperationService && v.DepthStart <= dto.DepthStart && v.DepthEnd > dto.DepthStart); - var dateStart = dto.DateStart; + var dateStart = dto.DateStart.ToUniversalTime(); var timeStart = new TimeDto(dateStart); var driller = schedules.FirstOrDefault(s => s.DrillStart <= dateStart && diff --git a/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs b/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs index 58f23ccc..69473ebd 100644 --- a/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs +++ b/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs @@ -178,8 +178,8 @@ public class DailyReportServiceTest IdWell = idWell, ShiftStart = new TimeDto(1), ShiftEnd = new TimeDto(5), - DrillStart = new DateTime(2023, 01, 26), - DrillEnd = new DateTime(2023, 12, 26), + DrillStart = new DateTimeOffset(2023, 01, 26, 0, 0, 0, TimeSpan.Zero), + DrillEnd = new DateTimeOffset(2023, 12, 26, 0, 0, 0, TimeSpan.Zero), Driller = new() { Name = "Иван", From 827e1c669480c5a6c81ab30a0b0a1ceb1253c968 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 22 Mar 2024 17:18:19 +0500 Subject: [PATCH 17/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=B0=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?TrajectoryRequest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Requests/TrajectoryRequest.cs | 4 ++-- AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AsbCloudApp/Requests/TrajectoryRequest.cs b/AsbCloudApp/Requests/TrajectoryRequest.cs index 954879bc..35eca8c3 100644 --- a/AsbCloudApp/Requests/TrajectoryRequest.cs +++ b/AsbCloudApp/Requests/TrajectoryRequest.cs @@ -15,10 +15,10 @@ public class TrajectoryRequest : RequestBase /// /// Больше или равно дате /// - public DateTime? GeDate { get; set; } + public DateTimeOffset? GeDate { get; set; } /// /// Меньше или равно дате /// - public DateTime? LeDate { get; set; } + public DateTimeOffset? LeDate { get; set; } } \ No newline at end of file diff --git a/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs index a55e465f..69c2cccc 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs @@ -38,13 +38,13 @@ namespace AsbCloudInfrastructure.Repository if (request.GeDate.HasValue) { - var geDate = request.GeDate.Value.ToUtcDateTimeOffset(timezone.Hours); + var geDate = request.GeDate.Value.ToUniversalTime(); query = query.Where(r => r.DateTime >= geDate); } if (request.LeDate.HasValue) { - var leDate = request.LeDate.Value.ToUtcDateTimeOffset(timezone.Hours); + var leDate = request.LeDate.Value.ToUniversalTime(); query = query.Where(r => r.DateTime <= leDate); } From 86674ba263637b877b30f7c473eaf7dd280b2cd5 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 22 Mar 2024 17:22:10 +0500 Subject: [PATCH 18/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=B0=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?WellDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/WellDto.cs | 2 +- AsbCloudInfrastructure/Services/WellService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AsbCloudApp/Data/WellDto.cs b/AsbCloudApp/Data/WellDto.cs index d9a67431..368e58c9 100644 --- a/AsbCloudApp/Data/WellDto.cs +++ b/AsbCloudApp/Data/WellDto.cs @@ -67,7 +67,7 @@ namespace AsbCloudApp.Data /// /// Дата/время первой операции /// - public DateTime? StartDate { get; set; } + public DateTimeOffset? StartDate { get; set; } /// /// Дата/время кода приходили данные последний раз diff --git a/AsbCloudInfrastructure/Services/WellService.cs b/AsbCloudInfrastructure/Services/WellService.cs index 2c579140..ac457347 100644 --- a/AsbCloudInfrastructure/Services/WellService.cs +++ b/AsbCloudInfrastructure/Services/WellService.cs @@ -273,7 +273,7 @@ namespace AsbCloudInfrastructure.Services if (entity.Timezone is null) dto.Timezone = GetTimezone(entity.Id); - dto.StartDate = wellOperationRepository.FirstOperationDate(entity.Id)?.ToRemoteDateTime(dto.Timezone.Hours); + dto.StartDate = wellOperationRepository.FirstOperationDate(entity.Id)?.ToOffset(TimeSpan.FromHours(dto.Timezone.Hours)); dto.WellType = entity.WellType.Caption; dto.Cluster = entity.Cluster.Caption; dto.Deposit = entity.Cluster.Deposit.Caption; From 72341e76d25d2923c87f187c922c3536939cfcf5 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 22 Mar 2024 17:59:03 +0500 Subject: [PATCH 19/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=BB=D1=8F=20ProcessMapRepor?= =?UTF-8?q?tDataSaubStatDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Report/ProcessMapReportDataSaubStatDto.cs | 2 +- .../Services/DailyReport/DailyReportService.cs | 14 ++++++++------ .../Report/ProcessMapReportDrillingService.cs | 2 +- .../Services/DailyReportServiceTest.cs | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/AsbCloudApp/Data/ProcessMaps/Report/ProcessMapReportDataSaubStatDto.cs b/AsbCloudApp/Data/ProcessMaps/Report/ProcessMapReportDataSaubStatDto.cs index 6255726f..4bf221de 100644 --- a/AsbCloudApp/Data/ProcessMaps/Report/ProcessMapReportDataSaubStatDto.cs +++ b/AsbCloudApp/Data/ProcessMaps/Report/ProcessMapReportDataSaubStatDto.cs @@ -44,7 +44,7 @@ public class ProcessMapReportDataSaubStatDto /// на начало интервала /// /// - public DateTime DateStart { get; set; } + public DateTimeOffset DateStart { get; set; } /// /// Режим бурения (Ротор/слайд/ручной) diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs index fba35c59..a188426e 100644 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs +++ b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs @@ -106,10 +106,11 @@ public class DailyReportService : IDailyReportService IdWell = well.Id }; - var geDate = dailyReport.Date.ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified); - var ltDate = dailyReport.Date.AddDays(1).ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified); - - var factOperationRequest = new WellOperationRequest + var offsetHours = wellService.GetTimezone(dailyReport.IdWell).Hours; + var geDate = new DateTimeOffset(dailyReport.Date, TimeOnly.MinValue, TimeSpan.FromHours(offsetHours)); + var ltDate = new DateTimeOffset(dailyReport.Date.AddDays(1), TimeOnly.MinValue, TimeSpan.FromHours(offsetHours)); + + var factOperationRequest = new WellOperationRequest { IdWell = idWell, OperationType = WellOperation.IdOperationTypeFact, @@ -369,8 +370,9 @@ public class DailyReportService : IDailyReportService private async Task AddProcessMapWellDrillingBlockAsync(DailyReportDto dailyReport, CancellationToken cancellationToken) { - var geDate = dailyReport.Date.ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified); - var leDate = dailyReport.Date.AddDays(1).ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified); + var offsetHours = wellService.GetTimezone(dailyReport.IdWell).Hours; + var geDate = new DateTimeOffset(dailyReport.Date, TimeOnly.MinValue, TimeSpan.FromHours(offsetHours)); + var leDate = new DateTimeOffset(dailyReport.Date.AddDays(1), TimeOnly.MinValue, TimeSpan.FromHours(offsetHours)); var request = new DataSaubStatRequest(); dailyReport.ProcessMapWellDrillingBlock = (await processMapReportDrillingService.GetAsync(dailyReport.IdWell, request, diff --git a/AsbCloudInfrastructure/Services/ProcessMaps/Report/ProcessMapReportDrillingService.cs b/AsbCloudInfrastructure/Services/ProcessMaps/Report/ProcessMapReportDrillingService.cs index 5ee331d4..74957d59 100644 --- a/AsbCloudInfrastructure/Services/ProcessMaps/Report/ProcessMapReportDrillingService.cs +++ b/AsbCloudInfrastructure/Services/ProcessMaps/Report/ProcessMapReportDrillingService.cs @@ -174,7 +174,7 @@ public class ProcessMapReportDrillingService : IProcessMapReportDrillingService var result = new ProcessMapReportDataSaubStatDto() { IdWellSectionType = wellSectionType.Id, - DateStart = firstElemInInterval.DateStart.DateTime, + DateStart = firstElemInInterval.DateStart, WellSectionTypeName = wellSectionType.Caption, DepthStart = firstElemInInterval.DepthStart, DepthEnd = lastElemInInterval.DepthEnd, diff --git a/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs b/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs index 69473ebd..ac109d7f 100644 --- a/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs +++ b/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs @@ -113,7 +113,7 @@ public class DailyReportServiceTest private readonly ProcessMapReportDataSaubStatDto fakeProcessMapReportWellDrilling = new() { DrillingMode = "Ротор", - DateStart = new DateTime(2023, 10, 26), + DateStart = new DateTimeOffset(2023, 10, 26, 0, 0, 0, TimeSpan.Zero), DeltaDepth = 500, Rop = new PlanFactDto { From 9e4761f97beaf7ad31b47e8b82b59cfd1b8dc5d2 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 22 Mar 2024 18:00:04 +0500 Subject: [PATCH 20/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20ProcessMapReportWellDrillingDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data/ProcessMaps/Report/ProcessMapReportWellDrillingDto.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsbCloudApp/Data/ProcessMaps/Report/ProcessMapReportWellDrillingDto.cs b/AsbCloudApp/Data/ProcessMaps/Report/ProcessMapReportWellDrillingDto.cs index 16a9749c..cee53050 100644 --- a/AsbCloudApp/Data/ProcessMaps/Report/ProcessMapReportWellDrillingDto.cs +++ b/AsbCloudApp/Data/ProcessMaps/Report/ProcessMapReportWellDrillingDto.cs @@ -44,7 +44,7 @@ public class ProcessMapReportWellDrillingDto /// на начало интервала /// /// - public DateTime DateStart { get; set; } + public DateTimeOffset DateStart { get; set; } /// /// Время мех бурения, ч From 488b8ec674817645eb061c03125653f3fd359f1d Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 25 Mar 2024 09:29:44 +0500 Subject: [PATCH 21/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20SetpointsRequestDto=20=D0=B8=20=D0=B2=D1=81=D1=91,=20?= =?UTF-8?q?=D1=87=D1=82=D0=BE=20=D1=81=20=D0=BD=D0=B8=D0=BC=20=D1=81=D0=B2?= =?UTF-8?q?=D1=8F=D0=B7=D0=B0=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/SAUB/SetpointsRequestDto.cs | 2 +- .../Repository/ScheduleRepository.cs | 11 +++++------ .../Repository/SetpointsRequestRepository.cs | 5 ++--- .../Services/SAUB/SetpointsService.cs | 1 - 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/AsbCloudApp/Data/SAUB/SetpointsRequestDto.cs b/AsbCloudApp/Data/SAUB/SetpointsRequestDto.cs index ed81c0ef..192805a6 100644 --- a/AsbCloudApp/Data/SAUB/SetpointsRequestDto.cs +++ b/AsbCloudApp/Data/SAUB/SetpointsRequestDto.cs @@ -33,7 +33,7 @@ namespace AsbCloudApp.Data.SAUB /// /// отметка времени создания запроса /// - public DateTime UploadDate { get; set; } = DateTime.Now; + public DateTimeOffset UploadDate { get; set; } = DateTimeOffset.Now; /// /// время в секундах актуальности этого запроса diff --git a/AsbCloudInfrastructure/Repository/ScheduleRepository.cs b/AsbCloudInfrastructure/Repository/ScheduleRepository.cs index 7c7e6491..781b51ee 100644 --- a/AsbCloudInfrastructure/Repository/ScheduleRepository.cs +++ b/AsbCloudInfrastructure/Repository/ScheduleRepository.cs @@ -24,7 +24,7 @@ namespace AsbCloudInfrastructure.Repository this.wellService = wellService; } - public async Task> GetAsync(int idWell, DateTime workTime, CancellationToken token) + public async Task> GetAsync(int idWell, DateTimeOffset workTime, CancellationToken token) { var entities = await BuildQuery(idWell, workTime) .AsNoTracking() @@ -33,7 +33,7 @@ namespace AsbCloudInfrastructure.Repository return entities.Select(Convert); } - public async Task GetOrDefaultDrillerAsync(int idWell, DateTime workTime, CancellationToken token) + public async Task GetOrDefaultDrillerAsync(int idWell, DateTimeOffset workTime, CancellationToken token) { var entities = await BuildQuery(idWell, workTime) .AsNoTracking() @@ -43,8 +43,7 @@ namespace AsbCloudInfrastructure.Repository return null; var hoursOffset = wellService.GetTimezone(idWell).Hours; - var remoteDate = workTime.ToUtcDateTimeOffset(hoursOffset).ToRemoteDateTime(hoursOffset); - var time = new TimeOnly(remoteDate.Hour, remoteDate.Minute, remoteDate.Second); + var time = new TimeOnly(workTime.Hour, workTime.Minute, workTime.Second); var entity = entities.FirstOrDefault(s => s.ShiftStart > s.ShiftEnd ^ @@ -69,11 +68,11 @@ namespace AsbCloudInfrastructure.Repository } - private IQueryable BuildQuery(int idWell, DateTime workTime) + private IQueryable BuildQuery(int idWell, DateTimeOffset workTime) { var hoursOffset = wellService.GetTimezone(idWell).Hours; - var workTimeDateTime = workTime.ToUtcDateTimeOffset(hoursOffset); + var workTimeDateTime = workTime.ToUniversalTime(); return GetQuery().Where(s => s.IdWell == idWell && s.DrillStart <= workTimeDateTime diff --git a/AsbCloudInfrastructure/Repository/SetpointsRequestRepository.cs b/AsbCloudInfrastructure/Repository/SetpointsRequestRepository.cs index 838ae15b..2c1f7905 100644 --- a/AsbCloudInfrastructure/Repository/SetpointsRequestRepository.cs +++ b/AsbCloudInfrastructure/Repository/SetpointsRequestRepository.cs @@ -50,15 +50,14 @@ namespace AsbCloudInfrastructure.Repository { var result = base.Convert(src); var timezoneOffsetHours = wellService.GetTimezone(src.IdWell).Hours; - result.UploadDate = src.UploadDate.ToRemoteDateTime(timezoneOffsetHours); + result.UploadDate = src.UploadDate.ToOffset(TimeSpan.FromHours(timezoneOffsetHours)); return result; } protected override SetpointsRequest Convert(SetpointsRequestDto src) { var result = base.Convert(src); - var timezoneOffsetHours = wellService.GetTimezone(src.IdWell).Hours; - result.UploadDate = src.UploadDate.ToUtcDateTimeOffset(timezoneOffsetHours); + result.UploadDate = src.UploadDate.ToUniversalTime(); return result; } } diff --git a/AsbCloudInfrastructure/Services/SAUB/SetpointsService.cs b/AsbCloudInfrastructure/Services/SAUB/SetpointsService.cs index b0f5c824..657a99c6 100644 --- a/AsbCloudInfrastructure/Services/SAUB/SetpointsService.cs +++ b/AsbCloudInfrastructure/Services/SAUB/SetpointsService.cs @@ -72,7 +72,6 @@ namespace AsbCloudInfrastructure.Services.SAUB foreach (var item in filtered) { item.IdState = 2; - item.UploadDate = DateTime.SpecifyKind(item.UploadDate, DateTimeKind.Utc); } await setpointsRepository.UpdateRangeAsync(filtered, token); From b9b8027a53d406ec1a48b4605c6c7c6255824bbf Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 25 Mar 2024 09:34:54 +0500 Subject: [PATCH 22/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20TrajectoryGeoDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/Trajectory/TrajectoryGeoDto.cs | 2 +- .../Repository/TrajectoryEditableRepository.cs | 2 +- .../Services/Trajectory/TrajectoryExportTest.cs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AsbCloudApp/Data/Trajectory/TrajectoryGeoDto.cs b/AsbCloudApp/Data/Trajectory/TrajectoryGeoDto.cs index 237c20b2..11b88141 100644 --- a/AsbCloudApp/Data/Trajectory/TrajectoryGeoDto.cs +++ b/AsbCloudApp/Data/Trajectory/TrajectoryGeoDto.cs @@ -46,7 +46,7 @@ namespace AsbCloudApp.Data.Trajectory /// /// Дата загрузки /// - public DateTime UpdateDate { get; set; } + public DateTimeOffset UpdateDate { get; set; } /// /// ИД пользователя diff --git a/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs index 4c8ab283..667691b1 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs @@ -108,7 +108,7 @@ namespace AsbCloudInfrastructure.Repository private static Tdto Convert(TEntity entity, double offsetHours) { var dto = entity.Adapt(); - dto.UpdateDate = entity.UpdateDate.ToRemoteDateTime(offsetHours); + dto.UpdateDate = entity.UpdateDate.ToOffset(TimeSpan.FromHours(offsetHours)); return dto; } diff --git a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs b/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs index 34d2077c..bffab69f 100644 --- a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs +++ b/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs @@ -34,7 +34,7 @@ namespace AsbCloudWebApi.Tests.Services.Trajectory IdUser = 1, IdWell = 4, Radius = 3, - UpdateDate = DateTime.Now, + UpdateDate = DateTimeOffset.Now, VerticalDepth = 100, WellboreDepth = 100, ZenithAngle = 10 @@ -47,7 +47,7 @@ namespace AsbCloudWebApi.Tests.Services.Trajectory IdUser = 1, IdWell = 4, Radius = 3, - UpdateDate = DateTime.Now, + UpdateDate = DateTimeOffset.Now, VerticalDepth = 100, WellboreDepth = 100, ZenithAngle = 10 @@ -62,7 +62,7 @@ namespace AsbCloudWebApi.Tests.Services.Trajectory Comment = "комментарий", IdUser = 1, IdWell = 4, - UpdateDate = DateTime.Now, + UpdateDate = DateTimeOffset.Now, VerticalDepth = 100, WellboreDepth = 100, ZenithAngle = 10 @@ -74,7 +74,7 @@ namespace AsbCloudWebApi.Tests.Services.Trajectory Comment = "комментарий", IdUser = 1, IdWell = 4, - UpdateDate = DateTime.Now, + UpdateDate = DateTimeOffset.Now, VerticalDepth = 100, WellboreDepth = 100, ZenithAngle = 10 From 55938eadcdb30f6da571b001e45191d63896eb0c Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 25 Mar 2024 09:35:27 +0500 Subject: [PATCH 23/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20ReportPropertiesDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/ReportPropertiesDto.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AsbCloudApp/Data/ReportPropertiesDto.cs b/AsbCloudApp/Data/ReportPropertiesDto.cs index 82caa77e..f802a7e0 100644 --- a/AsbCloudApp/Data/ReportPropertiesDto.cs +++ b/AsbCloudApp/Data/ReportPropertiesDto.cs @@ -29,17 +29,17 @@ namespace AsbCloudApp.Data /// /// Дата формирования /// - public DateTime Date { get; set; } + public DateTimeOffset Date { get; set; } /// /// Дата начала рапорта /// - public DateTime Begin { get; set; } + public DateTimeOffset Begin { get; set; } /// /// Дата окончания рапорта /// - public DateTime End { get; set; } + public DateTimeOffset End { get; set; } /// /// шаг между точками диаграммы From db33e82d022b8d5cad9b14253622011c740da110 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 25 Mar 2024 09:36:57 +0500 Subject: [PATCH 24/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D0=B2=D0=BD?= =?UTF-8?q?=D1=83=D1=82=D1=80=D0=B8=20DailyReportService,=20ReportService?= =?UTF-8?q?=20=D0=B8=20SheduleController?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Services/IScheduleService.cs | 4 ++-- .../Services/DailyReport/DailyReportService.cs | 8 +++----- AsbCloudInfrastructure/Services/ReportService.cs | 9 +++++---- AsbCloudWebApi/Controllers/ScheduleController.cs | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/AsbCloudApp/Services/IScheduleService.cs b/AsbCloudApp/Services/IScheduleService.cs index 5a28b4c2..81c0d385 100644 --- a/AsbCloudApp/Services/IScheduleService.cs +++ b/AsbCloudApp/Services/IScheduleService.cs @@ -19,7 +19,7 @@ namespace AsbCloudApp.Services /// /// /// - Task> GetAsync(int idWell, DateTime workTime, CancellationToken token); + Task> GetAsync(int idWell, DateTimeOffset workTime, CancellationToken token); /// /// получить бурильщика по idWell и времени @@ -28,7 +28,7 @@ namespace AsbCloudApp.Services /// /// /// - Task GetOrDefaultDrillerAsync(int idWell, DateTime workTime, CancellationToken token); + Task GetOrDefaultDrillerAsync(int idWell, DateTimeOffset workTime, CancellationToken token); /// /// Получить расписание смен diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs index a188426e..7570a95f 100644 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs +++ b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs @@ -135,7 +135,7 @@ public class DailyReportService : IDailyReportService await UpdateSubsystemBlockAsync(dailyReport, cancellationToken); await AddTrajectoryBlockAsync(dailyReport, cancellationToken); - await AddScheduleBlockAsync(dailyReport, cancellationToken); + await AddScheduleBlockAsync(dailyReport, geDate, cancellationToken); await AddProcessMapWellDrillingBlockAsync(dailyReport, cancellationToken); AddFactWellOperationBlock(dailyReport, factWellOperations); @@ -315,11 +315,9 @@ public class DailyReportService : IDailyReportService }; } - private async Task AddScheduleBlockAsync(DailyReportDto dailyReport, CancellationToken cancellationToken) + private async Task AddScheduleBlockAsync(DailyReportDto dailyReport, DateTimeOffset workDate, CancellationToken cancellationToken) { - var workDate = dailyReport.Date.ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified); - - dailyReport.ScheduleBlock = (await scheduleRepository.GetAsync(dailyReport.IdWell, workDate, cancellationToken)) + dailyReport.ScheduleBlock = (await scheduleRepository.GetAsync(dailyReport.IdWell, workDate, cancellationToken)) .Select(s => new ScheduleRecordDto { ShiftStart = s.ShiftStart, diff --git a/AsbCloudInfrastructure/Services/ReportService.cs b/AsbCloudInfrastructure/Services/ReportService.cs index 04d7c63b..4d321525 100644 --- a/AsbCloudInfrastructure/Services/ReportService.cs +++ b/AsbCloudInfrastructure/Services/ReportService.cs @@ -87,6 +87,7 @@ public class ReportService : IReportService public async Task> GetAllReportsByWellAsync(int idWell, CancellationToken token) { var timezoneOffset = wellService.GetTimezone(idWell).Hours; + var timeSpan = TimeSpan.FromHours(timezoneOffset); var propertiesQuery = db.ReportProperties.Include(r => r.File) .Where(p => p.IdWell == idWell) .OrderBy(o => o.File.UploadDate) @@ -106,12 +107,12 @@ public class ReportService : IReportService IdWell = p.File.IdWell, Name = p.File.Name, Size = p.File.Size, - UploadDate = p.File.UploadDate.ToOffset(TimeSpan.FromHours(timezoneOffset)), + UploadDate = p.File.UploadDate.ToOffset(timeSpan), }, IdWell = p.IdWell, - Date = p.File.UploadDate.ToRemoteDateTime(timezoneOffset), - Begin = p.Begin.ToRemoteDateTime(timezoneOffset), - End = p.End.ToRemoteDateTime(timezoneOffset), + Date = p.File.UploadDate.ToOffset(timeSpan), + Begin = p.Begin.ToOffset(timeSpan), + End = p.End.ToOffset(timeSpan), Step = p.Step, Format = p.Format == 0 ? ".pdf" : ".las" }); diff --git a/AsbCloudWebApi/Controllers/ScheduleController.cs b/AsbCloudWebApi/Controllers/ScheduleController.cs index a8c73d30..cc56a296 100644 --- a/AsbCloudWebApi/Controllers/ScheduleController.cs +++ b/AsbCloudWebApi/Controllers/ScheduleController.cs @@ -33,7 +33,7 @@ namespace AsbCloudWebApi.Controllers /// /// бурильщик [HttpGet("driller")] - public async Task> GetDrillerAsync(int idWell, DateTime workTime, CancellationToken token) + public async Task> GetDrillerAsync(int idWell, DateTimeOffset workTime, CancellationToken token) { if (!await UserHasAccesToWellAsync(idWell, token)) return Forbid(); From 15b74da498b0431e155d299cee84bb85aece4469 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 25 Mar 2024 09:45:48 +0500 Subject: [PATCH 25/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D0=B5=D0=B9=20StatOpera?= =?UTF-8?q?tionsDto=20=D0=B8=20WellMapInfoDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/StatOperationsDto.cs | 4 ++-- AsbCloudApp/Data/WellMapInfoDto.cs | 4 ++-- .../Services/WellOperationService/OperationsStatService.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AsbCloudApp/Data/StatOperationsDto.cs b/AsbCloudApp/Data/StatOperationsDto.cs index 7d082648..ec59eae0 100644 --- a/AsbCloudApp/Data/StatOperationsDto.cs +++ b/AsbCloudApp/Data/StatOperationsDto.cs @@ -11,12 +11,12 @@ namespace AsbCloudApp.Data /// /// Дата и время начала /// - public DateTime? Start { get; set; } + public DateTimeOffset? Start { get; set; } /// /// Дата и время окончания /// - public DateTime? End { get; set; } + public DateTimeOffset? End { get; set; } /// /// Глубина, м diff --git a/AsbCloudApp/Data/WellMapInfoDto.cs b/AsbCloudApp/Data/WellMapInfoDto.cs index a677a1e3..55098f4b 100644 --- a/AsbCloudApp/Data/WellMapInfoDto.cs +++ b/AsbCloudApp/Data/WellMapInfoDto.cs @@ -82,14 +82,14 @@ namespace AsbCloudApp.Data /// Дата начала первой фактической операции /// Используется как дата начала бурения /// - public DateTime? FirstFactOperationDateStart { get; set; } + public DateTimeOffset? FirstFactOperationDateStart { get; set; } /// /// Дата окончания последней прогнозируемой операции /// Если скважина завершена, то дата окончания последней фактической операции /// Используется как прогноз окончания бурения /// - public DateTime? LastPredictOperationDateEnd { get; set; } + public DateTimeOffset? LastPredictOperationDateEnd { get; set; } /// /// Рейсовая скорость проходки, последнего рейса diff --git a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs index 4bf326e7..c4463a78 100644 --- a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs +++ b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs @@ -288,8 +288,8 @@ public class OperationsStatService : IOperationsStatService var section = new StatOperationsDto { - Start = operations.FirstOrDefault()?.DateStart.ToRemoteDateTime(timezoneOffsetHours), - End = operations.Max(o => o.DateStart.ToRemoteDateTime(timezoneOffsetHours).AddHours(o.DurationHours)), + Start = operations.FirstOrDefault()?.DateStart.ToOffset(TimeSpan.FromHours(timezoneOffsetHours)), + End = operations.Max(o => o.DateStart.ToOffset(TimeSpan.FromHours(timezoneOffsetHours)).AddHours(o.DurationHours)), WellDepthStart = operations.Min(o => o.DepthStart), WellDepthEnd = operations.Max(o => o.DepthStart), Rop = CalcROP(operations), From 3def1ad101ac06bd7073a61b4cb0e0bcefa9d291 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 25 Mar 2024 09:52:34 +0500 Subject: [PATCH 26/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20TelemetryMessageDto=20=D0=B8=20TelemetryWirelineRunOut?= =?UTF-8?q?BaseDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/SAUB/TelemetryMessageDto.cs | 2 +- AsbCloudApp/Data/SAUB/TelemetryWirelineRunOutDto.cs | 2 +- .../Repository/TelemetryWirelineRunOutRepository.cs | 5 +++-- AsbCloudInfrastructure/Services/SAUB/MessageService.cs | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/AsbCloudApp/Data/SAUB/TelemetryMessageDto.cs b/AsbCloudApp/Data/SAUB/TelemetryMessageDto.cs index 6c246f16..ee86fc46 100644 --- a/AsbCloudApp/Data/SAUB/TelemetryMessageDto.cs +++ b/AsbCloudApp/Data/SAUB/TelemetryMessageDto.cs @@ -15,7 +15,7 @@ namespace AsbCloudApp.Data.SAUB /// /// отметка времени /// - public DateTime Date { get; set; } + public DateTimeOffset Date { get; set; } /// /// глубина забоя diff --git a/AsbCloudApp/Data/SAUB/TelemetryWirelineRunOutDto.cs b/AsbCloudApp/Data/SAUB/TelemetryWirelineRunOutDto.cs index 69ac6929..213b67ec 100644 --- a/AsbCloudApp/Data/SAUB/TelemetryWirelineRunOutDto.cs +++ b/AsbCloudApp/Data/SAUB/TelemetryWirelineRunOutDto.cs @@ -10,7 +10,7 @@ namespace AsbCloudApp.Data.SAUB /// /// отметка времени /// - public DateTime DateTime { get; set; } + public DateTimeOffset DateTime { get; set; } /// /// Наработка талевого каната с момента перетяжки каната, т*км diff --git a/AsbCloudInfrastructure/Repository/TelemetryWirelineRunOutRepository.cs b/AsbCloudInfrastructure/Repository/TelemetryWirelineRunOutRepository.cs index 81427cf6..ed1f02cf 100644 --- a/AsbCloudInfrastructure/Repository/TelemetryWirelineRunOutRepository.cs +++ b/AsbCloudInfrastructure/Repository/TelemetryWirelineRunOutRepository.cs @@ -5,6 +5,7 @@ using AsbCloudApp.Services; using AsbCloudDb.Model; using Mapster; using Microsoft.EntityFrameworkCore; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; @@ -93,14 +94,14 @@ namespace AsbCloudInfrastructure.Repository { var entity = dto.Adapt(); entity.IdTelemetry = idTelemetry; - entity.DateTime = dto.DateTime.ToUtcDateTimeOffset(timezoneOffset); + entity.DateTime = dto.DateTime.ToOffset(TimeSpan.FromHours(timezoneOffset)); return entity; } private static TelemetryWirelineRunOutDto Convert(TelemetryWirelineRunOut entity, WellDto well, double timezoneOffset) { var dto = entity.Adapt(); - dto.DateTime = entity.DateTime.ToRemoteDateTime(timezoneOffset); + dto.DateTime = entity.DateTime.ToOffset(TimeSpan.FromHours(timezoneOffset)); dto.WellInfo = well; return dto; } diff --git a/AsbCloudInfrastructure/Services/SAUB/MessageService.cs b/AsbCloudInfrastructure/Services/SAUB/MessageService.cs index 10b71093..d728536a 100644 --- a/AsbCloudInfrastructure/Services/SAUB/MessageService.cs +++ b/AsbCloudInfrastructure/Services/SAUB/MessageService.cs @@ -150,7 +150,7 @@ namespace AsbCloudInfrastructure.Services.SAUB var entity = dto.Adapt(); entity.Id = 0; entity.IdTelemetry = telemetry.Id; - entity.DateTime = dto.Date.ToUtcDateTimeOffset(timezone.Hours); + entity.DateTime = dto.Date.ToOffset(TimeSpan.FromHours(timezone.Hours)); db.TelemetryMessages.Add(entity); } From b5f71b9816b80e1630cb9a5766c45017a6de081c Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 25 Mar 2024 10:04:06 +0500 Subject: [PATCH 27/31] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20WellOperationPlanDto=20=D0=B8=20=D0=B2=D1=81=D1=91,=20?= =?UTF-8?q?=D1=87=D1=82=D0=BE=20=D1=81=20=D0=BD=D0=B8=D0=BC=20=D1=81=D0=B2?= =?UTF-8?q?=D1=8F=D0=B7=D0=B0=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/WellOperationPlanDto.cs | 2 +- AsbCloudApp/Repositories/IWellOperationRepository.cs | 2 +- .../Repository/WellOperationRepository.cs | 10 +++++----- AsbCloudWebApi/Controllers/WellOperationController.cs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/AsbCloudApp/Data/WellOperationPlanDto.cs b/AsbCloudApp/Data/WellOperationPlanDto.cs index 5c1bac9f..365e06f3 100644 --- a/AsbCloudApp/Data/WellOperationPlanDto.cs +++ b/AsbCloudApp/Data/WellOperationPlanDto.cs @@ -21,7 +21,7 @@ namespace AsbCloudApp.Data /// /// дата последней сопоставленной плановой операции /// - public DateTime? DateLastAssosiatedPlanOperation { get; set; } + public DateTimeOffset? DateLastAssosiatedPlanOperation { get; set; } } diff --git a/AsbCloudApp/Repositories/IWellOperationRepository.cs b/AsbCloudApp/Repositories/IWellOperationRepository.cs index dd39ce52..25550557 100644 --- a/AsbCloudApp/Repositories/IWellOperationRepository.cs +++ b/AsbCloudApp/Repositories/IWellOperationRepository.cs @@ -25,7 +25,7 @@ namespace AsbCloudApp.Repositories /// /// /// - Task GetOperationsPlanAsync(int idWell, DateTime? currentDate, CancellationToken token); + Task GetOperationsPlanAsync(int idWell, DateTimeOffset? currentDate, CancellationToken token); /// /// дата/время первой операции по скважине diff --git a/AsbCloudInfrastructure/Repository/WellOperationRepository.cs b/AsbCloudInfrastructure/Repository/WellOperationRepository.cs index 1c3f6fdc..4e494c77 100644 --- a/AsbCloudInfrastructure/Repository/WellOperationRepository.cs +++ b/AsbCloudInfrastructure/Repository/WellOperationRepository.cs @@ -43,7 +43,7 @@ public class WellOperationRepository : IWellOperationRepository .OrderBy(s => s.Order) .Select(s => s.Adapt()); - public async Task GetOperationsPlanAsync(int idWell, DateTime? currentDate, CancellationToken token) + public async Task GetOperationsPlanAsync(int idWell, DateTimeOffset? currentDate, CancellationToken token) { var timezone = wellService.GetTimezone(idWell); var request = new WellOperationRequest() @@ -67,16 +67,16 @@ public class WellOperationRepository : IWellOperationRepository return result; } - private async Task GetDateLastAssosiatedPlanOperationAsync( + private async Task GetDateLastAssosiatedPlanOperationAsync( int idWell, - DateTime? lessThenDate, + DateTimeOffset? lessThenDate, double timeZoneHours, CancellationToken token) { if (lessThenDate is null) return null; - var currentDateOffset = lessThenDate.Value.ToUtcDateTimeOffset(timeZoneHours); + var currentDateOffset = lessThenDate.Value.ToUniversalTime(); var timeZoneOffset = TimeSpan.FromHours(timeZoneHours); var lastFactOperation = await db.WellOperations @@ -90,7 +90,7 @@ public class WellOperationRepository : IWellOperationRepository .ConfigureAwait(false); if (lastFactOperation is not null) - return DateTime.SpecifyKind(lastFactOperation.OperationPlan!.DateStart.UtcDateTime + timeZoneOffset, DateTimeKind.Unspecified); + return lastFactOperation.OperationPlan!.DateStart; return null; } diff --git a/AsbCloudWebApi/Controllers/WellOperationController.cs b/AsbCloudWebApi/Controllers/WellOperationController.cs index d624e89a..2f2f805b 100644 --- a/AsbCloudWebApi/Controllers/WellOperationController.cs +++ b/AsbCloudWebApi/Controllers/WellOperationController.cs @@ -99,7 +99,7 @@ namespace AsbCloudWebApi.Controllers [ProducesResponseType(typeof(WellOperationPlanDto), (int)System.Net.HttpStatusCode.OK)] public async Task GetOperationsPlanAsync( [FromRoute] int idWell, - [FromQuery] DateTime currentDate, + [FromQuery] DateTimeOffset currentDate, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) From 09be968972c1b4998232153b786d6e852f4297f9 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 25 Mar 2024 10:10:40 +0500 Subject: [PATCH 28/31] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=82=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B4=D0=B0=D1=82=20=D0=B2=20?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=B0=D1=85=20=D0=B2=D0=BD=D1=83?= =?UTF-8?q?=D1=82=D1=80=D0=B8=20FileRepository=20=D0=B8=20TrajectoryEditab?= =?UTF-8?q?leRepository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Requests/SubsystemRequest.cs | 2 +- AsbCloudInfrastructure/Repository/FileRepository.cs | 4 ++-- .../Repository/TrajectoryEditableRepository.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AsbCloudApp/Requests/SubsystemRequest.cs b/AsbCloudApp/Requests/SubsystemRequest.cs index 23a7e70a..08b980ab 100644 --- a/AsbCloudApp/Requests/SubsystemRequest.cs +++ b/AsbCloudApp/Requests/SubsystemRequest.cs @@ -9,7 +9,7 @@ namespace AsbCloudApp.Requests /// public class SubsystemRequest: RequestBase, IValidatableObject { - private static readonly DateTime validationMinDate = new DateTime(2020,01,01,0,0,0,DateTimeKind.Utc); + private static readonly DateTimeOffset validationMinDate = new DateTimeOffset(2020,01,01,0,0,0, TimeSpan.Zero); /// /// идентификатор скважины diff --git a/AsbCloudInfrastructure/Repository/FileRepository.cs b/AsbCloudInfrastructure/Repository/FileRepository.cs index c4560116..2a203879 100644 --- a/AsbCloudInfrastructure/Repository/FileRepository.cs +++ b/AsbCloudInfrastructure/Repository/FileRepository.cs @@ -184,7 +184,7 @@ namespace AsbCloudInfrastructure.Repository var newFileMark = fileMarkDto.Adapt(); newFileMark.Id = default; - newFileMark.DateCreated = DateTime.UtcNow; + newFileMark.DateCreated = DateTimeOffset.UtcNow; newFileMark.IdUser = idUser; newFileMark.User = null!; @@ -244,7 +244,7 @@ namespace AsbCloudInfrastructure.Repository IdAuthor = newItem.IdAuthor, IdCategory = newItem.IdCategory, Name = newItem.Name, - UploadDate = DateTime.UtcNow, + UploadDate = DateTimeOffset.UtcNow, IsDeleted = false, Size = newItem.Size, }; diff --git a/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs index 667691b1..94c50ebf 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs @@ -115,7 +115,7 @@ namespace AsbCloudInfrastructure.Repository private static TEntity Convert(Tdto dto, double offsetHours) { var entity = dto.Adapt(); - entity.UpdateDate = DateTime.Now.ToUtcDateTimeOffset(offsetHours); + entity.UpdateDate = DateTimeOffset.Now.ToOffset(TimeSpan.FromHours(offsetHours)); return entity; } } From 3b7e3092f5f4b83ff6ea780f1a0eacaad21ccf3a Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 25 Mar 2024 16:08:59 +0500 Subject: [PATCH 29/31] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D1=80=D0=B5=D0=B7=D1=83=D0=BB=D1=8C=D1=82=D0=B0?= =?UTF-8?q?=D1=82=D0=B0=D0=BC=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Requests/ProcessMapPlanRequest.cs | 2 +- .../AsbCloudDbContextModelSnapshot.cs | 16004 ++++++++-------- .../Repository/FileRepository.cs | 3 - .../Repository/ScheduleRepository.cs | 6 +- .../TelemetryWirelineRunOutRepository.cs | 2 +- .../TrajectoryEditableRepository.cs | 13 +- .../Repository/WellOperationRepository.cs | 10 +- .../DailyReport/DailyReportService.cs | 48 +- .../Services/SAUB/TelemetryDataBaseService.cs | 2 +- .../Services/SAUB/TelemetryDataCache.cs | 4 +- .../OperationsStatService.cs | 2 +- 11 files changed, 8044 insertions(+), 8052 deletions(-) diff --git a/AsbCloudApp/Requests/ProcessMapPlanRequest.cs b/AsbCloudApp/Requests/ProcessMapPlanRequest.cs index 6a7fa14b..b3247ce2 100644 --- a/AsbCloudApp/Requests/ProcessMapPlanRequest.cs +++ b/AsbCloudApp/Requests/ProcessMapPlanRequest.cs @@ -20,5 +20,5 @@ public class ProcessMapPlanRequest /// /// Дата обновления /// - public DateTimeKind? UpdateFrom { get; set; } + public DateTimeOffset? UpdateFrom { get; set; } } \ No newline at end of file diff --git a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs index 9c6590fb..d3d74c7c 100644 --- a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs +++ b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs @@ -26,9300 +26,9300 @@ namespace AsbCloudDb.Migrations NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption") - .HasComment("Название"); + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); - b.Property("IdDeposit") - .HasColumnType("integer") - .HasColumnName("id_deposit"); + b.Property("IdDeposit") + .HasColumnType("integer") + .HasColumnName("id_deposit"); - b.Property("Latitude") - .HasColumnType("double precision") - .HasColumnName("latitude"); + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); - b.Property("Longitude") - .HasColumnType("double precision") - .HasColumnName("longitude"); + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); - b.Property("Timezone") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("timezone") - .HasComment("Смещение часового пояса от UTC"); + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdDeposit"); + b.HasIndex("IdDeposit"); - b.ToTable("t_cluster"); + b.ToTable("t_cluster"); - b.HasComment("Кусты"); - }); + b.HasComment("Кусты"); + }); modelBuilder.Entity("AsbCloudDb.Model.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption"); + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); - b.Property("IdCompanyType") - .HasMaxLength(255) - .HasColumnType("integer") - .HasColumnName("id_company_type") - .HasComment("вид деятельности"); + b.Property("IdCompanyType") + .HasMaxLength(255) + .HasColumnType("integer") + .HasColumnName("id_company_type") + .HasComment("вид деятельности"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdCompanyType"); + b.HasIndex("IdCompanyType"); - b.ToTable("t_company"); + b.ToTable("t_company"); - b.HasData( - new - { - Id = 1, - Caption = "ООО \"АСБ\"", - IdCompanyType = 3 - }); - }); + b.HasData( + new + { + Id = 1, + Caption = "ООО \"АСБ\"", + IdCompanyType = 3 + }); + }); modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption"); + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); - b.Property("IsContact") - .HasColumnType("boolean") - .HasColumnName("is_contact"); + b.Property("IsContact") + .HasColumnType("boolean") + .HasColumnName("is_contact"); - b.Property("Order") - .HasColumnType("integer") - .HasColumnName("order"); + b.Property("Order") + .HasColumnType("integer") + .HasColumnName("order"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("t_company_type"); + b.ToTable("t_company_type"); - b.HasData( - new - { - Id = 1, - Caption = "Недропользователь", - IsContact = true, - Order = 3 - }, - new - { - Id = 2, - Caption = "Буровой подрядчик", - IsContact = true, - Order = 2 - }, - new - { - Id = 3, - Caption = "Сервис автоматизации бурения", - IsContact = true, - Order = 0 - }, - new - { - Id = 4, - Caption = "Сервис по ГТИ", - IsContact = true, - Order = 6 - }, - new - { - Id = 5, - Caption = "Растворный сервис", - IsContact = true, - Order = 4 - }, - new - { - Id = 6, - Caption = "Сервис по ННБ", - IsContact = true, - Order = 5 - }, - new - { - Id = 7, - Caption = "Служба супервайзинга", - IsContact = false, - Order = 1 - }, - new - { - Id = 9, - Caption = "Сервис по цементированию", - IsContact = true, - Order = 7 - }, - new - { - Id = 11, - Caption = "Дизельный сервис", - IsContact = false, - Order = 9 - }, - new - { - Id = 12, - Caption = "Сервис по обслуживанию верхних силовых приводов", - IsContact = true, - Order = 8 - }); - }); + b.HasData( + new + { + Id = 1, + Caption = "Недропользователь", + IsContact = true, + Order = 3 + }, + new + { + Id = 2, + Caption = "Буровой подрядчик", + IsContact = true, + Order = 2 + }, + new + { + Id = 3, + Caption = "Сервис автоматизации бурения", + IsContact = true, + Order = 0 + }, + new + { + Id = 4, + Caption = "Сервис по ГТИ", + IsContact = true, + Order = 6 + }, + new + { + Id = 5, + Caption = "Растворный сервис", + IsContact = true, + Order = 4 + }, + new + { + Id = 6, + Caption = "Сервис по ННБ", + IsContact = true, + Order = 5 + }, + new + { + Id = 7, + Caption = "Служба супервайзинга", + IsContact = false, + Order = 1 + }, + new + { + Id = 9, + Caption = "Сервис по цементированию", + IsContact = true, + Order = 7 + }, + new + { + Id = 11, + Caption = "Дизельный сервис", + IsContact = false, + Order = 9 + }, + new + { + Id = 12, + Caption = "Сервис по обслуживанию верхних силовых приводов", + IsContact = true, + Order = 8 + }); + }); modelBuilder.Entity("AsbCloudDb.Model.Contact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Company") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("company") - .HasComment("компания"); + b.Property("Company") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("company") + .HasComment("компания"); - b.Property("Email") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("email") - .HasComment("email"); + b.Property("Email") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("email") + .HasComment("email"); - b.Property("FullName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("full_name") - .HasComment("ФИО"); + b.Property("FullName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("full_name") + .HasComment("ФИО"); - b.Property("IdCompanyType") - .HasMaxLength(255) - .HasColumnType("integer") - .HasColumnName("id_company_type") - .HasComment("вид деятельности"); + b.Property("IdCompanyType") + .HasMaxLength(255) + .HasColumnType("integer") + .HasColumnName("id_company_type") + .HasComment("вид деятельности"); - b.Property("IdWell") - .HasMaxLength(255) - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("ключ скважины"); + b.Property("IdWell") + .HasMaxLength(255) + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ключ скважины"); - b.Property("Phone") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("phone") - .HasComment("номер телефона"); + b.Property("Phone") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("phone") + .HasComment("номер телефона"); - b.Property("Position") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("position") - .HasComment("должность"); + b.Property("Position") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("position") + .HasComment("должность"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdCompanyType"); + b.HasIndex("IdCompanyType"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.ToTable("t_contact"); + b.ToTable("t_contact"); - b.HasComment("Контакты"); - }); + b.HasComment("Контакты"); + }); modelBuilder.Entity("AsbCloudDb.Model.DailyReports.DailyReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Date") - .HasColumnType("date") - .HasColumnName("date") - .HasComment("Дата формирования отчёта"); + b.Property("Date") + .HasColumnType("date") + .HasColumnName("date") + .HasComment("Дата формирования отчёта"); - b.Property("DateLastUpdate") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_last_update") - .HasComment("Дата последнего обновления"); + b.Property("DateLastUpdate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_last_update") + .HasComment("Дата последнего обновления"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("ID скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); - b.Property("SignBlock") - .HasColumnType("jsonb") - .HasColumnName("sign_block") - .HasComment("Подпись"); + b.Property("SignBlock") + .HasColumnType("jsonb") + .HasColumnName("sign_block") + .HasComment("Подпись"); - b.Property("SubsystemBlock") - .HasColumnType("jsonb") - .HasColumnName("subsystem_block") - .HasComment("Наработкой подсистем"); + b.Property("SubsystemBlock") + .HasColumnType("jsonb") + .HasColumnName("subsystem_block") + .HasComment("Наработкой подсистем"); - b.Property("TimeBalanceBlock") - .HasColumnType("jsonb") - .HasColumnName("time_balance_block") - .HasComment("Баланс времени"); + b.Property("TimeBalanceBlock") + .HasColumnType("jsonb") + .HasColumnName("time_balance_block") + .HasComment("Баланс времени"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdWell", "Date") - .IsUnique(); + b.HasIndex("IdWell", "Date") + .IsUnique(); - b.ToTable("t_daily_report"); + b.ToTable("t_daily_report"); - b.HasComment("Ежедневные отчёты"); - }); + b.HasComment("Ежедневные отчёты"); + }); modelBuilder.Entity("AsbCloudDb.Model.DataSaubStat", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AxialLoad") - .HasColumnType("double precision") - .HasColumnName("axial_load") - .HasComment("Фактическая нагрузка"); + b.Property("AxialLoad") + .HasColumnType("double precision") + .HasColumnName("axial_load") + .HasComment("Фактическая нагрузка"); - b.Property("AxialLoadLimitMax") - .HasColumnType("double precision") - .HasColumnName("axial_load_limit_max") - .HasComment("Максимально допустимая нагрузка"); + b.Property("AxialLoadLimitMax") + .HasColumnType("double precision") + .HasColumnName("axial_load_limit_max") + .HasComment("Максимально допустимая нагрузка"); - b.Property("AxialLoadSp") - .HasColumnType("double precision") - .HasColumnName("axial_load_sp") - .HasComment("Ограничение факт. нагрузки"); + b.Property("AxialLoadSp") + .HasColumnType("double precision") + .HasColumnName("axial_load_sp") + .HasComment("Ограничение факт. нагрузки"); - b.Property("BlockSpeedSp") - .HasColumnType("double precision") - .HasColumnName("block_speed_sp") - .HasComment("Ограничение скорости блока"); + b.Property("BlockSpeedSp") + .HasColumnType("double precision") + .HasColumnName("block_speed_sp") + .HasComment("Ограничение скорости блока"); - b.Property("DateEnd") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_end") - .HasComment("Дата и время окончания"); + b.Property("DateEnd") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_end") + .HasComment("Дата и время окончания"); - b.Property("DateStart") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_start") - .HasComment("Дата и время начала"); + b.Property("DateStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_start") + .HasComment("Дата и время начала"); - b.Property("DepthEnd") - .HasColumnType("double precision") - .HasColumnName("depth_end") - .HasComment("Глубина забоя по стволу конечная"); + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина забоя по стволу конечная"); - b.Property("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Глубина забоя по стволу начальная"); + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина забоя по стволу начальная"); - b.Property("EnabledSubsystems") - .HasColumnType("integer") - .HasColumnName("enabled_subsystems") - .HasComment("Флаги подсистем"); + b.Property("EnabledSubsystems") + .HasColumnType("integer") + .HasColumnName("enabled_subsystems") + .HasComment("Флаги подсистем"); - b.Property("Flow") - .HasColumnType("double precision") - .HasColumnName("flow") - .HasComment("Фактический расход"); + b.Property("Flow") + .HasColumnType("double precision") + .HasColumnName("flow") + .HasComment("Фактический расход"); - b.Property("HasOscillation") - .HasColumnType("boolean") - .HasColumnName("has_oscillation") - .HasComment("Наличие или отсутствие осцилляции"); + b.Property("HasOscillation") + .HasColumnType("boolean") + .HasColumnName("has_oscillation") + .HasComment("Наличие или отсутствие осцилляции"); - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("Название автоопределённой операции"); + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Название автоопределённой операции"); - b.Property("IdFeedRegulator") - .HasColumnType("smallint") - .HasColumnName("id_feed_regulator") - .HasComment("Работа при достижении ограничения"); + b.Property("IdFeedRegulator") + .HasColumnType("smallint") + .HasColumnName("id_feed_regulator") + .HasComment("Работа при достижении ограничения"); - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry") - .HasComment("Ключ телеметрии"); + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .HasComment("Ключ телеметрии"); - b.Property("Pressure") - .HasColumnType("double precision") - .HasColumnName("pressure") - .HasComment("Давление"); + b.Property("Pressure") + .HasColumnType("double precision") + .HasColumnName("pressure") + .HasComment("Давление"); - b.Property("PressureIdle") - .HasColumnType("double precision") - .HasColumnName("pressure_idle") - .HasComment("Давление холостого хода"); + b.Property("PressureIdle") + .HasColumnType("double precision") + .HasColumnName("pressure_idle") + .HasComment("Давление холостого хода"); - b.Property("PressureSp") - .HasColumnType("double precision") - .HasColumnName("pressure_sp") - .HasComment("Ограничение фактического давления"); + b.Property("PressureSp") + .HasColumnType("double precision") + .HasColumnName("pressure_sp") + .HasComment("Ограничение фактического давления"); - b.Property("RotorSpeed") - .HasColumnType("double precision") - .HasColumnName("rotor_speed") - .HasComment("Фактическая скорость оборотов ВСП"); + b.Property("RotorSpeed") + .HasColumnType("double precision") + .HasColumnName("rotor_speed") + .HasComment("Фактическая скорость оборотов ВСП"); - b.Property("RotorTorque") - .HasColumnType("double precision") - .HasColumnName("rotor_torque") - .HasComment("Фактический момент"); + b.Property("RotorTorque") + .HasColumnType("double precision") + .HasColumnName("rotor_torque") + .HasComment("Фактический момент"); - b.Property("RotorTorqueLimitMax") - .HasColumnType("double precision") - .HasColumnName("rotor_torque_limit_max") - .HasComment("Максимально допустимый момент"); + b.Property("RotorTorqueLimitMax") + .HasColumnType("double precision") + .HasColumnName("rotor_torque_limit_max") + .HasComment("Максимально допустимый момент"); - b.Property("RotorTorqueSp") - .HasColumnType("double precision") - .HasColumnName("rotor_torque_sp") - .HasComment("Ограничение факт. момента"); + b.Property("RotorTorqueSp") + .HasColumnType("double precision") + .HasColumnName("rotor_torque_sp") + .HasComment("Ограничение факт. момента"); - b.Property("Speed") - .HasColumnType("double precision") - .HasColumnName("speed") - .HasComment("Скорость бурения"); + b.Property("Speed") + .HasColumnType("double precision") + .HasColumnName("speed") + .HasComment("Скорость бурения"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdCategory"); + b.HasIndex("IdCategory"); - b.HasIndex("IdTelemetry"); + b.HasIndex("IdTelemetry"); - b.ToTable("t_data_saub_stat"); + b.ToTable("t_data_saub_stat"); - b.HasComment("Кеш-таблица для хранения данных для РТК-отчета"); - }); + b.HasComment("Кеш-таблица для хранения данных для РТК-отчета"); + }); modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption"); + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); - b.Property("Latitude") - .HasColumnType("double precision") - .HasColumnName("latitude"); + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); - b.Property("Longitude") - .HasColumnType("double precision") - .HasColumnName("longitude"); + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); - b.Property("Timezone") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("timezone") - .HasComment("Смещение часового пояса от UTC"); + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("t_deposit"); + b.ToTable("t_deposit"); - b.HasComment("Месторождение"); - }); + b.HasComment("Месторождение"); + }); modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateEnd") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_end") - .HasComment("Дата начала операции"); + b.Property("DateEnd") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_end") + .HasComment("Дата начала операции"); - b.Property("DateStart") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_start") - .HasComment("Дата начала операции"); + b.Property("DateStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_start") + .HasComment("Дата начала операции"); - b.Property("DepthEnd") - .HasColumnType("double precision") - .HasColumnName("depth_end") - .HasComment("Глубина после завершения операции, м"); + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина после завершения операции, м"); - b.Property("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Глубина на начало операции, м"); + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина на начало операции, м"); - b.Property("EnabledSubsystems") - .HasColumnType("integer") - .HasColumnName("enabled_subsystems") - .HasComment("флаги включенных подсистем"); + b.Property("EnabledSubsystems") + .HasColumnType("integer") + .HasColumnName("enabled_subsystems") + .HasComment("флаги включенных подсистем"); - b.Property("ExtraData") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("extra_data") - .HasComment("доп. инфо по операции"); + b.Property("ExtraData") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("extra_data") + .HasComment("доп. инфо по операции"); - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("Id категории операции"); + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории операции"); - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.Property("IdUsersAtStart") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("Id пользователя по телеметрии на момент начала операции"); + b.Property("IdUsersAtStart") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя по телеметрии на момент начала операции"); - b.Property("Value") - .HasColumnType("double precision") - .HasColumnName("value") - .HasComment("Ключевой показатель операции"); + b.Property("Value") + .HasColumnType("double precision") + .HasColumnName("value") + .HasComment("Ключевой показатель операции"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdCategory"); + b.HasIndex("IdCategory"); - b.HasIndex("IdTelemetry"); + b.HasIndex("IdTelemetry"); - b.ToTable("t_detected_operation"); + b.ToTable("t_detected_operation"); - b.HasComment("автоматически определенные операции по телеметрии"); - }); + b.HasComment("автоматически определенные операции по телеметрии"); + }); modelBuilder.Entity("AsbCloudDb.Model.Driller", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("name") - .HasComment("Имя"); + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name") + .HasComment("Имя"); - b.Property("Patronymic") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("patronymic") - .HasComment("Отчество"); + b.Property("Patronymic") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("patronymic") + .HasComment("Отчество"); - b.Property("Surname") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("surname") - .HasComment("Фамилия"); + b.Property("Surname") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname") + .HasComment("Фамилия"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("t_driller"); + b.ToTable("t_driller"); - b.HasComment("Бурильщик"); - }); + b.HasComment("Бурильщик"); + }); modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("IdFileCategory") - .HasColumnType("integer") - .HasColumnName("id_file_category"); + b.Property("IdFileCategory") + .HasColumnType("integer") + .HasColumnName("id_file_category"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdFileCategory"); + b.HasIndex("IdFileCategory"); - b.HasIndex("IdWell", "IdFileCategory") - .IsUnique(); + b.HasIndex("IdWell", "IdFileCategory") + .IsUnique(); - b.ToTable("t_drilling_program_part"); + b.ToTable("t_drilling_program_part"); - b.HasComment("части программ бурения"); - }); + b.HasComment("части программ бурения"); + }); modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => - { - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry") - .HasComment("Идентификатор телеметрии"); + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .HasComment("Идентификатор телеметрии"); - b.Property("DepthStart") - .HasColumnType("real") - .HasColumnName("depthStart") - .HasComment("Глубина начала"); + b.Property("DepthStart") + .HasColumnType("real") + .HasColumnName("depthStart") + .HasComment("Глубина начала"); - b.Property("Params") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("t_drill_test_params") - .HasComment("Параметры записи drill test"); + b.Property("Params") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("t_drill_test_params") + .HasComment("Параметры записи drill test"); - b.Property("TimeStampStart") - .HasColumnType("timestamp with time zone") - .HasColumnName("timestamp_start") - .HasComment("Время начала"); + b.Property("TimeStampStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("timestamp_start") + .HasComment("Время начала"); - b.HasKey("Id", "IdTelemetry"); + b.HasKey("Id", "IdTelemetry"); - b.HasIndex("IdTelemetry"); + b.HasIndex("IdTelemetry"); - b.ToTable("t_drill_test"); + b.ToTable("t_drill_test"); - b.HasComment("Drill_test"); - }); + b.HasComment("Drill_test"); + }); modelBuilder.Entity("AsbCloudDb.Model.Faq", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Answer") - .HasColumnType("text") - .HasColumnName("answer") - .HasComment("Текст ответа"); + b.Property("Answer") + .HasColumnType("text") + .HasColumnName("answer") + .HasComment("Текст ответа"); - b.Property("CounterQuestion") - .HasColumnType("integer") - .HasColumnName("counter_question") - .HasComment("Счетчик повторений вопроса"); + b.Property("CounterQuestion") + .HasColumnType("integer") + .HasColumnName("counter_question") + .HasComment("Счетчик повторений вопроса"); - b.Property("DateAnswer") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_answer") - .HasComment("Дата ответа"); + b.Property("DateAnswer") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_answer") + .HasComment("Дата ответа"); - b.Property("DateCreatedQuestion") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_created_question") - .HasComment("Дата создания вопроса"); + b.Property("DateCreatedQuestion") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_created_question") + .HasComment("Дата создания вопроса"); - b.Property("DateLastEditedQuestion") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_last_edited_question") - .HasComment("Дата последнего редактирования вопроса"); + b.Property("DateLastEditedQuestion") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_last_edited_question") + .HasComment("Дата последнего редактирования вопроса"); - b.Property("IdAuthorAnswer") - .HasColumnType("integer") - .HasColumnName("id_author_answer") - .HasComment("id автора ответа"); + b.Property("IdAuthorAnswer") + .HasColumnType("integer") + .HasColumnName("id_author_answer") + .HasComment("id автора ответа"); - b.Property("IdAuthorQuestion") - .HasColumnType("integer") - .HasColumnName("id_author_question") - .HasComment("id автора вопроса"); + b.Property("IdAuthorQuestion") + .HasColumnType("integer") + .HasColumnName("id_author_question") + .HasComment("id автора вопроса"); - b.Property("IdReplacementQuestion") - .HasColumnType("integer") - .HasColumnName("id_replacement_question") - .HasComment("Ключ заменяющего вопроса"); + b.Property("IdReplacementQuestion") + .HasColumnType("integer") + .HasColumnName("id_replacement_question") + .HasComment("Ключ заменяющего вопроса"); - b.Property("IsFrequently") - .HasColumnType("boolean") - .HasColumnName("is_frequently") - .HasComment("Частый вопрос"); + b.Property("IsFrequently") + .HasColumnType("boolean") + .HasColumnName("is_frequently") + .HasComment("Частый вопрос"); - b.Property("Question") - .IsRequired() - .HasColumnType("text") - .HasColumnName("question") - .HasComment("Текст вопроса"); + b.Property("Question") + .IsRequired() + .HasColumnType("text") + .HasColumnName("question") + .HasComment("Текст вопроса"); - b.Property("State") - .HasColumnType("integer") - .HasColumnName("state") - .HasComment("Статус вопроса"); + b.Property("State") + .HasColumnType("integer") + .HasColumnName("state") + .HasComment("Статус вопроса"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdAuthorAnswer"); + b.HasIndex("IdAuthorAnswer"); - b.HasIndex("IdAuthorQuestion"); + b.HasIndex("IdAuthorQuestion"); - b.ToTable("t_faq"); + b.ToTable("t_faq"); - b.HasComment("вопросы пользователей"); - }); + b.HasComment("вопросы пользователей"); + }); modelBuilder.Entity("AsbCloudDb.Model.FileCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название категории"); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории"); - b.Property("ShortName") - .HasColumnType("text") - .HasColumnName("short_name") - .HasComment("Короткое название категории"); + b.Property("ShortName") + .HasColumnType("text") + .HasColumnName("short_name") + .HasComment("Короткое название категории"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("t_file_category"); + b.ToTable("t_file_category"); - b.HasComment("Категории файлов"); + b.HasComment("Категории файлов"); - b.HasData( - new - { - Id = 1, - Name = "Растворный сервис", - ShortName = "fluidService" - }, - new - { - Id = 2, - Name = "Цементирование", - ShortName = "cement" - }, - new - { - Id = 3, - Name = "ННБ", - ShortName = "nnb" - }, - new - { - Id = 4, - Name = "ГТИ", - ShortName = "gti" - }, - new - { - Id = 5, - Name = "Документы по скважине", - ShortName = "wellDocuments" - }, - new - { - Id = 6, - Name = "Супервайзер", - ShortName = "supervisor" - }, - new - { - Id = 7, - Name = "Мастер", - ShortName = "master" - }, - new - { - Id = 8, - Name = "Долотный сервис", - ShortName = "toolService" - }, - new - { - Id = 9, - Name = "Буровой подрядчик", - ShortName = "drillService" - }, - new - { - Id = 10, - Name = "Сервис по заканчиванию скважины", - ShortName = "closingService" - }, - new - { - Id = 12, - Name = "Рапорт", - ShortName = "report" - }, - new - { - Id = 1000, - Name = "Программа бурения" - }, - new - { - Id = 1001, - Name = "Задание от геологов" - }, - new - { - Id = 1002, - Name = "Профиль ствола скважины (ННБ)" - }, - new - { - Id = 1003, - Name = "Технологические расчеты (ННБ)" - }, - new - { - Id = 1004, - Name = "Долотная программа" - }, - new - { - Id = 1005, - Name = "Программа по растворам" - }, - new - { - Id = 1006, - Name = "Программа геофизических исследований" - }, - new - { - Id = 1007, - Name = "Планы спусков обсадных колонн" - }, - new - { - Id = 1008, - Name = "Программы цементирования обсадных колонн" - }, - new - { - Id = 10000, - Name = "Проект на бурение транспортного и горизонтального участков скважины" - }, - new - { - Id = 10001, - Name = "Программа на бурение транспортного и горизонтального участков скважины" - }, - new - { - Id = 10002, - Name = "Акт о начале бурения" - }, - new - { - Id = 10003, - Name = "План работ спуска и цементирования направления" - }, - new - { - Id = 10004, - Name = "Программа цементирования направления" - }, - new - { - Id = 10005, - Name = "Мера обсадных труб (направление)" - }, - new - { - Id = 10006, - Name = "Акт на выполненные работы по цементированию направления" - }, - new - { - Id = 10007, - Name = "Отчет по цементированию направления (график)" - }, - new - { - Id = 10008, - Name = "План работ спуска и цементирования кондуктора" - }, - new - { - Id = 10009, - Name = "Программа цементирования (кондуктор)" - }, - new - { - Id = 10010, - Name = "Мера обсадных труб (кондуктор)" - }, - new - { - Id = 10011, - Name = "Карта крепления кондуктора" - }, - new - { - Id = 10012, - Name = "Акт на выполненные работы по цементированию кондуктора" - }, - new - { - Id = 10013, - Name = "Отчет по цементированию кондуктора (график)" - }, - new - { - Id = 10014, - Name = "Акт о замере расстояния от стола ротора до муфты кондуктора" - }, - new - { - Id = 10015, - Name = "Акт опресовки цементного кольца за кондуктором" - }, - new - { - Id = 10016, - Name = "Акт опресовки ППГ с глухими плашками совместно с кондуктором" - }, - new - { - Id = 10017, - Name = "Акт опресовки ПУГ, ППГ с трубными плашками совместно с кондуктором" - }, - new - { - Id = 10018, - Name = "План работ на крепление обсадной колонны (эк. колонна)" - }, - new - { - Id = 10019, - Name = "Программа цементирования (эк. колонна)" - }, - new - { - Id = 10020, - Name = "Мера труб эксплуатационной колонны" - }, - new - { - Id = 10021, - Name = "Карта по креплению скважины (эк. колонна)" - }, - new - { - Id = 10022, - Name = "Акт на установку пружинных центраторов" - }, - new - { - Id = 10023, - Name = "Отчет по цементированию эксплуатационной колонны (график)" - }, - new - { - Id = 10024, - Name = "Акт на выполненные работы по цементированию эксплуатационной колонны" - }, - new - { - Id = 10025, - Name = "Акт об испытании эк. колонны на герметичность (СТОП)" - }, - new - { - Id = 10026, - Name = "Акт опресовки ППГ с глухими плашками совместно с э/колонной" - }, - new - { - Id = 10027, - Name = "Акт опресовки ПУГ, ППГ с трубными плашками совместно с э/колонной" - }, - new - { - Id = 10028, - Name = "Акт на вскрытие продуктивного пласта" - }, - new - { - Id = 10029, - Name = "Акт замера параметров раствора при бурении горизонтального участка" - }, - new - { - Id = 10030, - Name = "Разрешение на спуск «хвостовика» (телефонограмма)" - }, - new - { - Id = 10031, - Name = "План работ на спуск «хвостовика»" - }, - new - { - Id = 10032, - Name = "Акт готовности бурового и энергетического оборудования к спуску «хвостовика»" - }, - new - { - Id = 10033, - Name = "Акт шаблонировки ствола скважины перед спуском «хвостовика»" - }, - new - { - Id = 10034, - Name = "Мера обсадных труб (хвостовик)" - }, - new - { - Id = 10035, - Name = "Акт выполненных работ по спуску хвостовика с закачкой (нефти, солевого раствора" - }, - new - { - Id = 10036, - Name = "Акт о переводе скважины на тех. воду" - }, - new - { - Id = 10037, - Name = "Акт об окончании бурения" - }, - new - { - Id = 10038, - Name = "Акт на передачу скважины в освоение (КРС)" - }, - new - { - Id = 10039, - Name = "Акт на опресовку межколонного пространства с КРС" - }, - new - { - Id = 10040, - Name = "Акт на сдачу скважины в ЦДНГ" - }, - new - { - Id = 10041, - Name = "Паспорт ОУС (заполняется геологами)" - }, - new - { - Id = 10042, - Name = "Паспорт скважины (заполняется геологами)" - }, - new - { - Id = 10043, - Name = "Фактические данные бурения (вставляются в паспорт скважины)" - }, - new - { - Id = 20000, - Name = "Справки по страницам" - }, - new - { - Id = 30000, - Name = "Инструкции" - }); - }); + b.HasData( + new + { + Id = 1, + Name = "Растворный сервис", + ShortName = "fluidService" + }, + new + { + Id = 2, + Name = "Цементирование", + ShortName = "cement" + }, + new + { + Id = 3, + Name = "ННБ", + ShortName = "nnb" + }, + new + { + Id = 4, + Name = "ГТИ", + ShortName = "gti" + }, + new + { + Id = 5, + Name = "Документы по скважине", + ShortName = "wellDocuments" + }, + new + { + Id = 6, + Name = "Супервайзер", + ShortName = "supervisor" + }, + new + { + Id = 7, + Name = "Мастер", + ShortName = "master" + }, + new + { + Id = 8, + Name = "Долотный сервис", + ShortName = "toolService" + }, + new + { + Id = 9, + Name = "Буровой подрядчик", + ShortName = "drillService" + }, + new + { + Id = 10, + Name = "Сервис по заканчиванию скважины", + ShortName = "closingService" + }, + new + { + Id = 12, + Name = "Рапорт", + ShortName = "report" + }, + new + { + Id = 1000, + Name = "Программа бурения" + }, + new + { + Id = 1001, + Name = "Задание от геологов" + }, + new + { + Id = 1002, + Name = "Профиль ствола скважины (ННБ)" + }, + new + { + Id = 1003, + Name = "Технологические расчеты (ННБ)" + }, + new + { + Id = 1004, + Name = "Долотная программа" + }, + new + { + Id = 1005, + Name = "Программа по растворам" + }, + new + { + Id = 1006, + Name = "Программа геофизических исследований" + }, + new + { + Id = 1007, + Name = "Планы спусков обсадных колонн" + }, + new + { + Id = 1008, + Name = "Программы цементирования обсадных колонн" + }, + new + { + Id = 10000, + Name = "Проект на бурение транспортного и горизонтального участков скважины" + }, + new + { + Id = 10001, + Name = "Программа на бурение транспортного и горизонтального участков скважины" + }, + new + { + Id = 10002, + Name = "Акт о начале бурения" + }, + new + { + Id = 10003, + Name = "План работ спуска и цементирования направления" + }, + new + { + Id = 10004, + Name = "Программа цементирования направления" + }, + new + { + Id = 10005, + Name = "Мера обсадных труб (направление)" + }, + new + { + Id = 10006, + Name = "Акт на выполненные работы по цементированию направления" + }, + new + { + Id = 10007, + Name = "Отчет по цементированию направления (график)" + }, + new + { + Id = 10008, + Name = "План работ спуска и цементирования кондуктора" + }, + new + { + Id = 10009, + Name = "Программа цементирования (кондуктор)" + }, + new + { + Id = 10010, + Name = "Мера обсадных труб (кондуктор)" + }, + new + { + Id = 10011, + Name = "Карта крепления кондуктора" + }, + new + { + Id = 10012, + Name = "Акт на выполненные работы по цементированию кондуктора" + }, + new + { + Id = 10013, + Name = "Отчет по цементированию кондуктора (график)" + }, + new + { + Id = 10014, + Name = "Акт о замере расстояния от стола ротора до муфты кондуктора" + }, + new + { + Id = 10015, + Name = "Акт опресовки цементного кольца за кондуктором" + }, + new + { + Id = 10016, + Name = "Акт опресовки ППГ с глухими плашками совместно с кондуктором" + }, + new + { + Id = 10017, + Name = "Акт опресовки ПУГ, ППГ с трубными плашками совместно с кондуктором" + }, + new + { + Id = 10018, + Name = "План работ на крепление обсадной колонны (эк. колонна)" + }, + new + { + Id = 10019, + Name = "Программа цементирования (эк. колонна)" + }, + new + { + Id = 10020, + Name = "Мера труб эксплуатационной колонны" + }, + new + { + Id = 10021, + Name = "Карта по креплению скважины (эк. колонна)" + }, + new + { + Id = 10022, + Name = "Акт на установку пружинных центраторов" + }, + new + { + Id = 10023, + Name = "Отчет по цементированию эксплуатационной колонны (график)" + }, + new + { + Id = 10024, + Name = "Акт на выполненные работы по цементированию эксплуатационной колонны" + }, + new + { + Id = 10025, + Name = "Акт об испытании эк. колонны на герметичность (СТОП)" + }, + new + { + Id = 10026, + Name = "Акт опресовки ППГ с глухими плашками совместно с э/колонной" + }, + new + { + Id = 10027, + Name = "Акт опресовки ПУГ, ППГ с трубными плашками совместно с э/колонной" + }, + new + { + Id = 10028, + Name = "Акт на вскрытие продуктивного пласта" + }, + new + { + Id = 10029, + Name = "Акт замера параметров раствора при бурении горизонтального участка" + }, + new + { + Id = 10030, + Name = "Разрешение на спуск «хвостовика» (телефонограмма)" + }, + new + { + Id = 10031, + Name = "План работ на спуск «хвостовика»" + }, + new + { + Id = 10032, + Name = "Акт готовности бурового и энергетического оборудования к спуску «хвостовика»" + }, + new + { + Id = 10033, + Name = "Акт шаблонировки ствола скважины перед спуском «хвостовика»" + }, + new + { + Id = 10034, + Name = "Мера обсадных труб (хвостовик)" + }, + new + { + Id = 10035, + Name = "Акт выполненных работ по спуску хвостовика с закачкой (нефти, солевого раствора" + }, + new + { + Id = 10036, + Name = "Акт о переводе скважины на тех. воду" + }, + new + { + Id = 10037, + Name = "Акт об окончании бурения" + }, + new + { + Id = 10038, + Name = "Акт на передачу скважины в освоение (КРС)" + }, + new + { + Id = 10039, + Name = "Акт на опресовку межколонного пространства с КРС" + }, + new + { + Id = 10040, + Name = "Акт на сдачу скважины в ЦДНГ" + }, + new + { + Id = 10041, + Name = "Паспорт ОУС (заполняется геологами)" + }, + new + { + Id = 10042, + Name = "Паспорт скважины (заполняется геологами)" + }, + new + { + Id = 10043, + Name = "Фактические данные бурения (вставляются в паспорт скважины)" + }, + new + { + Id = 20000, + Name = "Справки по страницам" + }, + new + { + Id = 30000, + Name = "Инструкции" + }); + }); modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("IdAuthor") - .HasColumnType("integer") - .HasColumnName("id_author") - .HasComment("Id пользователя, загрузившего файл"); + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Id пользователя, загрузившего файл"); - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("id категории файла"); + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("id категории файла"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("id скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); - b.Property("IsDeleted") - .HasColumnType("boolean") - .HasColumnName("is_deleted") - .HasComment("Удален ли файл"); + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Удален ли файл"); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название файла"); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название файла"); - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("file_size") - .HasComment("Размер файла"); + b.Property("Size") + .HasColumnType("bigint") + .HasColumnName("file_size") + .HasComment("Размер файла"); - b.Property("UploadDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); + b.Property("UploadDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdAuthor"); + b.HasIndex("IdAuthor"); - b.HasIndex("IdCategory"); + b.HasIndex("IdCategory"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.ToTable("t_file_info"); + b.ToTable("t_file_info"); - b.HasComment("Файлы всех категорий"); - }); + b.HasComment("Файлы всех категорий"); + }); modelBuilder.Entity("AsbCloudDb.Model.FileMark", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Comment") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("comment") - .HasComment("Комментарий"); + b.Property("Comment") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("comment") + .HasComment("Комментарий"); - b.Property("DateCreated") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_created") - .HasComment("Дата совершенного действия"); + b.Property("DateCreated") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_created") + .HasComment("Дата совершенного действия"); - b.Property("IdFile") - .HasColumnType("integer") - .HasColumnName("id_file") - .HasComment("id файла"); + b.Property("IdFile") + .HasColumnType("integer") + .HasColumnName("id_file") + .HasComment("id файла"); - b.Property("IdMarkType") - .HasColumnType("integer") - .HasColumnName("id_mark_type") - .HasComment("0 - отклонен, 1 - согласован"); + b.Property("IdMarkType") + .HasColumnType("integer") + .HasColumnName("id_mark_type") + .HasComment("0 - отклонен, 1 - согласован"); - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("id пользователя"); + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("id пользователя"); - b.Property("IsDeleted") - .HasColumnType("boolean") - .HasColumnName("is_deleted") - .HasComment("Помечен ли файл как удаленный"); + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Помечен ли файл как удаленный"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdFile"); + b.HasIndex("IdFile"); - b.HasIndex("IdUser"); + b.HasIndex("IdUser"); - b.ToTable("t_file_mark"); + b.ToTable("t_file_mark"); - b.HasComment("Действия с файлами."); - }); + b.HasComment("Действия с файлами."); + }); modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.Property("IdRecord") - .HasColumnType("integer") - .HasColumnName("id_record"); + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); - b.Property("IdItem") - .HasColumnType("integer") - .HasColumnName("id_item"); + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); - b.Property("Value") - .HasColumnType("real") - .HasColumnName("value"); + b.Property("Value") + .HasColumnType("real") + .HasColumnName("value"); - b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); - b.ToTable("t_wits_float"); + b.ToTable("t_wits_float"); - b.HasComment("таблица данных ГТИ с типом значения float"); - }); + b.HasComment("таблица данных ГТИ с типом значения float"); + }); modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.Property("IdRecord") - .HasColumnType("integer") - .HasColumnName("id_record"); + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); - b.Property("IdItem") - .HasColumnType("integer") - .HasColumnName("id_item"); + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); - b.Property("Value") - .HasColumnType("integer") - .HasColumnName("value"); + b.Property("Value") + .HasColumnType("integer") + .HasColumnName("value"); - b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); - b.ToTable("t_wits_int"); + b.ToTable("t_wits_int"); - b.HasComment("таблица данных ГТИ с типом значения int"); - }); + b.HasComment("таблица данных ГТИ с типом значения int"); + }); modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.Property("IdRecord") - .HasColumnType("integer") - .HasColumnName("id_record"); + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); - b.Property("IdItem") - .HasColumnType("integer") - .HasColumnName("id_item"); + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .HasColumnName("value"); + b.Property("Value") + .IsRequired() + .HasColumnType("text") + .HasColumnName("value"); - b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); - b.ToTable("t_wits_string"); + b.ToTable("t_wits_string"); - b.HasComment("таблица данных ГТИ с типом значения string"); - }); + b.HasComment("таблица данных ГТИ с типом значения string"); + }); modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("Id категории файла"); + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории файла"); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название файла"); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название файла"); - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("file_size") - .HasComment("Размер файла"); + b.Property("Size") + .HasColumnType("bigint") + .HasColumnName("file_size") + .HasComment("Размер файла"); - b.Property("UrlPage") - .IsRequired() - .HasColumnType("text") - .HasColumnName("url_page") - .HasComment("Url страницы"); + b.Property("UrlPage") + .IsRequired() + .HasColumnType("text") + .HasColumnName("url_page") + .HasComment("Url страницы"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdCategory"); + b.HasIndex("IdCategory"); - b.ToTable("t_help_page"); + b.ToTable("t_help_page"); - b.HasComment("Справки"); - }); + b.HasComment("Справки"); + }); modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateEnd") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_end"); + b.Property("DateEnd") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_end"); - b.Property("DateStart") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_start"); + b.Property("DateStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_start"); - b.Property("DepthEnd") - .HasColumnType("real") - .HasColumnName("depth_end"); + b.Property("DepthEnd") + .HasColumnType("real") + .HasColumnName("depth_end"); - b.Property("DepthStart") - .HasColumnType("real") - .HasColumnName("depth_start"); + b.Property("DepthStart") + .HasColumnType("real") + .HasColumnName("depth_start"); - b.Property("IdFeedRegulator") - .HasColumnType("smallint") - .HasColumnName("id_feed_regulator"); + b.Property("IdFeedRegulator") + .HasColumnType("smallint") + .HasColumnName("id_feed_regulator"); - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdTelemetry"); + b.HasIndex("IdTelemetry"); - b.ToTable("t_limiting_parameter"); + b.ToTable("t_limiting_parameter"); - b.HasComment("Ограничения по параметрам телеметрии"); - }); + b.HasComment("Ограничения по параметрам телеметрии"); + }); modelBuilder.Entity("AsbCloudDb.Model.Manuals.Manual", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateDownload") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_download") - .HasComment("Дата загрузки"); + b.Property("DateDownload") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_download") + .HasComment("Дата загрузки"); - b.Property("IdAuthor") - .HasColumnType("integer") - .HasColumnName("id_author") - .HasComment("Id автора"); + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Id автора"); - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("Id категории файла"); + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории файла"); - b.Property("IdDirectory") - .HasColumnType("integer") - .HasColumnName("id_directory") - .HasComment("Id директории"); + b.Property("IdDirectory") + .HasColumnType("integer") + .HasColumnName("id_directory") + .HasComment("Id директории"); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название"); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdAuthor"); + b.HasIndex("IdAuthor"); - b.HasIndex("IdCategory"); + b.HasIndex("IdCategory"); - b.HasIndex("IdDirectory"); + b.HasIndex("IdDirectory"); - b.ToTable("t_manual"); + b.ToTable("t_manual"); - b.HasComment("Инструкции"); - }); + b.HasComment("Инструкции"); + }); modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("IdParent") - .HasColumnType("integer") - .HasColumnName("id_parent") - .HasComment("Id родительской директории"); + b.Property("IdParent") + .HasColumnType("integer") + .HasColumnName("id_parent") + .HasComment("Id родительской директории"); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название"); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdParent"); + b.HasIndex("IdParent"); - b.ToTable("t_manual_directory"); + b.ToTable("t_manual_directory"); - b.HasComment("Директория для инструкций"); - }); + b.HasComment("Директория для инструкций"); + }); modelBuilder.Entity("AsbCloudDb.Model.Measure", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Data") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("data") - .HasComment("Данные таблицы последних данных"); + b.Property("Data") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("data") + .HasComment("Данные таблицы последних данных"); - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("id категории"); + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("id категории"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("id скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); - b.Property("IsDeleted") - .HasColumnType("boolean") - .HasColumnName("is_deleted") - .HasComment("Пометка удаленным"); + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Пометка удаленным"); - b.Property("Timestamp") - .HasColumnType("timestamp with time zone") - .HasColumnName("timestamp") - .HasComment("время добавления"); + b.Property("Timestamp") + .HasColumnType("timestamp with time zone") + .HasColumnName("timestamp") + .HasComment("время добавления"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdCategory"); + b.HasIndex("IdCategory"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.ToTable("t_measure"); + b.ToTable("t_measure"); - b.HasComment("Таблица c данными для вкладки 'Последние данные'"); - }); + b.HasComment("Таблица c данными для вкладки 'Последние данные'"); + }); modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название категории"); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории"); - b.Property("ShortName") - .HasColumnType("text") - .HasColumnName("short_name") - .HasComment("Короткое название категории"); + b.Property("ShortName") + .HasColumnType("text") + .HasColumnName("short_name") + .HasComment("Короткое название категории"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("t_measure_category"); + b.ToTable("t_measure_category"); - b.HasComment("Категория последних данных"); + b.HasComment("Категория последних данных"); - b.HasData( - new - { - Id = 1, - Name = "Показатели бурового раствора", - ShortName = "Раствор" - }, - new - { - Id = 2, - Name = "Шламограмма", - ShortName = "Шламограмма" - }, - new - { - Id = 3, - Name = "ННБ", - ShortName = "ННБ" - }); - }); + b.HasData( + new + { + Id = 1, + Name = "Показатели бурового раствора", + ShortName = "Раствор" + }, + new + { + Id = 2, + Name = "Шламограмма", + ShortName = "Шламограмма" + }, + new + { + Id = 3, + Name = "ННБ", + ShortName = "ННБ" + }); + }); modelBuilder.Entity("AsbCloudDb.Model.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("IdNotificationCategory") - .HasColumnType("integer") - .HasColumnName("id_notification_category") - .HasComment("Id категории уведомления"); + b.Property("IdNotificationCategory") + .HasColumnType("integer") + .HasColumnName("id_notification_category") + .HasComment("Id категории уведомления"); - b.Property("IdTransportType") - .HasColumnType("integer") - .HasColumnName("id_transport_type") - .HasComment("Id типа доставки уведомления"); + b.Property("IdTransportType") + .HasColumnType("integer") + .HasColumnName("id_transport_type") + .HasComment("Id типа доставки уведомления"); - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("Id получателя"); + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id получателя"); - b.Property("Message") - .IsRequired() - .HasColumnType("text") - .HasColumnName("message") - .HasComment("Сообщение уведомления"); + b.Property("Message") + .IsRequired() + .HasColumnType("text") + .HasColumnName("message") + .HasComment("Сообщение уведомления"); - b.Property("ReadDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("read_date") - .HasComment("Дата прочтения уведомления"); + b.Property("ReadDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("read_date") + .HasComment("Дата прочтения уведомления"); - b.Property("RegistrationDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("registration_date") - .HasComment("Дата регистрации уведомления"); + b.Property("RegistrationDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("registration_date") + .HasComment("Дата регистрации уведомления"); - b.Property("SentDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("sent_date") - .HasComment("Дата отправки уведомления"); + b.Property("SentDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("sent_date") + .HasComment("Дата отправки уведомления"); - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title") - .HasComment("Заголовок уведомления"); + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasColumnName("title") + .HasComment("Заголовок уведомления"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdNotificationCategory"); + b.HasIndex("IdNotificationCategory"); - b.HasIndex("IdUser"); + b.HasIndex("IdUser"); - b.ToTable("t_notification"); + b.ToTable("t_notification"); - b.HasComment("Уведомления"); - }); + b.HasComment("Уведомления"); + }); modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("t_notification_category"); + b.ToTable("t_notification_category"); - b.HasComment("Категории уведомлений"); + b.HasComment("Категории уведомлений"); - b.HasData( - new - { - Id = 1, - Name = "Системные уведомления" - }); - }); + b.HasData( + new + { + Id = 1, + Name = "Системные уведомления" + }); + }); modelBuilder.Entity("AsbCloudDb.Model.OperationValue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DepthEnd") - .HasColumnType("double precision") - .HasColumnName("depth_end") - .HasComment("Конечная глубина"); + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Конечная глубина"); - b.Property("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Старотовая глубина"); + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Старотовая глубина"); - b.Property("IdOperationCategory") - .HasColumnType("integer") - .HasColumnName("id_operation_category") - .HasComment("Ид категории операции"); + b.Property("IdOperationCategory") + .HasColumnType("integer") + .HasColumnName("id_operation_category") + .HasComment("Ид категории операции"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("Ид скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Ид скважины"); - b.Property("StandardValue") - .HasColumnType("double precision") - .HasColumnName("standard_value") - .HasComment("Нормативный показатель"); + b.Property("StandardValue") + .HasColumnType("double precision") + .HasColumnName("standard_value") + .HasComment("Нормативный показатель"); - b.Property("TargetValue") - .HasColumnType("double precision") - .HasColumnName("target_value") - .HasComment("Целевой показатель"); + b.Property("TargetValue") + .HasColumnType("double precision") + .HasColumnName("target_value") + .HasComment("Целевой показатель"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdOperationCategory"); + b.HasIndex("IdOperationCategory"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.ToTable("t_operationvalue"); + b.ToTable("t_operationvalue"); - b.HasComment("Целевые/нормативные показатели операции"); - }); + b.HasComment("Целевые/нормативные показатели операции"); + }); modelBuilder.Entity("AsbCloudDb.Model.Permission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("description") - .HasComment("Краткое описание"); + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("description") + .HasComment("Краткое описание"); - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("name") - .HasComment("Название"); + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name") + .HasComment("Название"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("t_permission"); + b.ToTable("t_permission"); - b.HasComment("Разрешения на доступ к данным"); + b.HasComment("Разрешения на доступ к данным"); - b.HasData( - new - { - Id = 100, - Description = "Разрешение удалять админ. Кусты", - Name = "AdminCluster.delete" - }, - new - { - Id = 101, - Description = "Разрешение редактировать админ. Кусты", - Name = "AdminCluster.edit" - }, - new - { - Id = 102, - Description = "Разрешение просматривать админ. Кусты", - Name = "AdminCluster.get" - }, - new - { - Id = 103, - Description = "Разрешение удалять админ. Компании", - Name = "AdminCompany.delete" - }, - new - { - Id = 104, - Description = "Разрешение редактировать админ. Компании", - Name = "AdminCompany.edit" - }, - new - { - Id = 105, - Description = "Разрешение просматривать админ. Компании", - Name = "AdminCompany.get" - }, - new - { - Id = 106, - Description = "Разрешение удалять админ. Типы компаний", - Name = "AdminCompanyType.delete" - }, - new - { - Id = 107, - Description = "Разрешение редактировать админ. Типы компаний", - Name = "AdminCompanyType.edit" - }, - new - { - Id = 108, - Description = "Разрешение просматривать админ. Типы компаний", - Name = "AdminCompanyType.get" - }, - new - { - Id = 109, - Description = "Разрешение удалять админ. Месторождения", - Name = "AdminDeposit.delete" - }, - new - { - Id = 110, - Description = "Разрешение редактировать админ. Месторождения", - Name = "AdminDeposit.edit" - }, - new - { - Id = 111, - Description = "Разрешение просматривать админ. Месторождения", - Name = "AdminDeposit.get" - }, - new - { - Id = 112, - Description = "Разрешение удалять админ. Разрешения", - Name = "AdminPermission.delete" - }, - new - { - Id = 113, - Description = "Разрешение редактировать админ. Разрешения", - Name = "AdminPermission.edit" - }, - new - { - Id = 114, - Description = "Разрешение просматривать админ. Разрешения", - Name = "AdminPermission.get" - }, - new - { - Id = 115, - Description = "Разрешение удалять админ. Телеметрию", - Name = "AdminTelemetry.delete" - }, - new - { - Id = 116, - Description = "Разрешение редактировать админ. Телеметрию", - Name = "AdminTelemetry.edit" - }, - new - { - Id = 117, - Description = "Разрешение просматривать админ. Телеметрию", - Name = "AdminTelemetry.get" - }, - new - { - Id = 118, - Description = "Разрешение удалять админ. Пользователей", - Name = "AdminUser.delete" - }, - new - { - Id = 119, - Description = "Разрешение редактировать админ. Пользователей", - Name = "AdminUser.edit" - }, - new - { - Id = 120, - Description = "Разрешение просматривать админ. Пользователей", - Name = "AdminUser.get" - }, - new - { - Id = 121, - Description = "Разрешение удалять админ. Роли пользователей", - Name = "AdminUserRole.delete" - }, - new - { - Id = 122, - Description = "Разрешение редактировать админ. Роли пользователей", - Name = "AdminUserRole.edit" - }, - new - { - Id = 123, - Description = "Разрешение просматривать админ. Роли пользователей", - Name = "AdminUserRole.get" - }, - new - { - Id = 124, - Description = "Разрешение удалять админ. Скважины", - Name = "AdminWell.delete" - }, - new - { - Id = 125, - Description = "Разрешение редактировать админ. Скважины", - Name = "AdminWell.edit" - }, - new - { - Id = 126, - Description = "Разрешение просматривать админ. Скважины", - Name = "AdminWell.get" - }, - new - { - Id = 127, - Description = "Разрешение удалять админ. Подсистемы", - Name = "AdminSubsytem.delete" - }, - new - { - Id = 128, - Description = "Разрешение редактировать админ. Подсистемы", - Name = "AdminSubsytem.edit" - }, - new - { - Id = 129, - Description = "Разрешение просматривать админ. Подсистемы", - Name = "AdminSubsytem.get" - }, - new - { - Id = 200, - Description = "Разрешение редактировать 0", - Name = "Auth.edit" - }, - new - { - Id = 201, - Description = "Разрешение просматривать 0", - Name = "Auth.get" - }, - new - { - Id = 202, - Description = "Разрешение просматривать Кусты", - Name = "Cluster.get" - }, - new - { - Id = 203, - Description = "Разрешение просматривать Месторождения", - Name = "Deposit.get" - }, - new - { - Id = 204, - Description = "Разрешение удалять РТК", - Name = "DrillFlowChart.delete" - }, - new - { - Id = 205, - Description = "Разрешение редактировать РТК", - Name = "DrillFlowChart.edit" - }, - new - { - Id = 206, - Description = "Разрешение просматривать РТК", - Name = "DrillFlowChart.get" - }, - new - { - Id = 207, - Description = "Разрешение удалять Программу бурения", - Name = "DrillingProgram.delete" - }, - new - { - Id = 208, - Description = "Разрешение редактировать Программу бурения", - Name = "DrillingProgram.edit" - }, - new - { - Id = 209, - Description = "Разрешение просматривать Программу бурения", - Name = "DrillingProgram.get" - }, - new - { - Id = 210, - Description = "Разрешение удалять Режимы бурения", - Name = "DrillParams.delete" - }, - new - { - Id = 211, - Description = "Разрешение редактировать Режимы бурения", - Name = "DrillParams.edit" - }, - new - { - Id = 212, - Description = "Разрешение просматривать Режимы бурения", - Name = "DrillParams.get" - }, - new - { - Id = 213, - Description = "Разрешение удалять Файлы", - Name = "File.delete" - }, - new - { - Id = 214, - Description = "Разрешение редактировать Файлы", - Name = "File.edit" - }, - new - { - Id = 215, - Description = "Разрешение просматривать Файлы", - Name = "File.get" - }, - new - { - Id = 216, - Description = "Разрешение удалять Измерения", - Name = "Measure.delete" - }, - new - { - Id = 217, - Description = "Разрешение редактировать Измерения", - Name = "Measure.edit" - }, - new - { - Id = 218, - Description = "Разрешение просматривать Измерения", - Name = "Measure.get" - }, - new - { - Id = 219, - Description = "Разрешение просматривать Сообщения телеметрии", - Name = "Message.get" - }, - new - { - Id = 220, - Description = "Разрешение просматривать Статистику по операциям", - Name = "OperationStat.get" - }, - new - { - Id = 221, - Description = "Разрешение редактировать Рапорта", - Name = "Report.edit" - }, - new - { - Id = 222, - Description = "Разрешение просматривать Рапорта", - Name = "Report.get" - }, - new - { - Id = 223, - Description = "Разрешение просматривать админ. Системная статистика", - Name = "RequestTracker.get" - }, - new - { - Id = 224, - Description = "Разрешение удалять Рекомендации уставок", - Name = "Setpoints.delete" - }, - new - { - Id = 225, - Description = "Разрешение редактировать Рекомендации уставок", - Name = "Setpoints.edit" - }, - new - { - Id = 226, - Description = "Разрешение просматривать Рекомендации уставок", - Name = "Setpoints.get" - }, - new - { - Id = 227, - Description = "Разрешение редактировать Телеметрии", - Name = "Telemetry.edit" - }, - new - { - Id = 228, - Description = "Разрешение просматривать Анализ телеметрии", - Name = "TelemetryAnalytics.get" - }, - new - { - Id = 229, - Description = "Разрешение редактировать Данные телеметрии по САУБ", - Name = "TelemetryDataSaub.edit" - }, - new - { - Id = 230, - Description = "Разрешение просматривать Данные телеметрии по САУБ", - Name = "TelemetryDataSaub.get" - }, - new - { - Id = 231, - Description = "Разрешение редактировать Данные телеметрии по SpinMaster", - Name = "TelemetryDataSpin.edit" - }, - new - { - Id = 232, - Description = "Разрешение просматривать Данные телеметрии по SpinMaster", - Name = "TelemetryDataSpin.get" - }, - new - { - Id = 233, - Description = "Разрешение редактировать Скважины", - Name = "Well.edit" - }, - new - { - Id = 234, - Description = "Разрешение просматривать Скважины", - Name = "Well.get" - }, - new - { - Id = 235, - Description = "Разрешение редактировать Композитные скважины", - Name = "WellComposite.edit" - }, - new - { - Id = 236, - Description = "Разрешение просматривать Композитные скважины", - Name = "WellComposite.get" - }, - new - { - Id = 237, - Description = "Разрешение удалять Операции по скважинам", - Name = "WellOperation.delete" - }, - new - { - Id = 238, - Description = "Разрешение редактировать Операции по скважинам", - Name = "WellOperation.edit" - }, - new - { - Id = 239, - Description = "Разрешение просматривать Операции по скважинам", - Name = "WellOperation.get" - }, - new - { - Id = 240, - Description = "Разрешение редактировать Файлы категории 1 (Растворный сервис)", - Name = "File.edit1" - }, - new - { - Id = 241, - Description = "Разрешение редактировать Файлы категории 2 (Цементирование)", - Name = "File.edit2" - }, - new - { - Id = 242, - Description = "Разрешение редактировать Файлы категории 3 (ННБ)", - Name = "File.edit3" - }, - new - { - Id = 243, - Description = "Разрешение редактировать Файлы категории 4 (ГТИ)", - Name = "File.edit4" - }, - new - { - Id = 244, - Description = "Разрешение редактировать Файлы категории 5 (Документы по скважине)", - Name = "File.edit5" - }, - new - { - Id = 245, - Description = "Разрешение редактировать Файлы категории 6 (Супервайзер)", - Name = "File.edit6" - }, - new - { - Id = 246, - Description = "Разрешение редактировать Файлы категории 7 (Мастер)", - Name = "File.edit7" - }, - new - { - Id = 247, - Description = "Разрешение редактировать Файлы категории 8 (Долотный сервис)", - Name = "File.edit8" - }, - new - { - Id = 248, - Description = "Разрешение редактировать Файлы категории 9 (Буровой подрядчик)", - Name = "File.edit9" - }, - new - { - Id = 249, - Description = "Разрешение редактировать Файлы категории 10 (Сервис по заканчиванию скважины)", - Name = "File.edit10" - }, - new - { - Id = 250, - Description = "Разрешение редактировать Файлы категории 11 (Рапорт)", - Name = "File.edit11" - }, - new - { - Id = 251, - Description = "Разрешение редактировать Файлы категории 12", - Name = "File.edit12" - }, - new - { - Id = 252, - Description = "Разрешение редактировать Файлы категории 12", - Name = "File.edit13" - }, - new - { - Id = 253, - Description = "Разрешение редактировать Файлы категории 13", - Name = "File.edit14" - }, - new - { - Id = 254, - Description = "Разрешение редактировать Файлы категории 14", - Name = "File.edit15" - }, - new - { - Id = 255, - Description = "Разрешение редактировать Файлы категории 15", - Name = "File.edit16" - }, - new - { - Id = 256, - Description = "Разрешение редактировать Файлы категории 16", - Name = "File.edit17" - }, - new - { - Id = 257, - Description = "Разрешение редактировать Файлы категории 17", - Name = "File.edit18" - }, - new - { - Id = 258, - Description = "Разрешение редактировать Файлы категории 18", - Name = "File.edit19" - }, - new - { - Id = 259, - Description = "Разрешение редактировать Файлы категории 19", - Name = "File.edit20" - }, - new - { - Id = 260, - Description = "Разрешение редактировать Файлы категории 20", - Name = "File.edit21" - }, - new - { - Id = 261, - Description = "Разрешение редактировать Файлы категории 21", - Name = "File.edit22" - }, - new - { - Id = 262, - Description = "Разрешение редактировать Файлы категории 22", - Name = "File.edit23" - }, - new - { - Id = 263, - Description = "Разрешение редактировать Файлы категории 23", - Name = "File.edit24" - }, - new - { - Id = 264, - Description = "Разрешение редактировать Файлы категории 24", - Name = "File.edit25" - }, - new - { - Id = 265, - Description = "Разрешение редактировать Файлы категории 25", - Name = "File.edit26" - }, - new - { - Id = 266, - Description = "Разрешение редактировать Файлы категории 26", - Name = "File.edit27" - }, - new - { - Id = 267, - Description = "Разрешение редактировать Файлы категории 27", - Name = "File.edit28" - }, - new - { - Id = 268, - Description = "Разрешение редактировать Файлы категории 28", - Name = "File.edit29" - }, - new - { - Id = 269, - Description = "Разрешение редактировать Файлы категории 29", - Name = "File.edit30" - }, - new - { - Id = 380, - Description = "Разрешение просматривать список бурильщиков", - Name = "Driller.get" - }, - new - { - Id = 381, - Description = "Разрешение редактировать бурильщика", - Name = "Driller.edit" - }, - new - { - Id = 382, - Description = "Разрешение удалять бурильщик", - Name = "Driller.delete" - }, - new - { - Id = 383, - Description = "Разрешение просматривать графики бурильщиков", - Name = "Schedule.get" - }, - new - { - Id = 384, - Description = "Разрешение редактировать график бурильщика", - Name = "Schedule.edit" - }, - new - { - Id = 385, - Description = "Разрешение удалять график бурильщика", - Name = "Schedule.delete" - }, - new - { - Id = 386, - Description = "Разрешение просматривать суточный рапорт", - Name = "DailyReport.get" - }, - new - { - Id = 387, - Description = "Разрешение редактировать суточный рапорт", - Name = "DailyReport.edit" - }, - new - { - Id = 388, - Description = "Разрешение просматривать авто. определенные операции", - Name = "DetectedOperation.get" - }, - new - { - Id = 389, - Description = "Разрешение просматривать целевые значения", - Name = "OperationValue.get" - }, - new - { - Id = 390, - Description = "Разрешение редактировать целевые значения", - Name = "OperationValue.edit" - }, - new - { - Id = 391, - Description = "Разрешение удалять целевые значения", - Name = "OperationValue.delete" - }, - new - { - Id = 400, - Description = "Разрешение просматривать инфо по wits параметрам", - Name = "WitsInfo.get" - }, - new - { - Id = 401, - Description = "Разрешение просматривать WITS record 1", - Name = "WitsRecord1.get" - }, - new - { - Id = 407, - Description = "Разрешение просматривать WITS record 7", - Name = "WitsRecord7.get" - }, - new - { - Id = 408, - Description = "Разрешение просматривать WITS record 8", - Name = "WitsRecord8.get" - }, - new - { - Id = 450, - Description = "Разрешение просматривать WITS record 50", - Name = "WitsRecord50.get" - }, - new - { - Id = 460, - Description = "Разрешение просматривать WITS record 60", - Name = "WitsRecord60.get" - }, - new - { - Id = 461, - Description = "Разрешение просматривать WITS record 61", - Name = "WitsRecord61.get" - }, - new - { - Id = 500, - Description = "Разрешение удалять Категорий документов файлов", - Name = "FileCategory.delete" - }, - new - { - Id = 501, - Description = "Разрешение редактировать Категорий документов файлов", - Name = "FileCategory.edit" - }, - new - { - Id = 502, - Description = "Разрешение просматривать Категорий документов файлов", - Name = "FileCategory.get" - }, - new - { - Id = 503, - Description = "Разрешение удалять Дело скважины", - Name = "WellFinalDocuments.delete" - }, - new - { - Id = 504, - Description = "Разрешение редактировать Дело скважины", - Name = "WellFinalDocuments.edit" - }, - new - { - Id = 505, - Description = "Разрешение просматривать Дело скважины", - Name = "WellFinalDocuments.get" - }, - new - { - Id = 506, - Description = "Разрешение редактировать ответственных за загрузку файла Дело скважины", - Name = "WellFinalDocuments.editPublisher" - }, - new - { - Id = 507, - Description = "Разрешение просматривать наработка талевого каната", - Name = "TelemetryWirelineRunOut.get" - }, - new - { - Id = 510, - Description = "Разрешение просматривать плановая траектория", - Name = "PlannedTrajectory.get" - }, - new - { - Id = 511, - Description = "Разрешение редактировать плановая траектория", - Name = "PlannedTrajectory.edit" - }, - new - { - Id = 512, - Description = "Разрешение удалять плановая траектория", - Name = "PlannedTrajectory.delete" - }, - new - { - Id = 516, - Description = "Разрешение просматривать статистику вопросов", - Name = "FaqStatistics.get" - }, - new - { - Id = 517, - Description = "Разрешение редактировать вопрос", - Name = "FaqStatistics.edit" - }, - new - { - Id = 518, - Description = "Разрешение удалять вопрос", - Name = "FaqStatistics.delete" - }, - new - { - Id = 519, - Description = "Разрешение просматривать список контактов", - Name = "WellContact.get" - }, - new - { - Id = 520, - Description = "Разрешение редактировать список контактов", - Name = "WellContact.edit" - }, - new - { - Id = 521, - Description = "Разрешить создание справок по страницам", - Name = "HelpPage.edit" - }, - new - { - Id = 522, - Description = "Разрешить удаление всех настроек пользователя", - Name = "UserSettings.delete" - }, - new - { - Id = 523, - Description = "Разрешить редактирование инструкций", - Name = "Manual.edit" - }, - new - { - Id = 524, - Description = "Разрешить получение инструкций", - Name = "Manual.get" - }, - new - { - Id = 525, - Description = "Разрешение на редактирование РТК у завершенной скважины", - Name = "ProcessMap.editCompletedWell" - }, - new - { - Id = 526, - Description = "Разрешение на редактирование операций у завершенной скважины", - Name = "WellOperation.editCompletedWell" - }, - new - { - Id = 527, - Description = "Разрешение на удаление инструкций", - Name = "Manual.delete" - }, - new - { - Id = 528, - Description = "Разрешение на удаление контакта", - Name = "WellContact.delete" - }, - new - { - Id = 530, - Description = "Разрешение на редактирование плановой конструкции скважины", - Name = "WellSectionPlan.edit" - }, - new - { - Id = 531, - Description = "Разрешение на удаление плановой конструкции скважины", - Name = "WellSectionPlan.delete" - }); - }); + b.HasData( + new + { + Id = 100, + Description = "Разрешение удалять админ. Кусты", + Name = "AdminCluster.delete" + }, + new + { + Id = 101, + Description = "Разрешение редактировать админ. Кусты", + Name = "AdminCluster.edit" + }, + new + { + Id = 102, + Description = "Разрешение просматривать админ. Кусты", + Name = "AdminCluster.get" + }, + new + { + Id = 103, + Description = "Разрешение удалять админ. Компании", + Name = "AdminCompany.delete" + }, + new + { + Id = 104, + Description = "Разрешение редактировать админ. Компании", + Name = "AdminCompany.edit" + }, + new + { + Id = 105, + Description = "Разрешение просматривать админ. Компании", + Name = "AdminCompany.get" + }, + new + { + Id = 106, + Description = "Разрешение удалять админ. Типы компаний", + Name = "AdminCompanyType.delete" + }, + new + { + Id = 107, + Description = "Разрешение редактировать админ. Типы компаний", + Name = "AdminCompanyType.edit" + }, + new + { + Id = 108, + Description = "Разрешение просматривать админ. Типы компаний", + Name = "AdminCompanyType.get" + }, + new + { + Id = 109, + Description = "Разрешение удалять админ. Месторождения", + Name = "AdminDeposit.delete" + }, + new + { + Id = 110, + Description = "Разрешение редактировать админ. Месторождения", + Name = "AdminDeposit.edit" + }, + new + { + Id = 111, + Description = "Разрешение просматривать админ. Месторождения", + Name = "AdminDeposit.get" + }, + new + { + Id = 112, + Description = "Разрешение удалять админ. Разрешения", + Name = "AdminPermission.delete" + }, + new + { + Id = 113, + Description = "Разрешение редактировать админ. Разрешения", + Name = "AdminPermission.edit" + }, + new + { + Id = 114, + Description = "Разрешение просматривать админ. Разрешения", + Name = "AdminPermission.get" + }, + new + { + Id = 115, + Description = "Разрешение удалять админ. Телеметрию", + Name = "AdminTelemetry.delete" + }, + new + { + Id = 116, + Description = "Разрешение редактировать админ. Телеметрию", + Name = "AdminTelemetry.edit" + }, + new + { + Id = 117, + Description = "Разрешение просматривать админ. Телеметрию", + Name = "AdminTelemetry.get" + }, + new + { + Id = 118, + Description = "Разрешение удалять админ. Пользователей", + Name = "AdminUser.delete" + }, + new + { + Id = 119, + Description = "Разрешение редактировать админ. Пользователей", + Name = "AdminUser.edit" + }, + new + { + Id = 120, + Description = "Разрешение просматривать админ. Пользователей", + Name = "AdminUser.get" + }, + new + { + Id = 121, + Description = "Разрешение удалять админ. Роли пользователей", + Name = "AdminUserRole.delete" + }, + new + { + Id = 122, + Description = "Разрешение редактировать админ. Роли пользователей", + Name = "AdminUserRole.edit" + }, + new + { + Id = 123, + Description = "Разрешение просматривать админ. Роли пользователей", + Name = "AdminUserRole.get" + }, + new + { + Id = 124, + Description = "Разрешение удалять админ. Скважины", + Name = "AdminWell.delete" + }, + new + { + Id = 125, + Description = "Разрешение редактировать админ. Скважины", + Name = "AdminWell.edit" + }, + new + { + Id = 126, + Description = "Разрешение просматривать админ. Скважины", + Name = "AdminWell.get" + }, + new + { + Id = 127, + Description = "Разрешение удалять админ. Подсистемы", + Name = "AdminSubsytem.delete" + }, + new + { + Id = 128, + Description = "Разрешение редактировать админ. Подсистемы", + Name = "AdminSubsytem.edit" + }, + new + { + Id = 129, + Description = "Разрешение просматривать админ. Подсистемы", + Name = "AdminSubsytem.get" + }, + new + { + Id = 200, + Description = "Разрешение редактировать 0", + Name = "Auth.edit" + }, + new + { + Id = 201, + Description = "Разрешение просматривать 0", + Name = "Auth.get" + }, + new + { + Id = 202, + Description = "Разрешение просматривать Кусты", + Name = "Cluster.get" + }, + new + { + Id = 203, + Description = "Разрешение просматривать Месторождения", + Name = "Deposit.get" + }, + new + { + Id = 204, + Description = "Разрешение удалять РТК", + Name = "DrillFlowChart.delete" + }, + new + { + Id = 205, + Description = "Разрешение редактировать РТК", + Name = "DrillFlowChart.edit" + }, + new + { + Id = 206, + Description = "Разрешение просматривать РТК", + Name = "DrillFlowChart.get" + }, + new + { + Id = 207, + Description = "Разрешение удалять Программу бурения", + Name = "DrillingProgram.delete" + }, + new + { + Id = 208, + Description = "Разрешение редактировать Программу бурения", + Name = "DrillingProgram.edit" + }, + new + { + Id = 209, + Description = "Разрешение просматривать Программу бурения", + Name = "DrillingProgram.get" + }, + new + { + Id = 210, + Description = "Разрешение удалять Режимы бурения", + Name = "DrillParams.delete" + }, + new + { + Id = 211, + Description = "Разрешение редактировать Режимы бурения", + Name = "DrillParams.edit" + }, + new + { + Id = 212, + Description = "Разрешение просматривать Режимы бурения", + Name = "DrillParams.get" + }, + new + { + Id = 213, + Description = "Разрешение удалять Файлы", + Name = "File.delete" + }, + new + { + Id = 214, + Description = "Разрешение редактировать Файлы", + Name = "File.edit" + }, + new + { + Id = 215, + Description = "Разрешение просматривать Файлы", + Name = "File.get" + }, + new + { + Id = 216, + Description = "Разрешение удалять Измерения", + Name = "Measure.delete" + }, + new + { + Id = 217, + Description = "Разрешение редактировать Измерения", + Name = "Measure.edit" + }, + new + { + Id = 218, + Description = "Разрешение просматривать Измерения", + Name = "Measure.get" + }, + new + { + Id = 219, + Description = "Разрешение просматривать Сообщения телеметрии", + Name = "Message.get" + }, + new + { + Id = 220, + Description = "Разрешение просматривать Статистику по операциям", + Name = "OperationStat.get" + }, + new + { + Id = 221, + Description = "Разрешение редактировать Рапорта", + Name = "Report.edit" + }, + new + { + Id = 222, + Description = "Разрешение просматривать Рапорта", + Name = "Report.get" + }, + new + { + Id = 223, + Description = "Разрешение просматривать админ. Системная статистика", + Name = "RequestTracker.get" + }, + new + { + Id = 224, + Description = "Разрешение удалять Рекомендации уставок", + Name = "Setpoints.delete" + }, + new + { + Id = 225, + Description = "Разрешение редактировать Рекомендации уставок", + Name = "Setpoints.edit" + }, + new + { + Id = 226, + Description = "Разрешение просматривать Рекомендации уставок", + Name = "Setpoints.get" + }, + new + { + Id = 227, + Description = "Разрешение редактировать Телеметрии", + Name = "Telemetry.edit" + }, + new + { + Id = 228, + Description = "Разрешение просматривать Анализ телеметрии", + Name = "TelemetryAnalytics.get" + }, + new + { + Id = 229, + Description = "Разрешение редактировать Данные телеметрии по САУБ", + Name = "TelemetryDataSaub.edit" + }, + new + { + Id = 230, + Description = "Разрешение просматривать Данные телеметрии по САУБ", + Name = "TelemetryDataSaub.get" + }, + new + { + Id = 231, + Description = "Разрешение редактировать Данные телеметрии по SpinMaster", + Name = "TelemetryDataSpin.edit" + }, + new + { + Id = 232, + Description = "Разрешение просматривать Данные телеметрии по SpinMaster", + Name = "TelemetryDataSpin.get" + }, + new + { + Id = 233, + Description = "Разрешение редактировать Скважины", + Name = "Well.edit" + }, + new + { + Id = 234, + Description = "Разрешение просматривать Скважины", + Name = "Well.get" + }, + new + { + Id = 235, + Description = "Разрешение редактировать Композитные скважины", + Name = "WellComposite.edit" + }, + new + { + Id = 236, + Description = "Разрешение просматривать Композитные скважины", + Name = "WellComposite.get" + }, + new + { + Id = 237, + Description = "Разрешение удалять Операции по скважинам", + Name = "WellOperation.delete" + }, + new + { + Id = 238, + Description = "Разрешение редактировать Операции по скважинам", + Name = "WellOperation.edit" + }, + new + { + Id = 239, + Description = "Разрешение просматривать Операции по скважинам", + Name = "WellOperation.get" + }, + new + { + Id = 240, + Description = "Разрешение редактировать Файлы категории 1 (Растворный сервис)", + Name = "File.edit1" + }, + new + { + Id = 241, + Description = "Разрешение редактировать Файлы категории 2 (Цементирование)", + Name = "File.edit2" + }, + new + { + Id = 242, + Description = "Разрешение редактировать Файлы категории 3 (ННБ)", + Name = "File.edit3" + }, + new + { + Id = 243, + Description = "Разрешение редактировать Файлы категории 4 (ГТИ)", + Name = "File.edit4" + }, + new + { + Id = 244, + Description = "Разрешение редактировать Файлы категории 5 (Документы по скважине)", + Name = "File.edit5" + }, + new + { + Id = 245, + Description = "Разрешение редактировать Файлы категории 6 (Супервайзер)", + Name = "File.edit6" + }, + new + { + Id = 246, + Description = "Разрешение редактировать Файлы категории 7 (Мастер)", + Name = "File.edit7" + }, + new + { + Id = 247, + Description = "Разрешение редактировать Файлы категории 8 (Долотный сервис)", + Name = "File.edit8" + }, + new + { + Id = 248, + Description = "Разрешение редактировать Файлы категории 9 (Буровой подрядчик)", + Name = "File.edit9" + }, + new + { + Id = 249, + Description = "Разрешение редактировать Файлы категории 10 (Сервис по заканчиванию скважины)", + Name = "File.edit10" + }, + new + { + Id = 250, + Description = "Разрешение редактировать Файлы категории 11 (Рапорт)", + Name = "File.edit11" + }, + new + { + Id = 251, + Description = "Разрешение редактировать Файлы категории 12", + Name = "File.edit12" + }, + new + { + Id = 252, + Description = "Разрешение редактировать Файлы категории 12", + Name = "File.edit13" + }, + new + { + Id = 253, + Description = "Разрешение редактировать Файлы категории 13", + Name = "File.edit14" + }, + new + { + Id = 254, + Description = "Разрешение редактировать Файлы категории 14", + Name = "File.edit15" + }, + new + { + Id = 255, + Description = "Разрешение редактировать Файлы категории 15", + Name = "File.edit16" + }, + new + { + Id = 256, + Description = "Разрешение редактировать Файлы категории 16", + Name = "File.edit17" + }, + new + { + Id = 257, + Description = "Разрешение редактировать Файлы категории 17", + Name = "File.edit18" + }, + new + { + Id = 258, + Description = "Разрешение редактировать Файлы категории 18", + Name = "File.edit19" + }, + new + { + Id = 259, + Description = "Разрешение редактировать Файлы категории 19", + Name = "File.edit20" + }, + new + { + Id = 260, + Description = "Разрешение редактировать Файлы категории 20", + Name = "File.edit21" + }, + new + { + Id = 261, + Description = "Разрешение редактировать Файлы категории 21", + Name = "File.edit22" + }, + new + { + Id = 262, + Description = "Разрешение редактировать Файлы категории 22", + Name = "File.edit23" + }, + new + { + Id = 263, + Description = "Разрешение редактировать Файлы категории 23", + Name = "File.edit24" + }, + new + { + Id = 264, + Description = "Разрешение редактировать Файлы категории 24", + Name = "File.edit25" + }, + new + { + Id = 265, + Description = "Разрешение редактировать Файлы категории 25", + Name = "File.edit26" + }, + new + { + Id = 266, + Description = "Разрешение редактировать Файлы категории 26", + Name = "File.edit27" + }, + new + { + Id = 267, + Description = "Разрешение редактировать Файлы категории 27", + Name = "File.edit28" + }, + new + { + Id = 268, + Description = "Разрешение редактировать Файлы категории 28", + Name = "File.edit29" + }, + new + { + Id = 269, + Description = "Разрешение редактировать Файлы категории 29", + Name = "File.edit30" + }, + new + { + Id = 380, + Description = "Разрешение просматривать список бурильщиков", + Name = "Driller.get" + }, + new + { + Id = 381, + Description = "Разрешение редактировать бурильщика", + Name = "Driller.edit" + }, + new + { + Id = 382, + Description = "Разрешение удалять бурильщик", + Name = "Driller.delete" + }, + new + { + Id = 383, + Description = "Разрешение просматривать графики бурильщиков", + Name = "Schedule.get" + }, + new + { + Id = 384, + Description = "Разрешение редактировать график бурильщика", + Name = "Schedule.edit" + }, + new + { + Id = 385, + Description = "Разрешение удалять график бурильщика", + Name = "Schedule.delete" + }, + new + { + Id = 386, + Description = "Разрешение просматривать суточный рапорт", + Name = "DailyReport.get" + }, + new + { + Id = 387, + Description = "Разрешение редактировать суточный рапорт", + Name = "DailyReport.edit" + }, + new + { + Id = 388, + Description = "Разрешение просматривать авто. определенные операции", + Name = "DetectedOperation.get" + }, + new + { + Id = 389, + Description = "Разрешение просматривать целевые значения", + Name = "OperationValue.get" + }, + new + { + Id = 390, + Description = "Разрешение редактировать целевые значения", + Name = "OperationValue.edit" + }, + new + { + Id = 391, + Description = "Разрешение удалять целевые значения", + Name = "OperationValue.delete" + }, + new + { + Id = 400, + Description = "Разрешение просматривать инфо по wits параметрам", + Name = "WitsInfo.get" + }, + new + { + Id = 401, + Description = "Разрешение просматривать WITS record 1", + Name = "WitsRecord1.get" + }, + new + { + Id = 407, + Description = "Разрешение просматривать WITS record 7", + Name = "WitsRecord7.get" + }, + new + { + Id = 408, + Description = "Разрешение просматривать WITS record 8", + Name = "WitsRecord8.get" + }, + new + { + Id = 450, + Description = "Разрешение просматривать WITS record 50", + Name = "WitsRecord50.get" + }, + new + { + Id = 460, + Description = "Разрешение просматривать WITS record 60", + Name = "WitsRecord60.get" + }, + new + { + Id = 461, + Description = "Разрешение просматривать WITS record 61", + Name = "WitsRecord61.get" + }, + new + { + Id = 500, + Description = "Разрешение удалять Категорий документов файлов", + Name = "FileCategory.delete" + }, + new + { + Id = 501, + Description = "Разрешение редактировать Категорий документов файлов", + Name = "FileCategory.edit" + }, + new + { + Id = 502, + Description = "Разрешение просматривать Категорий документов файлов", + Name = "FileCategory.get" + }, + new + { + Id = 503, + Description = "Разрешение удалять Дело скважины", + Name = "WellFinalDocuments.delete" + }, + new + { + Id = 504, + Description = "Разрешение редактировать Дело скважины", + Name = "WellFinalDocuments.edit" + }, + new + { + Id = 505, + Description = "Разрешение просматривать Дело скважины", + Name = "WellFinalDocuments.get" + }, + new + { + Id = 506, + Description = "Разрешение редактировать ответственных за загрузку файла Дело скважины", + Name = "WellFinalDocuments.editPublisher" + }, + new + { + Id = 507, + Description = "Разрешение просматривать наработка талевого каната", + Name = "TelemetryWirelineRunOut.get" + }, + new + { + Id = 510, + Description = "Разрешение просматривать плановая траектория", + Name = "PlannedTrajectory.get" + }, + new + { + Id = 511, + Description = "Разрешение редактировать плановая траектория", + Name = "PlannedTrajectory.edit" + }, + new + { + Id = 512, + Description = "Разрешение удалять плановая траектория", + Name = "PlannedTrajectory.delete" + }, + new + { + Id = 516, + Description = "Разрешение просматривать статистику вопросов", + Name = "FaqStatistics.get" + }, + new + { + Id = 517, + Description = "Разрешение редактировать вопрос", + Name = "FaqStatistics.edit" + }, + new + { + Id = 518, + Description = "Разрешение удалять вопрос", + Name = "FaqStatistics.delete" + }, + new + { + Id = 519, + Description = "Разрешение просматривать список контактов", + Name = "WellContact.get" + }, + new + { + Id = 520, + Description = "Разрешение редактировать список контактов", + Name = "WellContact.edit" + }, + new + { + Id = 521, + Description = "Разрешить создание справок по страницам", + Name = "HelpPage.edit" + }, + new + { + Id = 522, + Description = "Разрешить удаление всех настроек пользователя", + Name = "UserSettings.delete" + }, + new + { + Id = 523, + Description = "Разрешить редактирование инструкций", + Name = "Manual.edit" + }, + new + { + Id = 524, + Description = "Разрешить получение инструкций", + Name = "Manual.get" + }, + new + { + Id = 525, + Description = "Разрешение на редактирование РТК у завершенной скважины", + Name = "ProcessMap.editCompletedWell" + }, + new + { + Id = 526, + Description = "Разрешение на редактирование операций у завершенной скважины", + Name = "WellOperation.editCompletedWell" + }, + new + { + Id = 527, + Description = "Разрешение на удаление инструкций", + Name = "Manual.delete" + }, + new + { + Id = 528, + Description = "Разрешение на удаление контакта", + Name = "WellContact.delete" + }, + new + { + Id = 530, + Description = "Разрешение на редактирование плановой конструкции скважины", + Name = "WellSectionPlan.edit" + }, + new + { + Id = 531, + Description = "Разрешение на удаление плановой конструкции скважины", + Name = "WellSectionPlan.delete" + }); + }); modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanDrilling", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AxialLoadLimitMax") - .HasColumnType("double precision") - .HasColumnName("axial_load_limit_max") - .HasComment("Осевая нагрузка, т, допустимый максимум"); + b.Property("AxialLoadLimitMax") + .HasColumnType("double precision") + .HasColumnName("axial_load_limit_max") + .HasComment("Осевая нагрузка, т, допустимый максимум"); - b.Property("AxialLoadPlan") - .HasColumnType("double precision") - .HasColumnName("axial_load_plan") - .HasComment("Осевая нагрузка, т, план"); + b.Property("AxialLoadPlan") + .HasColumnType("double precision") + .HasColumnName("axial_load_plan") + .HasComment("Осевая нагрузка, т, план"); - b.Property("Comment") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("comment") - .HasComment("Комментарий"); + b.Property("Comment") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)") + .HasColumnName("comment") + .HasComment("Комментарий"); - b.Property("Creation") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation") - .HasComment("дата создания"); + b.Property("Creation") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation") + .HasComment("дата создания"); - b.Property("DeltaPressureLimitMax") - .HasColumnType("double precision") - .HasColumnName("delta_pressure_limit_max") - .HasComment("Перепад давления, атм, допустимый максимум"); + b.Property("DeltaPressureLimitMax") + .HasColumnType("double precision") + .HasColumnName("delta_pressure_limit_max") + .HasComment("Перепад давления, атм, допустимый максимум"); - b.Property("DeltaPressurePlan") - .HasColumnType("double precision") - .HasColumnName("delta_pressure_plan") - .HasComment("Перепад давления, атм, план"); + b.Property("DeltaPressurePlan") + .HasColumnType("double precision") + .HasColumnName("delta_pressure_plan") + .HasComment("Перепад давления, атм, план"); - b.Property("DepthEnd") - .HasColumnType("double precision") - .HasColumnName("depth_end") - .HasComment("Глубина по стволу до, м"); + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина по стволу до, м"); - b.Property("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Глубина по стволу от, м"); + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина по стволу от, м"); - b.Property("FlowLimitMax") - .HasColumnType("double precision") - .HasColumnName("flow_limit_max") - .HasComment("Расход, л/с, допустимый максимум"); + b.Property("FlowLimitMax") + .HasColumnType("double precision") + .HasColumnName("flow_limit_max") + .HasComment("Расход, л/с, допустимый максимум"); - b.Property("FlowPlan") - .HasColumnType("double precision") - .HasColumnName("flow_plan") - .HasComment("Расход, л/с, план"); + b.Property("FlowPlan") + .HasColumnType("double precision") + .HasColumnName("flow_plan") + .HasComment("Расход, л/с, план"); - b.Property("IdAuthor") - .HasColumnType("integer") - .HasColumnName("id_author") - .HasComment("Автор"); + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Автор"); - b.Property("IdEditor") - .HasColumnType("integer") - .HasColumnName("id_editor") - .HasComment("Редактор"); + b.Property("IdEditor") + .HasColumnType("integer") + .HasColumnName("id_editor") + .HasComment("Редактор"); - b.Property("IdMode") - .HasColumnType("integer") - .HasColumnName("id_mode") - .HasComment("Id режима (1- ротор, 2 слайд)"); + b.Property("IdMode") + .HasColumnType("integer") + .HasColumnName("id_mode") + .HasComment("Id режима (1- ротор, 2 слайд)"); - b.Property("IdPrevious") - .HasColumnType("integer") - .HasColumnName("id_previous") - .HasComment("ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная"); + b.Property("IdPrevious") + .HasColumnType("integer") + .HasColumnName("id_previous") + .HasComment("ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная"); - b.Property("IdState") - .HasColumnType("integer") - .HasColumnName("id_state") - .HasComment("ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная"); + b.Property("IdState") + .HasColumnType("integer") + .HasColumnName("id_state") + .HasComment("ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("Id скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); - b.Property("IdWellSectionType") - .HasColumnType("integer") - .HasColumnName("id_wellsection_type") - .HasComment("Тип секции"); + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_wellsection_type") + .HasComment("Тип секции"); - b.Property("Obsolete") - .HasColumnType("timestamp with time zone") - .HasColumnName("obsolete") - .HasComment("дата устаревания"); + b.Property("Obsolete") + .HasColumnType("timestamp with time zone") + .HasColumnName("obsolete") + .HasComment("дата устаревания"); - b.Property("RopPlan") - .HasColumnType("double precision") - .HasColumnName("rop_plan") - .HasComment("Плановая механическая скорость, м/ч"); + b.Property("RopPlan") + .HasColumnType("double precision") + .HasColumnName("rop_plan") + .HasComment("Плановая механическая скорость, м/ч"); - b.Property("TopDriveSpeedLimitMax") - .HasColumnType("double precision") - .HasColumnName("top_drive_speed_limit_max") - .HasComment("Обороты на ВСП, допустимый максимум"); + b.Property("TopDriveSpeedLimitMax") + .HasColumnType("double precision") + .HasColumnName("top_drive_speed_limit_max") + .HasComment("Обороты на ВСП, допустимый максимум"); - b.Property("TopDriveSpeedPlan") - .HasColumnType("double precision") - .HasColumnName("top_drive_speed_plan") - .HasComment("Обороты на ВСП, план"); + b.Property("TopDriveSpeedPlan") + .HasColumnType("double precision") + .HasColumnName("top_drive_speed_plan") + .HasComment("Обороты на ВСП, план"); - b.Property("TopDriveTorqueLimitMax") - .HasColumnType("double precision") - .HasColumnName("top_drive_torque_limit_max") - .HasComment("Момент на ВСП, допустимый максимум"); + b.Property("TopDriveTorqueLimitMax") + .HasColumnType("double precision") + .HasColumnName("top_drive_torque_limit_max") + .HasComment("Момент на ВСП, допустимый максимум"); - b.Property("TopDriveTorquePlan") - .HasColumnType("double precision") - .HasColumnName("top_drive_torque_plan") - .HasComment("Момент на ВСП, план"); + b.Property("TopDriveTorquePlan") + .HasColumnType("double precision") + .HasColumnName("top_drive_torque_plan") + .HasComment("Момент на ВСП, план"); - b.Property("UsageSaub") - .HasColumnType("double precision") - .HasColumnName("usage_saub") - .HasComment("Плановый процент использования АКБ"); + b.Property("UsageSaub") + .HasColumnType("double precision") + .HasColumnName("usage_saub") + .HasComment("Плановый процент использования АКБ"); - b.Property("UsageSpin") - .HasColumnType("double precision") - .HasColumnName("usage_spin") - .HasComment("Плановый процент использования spin master"); + b.Property("UsageSpin") + .HasColumnType("double precision") + .HasColumnName("usage_spin") + .HasComment("Плановый процент использования spin master"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdAuthor"); + b.HasIndex("IdAuthor"); - b.HasIndex("IdEditor"); + b.HasIndex("IdEditor"); - b.HasIndex("IdPrevious"); + b.HasIndex("IdPrevious"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.HasIndex("IdWellSectionType"); + b.HasIndex("IdWellSectionType"); - b.ToTable("t_process_map_plan_drilling"); + b.ToTable("t_process_map_plan_drilling"); - b.HasComment("РТК план бурение"); - }); + b.HasComment("РТК план бурение"); + }); modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanReam", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Creation") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation") - .HasComment("дата создания"); + b.Property("Creation") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation") + .HasComment("дата создания"); - b.Property("DepthEnd") - .HasColumnType("double precision") - .HasColumnName("depth_end") - .HasComment("Глубина по стволу до, м"); + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина по стволу до, м"); - b.Property("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Глубина по стволу от, м"); + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина по стволу от, м"); - b.Property("IdAuthor") - .HasColumnType("integer") - .HasColumnName("id_author") - .HasComment("Автор"); + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Автор"); - b.Property("IdEditor") - .HasColumnType("integer") - .HasColumnName("id_editor") - .HasComment("Редактор"); + b.Property("IdEditor") + .HasColumnType("integer") + .HasColumnName("id_editor") + .HasComment("Редактор"); - b.Property("IdPrevious") - .HasColumnType("integer") - .HasColumnName("id_previous") - .HasComment("ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная"); + b.Property("IdPrevious") + .HasColumnType("integer") + .HasColumnName("id_previous") + .HasComment("ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная"); - b.Property("IdState") - .HasColumnType("integer") - .HasColumnName("id_state") - .HasComment("ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная"); + b.Property("IdState") + .HasColumnType("integer") + .HasColumnName("id_state") + .HasComment("ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("Id скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); - b.Property("IdWellSectionType") - .HasColumnType("integer") - .HasColumnName("id_wellsection_type") - .HasComment("Тип секции"); + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_wellsection_type") + .HasComment("Тип секции"); - b.Property("Obsolete") - .HasColumnType("timestamp with time zone") - .HasColumnName("obsolete") - .HasComment("дата устаревания"); + b.Property("Obsolete") + .HasColumnType("timestamp with time zone") + .HasColumnName("obsolete") + .HasComment("дата устаревания"); - b.Property("Pressure") - .HasColumnType("double precision") - .HasColumnName("pressure") - .HasComment("Давление, атм"); + b.Property("Pressure") + .HasColumnType("double precision") + .HasColumnName("pressure") + .HasComment("Давление, атм"); - b.Property("Repeats") - .HasColumnType("double precision") - .HasColumnName("repeats") - .HasComment("Количество повторений"); + b.Property("Repeats") + .HasColumnType("double precision") + .HasColumnName("repeats") + .HasComment("Количество повторений"); - b.Property("SetpointDrag") - .HasColumnType("double precision") - .HasColumnName("setpoint_drag") - .HasComment("Уставка зятяжки, т"); + b.Property("SetpointDrag") + .HasColumnType("double precision") + .HasColumnName("setpoint_drag") + .HasComment("Уставка зятяжки, т"); - b.Property("SetpointTight") - .HasColumnType("double precision") - .HasColumnName("setpoint_tight") - .HasComment("Уставка посадки, т"); + b.Property("SetpointTight") + .HasColumnType("double precision") + .HasColumnName("setpoint_tight") + .HasComment("Уставка посадки, т"); - b.Property("SpeedDownward") - .HasColumnType("double precision") - .HasColumnName("speed_downward") - .HasComment("Скорость спуска, м/ч"); + b.Property("SpeedDownward") + .HasColumnType("double precision") + .HasColumnName("speed_downward") + .HasComment("Скорость спуска, м/ч"); - b.Property("SpeedUpward") - .HasColumnType("double precision") - .HasColumnName("speed_upward") - .HasComment("Скорость подъёма, м/ч"); + b.Property("SpeedUpward") + .HasColumnType("double precision") + .HasColumnName("speed_upward") + .HasComment("Скорость подъёма, м/ч"); - b.Property("SpinDownward") - .HasColumnType("double precision") - .HasColumnName("spin_downward") - .HasComment("Вращение при движении вниз, об/мин"); + b.Property("SpinDownward") + .HasColumnType("double precision") + .HasColumnName("spin_downward") + .HasComment("Вращение при движении вниз, об/мин"); - b.Property("SpinUpward") - .HasColumnType("double precision") - .HasColumnName("spin_upward") - .HasComment("Вращение при движении вверх, об/мин"); + b.Property("SpinUpward") + .HasColumnType("double precision") + .HasColumnName("spin_upward") + .HasComment("Вращение при движении вверх, об/мин"); - b.Property("Torque") - .HasColumnType("double precision") - .HasColumnName("torque") - .HasComment("Момент, кН*м"); + b.Property("Torque") + .HasColumnType("double precision") + .HasColumnName("torque") + .HasComment("Момент, кН*м"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdAuthor"); + b.HasIndex("IdAuthor"); - b.HasIndex("IdEditor"); + b.HasIndex("IdEditor"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.HasIndex("IdWellSectionType"); + b.HasIndex("IdWellSectionType"); - b.ToTable("t_process_map_plan_ream"); + b.ToTable("t_process_map_plan_ream"); - b.HasComment("РТК проработка скважины"); - }); + b.HasComment("РТК проработка скважины"); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b => - { - b.Property("IdCompany") - .HasColumnType("integer") - .HasColumnName("id_company"); + { + b.Property("IdCompany") + .HasColumnType("integer") + .HasColumnName("id_company"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); - b.HasKey("IdCompany", "IdWell"); + b.HasKey("IdCompany", "IdWell"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.ToTable("t_relation_company_well"); + b.ToTable("t_relation_company_well"); - b.HasComment("отношение скважин и компаний"); - }); + b.HasComment("отношение скважин и компаний"); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationContactWell", b => - { - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well"); + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); - b.HasKey("IdWell", "IdUser"); + b.HasKey("IdWell", "IdUser"); - b.HasIndex("IdUser"); + b.HasIndex("IdUser"); - b.ToTable("t_relation_contact_well"); - }); + b.ToTable("t_relation_contact_well"); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationUserDrillingProgramPart", b => - { - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); - b.Property("IdDrillingProgramPart") - .HasColumnType("integer") - .HasColumnName("id_drilling_program_part"); + b.Property("IdDrillingProgramPart") + .HasColumnType("integer") + .HasColumnName("id_drilling_program_part"); - b.Property("IdUserRole") - .HasColumnType("integer") - .HasColumnName("id_role") - .HasComment("1 - publisher, 2 - approver"); + b.Property("IdUserRole") + .HasColumnType("integer") + .HasColumnName("id_role") + .HasComment("1 - publisher, 2 - approver"); - b.HasKey("IdUser", "IdDrillingProgramPart") - .HasName("t_relation_user_drilling_program_part_pk"); + b.HasKey("IdUser", "IdDrillingProgramPart") + .HasName("t_relation_user_drilling_program_part_pk"); - b.HasIndex("IdDrillingProgramPart"); + b.HasIndex("IdDrillingProgramPart"); - b.ToTable("t_relation_user_drilling_program_part"); + b.ToTable("t_relation_user_drilling_program_part"); - b.HasComment("Отношение пользователей и частей ПБ"); - }); + b.HasComment("Отношение пользователей и частей ПБ"); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationUserRolePermission", b => - { - b.Property("IdUserRole") - .HasColumnType("integer") - .HasColumnName("id_user_role"); + { + b.Property("IdUserRole") + .HasColumnType("integer") + .HasColumnName("id_user_role"); - b.Property("IdPermission") - .HasColumnType("integer") - .HasColumnName("id_permission"); + b.Property("IdPermission") + .HasColumnType("integer") + .HasColumnName("id_permission"); - b.HasKey("IdUserRole", "IdPermission"); + b.HasKey("IdUserRole", "IdPermission"); - b.HasIndex("IdPermission"); + b.HasIndex("IdPermission"); - b.ToTable("t_relation_user_role_permission"); + b.ToTable("t_relation_user_role_permission"); - b.HasComment("Отношение ролей пользователей и разрешений доступа"); + b.HasComment("Отношение ролей пользователей и разрешений доступа"); - b.HasData( - new - { - IdUserRole = 1100, - IdPermission = 102 - }, - new - { - IdUserRole = 1100, - IdPermission = 111 - }, - new - { - IdUserRole = 1101, - IdPermission = 101 - }, - new - { - IdUserRole = 1101, - IdPermission = 100 - }, - new - { - IdUserRole = 1102, - IdPermission = 105 - }, - new - { - IdUserRole = 1102, - IdPermission = 108 - }, - new - { - IdUserRole = 1103, - IdPermission = 104 - }, - new - { - IdUserRole = 1103, - IdPermission = 103 - }, - new - { - IdUserRole = 1104, - IdPermission = 108 - }, - new - { - IdUserRole = 1105, - IdPermission = 107 - }, - new - { - IdUserRole = 1105, - IdPermission = 106 - }, - new - { - IdUserRole = 1106, - IdPermission = 111 - }, - new - { - IdUserRole = 1107, - IdPermission = 110 - }, - new - { - IdUserRole = 1107, - IdPermission = 109 - }, - new - { - IdUserRole = 1108, - IdPermission = 114 - }, - new - { - IdUserRole = 1109, - IdPermission = 113 - }, - new - { - IdUserRole = 1109, - IdPermission = 112 - }, - new - { - IdUserRole = 1110, - IdPermission = 123 - }, - new - { - IdUserRole = 1110, - IdPermission = 114 - }, - new - { - IdUserRole = 1111, - IdPermission = 122 - }, - new - { - IdUserRole = 1111, - IdPermission = 121 - }, - new - { - IdUserRole = 1112, - IdPermission = 117 - }, - new - { - IdUserRole = 1113, - IdPermission = 105 - }, - new - { - IdUserRole = 1113, - IdPermission = 123 - }, - new - { - IdUserRole = 1113, - IdPermission = 120 - }, - new - { - IdUserRole = 1114, - IdPermission = 119 - }, - new - { - IdUserRole = 1114, - IdPermission = 118 - }, - new - { - IdUserRole = 1114, - IdPermission = 200 - }, - new - { - IdUserRole = 1115, - IdPermission = 223 - }, - new - { - IdUserRole = 1116, - IdPermission = 105 - }, - new - { - IdUserRole = 1116, - IdPermission = 102 - }, - new - { - IdUserRole = 1116, - IdPermission = 117 - }, - new - { - IdUserRole = 1116, - IdPermission = 126 - }, - new - { - IdUserRole = 1117, - IdPermission = 125 - }, - new - { - IdUserRole = 1117, - IdPermission = 124 - }, - new - { - IdUserRole = 1200, - IdPermission = 203 - }, - new - { - IdUserRole = 1200, - IdPermission = 230 - }, - new - { - IdUserRole = 1201, - IdPermission = 202 - }, - new - { - IdUserRole = 1201, - IdPermission = 203 - }, - new - { - IdUserRole = 1201, - IdPermission = 220 - }, - new - { - IdUserRole = 1202, - IdPermission = 203 - }, - new - { - IdUserRole = 1202, - IdPermission = 220 - }, - new - { - IdUserRole = 1202, - IdPermission = 236 - }, - new - { - IdUserRole = 1202, - IdPermission = 212 - }, - new - { - IdUserRole = 1203, - IdPermission = 235 - }, - new - { - IdUserRole = 1204, - IdPermission = 202 - }, - new - { - IdUserRole = 1204, - IdPermission = 203 - }, - new - { - IdUserRole = 1205, - IdPermission = 215 - }, - new - { - IdUserRole = 1206, - IdPermission = 203 - }, - new - { - IdUserRole = 1206, - IdPermission = 206 - }, - new - { - IdUserRole = 1207, - IdPermission = 205 - }, - new - { - IdUserRole = 1208, - IdPermission = 218 - }, - new - { - IdUserRole = 1209, - IdPermission = 217 - }, - new - { - IdUserRole = 1210, - IdPermission = 203 - }, - new - { - IdUserRole = 1210, - IdPermission = 230 - }, - new - { - IdUserRole = 1210, - IdPermission = 219 - }, - new - { - IdUserRole = 1211, - IdPermission = 203 - }, - new - { - IdUserRole = 1211, - IdPermission = 220 - }, - new - { - IdUserRole = 1211, - IdPermission = 239 - }, - new - { - IdUserRole = 1212, - IdPermission = 238 - }, - new - { - IdUserRole = 1212, - IdPermission = 237 - }, - new - { - IdUserRole = 1213, - IdPermission = 203 - }, - new - { - IdUserRole = 1213, - IdPermission = 239 - }, - new - { - IdUserRole = 1213, - IdPermission = 212 - }, - new - { - IdUserRole = 1214, - IdPermission = 211 - }, - new - { - IdUserRole = 1214, - IdPermission = 210 - }, - new - { - IdUserRole = 1215, - IdPermission = 203 - }, - new - { - IdUserRole = 1215, - IdPermission = 222 - }, - new - { - IdUserRole = 1216, - IdPermission = 221 - }, - new - { - IdUserRole = 1217, - IdPermission = 226 - }, - new - { - IdUserRole = 1218, - IdPermission = 225 - }, - new - { - IdUserRole = 1218, - IdPermission = 224 - }, - new - { - IdUserRole = 1219, - IdPermission = 203 - }, - new - { - IdUserRole = 1219, - IdPermission = 206 - }, - new - { - IdUserRole = 1219, - IdPermission = 230 - }, - new - { - IdUserRole = 1219, - IdPermission = 232 - }, - new - { - IdUserRole = 1220, - IdPermission = 203 - }, - new - { - IdUserRole = 1220, - IdPermission = 228 - }, - new - { - IdUserRole = 1221, - IdPermission = 202 - }, - new - { - IdUserRole = 1221, - IdPermission = 203 - }, - new - { - IdUserRole = 1221, - IdPermission = 220 - }, - new - { - IdUserRole = 1221, - IdPermission = 234 - }, - new - { - IdUserRole = 1500, - IdPermission = 507 - }, - new - { - IdUserRole = 1500, - IdPermission = 510 - }, - new - { - IdUserRole = 1501, - IdPermission = 214 - }, - new - { - IdUserRole = 1501, - IdPermission = 213 - }, - new - { - IdUserRole = 1502, - IdPermission = 207 - }, - new - { - IdUserRole = 1502, - IdPermission = 208 - }, - new - { - IdUserRole = 2000, - IdPermission = 205 - }, - new - { - IdUserRole = 2000, - IdPermission = 204 - }, - new - { - IdUserRole = 2000, - IdPermission = 245 - }, - new - { - IdUserRole = 2001, - IdPermission = 244 - }, - new - { - IdUserRole = 2001, - IdPermission = 245 - }, - new - { - IdUserRole = 2002, - IdPermission = 244 - }, - new - { - IdUserRole = 2002, - IdPermission = 246 - }, - new - { - IdUserRole = 2002, - IdPermission = 237 - }, - new - { - IdUserRole = 2002, - IdPermission = 238 - }, - new - { - IdUserRole = 2003, - IdPermission = 240 - }, - new - { - IdUserRole = 2003, - IdPermission = 217 - }, - new - { - IdUserRole = 2003, - IdPermission = 216 - }, - new - { - IdUserRole = 2004, - IdPermission = 242 - }, - new - { - IdUserRole = 2004, - IdPermission = 217 - }, - new - { - IdUserRole = 2004, - IdPermission = 216 - }, - new - { - IdUserRole = 2004, - IdPermission = 205 - }, - new - { - IdUserRole = 2004, - IdPermission = 204 - }, - new - { - IdUserRole = 2005, - IdPermission = 247 - }, - new - { - IdUserRole = 2005, - IdPermission = 205 - }, - new - { - IdUserRole = 2005, - IdPermission = 204 - }, - new - { - IdUserRole = 2006, - IdPermission = 243 - }, - new - { - IdUserRole = 2006, - IdPermission = 205 - }, - new - { - IdUserRole = 2006, - IdPermission = 204 - }, - new - { - IdUserRole = 2007, - IdPermission = 241 - }, - new - { - IdUserRole = 2007, - IdPermission = 205 - }, - new - { - IdUserRole = 2007, - IdPermission = 204 - }, - new - { - IdUserRole = 1, - IdPermission = 100 - }, - new - { - IdUserRole = 1, - IdPermission = 101 - }, - new - { - IdUserRole = 1, - IdPermission = 102 - }, - new - { - IdUserRole = 1, - IdPermission = 103 - }, - new - { - IdUserRole = 1, - IdPermission = 104 - }, - new - { - IdUserRole = 1, - IdPermission = 105 - }, - new - { - IdUserRole = 1, - IdPermission = 106 - }, - new - { - IdUserRole = 1, - IdPermission = 107 - }, - new - { - IdUserRole = 1, - IdPermission = 108 - }, - new - { - IdUserRole = 1, - IdPermission = 109 - }, - new - { - IdUserRole = 1, - IdPermission = 110 - }, - new - { - IdUserRole = 1, - IdPermission = 111 - }, - new - { - IdUserRole = 1, - IdPermission = 112 - }, - new - { - IdUserRole = 1, - IdPermission = 113 - }, - new - { - IdUserRole = 1, - IdPermission = 114 - }, - new - { - IdUserRole = 1, - IdPermission = 115 - }, - new - { - IdUserRole = 1, - IdPermission = 116 - }, - new - { - IdUserRole = 1, - IdPermission = 117 - }, - new - { - IdUserRole = 1, - IdPermission = 118 - }, - new - { - IdUserRole = 1, - IdPermission = 119 - }, - new - { - IdUserRole = 1, - IdPermission = 120 - }, - new - { - IdUserRole = 1, - IdPermission = 121 - }, - new - { - IdUserRole = 1, - IdPermission = 122 - }, - new - { - IdUserRole = 1, - IdPermission = 123 - }, - new - { - IdUserRole = 1, - IdPermission = 124 - }, - new - { - IdUserRole = 1, - IdPermission = 125 - }, - new - { - IdUserRole = 1, - IdPermission = 126 - }, - new - { - IdUserRole = 1, - IdPermission = 127 - }, - new - { - IdUserRole = 1, - IdPermission = 128 - }, - new - { - IdUserRole = 1, - IdPermission = 129 - }, - new - { - IdUserRole = 1, - IdPermission = 200 - }, - new - { - IdUserRole = 1, - IdPermission = 201 - }, - new - { - IdUserRole = 1, - IdPermission = 202 - }, - new - { - IdUserRole = 1, - IdPermission = 203 - }, - new - { - IdUserRole = 1, - IdPermission = 204 - }, - new - { - IdUserRole = 1, - IdPermission = 205 - }, - new - { - IdUserRole = 1, - IdPermission = 206 - }, - new - { - IdUserRole = 1, - IdPermission = 207 - }, - new - { - IdUserRole = 1, - IdPermission = 208 - }, - new - { - IdUserRole = 1, - IdPermission = 209 - }, - new - { - IdUserRole = 1, - IdPermission = 210 - }, - new - { - IdUserRole = 1, - IdPermission = 211 - }, - new - { - IdUserRole = 1, - IdPermission = 212 - }, - new - { - IdUserRole = 1, - IdPermission = 213 - }, - new - { - IdUserRole = 1, - IdPermission = 214 - }, - new - { - IdUserRole = 1, - IdPermission = 215 - }, - new - { - IdUserRole = 1, - IdPermission = 216 - }, - new - { - IdUserRole = 1, - IdPermission = 217 - }, - new - { - IdUserRole = 1, - IdPermission = 218 - }, - new - { - IdUserRole = 1, - IdPermission = 219 - }, - new - { - IdUserRole = 1, - IdPermission = 220 - }, - new - { - IdUserRole = 1, - IdPermission = 221 - }, - new - { - IdUserRole = 1, - IdPermission = 222 - }, - new - { - IdUserRole = 1, - IdPermission = 223 - }, - new - { - IdUserRole = 1, - IdPermission = 224 - }, - new - { - IdUserRole = 1, - IdPermission = 225 - }, - new - { - IdUserRole = 1, - IdPermission = 226 - }, - new - { - IdUserRole = 1, - IdPermission = 227 - }, - new - { - IdUserRole = 1, - IdPermission = 228 - }, - new - { - IdUserRole = 1, - IdPermission = 229 - }, - new - { - IdUserRole = 1, - IdPermission = 230 - }, - new - { - IdUserRole = 1, - IdPermission = 231 - }, - new - { - IdUserRole = 1, - IdPermission = 232 - }, - new - { - IdUserRole = 1, - IdPermission = 233 - }, - new - { - IdUserRole = 1, - IdPermission = 234 - }, - new - { - IdUserRole = 1, - IdPermission = 235 - }, - new - { - IdUserRole = 1, - IdPermission = 236 - }, - new - { - IdUserRole = 1, - IdPermission = 237 - }, - new - { - IdUserRole = 1, - IdPermission = 238 - }, - new - { - IdUserRole = 1, - IdPermission = 239 - }, - new - { - IdUserRole = 1, - IdPermission = 240 - }, - new - { - IdUserRole = 1, - IdPermission = 241 - }, - new - { - IdUserRole = 1, - IdPermission = 242 - }, - new - { - IdUserRole = 1, - IdPermission = 243 - }, - new - { - IdUserRole = 1, - IdPermission = 244 - }, - new - { - IdUserRole = 1, - IdPermission = 245 - }, - new - { - IdUserRole = 1, - IdPermission = 246 - }, - new - { - IdUserRole = 1, - IdPermission = 247 - }, - new - { - IdUserRole = 1, - IdPermission = 248 - }, - new - { - IdUserRole = 1, - IdPermission = 249 - }, - new - { - IdUserRole = 1, - IdPermission = 250 - }, - new - { - IdUserRole = 1, - IdPermission = 251 - }, - new - { - IdUserRole = 1, - IdPermission = 252 - }, - new - { - IdUserRole = 1, - IdPermission = 253 - }, - new - { - IdUserRole = 1, - IdPermission = 254 - }, - new - { - IdUserRole = 1, - IdPermission = 255 - }, - new - { - IdUserRole = 1, - IdPermission = 256 - }, - new - { - IdUserRole = 1, - IdPermission = 257 - }, - new - { - IdUserRole = 1, - IdPermission = 258 - }, - new - { - IdUserRole = 1, - IdPermission = 259 - }, - new - { - IdUserRole = 1, - IdPermission = 260 - }, - new - { - IdUserRole = 1, - IdPermission = 261 - }, - new - { - IdUserRole = 1, - IdPermission = 262 - }, - new - { - IdUserRole = 1, - IdPermission = 263 - }, - new - { - IdUserRole = 1, - IdPermission = 264 - }, - new - { - IdUserRole = 1, - IdPermission = 265 - }, - new - { - IdUserRole = 1, - IdPermission = 266 - }, - new - { - IdUserRole = 1, - IdPermission = 267 - }, - new - { - IdUserRole = 1, - IdPermission = 268 - }, - new - { - IdUserRole = 1, - IdPermission = 269 - }, - new - { - IdUserRole = 1, - IdPermission = 380 - }, - new - { - IdUserRole = 1, - IdPermission = 381 - }, - new - { - IdUserRole = 1, - IdPermission = 382 - }, - new - { - IdUserRole = 1, - IdPermission = 383 - }, - new - { - IdUserRole = 1, - IdPermission = 384 - }, - new - { - IdUserRole = 1, - IdPermission = 385 - }, - new - { - IdUserRole = 1, - IdPermission = 386 - }, - new - { - IdUserRole = 1, - IdPermission = 387 - }, - new - { - IdUserRole = 1, - IdPermission = 388 - }, - new - { - IdUserRole = 1, - IdPermission = 389 - }, - new - { - IdUserRole = 1, - IdPermission = 390 - }, - new - { - IdUserRole = 1, - IdPermission = 391 - }, - new - { - IdUserRole = 1, - IdPermission = 400 - }, - new - { - IdUserRole = 1, - IdPermission = 401 - }, - new - { - IdUserRole = 1, - IdPermission = 407 - }, - new - { - IdUserRole = 1, - IdPermission = 408 - }, - new - { - IdUserRole = 1, - IdPermission = 450 - }, - new - { - IdUserRole = 1, - IdPermission = 460 - }, - new - { - IdUserRole = 1, - IdPermission = 461 - }, - new - { - IdUserRole = 1, - IdPermission = 500 - }, - new - { - IdUserRole = 1, - IdPermission = 501 - }, - new - { - IdUserRole = 1, - IdPermission = 502 - }, - new - { - IdUserRole = 1, - IdPermission = 503 - }, - new - { - IdUserRole = 1, - IdPermission = 504 - }, - new - { - IdUserRole = 1, - IdPermission = 505 - }, - new - { - IdUserRole = 1, - IdPermission = 506 - }, - new - { - IdUserRole = 1, - IdPermission = 507 - }, - new - { - IdUserRole = 1, - IdPermission = 510 - }, - new - { - IdUserRole = 1, - IdPermission = 511 - }, - new - { - IdUserRole = 1, - IdPermission = 512 - }, - new - { - IdUserRole = 1, - IdPermission = 516 - }, - new - { - IdUserRole = 1, - IdPermission = 517 - }, - new - { - IdUserRole = 1, - IdPermission = 518 - }, - new - { - IdUserRole = 1, - IdPermission = 519 - }, - new - { - IdUserRole = 1, - IdPermission = 520 - }, - new - { - IdUserRole = 1, - IdPermission = 521 - }, - new - { - IdUserRole = 1, - IdPermission = 522 - }, - new - { - IdUserRole = 1, - IdPermission = 523 - }, - new - { - IdUserRole = 1, - IdPermission = 524 - }, - new - { - IdUserRole = 1, - IdPermission = 525 - }, - new - { - IdUserRole = 1, - IdPermission = 526 - }, - new - { - IdUserRole = 1, - IdPermission = 527 - }, - new - { - IdUserRole = 1, - IdPermission = 528 - }, - new - { - IdUserRole = 1, - IdPermission = 530 - }, - new - { - IdUserRole = 1, - IdPermission = 531 - }); - }); + b.HasData( + new + { + IdUserRole = 1100, + IdPermission = 102 + }, + new + { + IdUserRole = 1100, + IdPermission = 111 + }, + new + { + IdUserRole = 1101, + IdPermission = 101 + }, + new + { + IdUserRole = 1101, + IdPermission = 100 + }, + new + { + IdUserRole = 1102, + IdPermission = 105 + }, + new + { + IdUserRole = 1102, + IdPermission = 108 + }, + new + { + IdUserRole = 1103, + IdPermission = 104 + }, + new + { + IdUserRole = 1103, + IdPermission = 103 + }, + new + { + IdUserRole = 1104, + IdPermission = 108 + }, + new + { + IdUserRole = 1105, + IdPermission = 107 + }, + new + { + IdUserRole = 1105, + IdPermission = 106 + }, + new + { + IdUserRole = 1106, + IdPermission = 111 + }, + new + { + IdUserRole = 1107, + IdPermission = 110 + }, + new + { + IdUserRole = 1107, + IdPermission = 109 + }, + new + { + IdUserRole = 1108, + IdPermission = 114 + }, + new + { + IdUserRole = 1109, + IdPermission = 113 + }, + new + { + IdUserRole = 1109, + IdPermission = 112 + }, + new + { + IdUserRole = 1110, + IdPermission = 123 + }, + new + { + IdUserRole = 1110, + IdPermission = 114 + }, + new + { + IdUserRole = 1111, + IdPermission = 122 + }, + new + { + IdUserRole = 1111, + IdPermission = 121 + }, + new + { + IdUserRole = 1112, + IdPermission = 117 + }, + new + { + IdUserRole = 1113, + IdPermission = 105 + }, + new + { + IdUserRole = 1113, + IdPermission = 123 + }, + new + { + IdUserRole = 1113, + IdPermission = 120 + }, + new + { + IdUserRole = 1114, + IdPermission = 119 + }, + new + { + IdUserRole = 1114, + IdPermission = 118 + }, + new + { + IdUserRole = 1114, + IdPermission = 200 + }, + new + { + IdUserRole = 1115, + IdPermission = 223 + }, + new + { + IdUserRole = 1116, + IdPermission = 105 + }, + new + { + IdUserRole = 1116, + IdPermission = 102 + }, + new + { + IdUserRole = 1116, + IdPermission = 117 + }, + new + { + IdUserRole = 1116, + IdPermission = 126 + }, + new + { + IdUserRole = 1117, + IdPermission = 125 + }, + new + { + IdUserRole = 1117, + IdPermission = 124 + }, + new + { + IdUserRole = 1200, + IdPermission = 203 + }, + new + { + IdUserRole = 1200, + IdPermission = 230 + }, + new + { + IdUserRole = 1201, + IdPermission = 202 + }, + new + { + IdUserRole = 1201, + IdPermission = 203 + }, + new + { + IdUserRole = 1201, + IdPermission = 220 + }, + new + { + IdUserRole = 1202, + IdPermission = 203 + }, + new + { + IdUserRole = 1202, + IdPermission = 220 + }, + new + { + IdUserRole = 1202, + IdPermission = 236 + }, + new + { + IdUserRole = 1202, + IdPermission = 212 + }, + new + { + IdUserRole = 1203, + IdPermission = 235 + }, + new + { + IdUserRole = 1204, + IdPermission = 202 + }, + new + { + IdUserRole = 1204, + IdPermission = 203 + }, + new + { + IdUserRole = 1205, + IdPermission = 215 + }, + new + { + IdUserRole = 1206, + IdPermission = 203 + }, + new + { + IdUserRole = 1206, + IdPermission = 206 + }, + new + { + IdUserRole = 1207, + IdPermission = 205 + }, + new + { + IdUserRole = 1208, + IdPermission = 218 + }, + new + { + IdUserRole = 1209, + IdPermission = 217 + }, + new + { + IdUserRole = 1210, + IdPermission = 203 + }, + new + { + IdUserRole = 1210, + IdPermission = 230 + }, + new + { + IdUserRole = 1210, + IdPermission = 219 + }, + new + { + IdUserRole = 1211, + IdPermission = 203 + }, + new + { + IdUserRole = 1211, + IdPermission = 220 + }, + new + { + IdUserRole = 1211, + IdPermission = 239 + }, + new + { + IdUserRole = 1212, + IdPermission = 238 + }, + new + { + IdUserRole = 1212, + IdPermission = 237 + }, + new + { + IdUserRole = 1213, + IdPermission = 203 + }, + new + { + IdUserRole = 1213, + IdPermission = 239 + }, + new + { + IdUserRole = 1213, + IdPermission = 212 + }, + new + { + IdUserRole = 1214, + IdPermission = 211 + }, + new + { + IdUserRole = 1214, + IdPermission = 210 + }, + new + { + IdUserRole = 1215, + IdPermission = 203 + }, + new + { + IdUserRole = 1215, + IdPermission = 222 + }, + new + { + IdUserRole = 1216, + IdPermission = 221 + }, + new + { + IdUserRole = 1217, + IdPermission = 226 + }, + new + { + IdUserRole = 1218, + IdPermission = 225 + }, + new + { + IdUserRole = 1218, + IdPermission = 224 + }, + new + { + IdUserRole = 1219, + IdPermission = 203 + }, + new + { + IdUserRole = 1219, + IdPermission = 206 + }, + new + { + IdUserRole = 1219, + IdPermission = 230 + }, + new + { + IdUserRole = 1219, + IdPermission = 232 + }, + new + { + IdUserRole = 1220, + IdPermission = 203 + }, + new + { + IdUserRole = 1220, + IdPermission = 228 + }, + new + { + IdUserRole = 1221, + IdPermission = 202 + }, + new + { + IdUserRole = 1221, + IdPermission = 203 + }, + new + { + IdUserRole = 1221, + IdPermission = 220 + }, + new + { + IdUserRole = 1221, + IdPermission = 234 + }, + new + { + IdUserRole = 1500, + IdPermission = 507 + }, + new + { + IdUserRole = 1500, + IdPermission = 510 + }, + new + { + IdUserRole = 1501, + IdPermission = 214 + }, + new + { + IdUserRole = 1501, + IdPermission = 213 + }, + new + { + IdUserRole = 1502, + IdPermission = 207 + }, + new + { + IdUserRole = 1502, + IdPermission = 208 + }, + new + { + IdUserRole = 2000, + IdPermission = 205 + }, + new + { + IdUserRole = 2000, + IdPermission = 204 + }, + new + { + IdUserRole = 2000, + IdPermission = 245 + }, + new + { + IdUserRole = 2001, + IdPermission = 244 + }, + new + { + IdUserRole = 2001, + IdPermission = 245 + }, + new + { + IdUserRole = 2002, + IdPermission = 244 + }, + new + { + IdUserRole = 2002, + IdPermission = 246 + }, + new + { + IdUserRole = 2002, + IdPermission = 237 + }, + new + { + IdUserRole = 2002, + IdPermission = 238 + }, + new + { + IdUserRole = 2003, + IdPermission = 240 + }, + new + { + IdUserRole = 2003, + IdPermission = 217 + }, + new + { + IdUserRole = 2003, + IdPermission = 216 + }, + new + { + IdUserRole = 2004, + IdPermission = 242 + }, + new + { + IdUserRole = 2004, + IdPermission = 217 + }, + new + { + IdUserRole = 2004, + IdPermission = 216 + }, + new + { + IdUserRole = 2004, + IdPermission = 205 + }, + new + { + IdUserRole = 2004, + IdPermission = 204 + }, + new + { + IdUserRole = 2005, + IdPermission = 247 + }, + new + { + IdUserRole = 2005, + IdPermission = 205 + }, + new + { + IdUserRole = 2005, + IdPermission = 204 + }, + new + { + IdUserRole = 2006, + IdPermission = 243 + }, + new + { + IdUserRole = 2006, + IdPermission = 205 + }, + new + { + IdUserRole = 2006, + IdPermission = 204 + }, + new + { + IdUserRole = 2007, + IdPermission = 241 + }, + new + { + IdUserRole = 2007, + IdPermission = 205 + }, + new + { + IdUserRole = 2007, + IdPermission = 204 + }, + new + { + IdUserRole = 1, + IdPermission = 100 + }, + new + { + IdUserRole = 1, + IdPermission = 101 + }, + new + { + IdUserRole = 1, + IdPermission = 102 + }, + new + { + IdUserRole = 1, + IdPermission = 103 + }, + new + { + IdUserRole = 1, + IdPermission = 104 + }, + new + { + IdUserRole = 1, + IdPermission = 105 + }, + new + { + IdUserRole = 1, + IdPermission = 106 + }, + new + { + IdUserRole = 1, + IdPermission = 107 + }, + new + { + IdUserRole = 1, + IdPermission = 108 + }, + new + { + IdUserRole = 1, + IdPermission = 109 + }, + new + { + IdUserRole = 1, + IdPermission = 110 + }, + new + { + IdUserRole = 1, + IdPermission = 111 + }, + new + { + IdUserRole = 1, + IdPermission = 112 + }, + new + { + IdUserRole = 1, + IdPermission = 113 + }, + new + { + IdUserRole = 1, + IdPermission = 114 + }, + new + { + IdUserRole = 1, + IdPermission = 115 + }, + new + { + IdUserRole = 1, + IdPermission = 116 + }, + new + { + IdUserRole = 1, + IdPermission = 117 + }, + new + { + IdUserRole = 1, + IdPermission = 118 + }, + new + { + IdUserRole = 1, + IdPermission = 119 + }, + new + { + IdUserRole = 1, + IdPermission = 120 + }, + new + { + IdUserRole = 1, + IdPermission = 121 + }, + new + { + IdUserRole = 1, + IdPermission = 122 + }, + new + { + IdUserRole = 1, + IdPermission = 123 + }, + new + { + IdUserRole = 1, + IdPermission = 124 + }, + new + { + IdUserRole = 1, + IdPermission = 125 + }, + new + { + IdUserRole = 1, + IdPermission = 126 + }, + new + { + IdUserRole = 1, + IdPermission = 127 + }, + new + { + IdUserRole = 1, + IdPermission = 128 + }, + new + { + IdUserRole = 1, + IdPermission = 129 + }, + new + { + IdUserRole = 1, + IdPermission = 200 + }, + new + { + IdUserRole = 1, + IdPermission = 201 + }, + new + { + IdUserRole = 1, + IdPermission = 202 + }, + new + { + IdUserRole = 1, + IdPermission = 203 + }, + new + { + IdUserRole = 1, + IdPermission = 204 + }, + new + { + IdUserRole = 1, + IdPermission = 205 + }, + new + { + IdUserRole = 1, + IdPermission = 206 + }, + new + { + IdUserRole = 1, + IdPermission = 207 + }, + new + { + IdUserRole = 1, + IdPermission = 208 + }, + new + { + IdUserRole = 1, + IdPermission = 209 + }, + new + { + IdUserRole = 1, + IdPermission = 210 + }, + new + { + IdUserRole = 1, + IdPermission = 211 + }, + new + { + IdUserRole = 1, + IdPermission = 212 + }, + new + { + IdUserRole = 1, + IdPermission = 213 + }, + new + { + IdUserRole = 1, + IdPermission = 214 + }, + new + { + IdUserRole = 1, + IdPermission = 215 + }, + new + { + IdUserRole = 1, + IdPermission = 216 + }, + new + { + IdUserRole = 1, + IdPermission = 217 + }, + new + { + IdUserRole = 1, + IdPermission = 218 + }, + new + { + IdUserRole = 1, + IdPermission = 219 + }, + new + { + IdUserRole = 1, + IdPermission = 220 + }, + new + { + IdUserRole = 1, + IdPermission = 221 + }, + new + { + IdUserRole = 1, + IdPermission = 222 + }, + new + { + IdUserRole = 1, + IdPermission = 223 + }, + new + { + IdUserRole = 1, + IdPermission = 224 + }, + new + { + IdUserRole = 1, + IdPermission = 225 + }, + new + { + IdUserRole = 1, + IdPermission = 226 + }, + new + { + IdUserRole = 1, + IdPermission = 227 + }, + new + { + IdUserRole = 1, + IdPermission = 228 + }, + new + { + IdUserRole = 1, + IdPermission = 229 + }, + new + { + IdUserRole = 1, + IdPermission = 230 + }, + new + { + IdUserRole = 1, + IdPermission = 231 + }, + new + { + IdUserRole = 1, + IdPermission = 232 + }, + new + { + IdUserRole = 1, + IdPermission = 233 + }, + new + { + IdUserRole = 1, + IdPermission = 234 + }, + new + { + IdUserRole = 1, + IdPermission = 235 + }, + new + { + IdUserRole = 1, + IdPermission = 236 + }, + new + { + IdUserRole = 1, + IdPermission = 237 + }, + new + { + IdUserRole = 1, + IdPermission = 238 + }, + new + { + IdUserRole = 1, + IdPermission = 239 + }, + new + { + IdUserRole = 1, + IdPermission = 240 + }, + new + { + IdUserRole = 1, + IdPermission = 241 + }, + new + { + IdUserRole = 1, + IdPermission = 242 + }, + new + { + IdUserRole = 1, + IdPermission = 243 + }, + new + { + IdUserRole = 1, + IdPermission = 244 + }, + new + { + IdUserRole = 1, + IdPermission = 245 + }, + new + { + IdUserRole = 1, + IdPermission = 246 + }, + new + { + IdUserRole = 1, + IdPermission = 247 + }, + new + { + IdUserRole = 1, + IdPermission = 248 + }, + new + { + IdUserRole = 1, + IdPermission = 249 + }, + new + { + IdUserRole = 1, + IdPermission = 250 + }, + new + { + IdUserRole = 1, + IdPermission = 251 + }, + new + { + IdUserRole = 1, + IdPermission = 252 + }, + new + { + IdUserRole = 1, + IdPermission = 253 + }, + new + { + IdUserRole = 1, + IdPermission = 254 + }, + new + { + IdUserRole = 1, + IdPermission = 255 + }, + new + { + IdUserRole = 1, + IdPermission = 256 + }, + new + { + IdUserRole = 1, + IdPermission = 257 + }, + new + { + IdUserRole = 1, + IdPermission = 258 + }, + new + { + IdUserRole = 1, + IdPermission = 259 + }, + new + { + IdUserRole = 1, + IdPermission = 260 + }, + new + { + IdUserRole = 1, + IdPermission = 261 + }, + new + { + IdUserRole = 1, + IdPermission = 262 + }, + new + { + IdUserRole = 1, + IdPermission = 263 + }, + new + { + IdUserRole = 1, + IdPermission = 264 + }, + new + { + IdUserRole = 1, + IdPermission = 265 + }, + new + { + IdUserRole = 1, + IdPermission = 266 + }, + new + { + IdUserRole = 1, + IdPermission = 267 + }, + new + { + IdUserRole = 1, + IdPermission = 268 + }, + new + { + IdUserRole = 1, + IdPermission = 269 + }, + new + { + IdUserRole = 1, + IdPermission = 380 + }, + new + { + IdUserRole = 1, + IdPermission = 381 + }, + new + { + IdUserRole = 1, + IdPermission = 382 + }, + new + { + IdUserRole = 1, + IdPermission = 383 + }, + new + { + IdUserRole = 1, + IdPermission = 384 + }, + new + { + IdUserRole = 1, + IdPermission = 385 + }, + new + { + IdUserRole = 1, + IdPermission = 386 + }, + new + { + IdUserRole = 1, + IdPermission = 387 + }, + new + { + IdUserRole = 1, + IdPermission = 388 + }, + new + { + IdUserRole = 1, + IdPermission = 389 + }, + new + { + IdUserRole = 1, + IdPermission = 390 + }, + new + { + IdUserRole = 1, + IdPermission = 391 + }, + new + { + IdUserRole = 1, + IdPermission = 400 + }, + new + { + IdUserRole = 1, + IdPermission = 401 + }, + new + { + IdUserRole = 1, + IdPermission = 407 + }, + new + { + IdUserRole = 1, + IdPermission = 408 + }, + new + { + IdUserRole = 1, + IdPermission = 450 + }, + new + { + IdUserRole = 1, + IdPermission = 460 + }, + new + { + IdUserRole = 1, + IdPermission = 461 + }, + new + { + IdUserRole = 1, + IdPermission = 500 + }, + new + { + IdUserRole = 1, + IdPermission = 501 + }, + new + { + IdUserRole = 1, + IdPermission = 502 + }, + new + { + IdUserRole = 1, + IdPermission = 503 + }, + new + { + IdUserRole = 1, + IdPermission = 504 + }, + new + { + IdUserRole = 1, + IdPermission = 505 + }, + new + { + IdUserRole = 1, + IdPermission = 506 + }, + new + { + IdUserRole = 1, + IdPermission = 507 + }, + new + { + IdUserRole = 1, + IdPermission = 510 + }, + new + { + IdUserRole = 1, + IdPermission = 511 + }, + new + { + IdUserRole = 1, + IdPermission = 512 + }, + new + { + IdUserRole = 1, + IdPermission = 516 + }, + new + { + IdUserRole = 1, + IdPermission = 517 + }, + new + { + IdUserRole = 1, + IdPermission = 518 + }, + new + { + IdUserRole = 1, + IdPermission = 519 + }, + new + { + IdUserRole = 1, + IdPermission = 520 + }, + new + { + IdUserRole = 1, + IdPermission = 521 + }, + new + { + IdUserRole = 1, + IdPermission = 522 + }, + new + { + IdUserRole = 1, + IdPermission = 523 + }, + new + { + IdUserRole = 1, + IdPermission = 524 + }, + new + { + IdUserRole = 1, + IdPermission = 525 + }, + new + { + IdUserRole = 1, + IdPermission = 526 + }, + new + { + IdUserRole = 1, + IdPermission = 527 + }, + new + { + IdUserRole = 1, + IdPermission = 528 + }, + new + { + IdUserRole = 1, + IdPermission = 530 + }, + new + { + IdUserRole = 1, + IdPermission = 531 + }); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationUserRoleUserRole", b => - { - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("id_user_role"); + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id_user_role"); - b.Property("IdInclude") - .HasColumnType("integer") - .HasColumnName("id_include_user_role"); + b.Property("IdInclude") + .HasColumnType("integer") + .HasColumnName("id_include_user_role"); - b.HasKey("Id", "IdInclude") - .HasName("t_relation_user_role_user_role_pk"); + b.HasKey("Id", "IdInclude") + .HasName("t_relation_user_role_user_role_pk"); - b.HasIndex("IdInclude"); + b.HasIndex("IdInclude"); - b.ToTable("t_relation_user_role_user_role"); + b.ToTable("t_relation_user_role_user_role"); - b.HasComment("Отношение ролей к ролям"); + b.HasComment("Отношение ролей к ролям"); - b.HasData( - new - { - Id = 1101, - IdInclude = 1100 - }, - new - { - Id = 1103, - IdInclude = 1102 - }, - new - { - Id = 1105, - IdInclude = 1104 - }, - new - { - Id = 1107, - IdInclude = 1106 - }, - new - { - Id = 1109, - IdInclude = 1108 - }, - new - { - Id = 1111, - IdInclude = 1110 - }, - new - { - Id = 1114, - IdInclude = 1113 - }, - new - { - Id = 1117, - IdInclude = 1116 - }, - new - { - Id = 1203, - IdInclude = 1202 - }, - new - { - Id = 1207, - IdInclude = 1206 - }, - new - { - Id = 1209, - IdInclude = 1208 - }, - new - { - Id = 1212, - IdInclude = 1211 - }, - new - { - Id = 1214, - IdInclude = 1213 - }, - new - { - Id = 1216, - IdInclude = 1215 - }, - new - { - Id = 1218, - IdInclude = 1217 - }, - new - { - Id = 2000, - IdInclude = 1200 - }, - new - { - Id = 2000, - IdInclude = 1201 - }, - new - { - Id = 2000, - IdInclude = 1202 - }, - new - { - Id = 2000, - IdInclude = 1204 - }, - new - { - Id = 2000, - IdInclude = 1205 - }, - new - { - Id = 2000, - IdInclude = 1206 - }, - new - { - Id = 2000, - IdInclude = 1208 - }, - new - { - Id = 2000, - IdInclude = 1210 - }, - new - { - Id = 2000, - IdInclude = 1211 - }, - new - { - Id = 2000, - IdInclude = 1213 - }, - new - { - Id = 2000, - IdInclude = 1215 - }, - new - { - Id = 2000, - IdInclude = 1217 - }, - new - { - Id = 2000, - IdInclude = 1219 - }, - new - { - Id = 2000, - IdInclude = 1220 - }, - new - { - Id = 2000, - IdInclude = 1221 - }, - new - { - Id = 2000, - IdInclude = 1500 - }, - new - { - Id = 2000, - IdInclude = 1501 - }, - new - { - Id = 2000, - IdInclude = 1502 - }, - new - { - Id = 2001, - IdInclude = 1500 - }, - new - { - Id = 2001, - IdInclude = 1501 - }, - new - { - Id = 2001, - IdInclude = 1502 - }, - new - { - Id = 2002, - IdInclude = 1500 - }, - new - { - Id = 2002, - IdInclude = 1501 - }, - new - { - Id = 2002, - IdInclude = 1502 - }, - new - { - Id = 2003, - IdInclude = 1500 - }, - new - { - Id = 2003, - IdInclude = 1501 - }, - new - { - Id = 2003, - IdInclude = 1502 - }, - new - { - Id = 2004, - IdInclude = 1500 - }, - new - { - Id = 2004, - IdInclude = 1501 - }, - new - { - Id = 2004, - IdInclude = 1502 - }, - new - { - Id = 2005, - IdInclude = 1500 - }, - new - { - Id = 2005, - IdInclude = 1501 - }, - new - { - Id = 2005, - IdInclude = 1502 - }, - new - { - Id = 2006, - IdInclude = 1500 - }, - new - { - Id = 2006, - IdInclude = 1501 - }, - new - { - Id = 2006, - IdInclude = 1502 - }, - new - { - Id = 2007, - IdInclude = 1500 - }, - new - { - Id = 2007, - IdInclude = 1501 - }, - new - { - Id = 2007, - IdInclude = 1502 - }); - }); + b.HasData( + new + { + Id = 1101, + IdInclude = 1100 + }, + new + { + Id = 1103, + IdInclude = 1102 + }, + new + { + Id = 1105, + IdInclude = 1104 + }, + new + { + Id = 1107, + IdInclude = 1106 + }, + new + { + Id = 1109, + IdInclude = 1108 + }, + new + { + Id = 1111, + IdInclude = 1110 + }, + new + { + Id = 1114, + IdInclude = 1113 + }, + new + { + Id = 1117, + IdInclude = 1116 + }, + new + { + Id = 1203, + IdInclude = 1202 + }, + new + { + Id = 1207, + IdInclude = 1206 + }, + new + { + Id = 1209, + IdInclude = 1208 + }, + new + { + Id = 1212, + IdInclude = 1211 + }, + new + { + Id = 1214, + IdInclude = 1213 + }, + new + { + Id = 1216, + IdInclude = 1215 + }, + new + { + Id = 1218, + IdInclude = 1217 + }, + new + { + Id = 2000, + IdInclude = 1200 + }, + new + { + Id = 2000, + IdInclude = 1201 + }, + new + { + Id = 2000, + IdInclude = 1202 + }, + new + { + Id = 2000, + IdInclude = 1204 + }, + new + { + Id = 2000, + IdInclude = 1205 + }, + new + { + Id = 2000, + IdInclude = 1206 + }, + new + { + Id = 2000, + IdInclude = 1208 + }, + new + { + Id = 2000, + IdInclude = 1210 + }, + new + { + Id = 2000, + IdInclude = 1211 + }, + new + { + Id = 2000, + IdInclude = 1213 + }, + new + { + Id = 2000, + IdInclude = 1215 + }, + new + { + Id = 2000, + IdInclude = 1217 + }, + new + { + Id = 2000, + IdInclude = 1219 + }, + new + { + Id = 2000, + IdInclude = 1220 + }, + new + { + Id = 2000, + IdInclude = 1221 + }, + new + { + Id = 2000, + IdInclude = 1500 + }, + new + { + Id = 2000, + IdInclude = 1501 + }, + new + { + Id = 2000, + IdInclude = 1502 + }, + new + { + Id = 2001, + IdInclude = 1500 + }, + new + { + Id = 2001, + IdInclude = 1501 + }, + new + { + Id = 2001, + IdInclude = 1502 + }, + new + { + Id = 2002, + IdInclude = 1500 + }, + new + { + Id = 2002, + IdInclude = 1501 + }, + new + { + Id = 2002, + IdInclude = 1502 + }, + new + { + Id = 2003, + IdInclude = 1500 + }, + new + { + Id = 2003, + IdInclude = 1501 + }, + new + { + Id = 2003, + IdInclude = 1502 + }, + new + { + Id = 2004, + IdInclude = 1500 + }, + new + { + Id = 2004, + IdInclude = 1501 + }, + new + { + Id = 2004, + IdInclude = 1502 + }, + new + { + Id = 2005, + IdInclude = 1500 + }, + new + { + Id = 2005, + IdInclude = 1501 + }, + new + { + Id = 2005, + IdInclude = 1502 + }, + new + { + Id = 2006, + IdInclude = 1500 + }, + new + { + Id = 2006, + IdInclude = 1501 + }, + new + { + Id = 2006, + IdInclude = 1502 + }, + new + { + Id = 2007, + IdInclude = 1500 + }, + new + { + Id = 2007, + IdInclude = 1501 + }, + new + { + Id = 2007, + IdInclude = 1502 + }); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationUserUserRole", b => - { - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); - b.Property("IdUserRole") - .HasColumnType("integer") - .HasColumnName("id_user_role"); + b.Property("IdUserRole") + .HasColumnType("integer") + .HasColumnName("id_user_role"); - b.HasKey("IdUser", "IdUserRole"); + b.HasKey("IdUser", "IdUserRole"); - b.HasIndex("IdUserRole"); + b.HasIndex("IdUserRole"); - b.ToTable("t_relation_user_user_role"); + b.ToTable("t_relation_user_user_role"); - b.HasComment("Отношение пользователей и ролей"); + b.HasComment("Отношение пользователей и ролей"); - b.HasData( - new - { - IdUser = 1, - IdUserRole = 1 - }); - }); + b.HasData( + new + { + IdUser = 1, + IdUserRole = 1 + }); + }); modelBuilder.Entity("AsbCloudDb.Model.ReportProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Begin") - .HasColumnType("timestamp with time zone") - .HasColumnName("begin"); + b.Property("Begin") + .HasColumnType("timestamp with time zone") + .HasColumnName("begin"); - b.Property("End") - .HasColumnType("timestamp with time zone") - .HasColumnName("end") - .HasComment("timestamp with time zone"); + b.Property("End") + .HasColumnType("timestamp with time zone") + .HasColumnName("end") + .HasComment("timestamp with time zone"); - b.Property("Format") - .HasColumnType("integer") - .HasColumnName("format") - .HasComment("Формат отчета"); + b.Property("Format") + .HasColumnType("integer") + .HasColumnName("format") + .HasComment("Формат отчета"); - b.Property("IdFile") - .HasColumnType("integer") - .HasColumnName("id_file") - .HasComment("id файла-родителя"); + b.Property("IdFile") + .HasColumnType("integer") + .HasColumnName("id_file") + .HasComment("id файла-родителя"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("id скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); - b.Property("Step") - .HasColumnType("integer") - .HasColumnName("step") - .HasComment("размер шага в секундах"); + b.Property("Step") + .HasColumnType("integer") + .HasColumnName("step") + .HasComment("размер шага в секундах"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdFile"); + b.HasIndex("IdFile"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.ToTable("t_report_property"); + b.ToTable("t_report_property"); - b.HasComment("Отчеты с данными по буровым"); - }); + b.HasComment("Отчеты с данными по буровым"); + }); modelBuilder.Entity("AsbCloudDb.Model.Schedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DrillEnd") - .HasColumnType("timestamp with time zone") - .HasColumnName("drill_end") - .HasComment("Конец вахты"); + b.Property("DrillEnd") + .HasColumnType("timestamp with time zone") + .HasColumnName("drill_end") + .HasComment("Конец вахты"); - b.Property("DrillStart") - .HasColumnType("timestamp with time zone") - .HasColumnName("drill_start") - .HasComment("Начало вахты"); + b.Property("DrillStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("drill_start") + .HasComment("Начало вахты"); - b.Property("IdDriller") - .HasColumnType("integer") - .HasColumnName("id_driller") - .HasComment("Идентификатор бурильщика"); + b.Property("IdDriller") + .HasColumnType("integer") + .HasColumnName("id_driller") + .HasComment("Идентификатор бурильщика"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("Идентификатор скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Идентификатор скважины"); - b.Property("ShiftEnd") - .HasColumnType("time without time zone") - .HasColumnName("shift_end") - .HasComment("Конец смены"); + b.Property("ShiftEnd") + .HasColumnType("time without time zone") + .HasColumnName("shift_end") + .HasComment("Конец смены"); - b.Property("ShiftStart") - .HasColumnType("time without time zone") - .HasColumnName("shift_start") - .HasComment("Начало смены"); + b.Property("ShiftStart") + .HasColumnType("time without time zone") + .HasColumnName("shift_start") + .HasComment("Начало смены"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdDriller"); + b.HasIndex("IdDriller"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.ToTable("t_schedule"); + b.ToTable("t_schedule"); - b.HasComment("График работы бурильщика"); - }); + b.HasComment("График работы бурильщика"); + }); modelBuilder.Entity("AsbCloudDb.Model.SetpointsRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("комментарий для оператора"); + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("комментарий для оператора"); - b.Property("IdAuthor") - .HasColumnType("integer") - .HasColumnName("id_author") - .HasComment("Id пользователя, загрузившего файл"); + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Id пользователя, загрузившего файл"); - b.Property("IdState") - .HasColumnType("integer") - .HasColumnName("id_state") - .HasComment("0: неизвестно, 1:ожидает отправки, 2: отправлено, 3: принято оператором, 4: отклонено оператором, 5: устарело"); + b.Property("IdState") + .HasColumnType("integer") + .HasColumnName("id_state") + .HasComment("0: неизвестно, 1:ожидает отправки, 2: отправлено, 3: принято оператором, 4: отклонено оператором, 5: устарело"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("id скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); - b.Property("ObsolescenceSec") - .HasColumnType("integer") - .HasColumnName("obsolescence") - .HasComment("сек. до устаревания"); + b.Property("ObsolescenceSec") + .HasColumnType("integer") + .HasColumnName("obsolescence") + .HasComment("сек. до устаревания"); - b.Property("Setpoints") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("setpoint_set") - .HasComment("Набор уставок"); + b.Property("Setpoints") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("setpoint_set") + .HasComment("Набор уставок"); - b.Property("UploadDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); + b.Property("UploadDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdAuthor"); + b.HasIndex("IdAuthor"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.ToTable("t_setpoints_rquest"); + b.ToTable("t_setpoints_rquest"); - b.HasComment("Запросы на изменение уставок панели оператора"); - }); + b.HasComment("Запросы на изменение уставок панели оператора"); + }); modelBuilder.Entity("AsbCloudDb.Model.Subsystem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("description"); + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("description"); - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("name"); + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("t_subsystem"); + b.ToTable("t_subsystem"); - b.HasComment("Описание подсистем"); + b.HasComment("Описание подсистем"); - b.HasData( - new - { - Id = 1, - Description = "Совместная работа режимов \"Бурение в роторе\" и \"Бурение в слайде\"", - Name = "АПД" - }, - new - { - Id = 11, - Description = "Режим работы \"Бурение в роторе\"", - Name = "АПД ротор" - }, - new - { - Id = 12, - Description = "Режим работы \"Бурение в слайде\"", - Name = "АПД слайд" - }, - new - { - Id = 65536, - Description = "Осцилляция", - Name = "Осцилляция" - }, - new - { - Id = 65537, - Description = "Демпфер", - Name = "Демпфер" - }); - }); + b.HasData( + new + { + Id = 1, + Description = "Совместная работа режимов \"Бурение в роторе\" и \"Бурение в слайде\"", + Name = "АПД" + }, + new + { + Id = 11, + Description = "Режим работы \"Бурение в роторе\"", + Name = "АПД ротор" + }, + new + { + Id = 12, + Description = "Режим работы \"Бурение в слайде\"", + Name = "АПД слайд" + }, + new + { + Id = 65536, + Description = "Осцилляция", + Name = "Осцилляция" + }, + new + { + Id = 65537, + Description = "Демпфер", + Name = "Демпфер" + }); + }); modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Info") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("info") - .HasComment("Информация с панели о скважине"); + b.Property("Info") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("info") + .HasComment("Информация с панели о скважине"); - b.Property("RemoteUid") - .IsRequired() - .HasColumnType("text") - .HasColumnName("remote_uid") - .HasComment("Идентификатор передающего устройства. Может повторяться в списке, так как комплекты оборудования переезжают от скв. к скв."); + b.Property("RemoteUid") + .IsRequired() + .HasColumnType("text") + .HasColumnName("remote_uid") + .HasComment("Идентификатор передающего устройства. Может повторяться в списке, так как комплекты оборудования переезжают от скв. к скв."); - b.Property("TimeZone") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("timezone") - .HasComment("Смещение часового пояса от UTC"); + b.Property("TimeZone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex(new[] { "RemoteUid" }, "t_telemetry_remote_uid_index"); + b.HasIndex(new[] { "RemoteUid" }, "t_telemetry_remote_uid_index"); - b.ToTable("t_telemetry"); + b.ToTable("t_telemetry"); - b.HasComment("таблица привязки телеметрии от комплектов к конкретной скважине."); - }); + b.HasComment("таблица привязки телеметрии от комплектов к конкретной скважине."); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaub", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date") - .HasComment("'2021-10-19 18:23:54+05'"); + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date") + .HasComment("'2021-10-19 18:23:54+05'"); - b.Property("AxialLoad") - .HasColumnType("real") - .HasColumnName("axial_load") - .HasComment("Осевая нагрузка"); + b.Property("AxialLoad") + .HasColumnType("real") + .HasColumnName("axial_load") + .HasComment("Осевая нагрузка"); - b.Property("AxialLoadLimitMax") - .HasColumnType("real") - .HasColumnName("axial_load_limit_max") - .HasComment("Осевая нагрузка. Аварийная макс."); + b.Property("AxialLoadLimitMax") + .HasColumnType("real") + .HasColumnName("axial_load_limit_max") + .HasComment("Осевая нагрузка. Аварийная макс."); - b.Property("AxialLoadSp") - .HasColumnType("real") - .HasColumnName("axial_load_sp") - .HasComment("Осевая нагрузка. Задание"); + b.Property("AxialLoadSp") + .HasColumnType("real") + .HasColumnName("axial_load_sp") + .HasComment("Осевая нагрузка. Задание"); - b.Property("BitDepth") - .HasColumnType("real") - .HasColumnName("bit_depth") - .HasComment("Положение инструмента"); + b.Property("BitDepth") + .HasColumnType("real") + .HasColumnName("bit_depth") + .HasComment("Положение инструмента"); - b.Property("BlockPosition") - .HasColumnType("real") - .HasColumnName("block_position") - .HasComment("Высота талевого блока"); + b.Property("BlockPosition") + .HasColumnType("real") + .HasColumnName("block_position") + .HasComment("Высота талевого блока"); - b.Property("BlockPositionMax") - .HasColumnType("real") - .HasColumnName("block_position_max") - .HasComment("Талевый блок. Макс положение"); + b.Property("BlockPositionMax") + .HasColumnType("real") + .HasColumnName("block_position_max") + .HasComment("Талевый блок. Макс положение"); - b.Property("BlockPositionMin") - .HasColumnType("real") - .HasColumnName("block_position_min") - .HasComment("Талевый блок. Мин положение"); + b.Property("BlockPositionMin") + .HasColumnType("real") + .HasColumnName("block_position_min") + .HasComment("Талевый блок. Мин положение"); - b.Property("BlockSpeed") - .HasColumnType("real") - .HasColumnName("block_speed") - .HasComment("Скорость талевого блока"); + b.Property("BlockSpeed") + .HasColumnType("real") + .HasColumnName("block_speed") + .HasComment("Скорость талевого блока"); - b.Property("BlockSpeedSp") - .HasColumnType("real") - .HasColumnName("block_speed_sp") - .HasComment("Скорости талевого блока. Задание"); + b.Property("BlockSpeedSp") + .HasColumnType("real") + .HasColumnName("block_speed_sp") + .HasComment("Скорости талевого блока. Задание"); - b.Property("BlockSpeedSpDevelop") - .HasColumnType("real") - .HasColumnName("block_speed_sp_develop") - .HasComment("Талевый блок. Задание скорости для проработки"); + b.Property("BlockSpeedSpDevelop") + .HasColumnType("real") + .HasColumnName("block_speed_sp_develop") + .HasComment("Талевый блок. Задание скорости для проработки"); - b.Property("BlockSpeedSpRotor") - .HasColumnType("real") - .HasColumnName("block_speed_sp_rotor") - .HasComment("Талевый блок. Задание скорости для роторного бурения"); + b.Property("BlockSpeedSpRotor") + .HasColumnType("real") + .HasColumnName("block_speed_sp_rotor") + .HasComment("Талевый блок. Задание скорости для роторного бурения"); - b.Property("BlockSpeedSpSlide") - .HasColumnType("real") - .HasColumnName("block_speed_sp_slide") - .HasComment("Талевый блок. Задание скорости для режима слайда"); + b.Property("BlockSpeedSpSlide") + .HasColumnType("real") + .HasColumnName("block_speed_sp_slide") + .HasComment("Талевый блок. Задание скорости для режима слайда"); - b.Property("Flow") - .HasColumnType("real") - .HasColumnName("flow") - .HasComment("Расход"); + b.Property("Flow") + .HasColumnType("real") + .HasColumnName("flow") + .HasComment("Расход"); - b.Property("FlowDeltaLimitMax") - .HasColumnType("real") - .HasColumnName("flow_delta_limit_max") - .HasComment("Расход. Аварийный макс."); + b.Property("FlowDeltaLimitMax") + .HasColumnType("real") + .HasColumnName("flow_delta_limit_max") + .HasComment("Расход. Аварийный макс."); - b.Property("FlowIdle") - .HasColumnType("real") - .HasColumnName("flow_idle") - .HasComment("Расход. Холостой ход"); + b.Property("FlowIdle") + .HasColumnType("real") + .HasColumnName("flow_idle") + .HasComment("Расход. Холостой ход"); - b.Property("HookWeight") - .HasColumnType("real") - .HasColumnName("hook_weight") - .HasComment("Вес на крюке"); + b.Property("HookWeight") + .HasColumnType("real") + .HasColumnName("hook_weight") + .HasComment("Вес на крюке"); - b.Property("HookWeightIdle") - .HasColumnType("real") - .HasColumnName("hook_weight_idle") - .HasComment("Вес на крюке. Холостой ход"); + b.Property("HookWeightIdle") + .HasColumnType("real") + .HasColumnName("hook_weight_idle") + .HasComment("Вес на крюке. Холостой ход"); - b.Property("HookWeightLimitMax") - .HasColumnType("real") - .HasColumnName("hook_weight_limit_max") - .HasComment("Вес на крюке. Затяжка"); + b.Property("HookWeightLimitMax") + .HasColumnType("real") + .HasColumnName("hook_weight_limit_max") + .HasComment("Вес на крюке. Затяжка"); - b.Property("HookWeightLimitMin") - .HasColumnType("real") - .HasColumnName("hook_weight_limit_min") - .HasComment("Вес на крюке. Посадка"); + b.Property("HookWeightLimitMin") + .HasColumnType("real") + .HasColumnName("hook_weight_limit_min") + .HasComment("Вес на крюке. Посадка"); - b.Property("IdFeedRegulator") - .HasColumnType("smallint") - .HasColumnName("id_feed_regulator") - .HasComment("Текущий критерий бурения"); + b.Property("IdFeedRegulator") + .HasColumnType("smallint") + .HasColumnName("id_feed_regulator") + .HasComment("Текущий критерий бурения"); - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("Пользователь САУБ"); + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Пользователь САУБ"); - b.Property("Mode") - .HasColumnType("smallint") - .HasColumnName("mode") - .HasComment("Режим САУБ"); + b.Property("Mode") + .HasColumnType("smallint") + .HasColumnName("mode") + .HasComment("Режим САУБ"); - b.Property("Mse") - .HasColumnType("real") - .HasColumnName("mse") - .HasComment("MSE"); + b.Property("Mse") + .HasColumnType("real") + .HasColumnName("mse") + .HasComment("MSE"); - b.Property("MseState") - .HasColumnType("smallint") - .HasColumnName("mse_state") - .HasComment("Текущее состояние работы MSE"); + b.Property("MseState") + .HasColumnType("smallint") + .HasColumnName("mse_state") + .HasComment("Текущее состояние работы MSE"); - b.Property("Pressure") - .HasColumnType("real") - .HasColumnName("pressure") - .HasComment("Давление"); + b.Property("Pressure") + .HasColumnType("real") + .HasColumnName("pressure") + .HasComment("Давление"); - b.Property("PressureDeltaLimitMax") - .HasColumnType("real") - .HasColumnName("pressure_delta_limit_max") - .HasComment("Давление дифф. Аварийное макс."); + b.Property("PressureDeltaLimitMax") + .HasColumnType("real") + .HasColumnName("pressure_delta_limit_max") + .HasComment("Давление дифф. Аварийное макс."); - b.Property("PressureIdle") - .HasColumnType("real") - .HasColumnName("pressure_idle") - .HasComment("Давление. Холостой ход"); + b.Property("PressureIdle") + .HasColumnType("real") + .HasColumnName("pressure_idle") + .HasComment("Давление. Холостой ход"); - b.Property("PressureSp") - .HasColumnType("real") - .HasColumnName("pressure_sp") - .HasComment("Давление. Задание"); + b.Property("PressureSp") + .HasColumnType("real") + .HasColumnName("pressure_sp") + .HasComment("Давление. Задание"); - b.Property("PressureSpDevelop") - .HasColumnType("real") - .HasColumnName("pressure_sp_develop") - .HasComment("Давление. Задание для проработки"); + b.Property("PressureSpDevelop") + .HasColumnType("real") + .HasColumnName("pressure_sp_develop") + .HasComment("Давление. Задание для проработки"); - b.Property("PressureSpRotor") - .HasColumnType("real") - .HasColumnName("pressure_sp_rotor") - .HasComment("Давление. Задание для роторного бурения"); + b.Property("PressureSpRotor") + .HasColumnType("real") + .HasColumnName("pressure_sp_rotor") + .HasComment("Давление. Задание для роторного бурения"); - b.Property("PressureSpSlide") - .HasColumnType("real") - .HasColumnName("pressure_sp_slide") - .HasComment("Давление. Задание для режима слайда"); + b.Property("PressureSpSlide") + .HasColumnType("real") + .HasColumnName("pressure_sp_slide") + .HasComment("Давление. Задание для режима слайда"); - b.Property("Pump0Flow") - .HasColumnType("real") - .HasColumnName("pump0_flow") - .HasComment("Расход. Буровой насос 1"); + b.Property("Pump0Flow") + .HasColumnType("real") + .HasColumnName("pump0_flow") + .HasComment("Расход. Буровой насос 1"); - b.Property("Pump1Flow") - .HasColumnType("real") - .HasColumnName("pump1_flow") - .HasComment("Расход. Буровой насос 2"); + b.Property("Pump1Flow") + .HasColumnType("real") + .HasColumnName("pump1_flow") + .HasComment("Расход. Буровой насос 2"); - b.Property("Pump2Flow") - .HasColumnType("real") - .HasColumnName("pump2_flow") - .HasComment("Расход. Буровой насос 3"); + b.Property("Pump2Flow") + .HasColumnType("real") + .HasColumnName("pump2_flow") + .HasComment("Расход. Буровой насос 3"); - b.Property("RotorSpeed") - .HasColumnType("real") - .HasColumnName("rotor_speed") - .HasComment("Обороты ротора"); + b.Property("RotorSpeed") + .HasColumnType("real") + .HasColumnName("rotor_speed") + .HasComment("Обороты ротора"); - b.Property("RotorTorque") - .HasColumnType("real") - .HasColumnName("rotor_torque") - .HasComment("Момент на роторе"); + b.Property("RotorTorque") + .HasColumnType("real") + .HasColumnName("rotor_torque") + .HasComment("Момент на роторе"); - b.Property("RotorTorqueIdle") - .HasColumnType("real") - .HasColumnName("rotor_torque_idle") - .HasComment("Момент на роторе. Холостой ход"); + b.Property("RotorTorqueIdle") + .HasColumnType("real") + .HasColumnName("rotor_torque_idle") + .HasComment("Момент на роторе. Холостой ход"); - b.Property("RotorTorqueLimitMax") - .HasColumnType("real") - .HasColumnName("rotor_torque_limit_max") - .HasComment("Момент на роторе. Аварийный макс."); + b.Property("RotorTorqueLimitMax") + .HasColumnType("real") + .HasColumnName("rotor_torque_limit_max") + .HasComment("Момент на роторе. Аварийный макс."); - b.Property("RotorTorqueSp") - .HasColumnType("real") - .HasColumnName("rotor_torque_sp") - .HasComment("Момент на роторе. Задание"); + b.Property("RotorTorqueSp") + .HasColumnType("real") + .HasColumnName("rotor_torque_sp") + .HasComment("Момент на роторе. Задание"); - b.Property("WellDepth") - .HasColumnType("real") - .HasColumnName("well_depth") - .HasComment("Глубина забоя"); + b.Property("WellDepth") + .HasColumnType("real") + .HasColumnName("well_depth") + .HasComment("Глубина забоя"); - b.HasKey("IdTelemetry", "DateTime"); + b.HasKey("IdTelemetry", "DateTime"); - b.ToTable("t_telemetry_data_saub"); + b.ToTable("t_telemetry_data_saub"); - b.HasComment("набор основных данных по SAUB"); - }); + b.HasComment("набор основных данных по SAUB"); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaubStat", b => - { - b.Property("Count") - .HasColumnType("bigint") - .HasColumnName("count_items"); + { + b.Property("Count") + .HasColumnType("bigint") + .HasColumnName("count_items"); - b.Property("DateMax") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_max"); + b.Property("DateMax") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_max"); - b.Property("DateMin") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_min"); + b.Property("DateMin") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_min"); - b.Property("DepthMax") - .HasColumnType("real") - .HasColumnName("depth_max"); + b.Property("DepthMax") + .HasColumnType("real") + .HasColumnName("depth_max"); - b.Property("DepthMin") - .HasColumnType("real") - .HasColumnName("depth_min"); + b.Property("DepthMin") + .HasColumnType("real") + .HasColumnName("depth_min"); - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.ToView("mw_telemetry_datas_saub_stat"); - }); + b.ToView("mw_telemetry_datas_saub_stat"); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSpin", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date") - .HasComment("'2021-10-19 18:23:54+05'"); + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date") + .HasComment("'2021-10-19 18:23:54+05'"); - b.Property("Mode") - .HasColumnType("smallint") - .HasColumnName("mode") - .HasComment("Выбранный режим управления"); + b.Property("Mode") + .HasColumnType("smallint") + .HasColumnName("mode") + .HasComment("Выбранный режим управления"); - b.Property("PositionRight") - .HasColumnType("real") - .HasColumnName("position_right") - .HasComment("Крайний правый угол осцилляции"); + b.Property("PositionRight") + .HasColumnType("real") + .HasColumnName("position_right") + .HasComment("Крайний правый угол осцилляции"); - b.Property("PositionZero") - .HasColumnType("real") - .HasColumnName("position_zero") - .HasComment("Нулевая позиция осцилляции"); + b.Property("PositionZero") + .HasColumnType("real") + .HasColumnName("position_zero") + .HasComment("Нулевая позиция осцилляции"); - b.Property("RevolsLeftLimit") - .HasColumnType("real") - .HasColumnName("revols_left_limit") - .HasComment("Ограничение числа оборотов влево"); + b.Property("RevolsLeftLimit") + .HasColumnType("real") + .HasColumnName("revols_left_limit") + .HasComment("Ограничение числа оборотов влево"); - b.Property("RevolsLeftTotal") - .HasColumnType("real") - .HasColumnName("revols_left_total") - .HasComment("Суммарное количество оборотов влево"); + b.Property("RevolsLeftTotal") + .HasColumnType("real") + .HasColumnName("revols_left_total") + .HasComment("Суммарное количество оборотов влево"); - b.Property("RevolsRightLimit") - .HasColumnType("real") - .HasColumnName("revols_right_limit") - .HasComment("Ограничение числа оборотов вправо"); + b.Property("RevolsRightLimit") + .HasColumnType("real") + .HasColumnName("revols_right_limit") + .HasComment("Ограничение числа оборотов вправо"); - b.Property("RevolsRightTotal") - .HasColumnType("real") - .HasColumnName("revols_right_total") - .HasComment("Суммарное количество оборотов вправо"); + b.Property("RevolsRightTotal") + .HasColumnType("real") + .HasColumnName("revols_right_total") + .HasComment("Суммарное количество оборотов вправо"); - b.Property("SpeedLeftSp") - .HasColumnType("real") - .HasColumnName("speed_left_sp") - .HasComment("Заданная скорость вращения влево"); + b.Property("SpeedLeftSp") + .HasColumnType("real") + .HasColumnName("speed_left_sp") + .HasComment("Заданная скорость вращения влево"); - b.Property("SpeedRightSp") - .HasColumnType("real") - .HasColumnName("speed_right_sp") - .HasComment("Заданная скорость вращения вправо"); + b.Property("SpeedRightSp") + .HasColumnType("real") + .HasColumnName("speed_right_sp") + .HasComment("Заданная скорость вращения вправо"); - b.Property("State") - .HasColumnType("smallint") - .HasColumnName("state") - .HasComment("Переменная этапа"); + b.Property("State") + .HasColumnType("smallint") + .HasColumnName("state") + .HasComment("Переменная этапа"); - b.HasKey("IdTelemetry", "DateTime"); + b.HasKey("IdTelemetry", "DateTime"); - b.ToTable("t_telemetry_data_spin"); + b.ToTable("t_telemetry_data_spin"); - b.HasComment("набор основных данных по SpinMaster"); - }); + b.HasComment("набор основных данных по SpinMaster"); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryEvent", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.Property("IdEvent") - .HasColumnType("integer") - .HasColumnName("id_event"); + b.Property("IdEvent") + .HasColumnType("integer") + .HasColumnName("id_event"); - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category"); + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category"); - b.Property("MessageTemplate") - .IsRequired() - .HasColumnType("text") - .HasColumnName("message_template"); + b.Property("MessageTemplate") + .IsRequired() + .HasColumnType("text") + .HasColumnName("message_template"); - b.HasKey("IdTelemetry", "IdEvent"); + b.HasKey("IdTelemetry", "IdEvent"); - b.ToTable("t_telemetry_event"); + b.ToTable("t_telemetry_event"); - b.HasComment("Справочник событий. События формируют сообщения. Разделено по версиям посылок от телеметрии."); - }); + b.HasComment("Справочник событий. События формируют сообщения. Разделено по версиям посылок от телеметрии."); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Arg0") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("arg0") - .HasComment("Аргумент №0 для вставки в шаблон сообщения"); + b.Property("Arg0") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg0") + .HasComment("Аргумент №0 для вставки в шаблон сообщения"); - b.Property("Arg1") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("arg1"); + b.Property("Arg1") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg1"); - b.Property("Arg2") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("arg2"); + b.Property("Arg2") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg2"); - b.Property("Arg3") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("arg3"); + b.Property("Arg3") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg3"); - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); - b.Property("IdEvent") - .HasColumnType("integer") - .HasColumnName("id_event"); + b.Property("IdEvent") + .HasColumnType("integer") + .HasColumnName("id_event"); - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.Property("IdTelemetryUser") - .HasColumnType("integer") - .HasColumnName("id_telemetry_user") - .HasComment("Пользователь панели отправляющей телеметрию. не пользователь облака."); + b.Property("IdTelemetryUser") + .HasColumnType("integer") + .HasColumnName("id_telemetry_user") + .HasComment("Пользователь панели отправляющей телеметрию. не пользователь облака."); - b.Property("WellDepth") - .HasColumnType("double precision") - .HasColumnName("well_depth"); + b.Property("WellDepth") + .HasColumnType("double precision") + .HasColumnName("well_depth"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdTelemetry"); + b.HasIndex("IdTelemetry"); - b.ToTable("t_telemetry_message"); + b.ToTable("t_telemetry_message"); - b.HasComment("Сообщения на буровых"); - }); + b.HasComment("Сообщения на буровых"); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryUser", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level"); - b.Property("Name") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("name"); + b.Property("Name") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); - b.Property("Patronymic") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("patronymic"); + b.Property("Patronymic") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("patronymic"); - b.Property("Surname") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("surname"); + b.Property("Surname") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname"); - b.HasKey("IdTelemetry", "IdUser"); + b.HasKey("IdTelemetry", "IdUser"); - b.ToTable("t_telemetry_user"); + b.ToTable("t_telemetry_user"); - b.HasComment("Пользователи панели САУБ. Для сообщений."); - }); + b.HasComment("Пользователи панели САУБ. Для сообщений."); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryWirelineRunOut", b => - { - b.Property("IdTelemetry") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_telemetry") - .HasComment("Идентификатор телеметрии"); + { + b.Property("IdTelemetry") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .HasComment("Идентификатор телеметрии"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("IdTelemetry")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("IdTelemetry")); - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_time") - .HasComment("Отметка времени"); + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_time") + .HasComment("Отметка времени"); - b.Property("Hauling") - .HasColumnType("real") - .HasColumnName("hauling") - .HasComment("Наработка талевого каната с момента перетяжки каната, т*км"); + b.Property("Hauling") + .HasColumnType("real") + .HasColumnName("hauling") + .HasComment("Наработка талевого каната с момента перетяжки каната, т*км"); - b.Property("HaulingWarnSp") - .HasColumnType("real") - .HasColumnName("hauling_warn_sp") - .HasComment("Наработка талевого каната до сигнализации о необходимости перетяжки, т*км"); + b.Property("HaulingWarnSp") + .HasColumnType("real") + .HasColumnName("hauling_warn_sp") + .HasComment("Наработка талевого каната до сигнализации о необходимости перетяжки, т*км"); - b.Property("Replace") - .HasColumnType("real") - .HasColumnName("replace") - .HasComment("Наработка талевого каната с момента замены каната, т*км"); + b.Property("Replace") + .HasColumnType("real") + .HasColumnName("replace") + .HasComment("Наработка талевого каната с момента замены каната, т*км"); - b.Property("ReplaceWarnSp") - .HasColumnType("real") - .HasColumnName("replace_warn_sp") - .HasComment("Наработка талевого каната до сигнализации о необходимости замены, т*км"); + b.Property("ReplaceWarnSp") + .HasColumnType("real") + .HasColumnName("replace_warn_sp") + .HasComment("Наработка талевого каната до сигнализации о необходимости замены, т*км"); - b.HasKey("IdTelemetry"); + b.HasKey("IdTelemetry"); - b.ToTable("t_telemetry_wireline_run_out"); + b.ToTable("t_telemetry_wireline_run_out"); - b.HasComment("Наработка талевого каната"); - }); + b.HasComment("Наработка талевого каната"); + }); modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryFact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AzimuthGeo") - .HasColumnType("double precision") - .HasColumnName("azimuth_geo") - .HasComment("Азимут Географ."); + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); - b.Property("AzimuthMagnetic") - .HasColumnType("double precision") - .HasColumnName("azimuth_magnetic") - .HasComment("Азимут Магнитный"); + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("Комментарии"); + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("ID пользователя который внес/изменил запись"); + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("ID пользователя который внес/изменил запись"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("ID скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); - b.Property("UpdateDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("update_date") - .HasComment("Дата загрузки траектории"); + b.Property("UpdateDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("update_date") + .HasComment("Дата загрузки траектории"); - b.Property("VerticalDepth") - .HasColumnType("double precision") - .HasColumnName("vertical_depth") - .HasComment("Глубина вертикальная"); + b.Property("VerticalDepth") + .HasColumnType("double precision") + .HasColumnName("vertical_depth") + .HasComment("Глубина вертикальная"); - b.Property("WellboreDepth") - .HasColumnType("double precision") - .HasColumnName("wellbore_depth") - .HasComment("Глубина по стволу"); + b.Property("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); - b.Property("ZenithAngle") - .HasColumnType("double precision") - .HasColumnName("zenith_angle") - .HasComment("Угол зенитный"); + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdUser"); + b.HasIndex("IdUser"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.ToTable("t_trajectory_fact"); + b.ToTable("t_trajectory_fact"); - b.HasComment("Загрузка фактической траектории"); - }); + b.HasComment("Загрузка фактической траектории"); + }); modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AzimuthGeo") - .HasColumnType("double precision") - .HasColumnName("azimuth_geo") - .HasComment("Азимут Географ."); + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); - b.Property("AzimuthMagnetic") - .HasColumnType("double precision") - .HasColumnName("azimuth_magnetic") - .HasComment("Азимут Магнитный"); + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("Комментарии"); + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("ID пользователя который внес/изменил запись"); + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("ID пользователя который внес/изменил запись"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("ID скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); - b.Property("Radius") - .HasColumnType("double precision") - .HasColumnName("radius") - .HasComment("Радиус цели"); + b.Property("Radius") + .HasColumnType("double precision") + .HasColumnName("radius") + .HasComment("Радиус цели"); - b.Property("UpdateDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("update_date") - .HasComment("Дата загрузки траектории"); + b.Property("UpdateDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("update_date") + .HasComment("Дата загрузки траектории"); - b.Property("VerticalDepth") - .HasColumnType("double precision") - .HasColumnName("vertical_depth") - .HasComment("Глубина вертикальная"); + b.Property("VerticalDepth") + .HasColumnType("double precision") + .HasColumnName("vertical_depth") + .HasComment("Глубина вертикальная"); - b.Property("WellboreDepth") - .HasColumnType("double precision") - .HasColumnName("wellbore_depth") - .HasComment("Глубина по стволу"); + b.Property("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); - b.Property("ZenithAngle") - .HasColumnType("double precision") - .HasColumnName("zenith_angle") - .HasComment("Угол зенитный"); + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdUser"); + b.HasIndex("IdUser"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.ToTable("t_trajectory_plan"); + b.ToTable("t_trajectory_plan"); - b.HasComment("Загрузка плановой траектории"); - }); + b.HasComment("Загрузка плановой траектории"); + }); modelBuilder.Entity("AsbCloudDb.Model.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Email") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("email") - .HasComment("должность"); + b.Property("Email") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("email") + .HasComment("должность"); - b.Property("IdCompany") - .HasColumnType("integer") - .HasColumnName("id_company"); + b.Property("IdCompany") + .HasColumnType("integer") + .HasColumnName("id_company"); - b.Property("IdState") - .HasColumnType("smallint") - .HasColumnName("state") - .HasComment("состояние:\n0 - не активен, \n1 - активен, \n2 - заблокирован"); + b.Property("IdState") + .HasColumnType("smallint") + .HasColumnName("state") + .HasComment("состояние:\n0 - не активен, \n1 - активен, \n2 - заблокирован"); - b.Property("Login") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("login"); + b.Property("Login") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("login"); - b.Property("Name") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("name") - .HasComment("имя"); + b.Property("Name") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name") + .HasComment("имя"); - b.Property("PasswordHash") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("password_hash") - .HasComment("соленый хэш пароля.\nпервые 5 символов - соль"); + b.Property("PasswordHash") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("password_hash") + .HasComment("соленый хэш пароля.\nпервые 5 символов - соль"); - b.Property("Patronymic") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("patronymic") - .HasComment("отчество"); + b.Property("Patronymic") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("patronymic") + .HasComment("отчество"); - b.Property("Phone") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("phone") - .HasComment("номер телефона"); + b.Property("Phone") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("phone") + .HasComment("номер телефона"); - b.Property("Position") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("position") - .HasComment("email"); + b.Property("Position") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("position") + .HasComment("email"); - b.Property("Surname") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("surname") - .HasComment("фамилия"); + b.Property("Surname") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname") + .HasComment("фамилия"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdCompany"); + b.HasIndex("IdCompany"); - b.HasIndex("Login") - .IsUnique(); + b.HasIndex("Login") + .IsUnique(); - b.ToTable("t_user"); + b.ToTable("t_user"); - b.HasComment("Пользователи облака"); + b.HasComment("Пользователи облака"); - b.HasData( - new - { - Id = 1, - Email = "", - IdCompany = 1, - IdState = (short)1, - Login = "dev", - Name = "Разработчик", - PasswordHash = "Vlcj|4fa529103dde7ff72cfe76185f344d4aa87931f8e1b2044e8a7739947c3d18923464eaad93843e4f809c5e126d013072" - }); - }); + b.HasData( + new + { + Id = 1, + Email = "", + IdCompany = 1, + IdState = (short)1, + Login = "dev", + Name = "Разработчик", + PasswordHash = "Vlcj|4fa529103dde7ff72cfe76185f344d4aa87931f8e1b2044e8a7739947c3d18923464eaad93843e4f809c5e126d013072" + }); + }); modelBuilder.Entity("AsbCloudDb.Model.UserRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption") - .HasComment("Название"); + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); - b.Property("IdType") - .HasColumnType("integer") - .HasColumnName("id_type") - .HasComment("0-роль из стандартной матрицы, \n1-специальная роль для какого-либо пользователя"); + b.Property("IdType") + .HasColumnType("integer") + .HasColumnName("id_type") + .HasComment("0-роль из стандартной матрицы, \n1-специальная роль для какого-либо пользователя"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("t_user_role"); + b.ToTable("t_user_role"); - b.HasComment("Роли пользователей в системе"); + b.HasComment("Роли пользователей в системе"); - b.HasData( - new - { - Id = 1, - Caption = "root", - IdType = 1 - }, - new - { - Id = 1100, - Caption = "admin_cluster.view", - IdType = 1 - }, - new - { - Id = 1101, - Caption = "admin_cluster.edit", - IdType = 1 - }, - new - { - Id = 1102, - Caption = "admin_company.view", - IdType = 1 - }, - new - { - Id = 1103, - Caption = "admin_company.edit", - IdType = 1 - }, - new - { - Id = 1104, - Caption = "admin_company_type.view", - IdType = 1 - }, - new - { - Id = 1105, - Caption = "admin_company_type.edit", - IdType = 1 - }, - new - { - Id = 1106, - Caption = "admin_deposit.view", - IdType = 1 - }, - new - { - Id = 1107, - Caption = "admin_deposit.edit", - IdType = 1 - }, - new - { - Id = 1108, - Caption = "admin_permission.view", - IdType = 1 - }, - new - { - Id = 1109, - Caption = "admin_permission.edit", - IdType = 1 - }, - new - { - Id = 1110, - Caption = "admin_role.view", - IdType = 1 - }, - new - { - Id = 1111, - Caption = "admin_role.edit", - IdType = 1 - }, - new - { - Id = 1112, - Caption = "admin_telemetry.view", - IdType = 1 - }, - new - { - Id = 1113, - Caption = "admin_user.view", - IdType = 1 - }, - new - { - Id = 1114, - Caption = "admin_user.edit", - IdType = 1 - }, - new - { - Id = 1115, - Caption = "admin_visit_log.view", - IdType = 1 - }, - new - { - Id = 1116, - Caption = "admin_well.view", - IdType = 1 - }, - new - { - Id = 1117, - Caption = "admin_well.edit", - IdType = 1 - }, - new - { - Id = 1200, - Caption = "archive.view", - IdType = 1 - }, - new - { - Id = 1201, - Caption = "cluster.view", - IdType = 1 - }, - new - { - Id = 1202, - Caption = "composite.view", - IdType = 1 - }, - new - { - Id = 1203, - Caption = "composite.edit", - IdType = 1 - }, - new - { - Id = 1204, - Caption = "deposit.view", - IdType = 1 - }, - new - { - Id = 1205, - Caption = "document.view", - IdType = 1 - }, - new - { - Id = 1206, - Caption = "drillProcessFlow.view", - IdType = 1 - }, - new - { - Id = 1207, - Caption = "drillProcessFlow.edit", - IdType = 1 - }, - new - { - Id = 1208, - Caption = "measure.view", - IdType = 1 - }, - new - { - Id = 1209, - Caption = "measure.edit", - IdType = 1 - }, - new - { - Id = 1210, - Caption = "message.view", - IdType = 1 - }, - new - { - Id = 1211, - Caption = "operations.view", - IdType = 1 - }, - new - { - Id = 1212, - Caption = "operations.edit", - IdType = 1 - }, - new - { - Id = 1213, - Caption = "params.view", - IdType = 1 - }, - new - { - Id = 1214, - Caption = "params.edit", - IdType = 1 - }, - new - { - Id = 1215, - Caption = "report.view", - IdType = 1 - }, - new - { - Id = 1216, - Caption = "report.edit", - IdType = 1 - }, - new - { - Id = 1217, - Caption = "setpoints.view", - IdType = 1 - }, - new - { - Id = 1218, - Caption = "setpoints.edit", - IdType = 1 - }, - new - { - Id = 1219, - Caption = "telemetry.view", - IdType = 1 - }, - new - { - Id = 1220, - Caption = "telemetryAnalysis.view", - IdType = 1 - }, - new - { - Id = 1221, - Caption = "well.view", - IdType = 1 - }, - new - { - Id = 1500, - Caption = "Просмотр всего", - IdType = 1 - }, - new - { - Id = 1501, - Caption = "file.edit", - IdType = 1 - }, - new - { - Id = 1502, - Caption = "drillingProgram.edit", - IdType = 1 - }, - new - { - Id = 2000, - Caption = "Заказчик", - IdType = 0 - }, - new - { - Id = 2001, - Caption = "Супервайзер", - IdType = 0 - }, - new - { - Id = 2002, - Caption = "Буровой подрядчик", - IdType = 0 - }, - new - { - Id = 2003, - Caption = "Растворщик", - IdType = 0 - }, - new - { - Id = 2004, - Caption = "Телеметрист", - IdType = 0 - }, - new - { - Id = 2005, - Caption = "Долотный сервис", - IdType = 0 - }, - new - { - Id = 2006, - Caption = "ГТИ", - IdType = 0 - }, - new - { - Id = 2007, - Caption = "Цементирование", - IdType = 0 - }); - }); + b.HasData( + new + { + Id = 1, + Caption = "root", + IdType = 1 + }, + new + { + Id = 1100, + Caption = "admin_cluster.view", + IdType = 1 + }, + new + { + Id = 1101, + Caption = "admin_cluster.edit", + IdType = 1 + }, + new + { + Id = 1102, + Caption = "admin_company.view", + IdType = 1 + }, + new + { + Id = 1103, + Caption = "admin_company.edit", + IdType = 1 + }, + new + { + Id = 1104, + Caption = "admin_company_type.view", + IdType = 1 + }, + new + { + Id = 1105, + Caption = "admin_company_type.edit", + IdType = 1 + }, + new + { + Id = 1106, + Caption = "admin_deposit.view", + IdType = 1 + }, + new + { + Id = 1107, + Caption = "admin_deposit.edit", + IdType = 1 + }, + new + { + Id = 1108, + Caption = "admin_permission.view", + IdType = 1 + }, + new + { + Id = 1109, + Caption = "admin_permission.edit", + IdType = 1 + }, + new + { + Id = 1110, + Caption = "admin_role.view", + IdType = 1 + }, + new + { + Id = 1111, + Caption = "admin_role.edit", + IdType = 1 + }, + new + { + Id = 1112, + Caption = "admin_telemetry.view", + IdType = 1 + }, + new + { + Id = 1113, + Caption = "admin_user.view", + IdType = 1 + }, + new + { + Id = 1114, + Caption = "admin_user.edit", + IdType = 1 + }, + new + { + Id = 1115, + Caption = "admin_visit_log.view", + IdType = 1 + }, + new + { + Id = 1116, + Caption = "admin_well.view", + IdType = 1 + }, + new + { + Id = 1117, + Caption = "admin_well.edit", + IdType = 1 + }, + new + { + Id = 1200, + Caption = "archive.view", + IdType = 1 + }, + new + { + Id = 1201, + Caption = "cluster.view", + IdType = 1 + }, + new + { + Id = 1202, + Caption = "composite.view", + IdType = 1 + }, + new + { + Id = 1203, + Caption = "composite.edit", + IdType = 1 + }, + new + { + Id = 1204, + Caption = "deposit.view", + IdType = 1 + }, + new + { + Id = 1205, + Caption = "document.view", + IdType = 1 + }, + new + { + Id = 1206, + Caption = "drillProcessFlow.view", + IdType = 1 + }, + new + { + Id = 1207, + Caption = "drillProcessFlow.edit", + IdType = 1 + }, + new + { + Id = 1208, + Caption = "measure.view", + IdType = 1 + }, + new + { + Id = 1209, + Caption = "measure.edit", + IdType = 1 + }, + new + { + Id = 1210, + Caption = "message.view", + IdType = 1 + }, + new + { + Id = 1211, + Caption = "operations.view", + IdType = 1 + }, + new + { + Id = 1212, + Caption = "operations.edit", + IdType = 1 + }, + new + { + Id = 1213, + Caption = "params.view", + IdType = 1 + }, + new + { + Id = 1214, + Caption = "params.edit", + IdType = 1 + }, + new + { + Id = 1215, + Caption = "report.view", + IdType = 1 + }, + new + { + Id = 1216, + Caption = "report.edit", + IdType = 1 + }, + new + { + Id = 1217, + Caption = "setpoints.view", + IdType = 1 + }, + new + { + Id = 1218, + Caption = "setpoints.edit", + IdType = 1 + }, + new + { + Id = 1219, + Caption = "telemetry.view", + IdType = 1 + }, + new + { + Id = 1220, + Caption = "telemetryAnalysis.view", + IdType = 1 + }, + new + { + Id = 1221, + Caption = "well.view", + IdType = 1 + }, + new + { + Id = 1500, + Caption = "Просмотр всего", + IdType = 1 + }, + new + { + Id = 1501, + Caption = "file.edit", + IdType = 1 + }, + new + { + Id = 1502, + Caption = "drillingProgram.edit", + IdType = 1 + }, + new + { + Id = 2000, + Caption = "Заказчик", + IdType = 0 + }, + new + { + Id = 2001, + Caption = "Супервайзер", + IdType = 0 + }, + new + { + Id = 2002, + Caption = "Буровой подрядчик", + IdType = 0 + }, + new + { + Id = 2003, + Caption = "Растворщик", + IdType = 0 + }, + new + { + Id = 2004, + Caption = "Телеметрист", + IdType = 0 + }, + new + { + Id = 2005, + Caption = "Долотный сервис", + IdType = 0 + }, + new + { + Id = 2006, + Caption = "ГТИ", + IdType = 0 + }, + new + { + Id = 2007, + Caption = "Цементирование", + IdType = 0 + }); + }); modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => - { - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); - b.Property("Key") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("key") - .HasComment("Ключ настроек пользователя"); + b.Property("Key") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("key") + .HasComment("Ключ настроек пользователя"); - b.Property("Value") - .HasColumnType("jsonb") - .HasColumnName("setting_value") - .HasComment("Значение настроек пользователя"); + b.Property("Value") + .HasColumnType("jsonb") + .HasColumnName("setting_value") + .HasComment("Значение настроек пользователя"); - b.HasKey("IdUser", "Key"); + b.HasKey("IdUser", "Key"); - b.ToTable("t_user_settings"); + b.ToTable("t_user_settings"); - b.HasComment("настройки интерфейса пользователя"); - }); + b.HasComment("настройки интерфейса пользователя"); + }); modelBuilder.Entity("AsbCloudDb.Model.Well", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption"); + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); - b.Property("IdCluster") - .HasColumnType("integer") - .HasColumnName("id_cluster"); + b.Property("IdCluster") + .HasColumnType("integer") + .HasColumnName("id_cluster"); - b.Property("IdState") - .HasColumnType("integer") - .HasColumnName("state") - .HasComment("0 - неизвестно, 1 - в работе, 2 - завершена"); + b.Property("IdState") + .HasColumnType("integer") + .HasColumnName("state") + .HasComment("0 - неизвестно, 1 - в работе, 2 - завершена"); - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.Property("IdWellType") - .HasColumnType("integer") - .HasColumnName("id_well_type"); + b.Property("IdWellType") + .HasColumnType("integer") + .HasColumnName("id_well_type"); - b.Property("Latitude") - .HasColumnType("double precision") - .HasColumnName("latitude"); + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); - b.Property("Longitude") - .HasColumnType("double precision") - .HasColumnName("longitude"); + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); - b.Property("Timezone") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("timezone") - .HasComment("Смещение часового пояса от UTC"); + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdCluster"); + b.HasIndex("IdCluster"); - b.HasIndex("IdTelemetry") - .IsUnique(); + b.HasIndex("IdTelemetry") + .IsUnique(); - b.HasIndex("IdWellType"); + b.HasIndex("IdWellType"); - b.ToTable("t_well"); + b.ToTable("t_well"); - b.HasComment("скважины"); - }); + b.HasComment("скважины"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellComposite", b => - { - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("Id скважины получателя"); + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины получателя"); - b.Property("IdWellSrc") - .HasColumnType("integer") - .HasColumnName("id_well_src") - .HasComment("Id скважины композита"); + b.Property("IdWellSrc") + .HasColumnType("integer") + .HasColumnName("id_well_src") + .HasComment("Id скважины композита"); - b.Property("IdWellSectionType") - .HasColumnType("integer") - .HasColumnName("id_well_section_type") - .HasComment("Id тип секции композита"); + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_well_section_type") + .HasComment("Id тип секции композита"); - b.HasKey("IdWell", "IdWellSrc", "IdWellSectionType"); + b.HasKey("IdWell", "IdWellSrc", "IdWellSectionType"); - b.HasIndex("IdWellSectionType"); + b.HasIndex("IdWellSectionType"); - b.HasIndex("IdWellSrc"); + b.HasIndex("IdWellSrc"); - b.ToTable("t_well_composite"); + b.ToTable("t_well_composite"); - b.HasComment("Композитная скважина"); - }); + b.HasComment("Композитная скважина"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellFinalDocument", b => - { - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well"); + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category"); + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category"); - b.HasKey("IdWell", "IdUser", "IdCategory") - .HasName("t_well_final_documents_pk"); + b.HasKey("IdWell", "IdUser", "IdCategory") + .HasName("t_well_final_documents_pk"); - b.HasIndex("IdCategory"); + b.HasIndex("IdCategory"); - b.HasIndex("IdUser"); + b.HasIndex("IdUser"); - b.ToTable("t_well_final_documents"); + b.ToTable("t_well_final_documents"); - b.HasComment("Дело скважины"); - }); + b.HasComment("Дело скважины"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellOperation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CategoryInfo") - .HasColumnType("text") - .HasColumnName("category_info") - .HasComment("Доп. информация к выбраной категории"); + b.Property("CategoryInfo") + .HasColumnType("text") + .HasColumnName("category_info") + .HasComment("Доп. информация к выбраной категории"); - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("Комментарий"); + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарий"); - b.Property("DateStart") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_start") - .HasComment("Дата начала операции"); + b.Property("DateStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_start") + .HasComment("Дата начала операции"); - b.Property("DepthEnd") - .HasColumnType("double precision") - .HasColumnName("depth_end") - .HasComment("Глубина после завершения операции, м"); + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина после завершения операции, м"); - b.Property("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Глубина на начало операции, м"); + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина на начало операции, м"); - b.Property("DurationHours") - .HasColumnType("double precision") - .HasColumnName("duration_hours") - .HasComment("Продолжительность, часы"); + b.Property("DurationHours") + .HasColumnType("double precision") + .HasColumnName("duration_hours") + .HasComment("Продолжительность, часы"); - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("Id категории операции"); + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории операции"); - b.Property("IdPlan") - .HasColumnType("integer") - .HasColumnName("id_plan") - .HasComment("Id плановой операции"); + b.Property("IdPlan") + .HasColumnType("integer") + .HasColumnName("id_plan") + .HasComment("Id плановой операции"); - b.Property("IdType") - .HasColumnType("integer") - .HasColumnName("id_type") - .HasComment("0 = План или 1 = Факт"); + b.Property("IdType") + .HasColumnType("integer") + .HasColumnName("id_type") + .HasComment("0 = План или 1 = Факт"); - b.Property("IdUser") - .HasColumnType("integer"); + b.Property("IdUser") + .HasColumnType("integer"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("Id скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); - b.Property("IdWellSectionType") - .HasColumnType("integer") - .HasColumnName("id_well_section_type") - .HasComment("Id тип секции скважины"); + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_well_section_type") + .HasComment("Id тип секции скважины"); - b.Property("LastUpdateDate") - .HasColumnType("timestamp with time zone"); + b.Property("LastUpdateDate") + .HasColumnType("timestamp with time zone"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("DateStart"); + b.HasIndex("DateStart"); - b.HasIndex("DepthEnd"); + b.HasIndex("DepthEnd"); - b.HasIndex("IdCategory"); + b.HasIndex("IdCategory"); - b.HasIndex("IdPlan"); + b.HasIndex("IdPlan"); - b.HasIndex("IdWell"); + b.HasIndex("IdWell"); - b.HasIndex("IdWellSectionType"); + b.HasIndex("IdWellSectionType"); - b.ToTable("t_well_operation"); + b.ToTable("t_well_operation"); - b.HasComment("Данные по операциям на скважине"); - }); + b.HasComment("Данные по операциям на скважине"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("IdParent") - .HasColumnType("integer") - .HasColumnName("id_parent") - .HasComment("id родительской категории"); + b.Property("IdParent") + .HasColumnType("integer") + .HasColumnName("id_parent") + .HasComment("id родительской категории"); - b.Property("KeyValueName") - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasColumnName("key_value_name") - .HasComment("Название ключевого показателя операции"); + b.Property("KeyValueName") + .HasMaxLength(32) + .HasColumnType("character varying(32)") + .HasColumnName("key_value_name") + .HasComment("Название ключевого показателя операции"); - b.Property("KeyValueUnits") - .HasMaxLength(16) - .HasColumnType("character varying(16)") - .HasColumnName("key_value_units") - .HasComment("Единицы измерения ключевого показателя операции"); + b.Property("KeyValueUnits") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("key_value_units") + .HasComment("Единицы измерения ключевого показателя операции"); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название категории операции"); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории операции"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdParent"); + b.HasIndex("IdParent"); - b.ToTable("t_well_operation_category"); + b.ToTable("t_well_operation_category"); - b.HasComment("Справочник операций на скважине"); + b.HasComment("Справочник операций на скважине"); - b.HasData( - new - { - Id = 3000, - KeyValueName = "dT", - KeyValueUnits = "м/ч", - Name = "БУРЕНИЕ" - }, - new - { - Id = 3001, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "СПО" - }, - new - { - Id = 3002, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "КРЕПЛЕНИЕ" - }, - new - { - Id = 3003, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "ГФР" - }, - new - { - Id = 3004, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Вспомогательные операции" - }, - new - { - Id = 3005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Непроизводительное время (НПВ)" - }, - new - { - Id = 4000, - IdParent = 3000, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "КНБК" - }, - new - { - Id = 4001, - IdParent = 3000, - KeyValueName = "dT", - KeyValueUnits = "м/ч", - Name = "Механическое. бурение" - }, - new - { - Id = 4002, - IdParent = 3000, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Статический замер" - }, - new - { - Id = 4003, - IdParent = 3000, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Нормализация диаметра скважины" - }, - new - { - Id = 4004, - IdParent = 3000, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Наращивание" - }, - new - { - Id = 4005, - IdParent = 3001, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "СПО" - }, - new - { - Id = 4006, - IdParent = 3002, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Спуск обсадной колонны" - }, - new - { - Id = 4018, - IdParent = 3002, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Крепление" - }, - new - { - Id = 4007, - IdParent = 3002, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Цементирование" - }, - new - { - Id = 4008, - IdParent = 3002, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Вспомогательные работы при креплении" - }, - new - { - Id = 4009, - IdParent = 3003, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Сборка/разборка приборов ГИС" - }, - new - { - Id = 4010, - IdParent = 3003, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "СПО" - }, - new - { - Id = 4011, - IdParent = 3003, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "ГИС" - }, - new - { - Id = 4012, - IdParent = 3004, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Промывка, ОБР" - }, - new - { - Id = 4013, - IdParent = 3004, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Вспомогательные работы" - }, - new - { - Id = 4014, - IdParent = 3005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Ремонт оборудования" - }, - new - { - Id = 4015, - IdParent = 3005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Аварийные работы" - }, - new - { - Id = 4016, - IdParent = 3005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Осложнение" - }, - new - { - Id = 4017, - IdParent = 3005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Незаложенные в ГГД операции" - }, - new - { - Id = 5000, - IdParent = 4000, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Разборка КНБК" - }, - new - { - Id = 5001, - IdParent = 4000, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Сборка КНБК" - }, - new - { - Id = 5002, - IdParent = 4001, - KeyValueName = "МСП", - KeyValueUnits = "м/ч", - Name = "Бурение слайдом" - }, - new - { - Id = 5003, - IdParent = 4001, - KeyValueName = "МСП", - KeyValueUnits = "м/ч", - Name = "Бурение ротором" - }, - new - { - Id = 5004, - IdParent = 4002, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Замер ЗТС (запись MWD)" - }, - new - { - Id = 5005, - IdParent = 4003, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Промывка перед наращиванием" - }, - new - { - Id = 5006, - IdParent = 4003, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Проработка во время бурения" - }, - new - { - Id = 5007, - IdParent = 4003, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Проработка перед наращиванием" - }, - new - { - Id = 5008, - IdParent = 4003, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Шаблонировка во время бурения" - }, - new - { - Id = 5009, - IdParent = 4003, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Шаблонировка перед наращиванием" - }, - new - { - Id = 5010, - IdParent = 4004, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Наращивание" - }, - new - { - Id = 5011, - IdParent = 4004, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Удержание в клиньях" - }, - new - { - Id = 5012, - IdParent = 4005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Подъем инструмента" - }, - new - { - Id = 5013, - IdParent = 4005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Подъем КНБК" - }, - new - { - Id = 5014, - IdParent = 4005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Спуск инструмента" - }, - new - { - Id = 5015, - IdParent = 4005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Спуск КНБК" - }, - new - { - Id = 5016, - IdParent = 4006, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Промывка при спуске ОК" - }, - new - { - Id = 5017, - IdParent = 4006, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Спуск ОК" - }, - new - { - Id = 5018, - IdParent = 4007, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "ОЗЦ" - }, - new - { - Id = 5019, - IdParent = 4007, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Цементирование" - }, - new - { - Id = 5020, - IdParent = 4008, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Опрессовка БИ" - }, - new - { - Id = 5021, - IdParent = 4008, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Опрессовка ОК" - }, - new - { - Id = 5022, - IdParent = 4008, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "ПЗР при спуске ОК" - }, - new - { - Id = 5023, - IdParent = 4008, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "ПЗР при цементировании" - }, - new - { - Id = 5024, - IdParent = 4009, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Разборка комплекса приборов ГИС" - }, - new - { - Id = 5025, - IdParent = 4009, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Сборка комплекса приборов ГИС" - }, - new - { - Id = 5026, - IdParent = 4010, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Подъем приборов ГИС (на трубах)" - }, - new - { - Id = 5027, - IdParent = 4010, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Спуск приборов ГИС (на трубах)" - }, - new - { - Id = 5028, - IdParent = 4011, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Комплекс ГИС на жестком кабеле" - }, - new - { - Id = 5029, - IdParent = 4011, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Комплекс ГИС на кабеле" - }, - new - { - Id = 5030, - IdParent = 4011, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Комплекс ГИС на трубах" - }, - new - { - Id = 5031, - IdParent = 4012, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Закачка/прокачка пачки" - }, - new - { - Id = 5032, - IdParent = 4012, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Обработка БР" - }, - new - { - Id = 5033, - IdParent = 4012, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Ориентирование ТС при бурении" - }, - new - { - Id = 5034, - IdParent = 4012, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Перезапись гаммы-каротажа" - }, - new - { - Id = 5035, - IdParent = 4012, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Приготовление БР" - }, - new - { - Id = 5036, - IdParent = 4012, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Промывка" - }, - new - { - Id = 5037, - IdParent = 4012, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Разбуривание тех.оснастки" - }, - new - { - Id = 5038, - IdParent = 4012, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Спуск инструмента с проработкой" - }, - new - { - Id = 5039, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "ВМР" - }, - new - { - Id = 5040, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Демонтаж ПВО" - }, - new - { - Id = 5041, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Долив затруба при подъёме" - }, - new - { - Id = 5042, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Монтаж ПВО" - }, - new - { - Id = 5043, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Наработка жёлоба" - }, - new - { - Id = 5044, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Обвязка устья с циркуляционной системой" - }, - new - { - Id = 5045, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Оборудование устья" - }, - new - { - Id = 5046, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Опрессовка ПВО" - }, - new - { - Id = 5047, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Перемонтаж ПВО " - }, - new - { - Id = 5048, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Перетяжка талевого каната" - }, - new - { - Id = 5049, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "ПЗР при сборке КНБК" - }, - new - { - Id = 5050, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Полная замена талевого каната" - }, - new - { - Id = 5051, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "ПР перед забуркой направления" - }, - new - { - Id = 5052, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Продувка манифольда" - }, - new - { - Id = 5053, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Срезка" - }, - new - { - Id = 5054, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Тайм-дриллинг" - }, - new - { - Id = 5055, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Тех.отстой" - }, - new - { - Id = 5056, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Учебная тревога \"Выброс\"" - }, - new - { - Id = 5057, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Чистка ЦСГО/емкостного блока" - }, - new - { - Id = 5058, - IdParent = 4014, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Ремонт бурового оборудования" - }, - new - { - Id = 5059, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Ловильные работы" - }, - new - { - Id = 5060, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Ожидание" - }, - new - { - Id = 5061, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Определение места прихвата и ЛМ" - }, - new - { - Id = 5062, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Работа яссом" - }, - new - { - Id = 5063, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Расхаживание" - }, - new - { - Id = 5064, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "СПО - колокол" - }, - new - { - Id = 5065, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "СПО - метчик" - }, - new - { - Id = 5066, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "СПО - овершот" - }, - new - { - Id = 5067, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "СПО - труболовка" - }, - new - { - Id = 5068, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Торпедирование (встряхивание)" - }, - new - { - Id = 5069, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Торпедирование (отстрел)" - }, - new - { - Id = 5070, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Установка ванн" - }, - new - { - Id = 5071, - IdParent = 4015, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Фрезеровка" - }, - new - { - Id = 5072, - IdParent = 4016, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Контролируемое ГНВП" - }, - new - { - Id = 5073, - IdParent = 4016, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Поглощение" - }, - new - { - Id = 5074, - IdParent = 4016, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Сальникообразование" - }, - new - { - Id = 5075, - IdParent = 4016, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Утяжеление БР" - }, - new - { - Id = 5076, - IdParent = 4017, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "НПВ / прочее" - }, - new - { - Id = 5077, - IdParent = 4017, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Обработка раствора (несоответствие параметров)" - }, - new - { - Id = 5078, - IdParent = 4017, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "подъем ОК" - }, - new - { - Id = 5079, - IdParent = 4017, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Ревизия КНБК/инструмента/ЗТС" - }, - new - { - Id = 5082, - IdParent = 4000, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Сборка устройства ориентирования КО" - }, - new - { - Id = 5083, - IdParent = 4003, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Проработка принудительная" - }, - new - { - Id = 5084, - IdParent = 4005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Шаблонировка подъем БИ, продувка" - }, - new - { - Id = 5085, - IdParent = 4005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Спуск бурильного инструмента со сборкой с мостков" - }, - new - { - Id = 5086, - IdParent = 4005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Подъем БИ с выбросом на мостки" - }, - new - { - Id = 5087, - IdParent = 4005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Спуск БИ со сборкой с мостков" - }, - new - { - Id = 5088, - IdParent = 4005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Сборка и спуск ТБТ" - }, - new - { - Id = 5089, - IdParent = 4005, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Спуск КО на транспотрной колонне" - }, - new - { - Id = 5090, - IdParent = 4008, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Отворот допускной трубы" - }, - new - { - Id = 5091, - IdParent = 4008, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Активация подвески, опрессовка" - }, - new - { - Id = 5092, - IdParent = 4008, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Монтаж, опрессовка ФА" - }, - new - { - Id = 5093, - IdParent = 4008, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Сборка хвостовика 114мм (согласно схеме)" - }, - new - { - Id = 5094, - IdParent = 4008, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "ПЗР к спуску УЭЦН" - }, - new - { - Id = 5095, - IdParent = 4008, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Активация подвески (потайной колонны, хвостовика)" - }, - new - { - Id = 5096, - IdParent = 4008, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Шаблонирование перед спуском" - }, - new - { - Id = 5097, - IdParent = 4012, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Промывка - перевод скважины на новый раствор" - }, - new - { - Id = 5098, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Сборка БИ с мостков на подсвечник" - }, - new - { - Id = 5099, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Подготовка ствола скважины. Перезапись ГК в интервале установки КО." - }, - new - { - Id = 5100, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Смена рабочего переводника ВСП" - }, - new - { - Id = 5101, - IdParent = 4014, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Ремонт" - }, - new - { - Id = 5102, - IdParent = 4018, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Спуск пакера" - }, - new - { - Id = 5103, - IdParent = 4011, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Запись гамма-каратожа" - }, - new - { - Id = 5104, - IdParent = 4013, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Шаблонирование спуск БИ" - }, - new - { - Id = 5105, - IdParent = 4018, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Сборка клин-отклонителя" - }, - new - { - Id = 5106, - IdParent = 4018, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Ориентирование и посадка клина-отклонителя" - }, - new - { - Id = 5107, - IdParent = 4018, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Протяжка подъемного патрубка подвески" - }, - new - { - Id = 5108, - IdParent = 4018, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Подъем клина-отклонителя" - }, - new - { - Id = 5109, - IdParent = 4018, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Стыковка стингера с хвостовиком основного ствола" - }, - new - { - Id = 5110, - IdParent = 4018, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Ориентирование и установка стыковочного узла хвостовика" - }, - new - { - Id = 5111, - IdParent = 4001, - KeyValueName = "МСП", - KeyValueUnits = "м/ч", - Name = "Бурение с отбором керна" - }, - new - { - Id = 5112, - IdParent = 4018, - KeyValueName = "dT", - KeyValueUnits = "мин", - Name = "Работа пакером в обсадной колонне" - }); - }); + b.HasData( + new + { + Id = 3000, + KeyValueName = "dT", + KeyValueUnits = "м/ч", + Name = "БУРЕНИЕ" + }, + new + { + Id = 3001, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "СПО" + }, + new + { + Id = 3002, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "КРЕПЛЕНИЕ" + }, + new + { + Id = 3003, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "ГФР" + }, + new + { + Id = 3004, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Вспомогательные операции" + }, + new + { + Id = 3005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Непроизводительное время (НПВ)" + }, + new + { + Id = 4000, + IdParent = 3000, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "КНБК" + }, + new + { + Id = 4001, + IdParent = 3000, + KeyValueName = "dT", + KeyValueUnits = "м/ч", + Name = "Механическое. бурение" + }, + new + { + Id = 4002, + IdParent = 3000, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Статический замер" + }, + new + { + Id = 4003, + IdParent = 3000, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Нормализация диаметра скважины" + }, + new + { + Id = 4004, + IdParent = 3000, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Наращивание" + }, + new + { + Id = 4005, + IdParent = 3001, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "СПО" + }, + new + { + Id = 4006, + IdParent = 3002, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Спуск обсадной колонны" + }, + new + { + Id = 4018, + IdParent = 3002, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Крепление" + }, + new + { + Id = 4007, + IdParent = 3002, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Цементирование" + }, + new + { + Id = 4008, + IdParent = 3002, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Вспомогательные работы при креплении" + }, + new + { + Id = 4009, + IdParent = 3003, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Сборка/разборка приборов ГИС" + }, + new + { + Id = 4010, + IdParent = 3003, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "СПО" + }, + new + { + Id = 4011, + IdParent = 3003, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "ГИС" + }, + new + { + Id = 4012, + IdParent = 3004, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Промывка, ОБР" + }, + new + { + Id = 4013, + IdParent = 3004, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Вспомогательные работы" + }, + new + { + Id = 4014, + IdParent = 3005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Ремонт оборудования" + }, + new + { + Id = 4015, + IdParent = 3005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Аварийные работы" + }, + new + { + Id = 4016, + IdParent = 3005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Осложнение" + }, + new + { + Id = 4017, + IdParent = 3005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Незаложенные в ГГД операции" + }, + new + { + Id = 5000, + IdParent = 4000, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Разборка КНБК" + }, + new + { + Id = 5001, + IdParent = 4000, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Сборка КНБК" + }, + new + { + Id = 5002, + IdParent = 4001, + KeyValueName = "МСП", + KeyValueUnits = "м/ч", + Name = "Бурение слайдом" + }, + new + { + Id = 5003, + IdParent = 4001, + KeyValueName = "МСП", + KeyValueUnits = "м/ч", + Name = "Бурение ротором" + }, + new + { + Id = 5004, + IdParent = 4002, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Замер ЗТС (запись MWD)" + }, + new + { + Id = 5005, + IdParent = 4003, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Промывка перед наращиванием" + }, + new + { + Id = 5006, + IdParent = 4003, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Проработка во время бурения" + }, + new + { + Id = 5007, + IdParent = 4003, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Проработка перед наращиванием" + }, + new + { + Id = 5008, + IdParent = 4003, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Шаблонировка во время бурения" + }, + new + { + Id = 5009, + IdParent = 4003, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Шаблонировка перед наращиванием" + }, + new + { + Id = 5010, + IdParent = 4004, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Наращивание" + }, + new + { + Id = 5011, + IdParent = 4004, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Удержание в клиньях" + }, + new + { + Id = 5012, + IdParent = 4005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Подъем инструмента" + }, + new + { + Id = 5013, + IdParent = 4005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Подъем КНБК" + }, + new + { + Id = 5014, + IdParent = 4005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Спуск инструмента" + }, + new + { + Id = 5015, + IdParent = 4005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Спуск КНБК" + }, + new + { + Id = 5016, + IdParent = 4006, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Промывка при спуске ОК" + }, + new + { + Id = 5017, + IdParent = 4006, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Спуск ОК" + }, + new + { + Id = 5018, + IdParent = 4007, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "ОЗЦ" + }, + new + { + Id = 5019, + IdParent = 4007, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Цементирование" + }, + new + { + Id = 5020, + IdParent = 4008, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Опрессовка БИ" + }, + new + { + Id = 5021, + IdParent = 4008, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Опрессовка ОК" + }, + new + { + Id = 5022, + IdParent = 4008, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "ПЗР при спуске ОК" + }, + new + { + Id = 5023, + IdParent = 4008, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "ПЗР при цементировании" + }, + new + { + Id = 5024, + IdParent = 4009, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Разборка комплекса приборов ГИС" + }, + new + { + Id = 5025, + IdParent = 4009, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Сборка комплекса приборов ГИС" + }, + new + { + Id = 5026, + IdParent = 4010, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Подъем приборов ГИС (на трубах)" + }, + new + { + Id = 5027, + IdParent = 4010, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Спуск приборов ГИС (на трубах)" + }, + new + { + Id = 5028, + IdParent = 4011, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Комплекс ГИС на жестком кабеле" + }, + new + { + Id = 5029, + IdParent = 4011, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Комплекс ГИС на кабеле" + }, + new + { + Id = 5030, + IdParent = 4011, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Комплекс ГИС на трубах" + }, + new + { + Id = 5031, + IdParent = 4012, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Закачка/прокачка пачки" + }, + new + { + Id = 5032, + IdParent = 4012, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Обработка БР" + }, + new + { + Id = 5033, + IdParent = 4012, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Ориентирование ТС при бурении" + }, + new + { + Id = 5034, + IdParent = 4012, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Перезапись гаммы-каротажа" + }, + new + { + Id = 5035, + IdParent = 4012, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Приготовление БР" + }, + new + { + Id = 5036, + IdParent = 4012, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Промывка" + }, + new + { + Id = 5037, + IdParent = 4012, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Разбуривание тех.оснастки" + }, + new + { + Id = 5038, + IdParent = 4012, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Спуск инструмента с проработкой" + }, + new + { + Id = 5039, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "ВМР" + }, + new + { + Id = 5040, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Демонтаж ПВО" + }, + new + { + Id = 5041, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Долив затруба при подъёме" + }, + new + { + Id = 5042, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Монтаж ПВО" + }, + new + { + Id = 5043, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Наработка жёлоба" + }, + new + { + Id = 5044, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Обвязка устья с циркуляционной системой" + }, + new + { + Id = 5045, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Оборудование устья" + }, + new + { + Id = 5046, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Опрессовка ПВО" + }, + new + { + Id = 5047, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Перемонтаж ПВО " + }, + new + { + Id = 5048, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Перетяжка талевого каната" + }, + new + { + Id = 5049, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "ПЗР при сборке КНБК" + }, + new + { + Id = 5050, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Полная замена талевого каната" + }, + new + { + Id = 5051, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "ПР перед забуркой направления" + }, + new + { + Id = 5052, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Продувка манифольда" + }, + new + { + Id = 5053, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Срезка" + }, + new + { + Id = 5054, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Тайм-дриллинг" + }, + new + { + Id = 5055, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Тех.отстой" + }, + new + { + Id = 5056, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Учебная тревога \"Выброс\"" + }, + new + { + Id = 5057, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Чистка ЦСГО/емкостного блока" + }, + new + { + Id = 5058, + IdParent = 4014, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Ремонт бурового оборудования" + }, + new + { + Id = 5059, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Ловильные работы" + }, + new + { + Id = 5060, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Ожидание" + }, + new + { + Id = 5061, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Определение места прихвата и ЛМ" + }, + new + { + Id = 5062, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Работа яссом" + }, + new + { + Id = 5063, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Расхаживание" + }, + new + { + Id = 5064, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "СПО - колокол" + }, + new + { + Id = 5065, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "СПО - метчик" + }, + new + { + Id = 5066, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "СПО - овершот" + }, + new + { + Id = 5067, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "СПО - труболовка" + }, + new + { + Id = 5068, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Торпедирование (встряхивание)" + }, + new + { + Id = 5069, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Торпедирование (отстрел)" + }, + new + { + Id = 5070, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Установка ванн" + }, + new + { + Id = 5071, + IdParent = 4015, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Фрезеровка" + }, + new + { + Id = 5072, + IdParent = 4016, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Контролируемое ГНВП" + }, + new + { + Id = 5073, + IdParent = 4016, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Поглощение" + }, + new + { + Id = 5074, + IdParent = 4016, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Сальникообразование" + }, + new + { + Id = 5075, + IdParent = 4016, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Утяжеление БР" + }, + new + { + Id = 5076, + IdParent = 4017, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "НПВ / прочее" + }, + new + { + Id = 5077, + IdParent = 4017, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Обработка раствора (несоответствие параметров)" + }, + new + { + Id = 5078, + IdParent = 4017, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "подъем ОК" + }, + new + { + Id = 5079, + IdParent = 4017, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Ревизия КНБК/инструмента/ЗТС" + }, + new + { + Id = 5082, + IdParent = 4000, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Сборка устройства ориентирования КО" + }, + new + { + Id = 5083, + IdParent = 4003, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Проработка принудительная" + }, + new + { + Id = 5084, + IdParent = 4005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Шаблонировка подъем БИ, продувка" + }, + new + { + Id = 5085, + IdParent = 4005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Спуск бурильного инструмента со сборкой с мостков" + }, + new + { + Id = 5086, + IdParent = 4005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Подъем БИ с выбросом на мостки" + }, + new + { + Id = 5087, + IdParent = 4005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Спуск БИ со сборкой с мостков" + }, + new + { + Id = 5088, + IdParent = 4005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Сборка и спуск ТБТ" + }, + new + { + Id = 5089, + IdParent = 4005, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Спуск КО на транспотрной колонне" + }, + new + { + Id = 5090, + IdParent = 4008, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Отворот допускной трубы" + }, + new + { + Id = 5091, + IdParent = 4008, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Активация подвески, опрессовка" + }, + new + { + Id = 5092, + IdParent = 4008, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Монтаж, опрессовка ФА" + }, + new + { + Id = 5093, + IdParent = 4008, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Сборка хвостовика 114мм (согласно схеме)" + }, + new + { + Id = 5094, + IdParent = 4008, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "ПЗР к спуску УЭЦН" + }, + new + { + Id = 5095, + IdParent = 4008, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Активация подвески (потайной колонны, хвостовика)" + }, + new + { + Id = 5096, + IdParent = 4008, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Шаблонирование перед спуском" + }, + new + { + Id = 5097, + IdParent = 4012, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Промывка - перевод скважины на новый раствор" + }, + new + { + Id = 5098, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Сборка БИ с мостков на подсвечник" + }, + new + { + Id = 5099, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Подготовка ствола скважины. Перезапись ГК в интервале установки КО." + }, + new + { + Id = 5100, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Смена рабочего переводника ВСП" + }, + new + { + Id = 5101, + IdParent = 4014, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Ремонт" + }, + new + { + Id = 5102, + IdParent = 4018, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Спуск пакера" + }, + new + { + Id = 5103, + IdParent = 4011, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Запись гамма-каратожа" + }, + new + { + Id = 5104, + IdParent = 4013, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Шаблонирование спуск БИ" + }, + new + { + Id = 5105, + IdParent = 4018, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Сборка клин-отклонителя" + }, + new + { + Id = 5106, + IdParent = 4018, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Ориентирование и посадка клина-отклонителя" + }, + new + { + Id = 5107, + IdParent = 4018, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Протяжка подъемного патрубка подвески" + }, + new + { + Id = 5108, + IdParent = 4018, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Подъем клина-отклонителя" + }, + new + { + Id = 5109, + IdParent = 4018, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Стыковка стингера с хвостовиком основного ствола" + }, + new + { + Id = 5110, + IdParent = 4018, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Ориентирование и установка стыковочного узла хвостовика" + }, + new + { + Id = 5111, + IdParent = 4001, + KeyValueName = "МСП", + KeyValueUnits = "м/ч", + Name = "Бурение с отбором керна" + }, + new + { + Id = 5112, + IdParent = 4018, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Работа пакером в обсадной колонне" + }); + }); modelBuilder.Entity("AsbCloudDb.Model.WellSections.WellSectionPlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DepthEnd") - .HasColumnType("double precision") - .HasColumnName("depth_end") - .HasComment("Конечная глубина бурения, м"); + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Конечная глубина бурения, м"); - b.Property("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Начальная глубина бурения, м"); + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Начальная глубина бурения, м"); - b.Property("IdSectionType") - .HasColumnType("integer") - .HasColumnName("id_section_type") - .HasComment("Тип секции"); + b.Property("IdSectionType") + .HasColumnType("integer") + .HasColumnName("id_section_type") + .HasComment("Тип секции"); - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("Id пользователя"); + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя"); - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("Id скважины"); + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); - b.Property("InnerDiameter") - .HasColumnType("double precision") - .HasColumnName("inner_diameter") - .HasComment("Внутренний диаметр"); + b.Property("InnerDiameter") + .HasColumnType("double precision") + .HasColumnName("inner_diameter") + .HasComment("Внутренний диаметр"); - b.Property("LastUpdateDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_last_update") - .HasComment("Дата последнего обновления"); + b.Property("LastUpdateDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_last_update") + .HasComment("Дата последнего обновления"); - b.Property("OuterDiameter") - .HasColumnType("double precision") - .HasColumnName("outer_diameter") - .HasComment("Внешний диаметр"); + b.Property("OuterDiameter") + .HasColumnType("double precision") + .HasColumnName("outer_diameter") + .HasComment("Внешний диаметр"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("IdSectionType"); + b.HasIndex("IdSectionType"); - b.HasIndex("IdWell", "IdSectionType") - .IsUnique(); + b.HasIndex("IdWell", "IdSectionType") + .IsUnique(); - b.ToTable("t_well_section_plan"); - }); + b.ToTable("t_well_section_plan"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption") - .HasComment("Название"); + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); - b.Property("Order") - .HasColumnType("real") - .HasColumnName("order") - .HasComment("Порядок"); + b.Property("Order") + .HasColumnType("real") + .HasColumnName("order") + .HasComment("Порядок"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("t_well_section_type"); + b.ToTable("t_well_section_type"); - b.HasComment("конструкция секции скважины"); + b.HasComment("конструкция секции скважины"); - b.HasData( - new - { - Id = 1, - Caption = "Пилотный ствол", - Order = 4f - }, - new - { - Id = 2, - Caption = "Направление", - Order = 0f - }, - new - { - Id = 3, - Caption = "Кондуктор", - Order = 1f - }, - new - { - Id = 4, - Caption = "Эксплуатационная колонна", - Order = 3f - }, - new - { - Id = 5, - Caption = "Транспортный ствол", - Order = 5f - }, - new - { - Id = 6, - Caption = "Хвостовик", - Order = 6f - }, - new - { - Id = 7, - Caption = "Пилотный ствол 2", - Order = 4.1f - }, - new - { - Id = 8, - Caption = "Направление 2", - Order = 0.1f - }, - new - { - Id = 9, - Caption = "Кондуктор 2", - Order = 1.1f - }, - new - { - Id = 10, - Caption = "Эксплуатационная колонна 2", - Order = 3.1f - }, - new - { - Id = 11, - Caption = "Транспортный ствол 2", - Order = 5.1f - }, - new - { - Id = 12, - Caption = "Хвостовик 2", - Order = 6.1f - }, - new - { - Id = 13, - Caption = "Пилотный ствол 3", - Order = 4.2f - }, - new - { - Id = 14, - Caption = "Направление 3", - Order = 0.2f - }, - new - { - Id = 15, - Caption = "Кондуктор 3", - Order = 1.2f - }, - new - { - Id = 16, - Caption = "Эксплуатационная колонна 3", - Order = 3.2f - }, - new - { - Id = 17, - Caption = "Транспортный ствол 3", - Order = 5.2f - }, - new - { - Id = 18, - Caption = "Хвостовик 3", - Order = 6.2f - }, - new - { - Id = 19, - Caption = "Пилотный ствол 4", - Order = 4.3f - }, - new - { - Id = 20, - Caption = "Направление 4", - Order = 0.3f - }, - new - { - Id = 21, - Caption = "Кондуктор 4", - Order = 1.3f - }, - new - { - Id = 22, - Caption = "Эксплуатационная колонна 4", - Order = 3.3f - }, - new - { - Id = 23, - Caption = "Транспортный ствол 4", - Order = 5.3f - }, - new - { - Id = 24, - Caption = "Хвостовик 4", - Order = 6.3f - }, - new - { - Id = 25, - Caption = "Пилотный ствол 5", - Order = 4.4f - }, - new - { - Id = 26, - Caption = "Направление 5", - Order = 0.4f - }, - new - { - Id = 27, - Caption = "Кондуктор 5", - Order = 1.4f - }, - new - { - Id = 28, - Caption = "Эксплуатационная колонна 5", - Order = 3.4f - }, - new - { - Id = 29, - Caption = "Транспортный ствол 5", - Order = 5.4f - }, - new - { - Id = 30, - Caption = "Хвостовик 5", - Order = 6.4f - }, - new - { - Id = 31, - Caption = "Техническая колонна", - Order = 2f - }, - new - { - Id = 32, - Caption = "Техническая колонна 2", - Order = 2.1f - }, - new - { - Id = 33, - Caption = "Техническая колонна 3", - Order = 2.2f - }, - new - { - Id = 34, - Caption = "Хвостовик 6", - Order = 6.5f - }, - new - { - Id = 35, - Caption = "Хвостовик 7", - Order = 6.6f - }, - new - { - Id = 36, - Caption = "Хвостовик 8", - Order = 6.7f - }, - new - { - Id = 37, - Caption = "Хвостовик 9", - Order = 6.8f - }, - new - { - Id = 38, - Caption = "Хвостовик 10", - Order = 6.9f - }); - }); + b.HasData( + new + { + Id = 1, + Caption = "Пилотный ствол", + Order = 4f + }, + new + { + Id = 2, + Caption = "Направление", + Order = 0f + }, + new + { + Id = 3, + Caption = "Кондуктор", + Order = 1f + }, + new + { + Id = 4, + Caption = "Эксплуатационная колонна", + Order = 3f + }, + new + { + Id = 5, + Caption = "Транспортный ствол", + Order = 5f + }, + new + { + Id = 6, + Caption = "Хвостовик", + Order = 6f + }, + new + { + Id = 7, + Caption = "Пилотный ствол 2", + Order = 4.1f + }, + new + { + Id = 8, + Caption = "Направление 2", + Order = 0.1f + }, + new + { + Id = 9, + Caption = "Кондуктор 2", + Order = 1.1f + }, + new + { + Id = 10, + Caption = "Эксплуатационная колонна 2", + Order = 3.1f + }, + new + { + Id = 11, + Caption = "Транспортный ствол 2", + Order = 5.1f + }, + new + { + Id = 12, + Caption = "Хвостовик 2", + Order = 6.1f + }, + new + { + Id = 13, + Caption = "Пилотный ствол 3", + Order = 4.2f + }, + new + { + Id = 14, + Caption = "Направление 3", + Order = 0.2f + }, + new + { + Id = 15, + Caption = "Кондуктор 3", + Order = 1.2f + }, + new + { + Id = 16, + Caption = "Эксплуатационная колонна 3", + Order = 3.2f + }, + new + { + Id = 17, + Caption = "Транспортный ствол 3", + Order = 5.2f + }, + new + { + Id = 18, + Caption = "Хвостовик 3", + Order = 6.2f + }, + new + { + Id = 19, + Caption = "Пилотный ствол 4", + Order = 4.3f + }, + new + { + Id = 20, + Caption = "Направление 4", + Order = 0.3f + }, + new + { + Id = 21, + Caption = "Кондуктор 4", + Order = 1.3f + }, + new + { + Id = 22, + Caption = "Эксплуатационная колонна 4", + Order = 3.3f + }, + new + { + Id = 23, + Caption = "Транспортный ствол 4", + Order = 5.3f + }, + new + { + Id = 24, + Caption = "Хвостовик 4", + Order = 6.3f + }, + new + { + Id = 25, + Caption = "Пилотный ствол 5", + Order = 4.4f + }, + new + { + Id = 26, + Caption = "Направление 5", + Order = 0.4f + }, + new + { + Id = 27, + Caption = "Кондуктор 5", + Order = 1.4f + }, + new + { + Id = 28, + Caption = "Эксплуатационная колонна 5", + Order = 3.4f + }, + new + { + Id = 29, + Caption = "Транспортный ствол 5", + Order = 5.4f + }, + new + { + Id = 30, + Caption = "Хвостовик 5", + Order = 6.4f + }, + new + { + Id = 31, + Caption = "Техническая колонна", + Order = 2f + }, + new + { + Id = 32, + Caption = "Техническая колонна 2", + Order = 2.1f + }, + new + { + Id = 33, + Caption = "Техническая колонна 3", + Order = 2.2f + }, + new + { + Id = 34, + Caption = "Хвостовик 6", + Order = 6.5f + }, + new + { + Id = 35, + Caption = "Хвостовик 7", + Order = 6.6f + }, + new + { + Id = 36, + Caption = "Хвостовик 8", + Order = 6.7f + }, + new + { + Id = 37, + Caption = "Хвостовик 9", + Order = 6.8f + }, + new + { + Id = 38, + Caption = "Хвостовик 10", + Order = 6.9f + }); + }); modelBuilder.Entity("AsbCloudDb.Model.WellType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption") - .HasComment("Название"); + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("t_well_type"); + b.ToTable("t_well_type"); - b.HasComment("конструкция скважины"); + b.HasComment("конструкция скважины"); - b.HasData( - new - { - Id = 1, - Caption = "Наклонно-направленная" - }, - new - { - Id = 2, - Caption = "Горизонтальная" - }); - }); + b.HasData( + new + { + Id = 1, + Caption = "Наклонно-направленная" + }, + new + { + Id = 2, + Caption = "Горизонтальная" + }); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.RecordBase", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); - b.Property("Actcod") - .HasColumnType("smallint") - .HasColumnName("ACTCOD"); + b.Property("Actcod") + .HasColumnType("smallint") + .HasColumnName("ACTCOD"); - b.Property("Date") - .HasColumnType("integer") - .HasColumnName("DATE"); + b.Property("Date") + .HasColumnType("integer") + .HasColumnName("DATE"); - b.Property("Recid") - .HasColumnType("smallint") - .HasColumnName("RECID"); + b.Property("Recid") + .HasColumnType("smallint") + .HasColumnName("RECID"); - b.Property("Seqid") - .HasColumnType("integer") - .HasColumnName("SEQID"); + b.Property("Seqid") + .HasColumnType("integer") + .HasColumnName("SEQID"); - b.Property("Stknum") - .HasColumnType("smallint") - .HasColumnName("STKNUM"); + b.Property("Stknum") + .HasColumnType("smallint") + .HasColumnName("STKNUM"); - b.Property("Time") - .HasColumnType("integer") - .HasColumnName("TIME"); + b.Property("Time") + .HasColumnType("integer") + .HasColumnName("TIME"); - b.Property("Wellid") - .HasColumnType("text") - .HasColumnName("WELLID"); + b.Property("Wellid") + .HasColumnType("text") + .HasColumnName("WELLID"); - b.HasKey("IdTelemetry", "DateTime"); + b.HasKey("IdTelemetry", "DateTime"); - b.ToTable("t_telemetry_wits_base"); - }); + b.ToTable("t_telemetry_wits_base"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - b.Property("Blkpos") - .HasColumnType("real") - .HasColumnName("BLKPOS"); + b.Property("Blkpos") + .HasColumnType("real") + .HasColumnName("BLKPOS"); - b.Property("Chkp") - .HasColumnType("real") - .HasColumnName("CHKP"); + b.Property("Chkp") + .HasColumnType("real") + .HasColumnName("CHKP"); - b.Property("Deptbitm") - .HasColumnType("real") - .HasColumnName("DEPTBITM"); + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); - b.Property("Deptbitv") - .HasColumnType("real") - .HasColumnName("DEPTBITV"); + b.Property("Deptbitv") + .HasColumnType("real") + .HasColumnName("DEPTBITV"); - b.Property("Deptmeas") - .HasColumnType("real") - .HasColumnName("DEPTMEAS"); + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); - b.Property("Deptretm") - .HasColumnType("real") - .HasColumnName("DEPTRETM"); + b.Property("Deptretm") + .HasColumnType("real") + .HasColumnName("DEPTRETM"); - b.Property("Deptvert") - .HasColumnType("real") - .HasColumnName("DEPTVERT"); + b.Property("Deptvert") + .HasColumnType("real") + .HasColumnName("DEPTVERT"); - b.Property("Gasa") - .HasColumnType("real") - .HasColumnName("GASA"); + b.Property("Gasa") + .HasColumnType("real") + .HasColumnName("GASA"); - b.Property("Hkla") - .HasColumnType("real") - .HasColumnName("HKLA"); + b.Property("Hkla") + .HasColumnType("real") + .HasColumnName("HKLA"); - b.Property("Hklx") - .HasColumnType("real") - .HasColumnName("HKLX"); + b.Property("Hklx") + .HasColumnType("real") + .HasColumnName("HKLX"); - b.Property("Lagstks") - .HasColumnType("smallint") - .HasColumnName("LAGSTKS"); + b.Property("Lagstks") + .HasColumnType("smallint") + .HasColumnName("LAGSTKS"); - b.Property("Mcia") - .HasColumnType("real") - .HasColumnName("MCIA"); + b.Property("Mcia") + .HasColumnType("real") + .HasColumnName("MCIA"); - b.Property("Mcoa") - .HasColumnType("real") - .HasColumnName("MCOA"); + b.Property("Mcoa") + .HasColumnType("real") + .HasColumnName("MCOA"); - b.Property("Mdia") - .HasColumnType("real") - .HasColumnName("MDIA"); + b.Property("Mdia") + .HasColumnType("real") + .HasColumnName("MDIA"); - b.Property("Mdoa") - .HasColumnType("real") - .HasColumnName("MDOA"); + b.Property("Mdoa") + .HasColumnType("real") + .HasColumnName("MDOA"); - b.Property("Mfia") - .HasColumnType("real") - .HasColumnName("MFIA"); + b.Property("Mfia") + .HasColumnType("real") + .HasColumnName("MFIA"); - b.Property("Mfoa") - .HasColumnType("real") - .HasColumnName("MFOA"); + b.Property("Mfoa") + .HasColumnType("real") + .HasColumnName("MFOA"); - b.Property("Mfop") - .HasColumnType("smallint") - .HasColumnName("MFOP"); + b.Property("Mfop") + .HasColumnType("smallint") + .HasColumnName("MFOP"); - b.Property("Mtia") - .HasColumnType("real") - .HasColumnName("MTIA"); + b.Property("Mtia") + .HasColumnType("real") + .HasColumnName("MTIA"); - b.Property("Mtoa") - .HasColumnType("real") - .HasColumnName("MTOA"); + b.Property("Mtoa") + .HasColumnType("real") + .HasColumnName("MTOA"); - b.Property("Ropa") - .HasColumnType("real") - .HasColumnName("ROPA"); + b.Property("Ropa") + .HasColumnType("real") + .HasColumnName("ROPA"); - b.Property("Rpma") - .HasColumnType("smallint") - .HasColumnName("RPMA"); + b.Property("Rpma") + .HasColumnType("smallint") + .HasColumnName("RPMA"); - b.Property("Spare1") - .HasColumnType("real") - .HasColumnName("SPARE1"); + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); - b.Property("Spare2") - .HasColumnType("real") - .HasColumnName("SPARE2"); + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); - b.Property("Spare3") - .HasColumnType("real") - .HasColumnName("SPARE3"); + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); - b.Property("Spare4") - .HasColumnType("real") - .HasColumnName("SPARE4"); + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); - b.Property("Spare5") - .HasColumnType("real") - .HasColumnName("SPARE5"); + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); - b.Property("Spm1") - .HasColumnType("smallint") - .HasColumnName("SPM1"); + b.Property("Spm1") + .HasColumnType("smallint") + .HasColumnName("SPM1"); - b.Property("Spm2") - .HasColumnType("smallint") - .HasColumnName("SPM2"); + b.Property("Spm2") + .HasColumnType("smallint") + .HasColumnName("SPM2"); - b.Property("Spm3") - .HasColumnType("smallint") - .HasColumnName("SPM3"); + b.Property("Spm3") + .HasColumnType("smallint") + .HasColumnName("SPM3"); - b.Property("Sppa") - .HasColumnType("real") - .HasColumnName("SPPA"); + b.Property("Sppa") + .HasColumnType("real") + .HasColumnName("SPPA"); - b.Property("Stkc") - .HasColumnType("integer") - .HasColumnName("STKC"); + b.Property("Stkc") + .HasColumnType("integer") + .HasColumnName("STKC"); - b.Property("TelemetryId") - .HasColumnType("integer"); + b.Property("TelemetryId") + .HasColumnType("integer"); - b.Property("Torqa") - .HasColumnType("real") - .HasColumnName("TORQA"); + b.Property("Torqa") + .HasColumnType("real") + .HasColumnName("TORQA"); - b.Property("Torqx") - .HasColumnType("real") - .HasColumnName("TORQX"); + b.Property("Torqx") + .HasColumnType("real") + .HasColumnName("TORQX"); - b.Property("Tvolact") - .HasColumnType("real") - .HasColumnName("TVOLACT"); + b.Property("Tvolact") + .HasColumnType("real") + .HasColumnName("TVOLACT"); - b.Property("Tvolcact") - .HasColumnType("real") - .HasColumnName("TVOLCACT"); + b.Property("Tvolcact") + .HasColumnType("real") + .HasColumnName("TVOLCACT"); - b.Property("Woba") - .HasColumnType("real") - .HasColumnName("WOBA"); + b.Property("Woba") + .HasColumnType("real") + .HasColumnName("WOBA"); - b.Property("Wobx") - .HasColumnType("real") - .HasColumnName("WOBX"); + b.Property("Wobx") + .HasColumnType("real") + .HasColumnName("WOBX"); - b.HasIndex("TelemetryId"); + b.HasIndex("TelemetryId"); - b.ToTable("t_telemetry_wits_1"); - }); + b.ToTable("t_telemetry_wits_1"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - b.Property("Deptbitm") - .HasColumnType("real") - .HasColumnName("DEPTBITM"); + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); - b.Property("DeptmeasGdpMc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_GDP_mc"); + b.Property("DeptmeasGdpMc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_GDP_mc"); - b.Property("DeptmeasMcrstat") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_MCRSTAT"); + b.Property("DeptmeasMcrstat") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_MCRSTAT"); - b.Property("DeptmeasRa33Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RA33_mc"); + b.Property("DeptmeasRa33Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33_mc"); - b.Property("DeptmeasRa33f2Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RA33F2_mc"); + b.Property("DeptmeasRa33f2Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33F2_mc"); - b.Property("DeptmeasRa33f4Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RA33F4_mc"); + b.Property("DeptmeasRa33f4Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33F4_mc"); - b.Property("DeptmeasRp33Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RP33_mc"); + b.Property("DeptmeasRp33Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33_mc"); - b.Property("DeptmeasRp33f2Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RP33F2_mc"); + b.Property("DeptmeasRp33f2Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33F2_mc"); - b.Property("DeptmeasRp33f4Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RP33F4_mc"); + b.Property("DeptmeasRp33f4Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33F4_mc"); - b.Property("DeptmeasSlvlMc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_SLVL_mc"); + b.Property("DeptmeasSlvlMc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_SLVL_mc"); - b.Property("GdpMc") - .HasColumnType("real") - .HasColumnName("GDP_mc"); + b.Property("GdpMc") + .HasColumnType("real") + .HasColumnName("GDP_mc"); - b.Property("Mcrstat") - .HasColumnType("real") - .HasColumnName("MCRSTAT"); + b.Property("Mcrstat") + .HasColumnType("real") + .HasColumnName("MCRSTAT"); - b.Property("Ra33Mc") - .HasColumnType("real") - .HasColumnName("RA33_mc"); + b.Property("Ra33Mc") + .HasColumnType("real") + .HasColumnName("RA33_mc"); - b.Property("Ra33f2Mc") - .HasColumnType("real") - .HasColumnName("RA33F2_mc"); + b.Property("Ra33f2Mc") + .HasColumnType("real") + .HasColumnName("RA33F2_mc"); - b.Property("Ra33f4Mc") - .HasColumnType("real") - .HasColumnName("RA33F4_mc"); + b.Property("Ra33f4Mc") + .HasColumnType("real") + .HasColumnName("RA33F4_mc"); - b.Property("Rp33Mc") - .HasColumnType("real") - .HasColumnName("RP33_mc"); + b.Property("Rp33Mc") + .HasColumnType("real") + .HasColumnName("RP33_mc"); - b.Property("Rp33f2Mc") - .HasColumnType("real") - .HasColumnName("RP33F2_mc"); + b.Property("Rp33f2Mc") + .HasColumnType("real") + .HasColumnName("RP33F2_mc"); - b.Property("Rp33f4Mc") - .HasColumnType("real") - .HasColumnName("RP33F4_mc"); + b.Property("Rp33f4Mc") + .HasColumnType("real") + .HasColumnName("RP33F4_mc"); - b.Property("SlvlMc") - .HasColumnType("real") - .HasColumnName("SLVL_mc"); + b.Property("SlvlMc") + .HasColumnType("real") + .HasColumnName("SLVL_mc"); - b.Property("TelemetryId") - .HasColumnType("integer"); + b.Property("TelemetryId") + .HasColumnType("integer"); - b.HasIndex("TelemetryId"); + b.HasIndex("TelemetryId"); - b.ToTable("t_telemetry_wits_50"); - }); + b.ToTable("t_telemetry_wits_50"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - b.Property("Btot") - .HasColumnType("real") - .HasColumnName("Btot"); + b.Property("Btot") + .HasColumnType("real") + .HasColumnName("Btot"); - b.Property("Bx") - .HasColumnType("real") - .HasColumnName("Bx"); + b.Property("Bx") + .HasColumnType("real") + .HasColumnName("Bx"); - b.Property("By") - .HasColumnType("real") - .HasColumnName("By"); + b.Property("By") + .HasColumnType("real") + .HasColumnName("By"); - b.Property("Bz") - .HasColumnType("real") - .HasColumnName("Bz"); + b.Property("Bz") + .HasColumnType("real") + .HasColumnName("Bz"); - b.Property("Deptbitm") - .HasColumnType("real") - .HasColumnName("DEPTBITM"); + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); - b.Property("Deptmeas") - .HasColumnType("real") - .HasColumnName("DEPTMEAS"); + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); - b.Property("Gtot") - .HasColumnType("real") - .HasColumnName("Gtot"); + b.Property("Gtot") + .HasColumnType("real") + .HasColumnName("Gtot"); - b.Property("Gx") - .HasColumnType("real") - .HasColumnName("Gx"); + b.Property("Gx") + .HasColumnType("real") + .HasColumnName("Gx"); - b.Property("Gy") - .HasColumnType("real") - .HasColumnName("Gy"); + b.Property("Gy") + .HasColumnType("real") + .HasColumnName("Gy"); - b.Property("Gz") - .HasColumnType("real") - .HasColumnName("Gz"); + b.Property("Gz") + .HasColumnType("real") + .HasColumnName("Gz"); - b.Property("TelemetryId") - .HasColumnType("integer"); + b.Property("TelemetryId") + .HasColumnType("integer"); - b.HasIndex("TelemetryId"); + b.HasIndex("TelemetryId"); - b.ToTable("t_telemetry_wits_60"); - }); + b.ToTable("t_telemetry_wits_60"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - b.Property("Att06h") - .HasColumnType("real") - .HasColumnName("ATT06H"); + b.Property("Att06h") + .HasColumnType("real") + .HasColumnName("ATT06H"); - b.Property("Att06l") - .HasColumnType("real") - .HasColumnName("ATT06L"); + b.Property("Att06l") + .HasColumnType("real") + .HasColumnName("ATT06L"); - b.Property("Att10h") - .HasColumnType("real") - .HasColumnName("ATT10H"); + b.Property("Att10h") + .HasColumnType("real") + .HasColumnName("ATT10H"); - b.Property("Att10l") - .HasColumnType("real") - .HasColumnName("ATT10L"); + b.Property("Att10l") + .HasColumnType("real") + .HasColumnName("ATT10L"); - b.Property("Deptbitm") - .HasColumnType("real") - .HasColumnName("DEPTBITM"); + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); - b.Property("Deptmeas") - .HasColumnType("real") - .HasColumnName("DEPTMEAS"); + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); - b.Property("Phl1f1") - .HasColumnType("real") - .HasColumnName("PHL1F1"); + b.Property("Phl1f1") + .HasColumnType("real") + .HasColumnName("PHL1F1"); - b.Property("Phl1f2") - .HasColumnType("real") - .HasColumnName("PHL1F2"); + b.Property("Phl1f2") + .HasColumnType("real") + .HasColumnName("PHL1F2"); - b.Property("Phl2f1") - .HasColumnType("real") - .HasColumnName("PHL2F1"); + b.Property("Phl2f1") + .HasColumnType("real") + .HasColumnName("PHL2F1"); - b.Property("Phl2f2") - .HasColumnType("real") - .HasColumnName("PHL2F2"); + b.Property("Phl2f2") + .HasColumnType("real") + .HasColumnName("PHL2F2"); - b.Property("Status") - .HasColumnType("real") - .HasColumnName("Status"); + b.Property("Status") + .HasColumnType("real") + .HasColumnName("Status"); - b.Property("TelemetryId") - .HasColumnType("integer"); + b.Property("TelemetryId") + .HasColumnType("integer"); - b.HasIndex("TelemetryId"); + b.HasIndex("TelemetryId"); - b.ToTable("t_telemetry_wits_61"); - }); + b.ToTable("t_telemetry_wits_61"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - b.Property("Deptmeas") - .HasColumnType("real") - .HasColumnName("DEPTMEAS"); + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); - b.Property("Deptsvym") - .HasColumnType("real") - .HasColumnName("DEPTSVYM"); + b.Property("Deptsvym") + .HasColumnType("real") + .HasColumnName("DEPTSVYM"); - b.Property("Deptsvyv") - .HasColumnType("real") - .HasColumnName("DEPTSVYV"); + b.Property("Deptsvyv") + .HasColumnType("real") + .HasColumnName("DEPTSVYV"); - b.Property("Passnum") - .HasColumnType("smallint") - .HasColumnName("PASSNUM"); + b.Property("Passnum") + .HasColumnType("smallint") + .HasColumnName("PASSNUM"); - b.Property("Spare1") - .HasColumnType("real") - .HasColumnName("SPARE1"); + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); - b.Property("Spare2") - .HasColumnType("real") - .HasColumnName("SPARE2"); + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); - b.Property("Spare3") - .HasColumnType("real") - .HasColumnName("SPARE3"); + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); - b.Property("Spare4") - .HasColumnType("real") - .HasColumnName("SPARE4"); + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); - b.Property("Spare5") - .HasColumnType("real") - .HasColumnName("SPARE5"); + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); - b.Property("Svyazc") - .HasColumnType("real") - .HasColumnName("SVYAZC"); + b.Property("Svyazc") + .HasColumnType("real") + .HasColumnName("SVYAZC"); - b.Property("Svyazu") - .HasColumnType("real") - .HasColumnName("SVYAZU"); + b.Property("Svyazu") + .HasColumnType("real") + .HasColumnName("SVYAZU"); - b.Property("Svydls") - .HasColumnType("real") - .HasColumnName("SVYDLS"); + b.Property("Svydls") + .HasColumnType("real") + .HasColumnName("SVYDLS"); - b.Property("Svyew") - .HasColumnType("real") - .HasColumnName("SVYEW"); + b.Property("Svyew") + .HasColumnType("real") + .HasColumnName("SVYEW"); - b.Property("Svygtf") - .HasColumnType("real") - .HasColumnName("SVYGTF"); + b.Property("Svygtf") + .HasColumnType("real") + .HasColumnName("SVYGTF"); - b.Property("Svyinc") - .HasColumnType("real") - .HasColumnName("SVYINC"); + b.Property("Svyinc") + .HasColumnType("real") + .HasColumnName("SVYINC"); - b.Property("Svymtf") - .HasColumnType("real") - .HasColumnName("SVYMTF"); + b.Property("Svymtf") + .HasColumnType("real") + .HasColumnName("SVYMTF"); - b.Property("Svyns") - .HasColumnType("real") - .HasColumnName("SVYNS"); + b.Property("Svyns") + .HasColumnType("real") + .HasColumnName("SVYNS"); - b.Property("Svytype") - .HasColumnType("text") - .HasColumnName("SVYTYPE"); + b.Property("Svytype") + .HasColumnType("text") + .HasColumnName("SVYTYPE"); - b.Property("Svywalk") - .HasColumnType("real") - .HasColumnName("SVYWALK"); + b.Property("Svywalk") + .HasColumnType("real") + .HasColumnName("SVYWALK"); - b.Property("TelemetryId") - .HasColumnType("integer"); + b.Property("TelemetryId") + .HasColumnType("integer"); - b.HasIndex("TelemetryId"); + b.HasIndex("TelemetryId"); - b.ToTable("t_telemetry_wits_7"); - }); + b.ToTable("t_telemetry_wits_7"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - b.Property("Deptbitm") - .HasColumnType("real") - .HasColumnName("DEPTBITM"); + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); - b.Property("Deptbitv") - .HasColumnType("real") - .HasColumnName("DEPTBITV"); + b.Property("Deptbitv") + .HasColumnType("real") + .HasColumnName("DEPTBITV"); - b.Property("Deptcalm") - .HasColumnType("real") - .HasColumnName("DEPTCALM"); + b.Property("Deptcalm") + .HasColumnType("real") + .HasColumnName("DEPTCALM"); - b.Property("Deptcalv") - .HasColumnType("real") - .HasColumnName("DEPTCALV"); + b.Property("Deptcalv") + .HasColumnType("real") + .HasColumnName("DEPTCALV"); - b.Property("Deptfdm") - .HasColumnType("real") - .HasColumnName("DEPTFDM"); + b.Property("Deptfdm") + .HasColumnType("real") + .HasColumnName("DEPTFDM"); - b.Property("Deptfdv") - .HasColumnType("real") - .HasColumnName("DEPTFDV"); + b.Property("Deptfdv") + .HasColumnType("real") + .HasColumnName("DEPTFDV"); - b.Property("Deptgr1m") - .HasColumnType("real") - .HasColumnName("DEPTGR1M"); + b.Property("Deptgr1m") + .HasColumnType("real") + .HasColumnName("DEPTGR1M"); - b.Property("Deptgr1v") - .HasColumnType("real") - .HasColumnName("DEPTGR1V"); + b.Property("Deptgr1v") + .HasColumnType("real") + .HasColumnName("DEPTGR1V"); - b.Property("Deptgr2m") - .HasColumnType("real") - .HasColumnName("DEPTGR2M"); + b.Property("Deptgr2m") + .HasColumnType("real") + .HasColumnName("DEPTGR2M"); - b.Property("Deptgr2v") - .HasColumnType("real") - .HasColumnName("DEPTGR2V"); + b.Property("Deptgr2v") + .HasColumnType("real") + .HasColumnName("DEPTGR2V"); - b.Property("Deptmeas") - .HasColumnType("real") - .HasColumnName("DEPTMEAS"); + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); - b.Property("Deptp1m") - .HasColumnType("real") - .HasColumnName("DEPTP1M"); + b.Property("Deptp1m") + .HasColumnType("real") + .HasColumnName("DEPTP1M"); - b.Property("Deptp1v") - .HasColumnType("real") - .HasColumnName("DEPTP1V"); + b.Property("Deptp1v") + .HasColumnType("real") + .HasColumnName("DEPTP1V"); - b.Property("Deptp2m") - .HasColumnType("real") - .HasColumnName("DEPTP2M"); + b.Property("Deptp2m") + .HasColumnType("real") + .HasColumnName("DEPTP2M"); - b.Property("Deptp2v") - .HasColumnType("real") - .HasColumnName("DEPTP2V"); + b.Property("Deptp2v") + .HasColumnType("real") + .HasColumnName("DEPTP2V"); - b.Property("Deptrs1m") - .HasColumnType("real") - .HasColumnName("DEPTRS1M"); + b.Property("Deptrs1m") + .HasColumnType("real") + .HasColumnName("DEPTRS1M"); - b.Property("Deptrs1v") - .HasColumnType("real") - .HasColumnName("DEPTRS1V"); + b.Property("Deptrs1v") + .HasColumnType("real") + .HasColumnName("DEPTRS1V"); - b.Property("Deptrs2m") - .HasColumnType("real") - .HasColumnName("DEPTRS2M"); + b.Property("Deptrs2m") + .HasColumnType("real") + .HasColumnName("DEPTRS2M"); - b.Property("Deptrs2v") - .HasColumnType("real") - .HasColumnName("DEPTRS2V"); + b.Property("Deptrs2v") + .HasColumnType("real") + .HasColumnName("DEPTRS2V"); - b.Property("Deptvert") - .HasColumnType("real") - .HasColumnName("DEPTVERT"); + b.Property("Deptvert") + .HasColumnType("real") + .HasColumnName("DEPTVERT"); - b.Property("Mclp") - .HasColumnType("real") - .HasColumnName("MCLP"); + b.Property("Mclp") + .HasColumnType("real") + .HasColumnName("MCLP"); - b.Property("Mfd") - .HasColumnType("real") - .HasColumnName("MFD"); + b.Property("Mfd") + .HasColumnType("real") + .HasColumnName("MFD"); - b.Property("Mffp") - .HasColumnType("real") - .HasColumnName("MFFP"); + b.Property("Mffp") + .HasColumnType("real") + .HasColumnName("MFFP"); - b.Property("Mfpp") - .HasColumnType("real") - .HasColumnName("MFPP"); + b.Property("Mfpp") + .HasColumnType("real") + .HasColumnName("MFPP"); - b.Property("Mfrann") - .HasColumnType("real") - .HasColumnName("MFRANN"); + b.Property("Mfrann") + .HasColumnType("real") + .HasColumnName("MFRANN"); - b.Property("Mfrpipe") - .HasColumnType("real") - .HasColumnName("MFRPIPE"); + b.Property("Mfrpipe") + .HasColumnType("real") + .HasColumnName("MFRPIPE"); - b.Property("Mftann") - .HasColumnType("real") - .HasColumnName("MFTANN"); + b.Property("Mftann") + .HasColumnType("real") + .HasColumnName("MFTANN"); - b.Property("Mftpipe") - .HasColumnType("real") - .HasColumnName("MFTPIPE"); + b.Property("Mftpipe") + .HasColumnType("real") + .HasColumnName("MFTPIPE"); - b.Property("Mg1") - .HasColumnType("real") - .HasColumnName("MG1"); + b.Property("Mg1") + .HasColumnType("real") + .HasColumnName("MG1"); - b.Property("Mg1c") - .HasColumnType("real") - .HasColumnName("MG1C"); + b.Property("Mg1c") + .HasColumnType("real") + .HasColumnName("MG1C"); - b.Property("Mg2") - .HasColumnType("real") - .HasColumnName("MG2"); + b.Property("Mg2") + .HasColumnType("real") + .HasColumnName("MG2"); - b.Property("Mg2c") - .HasColumnType("real") - .HasColumnName("MG2C"); + b.Property("Mg2c") + .HasColumnType("real") + .HasColumnName("MG2C"); - b.Property("Mpo1") - .HasColumnType("real") - .HasColumnName("MPO1"); + b.Property("Mpo1") + .HasColumnType("real") + .HasColumnName("MPO1"); - b.Property("Mpo2") - .HasColumnType("real") - .HasColumnName("MPO2"); + b.Property("Mpo2") + .HasColumnType("real") + .HasColumnName("MPO2"); - b.Property("Mr1") - .HasColumnType("real") - .HasColumnName("MR1"); + b.Property("Mr1") + .HasColumnType("real") + .HasColumnName("MR1"); - b.Property("Mr1c") - .HasColumnType("real") - .HasColumnName("MR1C"); + b.Property("Mr1c") + .HasColumnType("real") + .HasColumnName("MR1C"); - b.Property("Mr2") - .HasColumnType("real") - .HasColumnName("MR2"); + b.Property("Mr2") + .HasColumnType("real") + .HasColumnName("MR2"); - b.Property("Mr2c") - .HasColumnType("real") - .HasColumnName("MR2C"); + b.Property("Mr2c") + .HasColumnType("real") + .HasColumnName("MR2C"); - b.Property("Passnum") - .HasColumnType("smallint") - .HasColumnName("PASSNUM"); + b.Property("Passnum") + .HasColumnType("smallint") + .HasColumnName("PASSNUM"); - b.Property("Spare1") - .HasColumnType("real") - .HasColumnName("SPARE1"); + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); - b.Property("Spare2") - .HasColumnType("real") - .HasColumnName("SPARE2"); + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); - b.Property("Spare3") - .HasColumnType("real") - .HasColumnName("SPARE3"); + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); - b.Property("Spare4") - .HasColumnType("real") - .HasColumnName("SPARE4"); + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); - b.Property("Spare5") - .HasColumnType("real") - .HasColumnName("SPARE5"); + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); - b.Property("Spare6") - .HasColumnType("real") - .HasColumnName("SPARE6"); + b.Property("Spare6") + .HasColumnType("real") + .HasColumnName("SPARE6"); - b.Property("Spare7") - .HasColumnType("real") - .HasColumnName("SPARE7"); + b.Property("Spare7") + .HasColumnType("real") + .HasColumnName("SPARE7"); - b.Property("Spare8") - .HasColumnType("real") - .HasColumnName("SPARE8"); + b.Property("Spare8") + .HasColumnType("real") + .HasColumnName("SPARE8"); - b.Property("Spare9") - .HasColumnType("real") - .HasColumnName("SPARE9"); + b.Property("Spare9") + .HasColumnType("real") + .HasColumnName("SPARE9"); - b.Property("TelemetryId") - .HasColumnType("integer"); + b.Property("TelemetryId") + .HasColumnType("integer"); - b.HasIndex("TelemetryId"); + b.HasIndex("TelemetryId"); - b.ToTable("t_telemetry_wits_8"); - }); + b.ToTable("t_telemetry_wits_8"); + }); modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => - { - b.HasOne("AsbCloudDb.Model.Deposit", "Deposit") - .WithMany("Clusters") - .HasForeignKey("IdDeposit") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_cluster_t_deposit_id_fk"); + { + b.HasOne("AsbCloudDb.Model.Deposit", "Deposit") + .WithMany("Clusters") + .HasForeignKey("IdDeposit") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_cluster_t_deposit_id_fk"); - b.Navigation("Deposit"); - }); + b.Navigation("Deposit"); + }); modelBuilder.Entity("AsbCloudDb.Model.Company", b => - { - b.HasOne("AsbCloudDb.Model.CompanyType", "CompanyType") - .WithMany("Companies") - .HasForeignKey("IdCompanyType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.CompanyType", "CompanyType") + .WithMany("Companies") + .HasForeignKey("IdCompanyType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("CompanyType"); - }); + b.Navigation("CompanyType"); + }); modelBuilder.Entity("AsbCloudDb.Model.Contact", b => - { - b.HasOne("AsbCloudDb.Model.CompanyType", "CompanyType") - .WithMany("Contacts") - .HasForeignKey("IdCompanyType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.CompanyType", "CompanyType") + .WithMany("Contacts") + .HasForeignKey("IdCompanyType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany("Contacts") - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany("Contacts") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("CompanyType"); + b.Navigation("CompanyType"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.DailyReports.DailyReport", b => - { - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.DataSaubStat", b => - { - b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory") - .WithMany() - .HasForeignKey("IdCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory") + .WithMany() + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("OperationCategory"); + b.Navigation("OperationCategory"); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => - { - b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory") - .WithMany() - .HasForeignKey("IdCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory") + .WithMany() + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("OperationCategory"); + b.Navigation("OperationCategory"); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => - { - b.HasOne("AsbCloudDb.Model.FileCategory", "FileCategory") - .WithMany() - .HasForeignKey("IdFileCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.FileCategory", "FileCategory") + .WithMany() + .HasForeignKey("IdFileCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany("DrillingProgramParts") - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany("DrillingProgramParts") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("FileCategory"); + b.Navigation("FileCategory"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.Faq", b => - { - b.HasOne("AsbCloudDb.Model.User", "AuthorAnswer") - .WithMany() - .HasForeignKey("IdAuthorAnswer"); + { + b.HasOne("AsbCloudDb.Model.User", "AuthorAnswer") + .WithMany() + .HasForeignKey("IdAuthorAnswer"); - b.HasOne("AsbCloudDb.Model.User", "AuthorQuestion") - .WithMany() - .HasForeignKey("IdAuthorQuestion") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.User", "AuthorQuestion") + .WithMany() + .HasForeignKey("IdAuthorQuestion") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("AuthorAnswer"); + b.Navigation("AuthorAnswer"); - b.Navigation("AuthorQuestion"); - }); + b.Navigation("AuthorQuestion"); + }); modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => - { - b.HasOne("AsbCloudDb.Model.User", "Author") - .WithMany("Files") - .HasForeignKey("IdAuthor"); + { + b.HasOne("AsbCloudDb.Model.User", "Author") + .WithMany("Files") + .HasForeignKey("IdAuthor"); - b.HasOne("AsbCloudDb.Model.FileCategory", "FileCategory") - .WithMany() - .HasForeignKey("IdCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.FileCategory", "FileCategory") + .WithMany() + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Author"); + b.Navigation("Author"); - b.Navigation("FileCategory"); + b.Navigation("FileCategory"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.FileMark", b => - { - b.HasOne("AsbCloudDb.Model.FileInfo", "FileInfo") - .WithMany("FileMarks") - .HasForeignKey("IdFile") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_file_mark_t_file_info_fk"); + { + b.HasOne("AsbCloudDb.Model.FileInfo", "FileInfo") + .WithMany("FileMarks") + .HasForeignKey("IdFile") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_file_mark_t_file_info_fk"); - b.HasOne("AsbCloudDb.Model.User", "User") - .WithMany("FileMarks") - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_user_t_file_mark_fk"); + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany("FileMarks") + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_user_t_file_mark_fk"); - b.Navigation("FileInfo"); + b.Navigation("FileInfo"); - b.Navigation("User"); - }); + b.Navigation("User"); + }); modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => - { - b.HasOne("AsbCloudDb.Model.FileCategory", "FileCategory") - .WithMany() - .HasForeignKey("IdCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.FileCategory", "FileCategory") + .WithMany() + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("FileCategory"); - }); + b.Navigation("FileCategory"); + }); modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.Manuals.Manual", b => - { - b.HasOne("AsbCloudDb.Model.User", "Author") - .WithMany() - .HasForeignKey("IdAuthor") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.User", "Author") + .WithMany() + .HasForeignKey("IdAuthor") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.FileCategory", "Category") - .WithMany() - .HasForeignKey("IdCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.FileCategory", "Category") + .WithMany() + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Manuals.ManualDirectory", "Directory") - .WithMany("Manuals") - .HasForeignKey("IdDirectory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Manuals.ManualDirectory", "Directory") + .WithMany("Manuals") + .HasForeignKey("IdDirectory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Author"); + b.Navigation("Author"); - b.Navigation("Category"); + b.Navigation("Category"); - b.Navigation("Directory"); - }); + b.Navigation("Directory"); + }); modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => - { - b.HasOne("AsbCloudDb.Model.Manuals.ManualDirectory", "Parent") - .WithMany("Children") - .HasForeignKey("IdParent") - .OnDelete(DeleteBehavior.Cascade); + { + b.HasOne("AsbCloudDb.Model.Manuals.ManualDirectory", "Parent") + .WithMany("Children") + .HasForeignKey("IdParent") + .OnDelete(DeleteBehavior.Cascade); - b.Navigation("Parent"); - }); + b.Navigation("Parent"); + }); modelBuilder.Entity("AsbCloudDb.Model.Measure", b => - { - b.HasOne("AsbCloudDb.Model.MeasureCategory", "Category") - .WithMany("Measures") - .HasForeignKey("IdCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.MeasureCategory", "Category") + .WithMany("Measures") + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Category"); + b.Navigation("Category"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.Notification", b => - { - b.HasOne("AsbCloudDb.Model.NotificationCategory", "NotificationCategory") - .WithMany("Notifications") - .HasForeignKey("IdNotificationCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.NotificationCategory", "NotificationCategory") + .WithMany("Notifications") + .HasForeignKey("IdNotificationCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.User", "User") - .WithMany() - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("NotificationCategory"); + b.Navigation("NotificationCategory"); - b.Navigation("User"); - }); + b.Navigation("User"); + }); modelBuilder.Entity("AsbCloudDb.Model.OperationValue", b => - { - b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory") - .WithMany() - .HasForeignKey("IdOperationCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory") + .WithMany() + .HasForeignKey("IdOperationCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("OperationCategory"); + b.Navigation("OperationCategory"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanDrilling", b => - { - b.HasOne("AsbCloudDb.Model.User", "Author") - .WithMany() - .HasForeignKey("IdAuthor") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.User", "Author") + .WithMany() + .HasForeignKey("IdAuthor") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.User", "Editor") - .WithMany() - .HasForeignKey("IdEditor") - .OnDelete(DeleteBehavior.Restrict); + b.HasOne("AsbCloudDb.Model.User", "Editor") + .WithMany() + .HasForeignKey("IdEditor") + .OnDelete(DeleteBehavior.Restrict); - b.HasOne("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanDrilling", "Previous") - .WithMany() - .HasForeignKey("IdPrevious"); + b.HasOne("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanDrilling", "Previous") + .WithMany() + .HasForeignKey("IdPrevious"); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.WellSectionType", "WellSectionType") - .WithMany() - .HasForeignKey("IdWellSectionType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.WellSectionType", "WellSectionType") + .WithMany() + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Author"); + b.Navigation("Author"); - b.Navigation("Editor"); + b.Navigation("Editor"); - b.Navigation("Previous"); + b.Navigation("Previous"); - b.Navigation("Well"); + b.Navigation("Well"); - b.Navigation("WellSectionType"); - }); + b.Navigation("WellSectionType"); + }); modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanReam", b => - { - b.HasOne("AsbCloudDb.Model.User", "Author") - .WithMany() - .HasForeignKey("IdAuthor") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.User", "Author") + .WithMany() + .HasForeignKey("IdAuthor") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.User", "Editor") - .WithMany() - .HasForeignKey("IdEditor"); + b.HasOne("AsbCloudDb.Model.User", "Editor") + .WithMany() + .HasForeignKey("IdEditor"); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.WellSectionType", "WellSectionType") - .WithMany() - .HasForeignKey("IdWellSectionType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.WellSectionType", "WellSectionType") + .WithMany() + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Author"); + b.Navigation("Author"); - b.Navigation("Editor"); + b.Navigation("Editor"); - b.Navigation("Well"); + b.Navigation("Well"); - b.Navigation("WellSectionType"); - }); + b.Navigation("WellSectionType"); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b => - { - b.HasOne("AsbCloudDb.Model.Company", "Company") - .WithMany("RelationCompaniesWells") - .HasForeignKey("IdCompany") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_relation_company_well_t_company_id_fk"); + { + b.HasOne("AsbCloudDb.Model.Company", "Company") + .WithMany("RelationCompaniesWells") + .HasForeignKey("IdCompany") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_relation_company_well_t_company_id_fk"); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany("RelationCompaniesWells") - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_relation_company_well_t_well_id_fk"); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany("RelationCompaniesWells") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_relation_company_well_t_well_id_fk"); - b.Navigation("Company"); + b.Navigation("Company"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationContactWell", b => - { - b.HasOne("AsbCloudDb.Model.User", "User") - .WithMany("RelationContactsWells") - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany("RelationContactsWells") + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("User"); + b.Navigation("User"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationUserDrillingProgramPart", b => - { - b.HasOne("AsbCloudDb.Model.DrillingProgramPart", "DrillingProgramPart") - .WithMany("RelatedUsers") - .HasForeignKey("IdDrillingProgramPart") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.DrillingProgramPart", "DrillingProgramPart") + .WithMany("RelatedUsers") + .HasForeignKey("IdDrillingProgramPart") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.User", "User") - .WithMany() - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("DrillingProgramPart"); + b.Navigation("DrillingProgramPart"); - b.Navigation("User"); - }); + b.Navigation("User"); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationUserRolePermission", b => - { - b.HasOne("AsbCloudDb.Model.Permission", "Permission") - .WithMany("RelationUserRolePermissions") - .HasForeignKey("IdPermission") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.Permission", "Permission") + .WithMany("RelationUserRolePermissions") + .HasForeignKey("IdPermission") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.UserRole", "UserRole") - .WithMany("RelationUserRolePermissions") - .HasForeignKey("IdUserRole") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.UserRole", "UserRole") + .WithMany("RelationUserRolePermissions") + .HasForeignKey("IdUserRole") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Permission"); + b.Navigation("Permission"); - b.Navigation("UserRole"); - }); + b.Navigation("UserRole"); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationUserRoleUserRole", b => - { - b.HasOne("AsbCloudDb.Model.UserRole", "Role") - .WithMany("RelationUserRoleUserRoles") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.UserRole", "Role") + .WithMany("RelationUserRoleUserRoles") + .HasForeignKey("Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.UserRole", "IncludeRole") - .WithMany() - .HasForeignKey("IdInclude") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.UserRole", "IncludeRole") + .WithMany() + .HasForeignKey("IdInclude") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("IncludeRole"); + b.Navigation("IncludeRole"); - b.Navigation("Role"); - }); + b.Navigation("Role"); + }); modelBuilder.Entity("AsbCloudDb.Model.RelationUserUserRole", b => - { - b.HasOne("AsbCloudDb.Model.User", "User") - .WithMany("RelationUsersUserRoles") - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany("RelationUsersUserRoles") + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.UserRole", "UserRole") - .WithMany("RelationUsersUserRoles") - .HasForeignKey("IdUserRole") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.UserRole", "UserRole") + .WithMany("RelationUsersUserRoles") + .HasForeignKey("IdUserRole") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("User"); + b.Navigation("User"); - b.Navigation("UserRole"); - }); + b.Navigation("UserRole"); + }); modelBuilder.Entity("AsbCloudDb.Model.ReportProperty", b => - { - b.HasOne("AsbCloudDb.Model.FileInfo", "File") - .WithMany() - .HasForeignKey("IdFile") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.FileInfo", "File") + .WithMany() + .HasForeignKey("IdFile") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("File"); + b.Navigation("File"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.Schedule", b => - { - b.HasOne("AsbCloudDb.Model.Driller", "Driller") - .WithMany("Schedule") - .HasForeignKey("IdDriller") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_schedule_t_driller_id_driller"); + { + b.HasOne("AsbCloudDb.Model.Driller", "Driller") + .WithMany("Schedule") + .HasForeignKey("IdDriller") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_schedule_t_driller_id_driller"); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Driller"); + b.Navigation("Driller"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.SetpointsRequest", b => - { - b.HasOne("AsbCloudDb.Model.User", "Author") - .WithMany() - .HasForeignKey("IdAuthor") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.User", "Author") + .WithMany() + .HasForeignKey("IdAuthor") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Author"); + b.Navigation("Author"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaub", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany("DataSaub") - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_telemetry_data_saub_t_telemetry_id_fk"); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany("DataSaub") + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_telemetry_data_saub_t_telemetry_id_fk"); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSpin", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany("DataSpin") - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_telemetry_data_spin_t_telemetry_id_fk"); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany("DataSpin") + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_telemetry_data_spin_t_telemetry_id_fk"); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryEvent", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany("Events") - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_event_t_telemetry_id_fk"); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany("Events") + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_event_t_telemetry_id_fk"); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryMessage", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany("Messages") - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_messages_t_telemetry_id_fk"); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany("Messages") + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_messages_t_telemetry_id_fk"); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.TelemetryUser", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany("Users") - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_telemetry_user_t_telemetry_id_fk"); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany("Users") + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_telemetry_user_t_telemetry_id_fk"); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryFact", b => - { - b.HasOne("AsbCloudDb.Model.User", "User") - .WithMany() - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("User"); + b.Navigation("User"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlan", b => - { - b.HasOne("AsbCloudDb.Model.User", "User") - .WithMany() - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("User"); + b.Navigation("User"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.User", b => - { - b.HasOne("AsbCloudDb.Model.Company", "Company") - .WithMany("Users") - .HasForeignKey("IdCompany") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("t_user_t_company_id_fk"); + { + b.HasOne("AsbCloudDb.Model.Company", "Company") + .WithMany("Users") + .HasForeignKey("IdCompany") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired() + .HasConstraintName("t_user_t_company_id_fk"); - b.Navigation("Company"); - }); + b.Navigation("Company"); + }); modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => - { - b.HasOne("AsbCloudDb.Model.User", "User") - .WithMany() - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("User"); - }); + b.Navigation("User"); + }); modelBuilder.Entity("AsbCloudDb.Model.Well", b => - { - b.HasOne("AsbCloudDb.Model.Cluster", "Cluster") - .WithMany("Wells") - .HasForeignKey("IdCluster") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_well_t_cluster_id_fk"); + { + b.HasOne("AsbCloudDb.Model.Cluster", "Cluster") + .WithMany("Wells") + .HasForeignKey("IdCluster") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_well_t_cluster_id_fk"); - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithOne("Well") - .HasForeignKey("AsbCloudDb.Model.Well", "IdTelemetry") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("t_well_t_telemetry_id_fk"); + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithOne("Well") + .HasForeignKey("AsbCloudDb.Model.Well", "IdTelemetry") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("t_well_t_telemetry_id_fk"); - b.HasOne("AsbCloudDb.Model.WellType", "WellType") - .WithMany("Wells") - .HasForeignKey("IdWellType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.WellType", "WellType") + .WithMany("Wells") + .HasForeignKey("IdWellType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Cluster"); + b.Navigation("Cluster"); - b.Navigation("Telemetry"); + b.Navigation("Telemetry"); - b.Navigation("WellType"); - }); + b.Navigation("WellType"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellComposite", b => - { - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany("WellComposites") - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_well_сomposite_t_well_id_fk"); + { + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany("WellComposites") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_well_сomposite_t_well_id_fk"); - b.HasOne("AsbCloudDb.Model.WellSectionType", "WellSectionType") - .WithMany("WellComposites") - .HasForeignKey("IdWellSectionType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_well_сomposite_t_well_section_type_id_fk"); + b.HasOne("AsbCloudDb.Model.WellSectionType", "WellSectionType") + .WithMany("WellComposites") + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_well_сomposite_t_well_section_type_id_fk"); - b.HasOne("AsbCloudDb.Model.Well", "WellSrc") - .WithMany("WellCompositeSrcs") - .HasForeignKey("IdWellSrc") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_well_сomposite_src_t_well_id_fk"); + b.HasOne("AsbCloudDb.Model.Well", "WellSrc") + .WithMany("WellCompositeSrcs") + .HasForeignKey("IdWellSrc") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_well_сomposite_src_t_well_id_fk"); - b.Navigation("Well"); + b.Navigation("Well"); - b.Navigation("WellSectionType"); + b.Navigation("WellSectionType"); - b.Navigation("WellSrc"); - }); + b.Navigation("WellSrc"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellFinalDocument", b => - { - b.HasOne("AsbCloudDb.Model.FileCategory", "Category") - .WithMany() - .HasForeignKey("IdCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.FileCategory", "Category") + .WithMany() + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.User", "User") - .WithMany() - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Category"); + b.Navigation("Category"); - b.Navigation("User"); + b.Navigation("User"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellOperation", b => - { - b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory") - .WithMany() - .HasForeignKey("IdCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory") + .WithMany() + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.WellOperation", "OperationPlan") - .WithMany() - .HasForeignKey("IdPlan") - .OnDelete(DeleteBehavior.SetNull); + b.HasOne("AsbCloudDb.Model.WellOperation", "OperationPlan") + .WithMany() + .HasForeignKey("IdPlan") + .OnDelete(DeleteBehavior.SetNull); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany("WellOperations") - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany("WellOperations") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.WellSectionType", "WellSectionType") - .WithMany("WellOperations") - .HasForeignKey("IdWellSectionType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.WellSectionType", "WellSectionType") + .WithMany("WellOperations") + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("OperationCategory"); + b.Navigation("OperationCategory"); - b.Navigation("OperationPlan"); + b.Navigation("OperationPlan"); - b.Navigation("Well"); + b.Navigation("Well"); - b.Navigation("WellSectionType"); - }); + b.Navigation("WellSectionType"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => - { - b.HasOne("AsbCloudDb.Model.WellOperationCategory", "Parent") - .WithMany() - .HasForeignKey("IdParent"); + { + b.HasOne("AsbCloudDb.Model.WellOperationCategory", "Parent") + .WithMany() + .HasForeignKey("IdParent"); - b.Navigation("Parent"); - }); + b.Navigation("Parent"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellSections.WellSectionPlan", b => - { - b.HasOne("AsbCloudDb.Model.WellSectionType", "SectionType") - .WithMany() - .HasForeignKey("IdSectionType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("AsbCloudDb.Model.WellSectionType", "SectionType") + .WithMany() + .HasForeignKey("IdSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("SectionType"); + b.Navigation("SectionType"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("TelemetryId"); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("TelemetryId"); - b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) - .WithOne() - .HasForeignKey("AsbCloudDb.Model.WITS.Record1", "IdTelemetry", "DateTime") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) + .WithOne() + .HasForeignKey("AsbCloudDb.Model.WITS.Record1", "IdTelemetry", "DateTime") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("TelemetryId"); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("TelemetryId"); - b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) - .WithOne() - .HasForeignKey("AsbCloudDb.Model.WITS.Record50", "IdTelemetry", "DateTime") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) + .WithOne() + .HasForeignKey("AsbCloudDb.Model.WITS.Record50", "IdTelemetry", "DateTime") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("TelemetryId"); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("TelemetryId"); - b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) - .WithOne() - .HasForeignKey("AsbCloudDb.Model.WITS.Record60", "IdTelemetry", "DateTime") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) + .WithOne() + .HasForeignKey("AsbCloudDb.Model.WITS.Record60", "IdTelemetry", "DateTime") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("TelemetryId"); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("TelemetryId"); - b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) - .WithOne() - .HasForeignKey("AsbCloudDb.Model.WITS.Record61", "IdTelemetry", "DateTime") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) + .WithOne() + .HasForeignKey("AsbCloudDb.Model.WITS.Record61", "IdTelemetry", "DateTime") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("TelemetryId"); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("TelemetryId"); - b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) - .WithOne() - .HasForeignKey("AsbCloudDb.Model.WITS.Record7", "IdTelemetry", "DateTime") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) + .WithOne() + .HasForeignKey("AsbCloudDb.Model.WITS.Record7", "IdTelemetry", "DateTime") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("TelemetryId"); + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("TelemetryId"); - b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) - .WithOne() - .HasForeignKey("AsbCloudDb.Model.WITS.Record8", "IdTelemetry", "DateTime") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("AsbCloudDb.Model.WITS.RecordBase", null) + .WithOne() + .HasForeignKey("AsbCloudDb.Model.WITS.Record8", "IdTelemetry", "DateTime") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Telemetry"); - }); + b.Navigation("Telemetry"); + }); modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => - { - b.Navigation("Wells"); - }); + { + b.Navigation("Wells"); + }); modelBuilder.Entity("AsbCloudDb.Model.Company", b => - { - b.Navigation("RelationCompaniesWells"); + { + b.Navigation("RelationCompaniesWells"); - b.Navigation("Users"); - }); + b.Navigation("Users"); + }); modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => - { - b.Navigation("Companies"); + { + b.Navigation("Companies"); - b.Navigation("Contacts"); - }); + b.Navigation("Contacts"); + }); modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => - { - b.Navigation("Clusters"); - }); + { + b.Navigation("Clusters"); + }); modelBuilder.Entity("AsbCloudDb.Model.Driller", b => - { - b.Navigation("Schedule"); - }); + { + b.Navigation("Schedule"); + }); modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => - { - b.Navigation("RelatedUsers"); - }); + { + b.Navigation("RelatedUsers"); + }); modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => - { - b.Navigation("FileMarks"); - }); + { + b.Navigation("FileMarks"); + }); modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => - { - b.Navigation("Children"); + { + b.Navigation("Children"); - b.Navigation("Manuals"); - }); + b.Navigation("Manuals"); + }); modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => - { - b.Navigation("Measures"); - }); + { + b.Navigation("Measures"); + }); modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => - { - b.Navigation("Notifications"); - }); + { + b.Navigation("Notifications"); + }); modelBuilder.Entity("AsbCloudDb.Model.Permission", b => - { - b.Navigation("RelationUserRolePermissions"); - }); + { + b.Navigation("RelationUserRolePermissions"); + }); modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => - { - b.Navigation("DataSaub"); + { + b.Navigation("DataSaub"); - b.Navigation("DataSpin"); + b.Navigation("DataSpin"); - b.Navigation("Events"); + b.Navigation("Events"); - b.Navigation("Messages"); + b.Navigation("Messages"); - b.Navigation("Users"); + b.Navigation("Users"); - b.Navigation("Well"); - }); + b.Navigation("Well"); + }); modelBuilder.Entity("AsbCloudDb.Model.User", b => - { - b.Navigation("FileMarks"); + { + b.Navigation("FileMarks"); - b.Navigation("Files"); + b.Navigation("Files"); - b.Navigation("RelationContactsWells"); + b.Navigation("RelationContactsWells"); - b.Navigation("RelationUsersUserRoles"); - }); + b.Navigation("RelationUsersUserRoles"); + }); modelBuilder.Entity("AsbCloudDb.Model.UserRole", b => - { - b.Navigation("RelationUserRolePermissions"); + { + b.Navigation("RelationUserRolePermissions"); - b.Navigation("RelationUserRoleUserRoles"); + b.Navigation("RelationUserRoleUserRoles"); - b.Navigation("RelationUsersUserRoles"); - }); + b.Navigation("RelationUsersUserRoles"); + }); modelBuilder.Entity("AsbCloudDb.Model.Well", b => - { - b.Navigation("Contacts"); + { + b.Navigation("Contacts"); - b.Navigation("DrillingProgramParts"); + b.Navigation("DrillingProgramParts"); - b.Navigation("RelationCompaniesWells"); + b.Navigation("RelationCompaniesWells"); - b.Navigation("WellCompositeSrcs"); + b.Navigation("WellCompositeSrcs"); - b.Navigation("WellComposites"); + b.Navigation("WellComposites"); - b.Navigation("WellOperations"); - }); + b.Navigation("WellOperations"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => - { - b.Navigation("WellComposites"); + { + b.Navigation("WellComposites"); - b.Navigation("WellOperations"); - }); + b.Navigation("WellOperations"); + }); modelBuilder.Entity("AsbCloudDb.Model.WellType", b => - { - b.Navigation("Wells"); - }); + { + b.Navigation("Wells"); + }); #pragma warning restore 612, 618 } } diff --git a/AsbCloudInfrastructure/Repository/FileRepository.cs b/AsbCloudInfrastructure/Repository/FileRepository.cs index 2a203879..3e97da03 100644 --- a/AsbCloudInfrastructure/Repository/FileRepository.cs +++ b/AsbCloudInfrastructure/Repository/FileRepository.cs @@ -36,9 +36,6 @@ namespace AsbCloudInfrastructure.Repository var query = dbSetConfigured .Where(e => e.IdWell == request.IdWell); - double timezoneOffsetHours = query.FirstOrDefault() - ?.Well.Timezone.Hours ?? 5d; - if (request.IdCategory is not null) query = query.Where(x => x.IdCategory == request.IdCategory); diff --git a/AsbCloudInfrastructure/Repository/ScheduleRepository.cs b/AsbCloudInfrastructure/Repository/ScheduleRepository.cs index 781b51ee..413bb661 100644 --- a/AsbCloudInfrastructure/Repository/ScheduleRepository.cs +++ b/AsbCloudInfrastructure/Repository/ScheduleRepository.cs @@ -90,9 +90,11 @@ namespace AsbCloudInfrastructure.Repository protected override ScheduleDto Convert(Schedule entity) { var hoursOffset = wellService.GetTimezone(entity.IdWell).Hours; + var timeSpan = TimeSpan.FromHours(hoursOffset); + var dto = base.Convert(entity); - dto.DrillStart = entity.DrillStart.ToOffset(TimeSpan.FromHours(hoursOffset)); - dto.DrillEnd = entity.DrillEnd.ToOffset(TimeSpan.FromHours(hoursOffset)); + dto.DrillStart = entity.DrillStart.ToOffset(timeSpan); + dto.DrillEnd = entity.DrillEnd.ToOffset(timeSpan); return dto; } } diff --git a/AsbCloudInfrastructure/Repository/TelemetryWirelineRunOutRepository.cs b/AsbCloudInfrastructure/Repository/TelemetryWirelineRunOutRepository.cs index ed1f02cf..af2b6438 100644 --- a/AsbCloudInfrastructure/Repository/TelemetryWirelineRunOutRepository.cs +++ b/AsbCloudInfrastructure/Repository/TelemetryWirelineRunOutRepository.cs @@ -94,7 +94,7 @@ namespace AsbCloudInfrastructure.Repository { var entity = dto.Adapt(); entity.IdTelemetry = idTelemetry; - entity.DateTime = dto.DateTime.ToOffset(TimeSpan.FromHours(timezoneOffset)); + entity.DateTime = dto.DateTime.ToUniversalTime(); return entity; } diff --git a/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs index 94c50ebf..6ac07c52 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs @@ -37,11 +37,10 @@ namespace AsbCloudInfrastructure.Repository if (!trajectoryRows.All(r => r.IdWell == idWell)) throw new ArgumentInvalidException(nameof(trajectoryRows), "Все строки должны относиться к одной скважине"); - var offsetHours = wellService.GetTimezone(idWell).Hours; var entities = trajectoryRows .Select(e => { - var entity = Convert(e, offsetHours); + var entity = Convert(e); entity.Id = 0; return entity; }); @@ -52,8 +51,7 @@ namespace AsbCloudInfrastructure.Repository public async Task AddAsync(Tdto trajectoryRow, CancellationToken token) { - var offsetHours = wellService.GetTimezone(trajectoryRow.IdWell).Hours; - var entity = Convert(trajectoryRow, offsetHours); + var entity = Convert(trajectoryRow); entity.Id = 0; db.Set().Add(entity); return await db.SaveChangesAsync(token) @@ -98,8 +96,7 @@ namespace AsbCloudInfrastructure.Repository public async Task UpdateAsync(Tdto row, CancellationToken token) { - var offsetHours = wellService.GetTimezone(row.IdWell).Hours; - var entity = Convert(row, offsetHours); + var entity = Convert(row); db.Set().Update(entity); return await db.SaveChangesAsync(token) .ConfigureAwait(false); @@ -112,10 +109,10 @@ namespace AsbCloudInfrastructure.Repository return dto; } - private static TEntity Convert(Tdto dto, double offsetHours) + private static TEntity Convert(Tdto dto) { var entity = dto.Adapt(); - entity.UpdateDate = DateTimeOffset.Now.ToOffset(TimeSpan.FromHours(offsetHours)); + entity.UpdateDate = DateTimeOffset.Now; return entity; } } diff --git a/AsbCloudInfrastructure/Repository/WellOperationRepository.cs b/AsbCloudInfrastructure/Repository/WellOperationRepository.cs index 4e494c77..a5f12a2b 100644 --- a/AsbCloudInfrastructure/Repository/WellOperationRepository.cs +++ b/AsbCloudInfrastructure/Repository/WellOperationRepository.cs @@ -98,6 +98,10 @@ public class WellOperationRepository : IWellOperationRepository /// public async Task> GetSectionsAsync(IEnumerable idsWells, CancellationToken token) { + var timeSpans = idsWells + .Distinct() + .ToDictionary(idWell => idWell, idWell => TimeSpan.FromHours(wellService.GetTimezone(idWell).Hours)); + var cache = await memoryCache.GetOrCreateAsync(KeyCacheSections, async (entry) => { entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(30); @@ -146,10 +150,10 @@ public class WellOperationRepository : IWellOperationRepository Caption = item.Caption, - DateStart = item.First.DateStart, + DateStart = item.First.DateStart.ToOffset(timeSpans[item.IdWell]), + DateEnd = item.Last.DateStart.ToOffset(timeSpans[item.IdWell]).AddHours(item.Last.DurationHours), + DepthStart = item.First.DepthStart, - - DateEnd = item.Last.DateStart.AddHours(item.Last.DurationHours), DepthEnd = item.Last.DepthEnd, }) .ToArray() diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs index 7570a95f..da55b708 100644 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs +++ b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs @@ -108,15 +108,15 @@ public class DailyReportService : IDailyReportService var offsetHours = wellService.GetTimezone(dailyReport.IdWell).Hours; var geDate = new DateTimeOffset(dailyReport.Date, TimeOnly.MinValue, TimeSpan.FromHours(offsetHours)); - var ltDate = new DateTimeOffset(dailyReport.Date.AddDays(1), TimeOnly.MinValue, TimeSpan.FromHours(offsetHours)); + var leDate = new DateTimeOffset(dailyReport.Date.AddDays(1), TimeOnly.MinValue, TimeSpan.FromHours(offsetHours)); var factOperationRequest = new WellOperationRequest { IdWell = idWell, OperationType = WellOperation.IdOperationTypeFact, GeDate = geDate, - LeDate = ltDate - }; + LeDate = leDate + }; var factWellOperations = (await wellOperationRepository.GetAsync(factOperationRequest, cancellationToken)) .OrderBy(o => o.DateStart) @@ -131,12 +131,12 @@ public class DailyReportService : IDailyReportService dailyReport.DepthStart = factWellOperations.FirstOrDefault()?.DepthStart; dailyReport.DepthEnd = factWellOperations.LastOrDefault()?.DepthEnd; - await UpdateTimeBalanceBlockAsync(dailyReport, factWellOperations, cancellationToken); - await UpdateSubsystemBlockAsync(dailyReport, cancellationToken); + await UpdateTimeBalanceBlockAsync(dailyReport, factWellOperations, geDate, leDate, cancellationToken); + await UpdateSubsystemBlockAsync(dailyReport, geDate, leDate, cancellationToken); - await AddTrajectoryBlockAsync(dailyReport, cancellationToken); + await AddTrajectoryBlockAsync(dailyReport, geDate, leDate, cancellationToken); await AddScheduleBlockAsync(dailyReport, geDate, cancellationToken); - await AddProcessMapWellDrillingBlockAsync(dailyReport, cancellationToken); + await AddProcessMapWellDrillingBlockAsync(dailyReport, geDate, leDate, cancellationToken); AddFactWellOperationBlock(dailyReport, factWellOperations); @@ -228,11 +228,11 @@ public class DailyReportService : IDailyReportService IdWell = idWell }; - var geDate = date.ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified); - var leDate = date.AddDays(1).ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified); + var geDate = new DateTimeOffset(date, TimeOnly.MinValue, offset); + var leDate = new DateTimeOffset(date.AddDays(1), TimeOnly.MinValue, offset); - var factWellOperationPerDay = factWellOperations.Where(o => o.DateStart.Date >= geDate && - o.DateStart.Date <= leDate); + var factWellOperationPerDay = factWellOperations.Where(o => o.DateStart >= geDate && + o.DateStart <= leDate); AddFactWellOperationBlock(dailyReport, factWellOperationPerDay); @@ -267,7 +267,7 @@ public class DailyReportService : IDailyReportService } private async Task UpdateTimeBalanceBlockAsync(DailyReportDto dailyReport, IEnumerable factWellOperations, - CancellationToken cancellationToken) + DateTimeOffset geDateStart, DateTimeOffset leDateEnd, CancellationToken cancellationToken) { const int idWellOperationSlipsTime = 5011; @@ -276,10 +276,7 @@ public class DailyReportService : IDailyReportService dailyReport.TimeBalanceBlock.SectionName = wellOperationRepository.GetSectionTypes() .FirstOrDefault(s => s.Id == dailyReport.TimeBalanceBlock.IdSection)?.Caption; - var geDateStart = dailyReport.Date.ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified); - var leDateEnd = dailyReport.Date.AddDays(1).ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified); - - dailyReport.TimeBalanceBlock.WellOperationSlipsTimeCount = (await detectedOperationService.GetAsync( + dailyReport.TimeBalanceBlock.WellOperationSlipsTimeCount = (await detectedOperationService.GetAsync( new DetectedOperationByWellRequest { IdsCategories = new[] { idWellOperationSlipsTime }, @@ -294,11 +291,9 @@ public class DailyReportService : IDailyReportService } } - private async Task AddTrajectoryBlockAsync(DailyReportDto dailyReport, CancellationToken cancellationToken) + private async Task AddTrajectoryBlockAsync(DailyReportDto dailyReport, + DateTimeOffset geDate, DateTimeOffset leDate, CancellationToken cancellationToken) { - var geDate = dailyReport.Date.ToDateTime(TimeOnly.MinValue, DateTimeKind.Utc); - var leDate = dailyReport.Date.AddDays(1).ToDateTime(TimeOnly.MinValue, DateTimeKind.Utc); - var trajectory = (await trajectoryFactNnbRepository.GetByRequestAsync(new TrajectoryRequest { IdWell = dailyReport.IdWell, @@ -328,7 +323,8 @@ public class DailyReportService : IDailyReportService }); } - private async Task UpdateSubsystemBlockAsync(DailyReportDto dailyReport, CancellationToken cancellationToken) + private async Task UpdateSubsystemBlockAsync(DailyReportDto dailyReport, + DateTimeOffset geDate, DateTimeOffset leDate, CancellationToken cancellationToken) { dailyReport.SubsystemBlock ??= new SubsystemBlockDto(); @@ -340,9 +336,6 @@ public class DailyReportService : IDailyReportService { IdWell = dailyReport.IdWell }, cancellationToken); - - var geDate = dailyReport.Date.ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified); - var leDate = dailyReport.Date.AddDays(1).ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified); var subsystemsStatPerDay = await subsystemService.GetStatAsync(new SubsystemRequest { @@ -366,12 +359,9 @@ public class DailyReportService : IDailyReportService } } - private async Task AddProcessMapWellDrillingBlockAsync(DailyReportDto dailyReport, CancellationToken cancellationToken) + private async Task AddProcessMapWellDrillingBlockAsync(DailyReportDto dailyReport, + DateTimeOffset geDate, DateTimeOffset leDate, CancellationToken cancellationToken) { - var offsetHours = wellService.GetTimezone(dailyReport.IdWell).Hours; - var geDate = new DateTimeOffset(dailyReport.Date, TimeOnly.MinValue, TimeSpan.FromHours(offsetHours)); - var leDate = new DateTimeOffset(dailyReport.Date.AddDays(1), TimeOnly.MinValue, TimeSpan.FromHours(offsetHours)); - var request = new DataSaubStatRequest(); dailyReport.ProcessMapWellDrillingBlock = (await processMapReportDrillingService.GetAsync(dailyReport.IdWell, request, cancellationToken)).Where(p => p.DateStart >= geDate && p.DateStart <= leDate) diff --git a/AsbCloudInfrastructure/Services/SAUB/TelemetryDataBaseService.cs b/AsbCloudInfrastructure/Services/SAUB/TelemetryDataBaseService.cs index 52966fad..53ed062b 100644 --- a/AsbCloudInfrastructure/Services/SAUB/TelemetryDataBaseService.cs +++ b/AsbCloudInfrastructure/Services/SAUB/TelemetryDataBaseService.cs @@ -102,7 +102,7 @@ namespace AsbCloudInfrastructure.Services.SAUB if (dateBegin == default) { var dateRange = telemetryDataCache.GetOrDefaultDataDateRange(telemetry.Id); - dateBeginUtc = (dateRange?.To.ToOffset(timezone.Offset) ?? DateTimeOffset.UtcNow) + dateBeginUtc = (dateRange?.To ?? DateTimeOffset.UtcNow) .AddSeconds(-intervalSec); } else diff --git a/AsbCloudInfrastructure/Services/SAUB/TelemetryDataCache.cs b/AsbCloudInfrastructure/Services/SAUB/TelemetryDataCache.cs index 74643429..a75c7bf3 100644 --- a/AsbCloudInfrastructure/Services/SAUB/TelemetryDataCache.cs +++ b/AsbCloudInfrastructure/Services/SAUB/TelemetryDataCache.cs @@ -156,7 +156,9 @@ namespace AsbCloudInfrastructure.Services.SAUB var to = cacheItem.LastData[^1].DateTime; from = from ?? cacheItem.LastData[0].DateTime; - return new DatesRangeDto { From = from.Value, To = to }; + return new DatesRangeDto { + From = from.Value.ToUtcDateTimeOffset(cacheItem.TimezoneHours), + To = to.ToUtcDateTimeOffset(cacheItem.TimezoneHours) }; } public DatesRangeDto? GetOrDefaultCachedDateRange(int idTelemetry) diff --git a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs index c4463a78..ca61dc49 100644 --- a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs +++ b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs @@ -157,7 +157,7 @@ public class OperationsStatService : IOperationsStatService WellType = wellType?.Caption ?? "", IdState = well.IdState, State = wellService.GetStateText(well.IdState), - LastTelemetryDate = wellService.GetLastTelemetryDate(well.Id).ToOffset(timezone.Offset), + LastTelemetryDate = wellService.GetLastTelemetryDate(well.Id), Companies = await wellService.GetCompaniesAsync(well.Id, token) }; From e2cd8cbfd23d006a1d7b94a697f314f638f01606 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Tue, 26 Mar 2024 10:16:18 +0500 Subject: [PATCH 30/31] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=20=D0=BB?= =?UTF-8?q?=D0=B8=D1=88=D0=BD=D0=B8=D0=B9=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4?= =?UTF-8?q?=20GetDatesRangeAsync=20=D0=B2=20IDailyReportService=20+=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DailyReport/IDailyReportService.cs | 8 ---- .../DailyReport/DailyReportService.cs | 41 ++++--------------- .../Services/DailyReportServiceTest.cs | 7 ++-- .../Controllers/DailyReportController.cs | 3 +- 4 files changed, 13 insertions(+), 46 deletions(-) diff --git a/AsbCloudApp/Services/DailyReport/IDailyReportService.cs b/AsbCloudApp/Services/DailyReport/IDailyReportService.cs index f0318025..b39375a6 100644 --- a/AsbCloudApp/Services/DailyReport/IDailyReportService.cs +++ b/AsbCloudApp/Services/DailyReport/IDailyReportService.cs @@ -42,12 +42,4 @@ public interface IDailyReportService /// /// Task> GetAsync(int idWell, FileReportRequest request, CancellationToken cancellationToken); - - /// - /// Получить диапазон дат по которым возможно сформировать суточный отчёты - /// - /// - /// - /// - Task GetDatesRangeAsync(int idWell, CancellationToken cancellationToken); } \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs index da55b708..488d573f 100644 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs +++ b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs @@ -153,7 +153,7 @@ public class DailyReportService : IDailyReportService Items = Enumerable.Empty() }; - var datesRange = await GetDatesRangeAsync(idWell, cancellationToken); + var datesRange = await wellOperationRepository.GetDatesRangeAsync(idWell, WellOperation.IdOperationTypeFact, cancellationToken); if (datesRange is null) return result; @@ -177,9 +177,8 @@ public class DailyReportService : IDailyReportService datesRange.To = finishDate; } - if (datesRange.From.AddDays(result.Skip) <= datesRange.To) - result.Count = (int)(Math.Ceiling((datesRange.To - DateTimeOffset.UnixEpoch).TotalDays) - - Math.Floor((datesRange.From - DateTimeOffset.UnixEpoch).TotalDays)) + 1; + result.Count = (int)(Math.Ceiling((datesRange.To - DateTimeOffset.UnixEpoch).TotalDays) + - Math.Floor((datesRange.From - DateTimeOffset.UnixEpoch).TotalDays)); var existingDailyReports = await dailyReportRepository.GetAsync(idWell, request, cancellationToken); @@ -240,32 +239,6 @@ public class DailyReportService : IDailyReportService } } - public async Task GetDatesRangeAsync(int idWell, CancellationToken cancellationToken) - { - var timezone = wellService.GetTimezone(idWell); - var currentDate = DateTimeOffset.UtcNow.ToOffset(TimeSpan.FromHours(timezone.Hours)); - - var factOperationDatesRange = await wellOperationRepository.GetDatesRangeAsync(idWell, WellOperation.IdOperationTypeFact, - cancellationToken); - - if (factOperationDatesRange is null) - return null; - - var from = (factOperationDatesRange.From.AddDays(1) <= DateTimeOffset.UtcNow.ToOffset(TimeSpan.FromHours(timezone.Hours)) ? - factOperationDatesRange.From : - currentDate.AddDays(-1)); - - var to = (factOperationDatesRange.To.AddDays(1) <= DateTimeOffset.UtcNow.ToOffset(TimeSpan.FromHours(timezone.Hours)) ? - factOperationDatesRange.To : - currentDate.AddDays(-1)); - - return new DatesRangeDto - { - From = from, - To = to - }; - } - private async Task UpdateTimeBalanceBlockAsync(DailyReportDto dailyReport, IEnumerable factWellOperations, DateTimeOffset geDateStart, DateTimeOffset leDateEnd, CancellationToken cancellationToken) { @@ -400,13 +373,13 @@ public class DailyReportService : IDailyReportService private async Task IsDateDailyReportInRangeAsync(int idWell, DateOnly dateDailyReport, CancellationToken cancellationToken) { - var datesRange = await GetDatesRangeAsync(idWell, cancellationToken); + var datesRange = await wellOperationRepository.GetDatesRangeAsync(idWell, WellOperation.IdOperationTypeFact, cancellationToken); if (datesRange is null) return false; - var from = DateOnly.FromDateTime(datesRange.From.ToUniversalTime().DateTime); - var to = DateOnly.FromDateTime(datesRange.To.ToUniversalTime().DateTime); + var from = DateOnly.FromDateTime(datesRange.From.DateTime); + var to = DateOnly.FromDateTime(datesRange.To.DateTime); - return dateDailyReport >= from && dateDailyReport <= to; + return dateDailyReport >= from && dateDailyReport <= to; } } \ No newline at end of file diff --git a/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs b/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs index ac109d7f..b8e61aa0 100644 --- a/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs +++ b/AsbCloudWebApi.Tests/Services/DailyReportServiceTest.cs @@ -12,6 +12,7 @@ using AsbCloudApp.Repositories; using AsbCloudApp.Requests; using AsbCloudApp.Services; using AsbCloudApp.Services.ProcessMaps.WellDrilling; +using AsbCloudDb.Model; using AsbCloudInfrastructure.Services.DailyReport; using NSubstitute; using System; @@ -282,7 +283,7 @@ public class DailyReportServiceTest subsystemServiceMock.GetStatAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(new[] { fakeSubsystemsStat }); - scheduleRepositoryMock.GetAsync(Arg.Any(), Arg.Any(), Arg.Any()) + scheduleRepositoryMock.GetAsync(Arg.Any(), Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(new[] { fakeShedule }); processMapReportWellDrillingServiceMock.GetAsync(Arg.Any(), fakeRequest, Arg.Any()) @@ -523,12 +524,12 @@ public class DailyReportServiceTest .Returns(datesRange); //act - var result = await dailyReportService.GetDatesRangeAsync(idWell, CancellationToken.None); + var result = await wellOperationRepositoryMock.GetDatesRangeAsync(idWell, WellOperation.IdOperationTypeFact, CancellationToken.None); //assert Assert.NotNull(result); Assert.True(result.From <= result.To); - Assert.True(result.To < DateTime.UtcNow.Date); + Assert.True(result.To < DateTimeOffset.UtcNow); } public static IEnumerable DateDailyReport() diff --git a/AsbCloudWebApi/Controllers/DailyReportController.cs b/AsbCloudWebApi/Controllers/DailyReportController.cs index e36868f1..682dc74d 100644 --- a/AsbCloudWebApi/Controllers/DailyReportController.cs +++ b/AsbCloudWebApi/Controllers/DailyReportController.cs @@ -13,6 +13,7 @@ using AsbCloudApp.Repositories; using AsbCloudApp.Requests; using AsbCloudApp.Services; using AsbCloudApp.Services.DailyReport; +using AsbCloudDb.Model; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -156,7 +157,7 @@ public class DailyReportController : ControllerBase { await AssertUserAccessToWell(idWell, cancellationToken); - var datesRanges = await dailyReportService.GetDatesRangeAsync(idWell, cancellationToken); + var datesRanges = await wellOperationRepository.GetDatesRangeAsync(idWell, WellOperation.IdOperationTypeFact, cancellationToken); return Ok(datesRanges); } From 626c3cb238d8b2cc0a44b237ab0c9c5962c2c3b9 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Tue, 26 Mar 2024 15:23:24 +0500 Subject: [PATCH 31/31] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BF=D0=B8?= =?UTF-8?q?=D1=81=D0=B0=D0=BD=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20GetTimezo?= =?UTF-8?q?ne=20(=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20=D0=B1=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D1=88=D0=B5=20=D0=BD=D0=B5=20=D0=BC=D0=B0=D0=BF=D0=BF=D0=B8?= =?UTF-8?q?=D1=82=20=D0=B2=20dto)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/WellService.cs | 68 ++++--------------- 1 file changed, 14 insertions(+), 54 deletions(-) diff --git a/AsbCloudInfrastructure/Services/WellService.cs b/AsbCloudInfrastructure/Services/WellService.cs index ac457347..853a0773 100644 --- a/AsbCloudInfrastructure/Services/WellService.cs +++ b/AsbCloudInfrastructure/Services/WellService.cs @@ -116,12 +116,12 @@ namespace AsbCloudInfrastructure.Services if (well is null) return null; - + var wellInfo = wellInfoService.FirstOrDefault(well => well.Id == idWell); if (wellInfo is null) return well.Adapt(); - + wellInfo.IdState = well.IdState; return wellInfo; } @@ -153,7 +153,7 @@ namespace AsbCloudInfrastructure.Services { if (IsTelemetryAssignedToDifferentWell(dto)) throw new ArgumentInvalidException(nameof(dto), "Телеметрия уже была привязана к другой скважине."); - + if (dto.Id != 0 && (await GetCacheAsync(token)).Any(w => w.Id == dto.Id)) throw new ArgumentInvalidException(nameof(dto), $"Нельзя повторно добавить скважину с id: {dto.Id}"); @@ -177,12 +177,12 @@ namespace AsbCloudInfrastructure.Services throw new NotImplementedException(); } - public override async Task UpdateAsync(WellDto dto, + public override async Task UpdateAsync(WellDto dto, CancellationToken token) { if (IsTelemetryAssignedToDifferentWell(dto)) throw new ArgumentInvalidException(nameof(dto), "Телеметрия уже была привязана к другой скважине."); - + var oldRelations = (await GetCacheRelationCompanyWellAsync(token)) .Where(r => r.IdWell == dto.Id).ToArray(); @@ -192,16 +192,16 @@ namespace AsbCloudInfrastructure.Services dbContext.RelationCompaniesWells .RemoveRange(dbContext.RelationCompaniesWells .Where(r => r.IdWell == dto.Id)); - + DropCacheRelationCompanyWell(); var newRelations = dto.Companies .Select(c => new RelationCompanyWell { - IdWell = dto.Id, + IdWell = dto.Id, IdCompany = c.Id }); - + dbContext.RelationCompaniesWells.AddRange(newRelations); } @@ -215,7 +215,7 @@ namespace AsbCloudInfrastructure.Services public async Task GetWellCaptionByIdAsync(int idWell, CancellationToken token) { - var entity = await GetOrDefaultAsync(idWell, token).ConfigureAwait(false); + var entity = await GetOrDefaultAsync(idWell, token).ConfigureAwait(false); return entity!.Caption; } @@ -270,10 +270,7 @@ namespace AsbCloudInfrastructure.Services { var dto = base.Convert(entity); - if (entity.Timezone is null) - dto.Timezone = GetTimezone(entity.Id); - - dto.StartDate = wellOperationRepository.FirstOperationDate(entity.Id)?.ToOffset(TimeSpan.FromHours(dto.Timezone.Hours)); + dto.StartDate = wellOperationRepository.FirstOperationDate(entity.Id); dto.WellType = entity.WellType.Caption; dto.Cluster = entity.Cluster.Caption; dto.Deposit = entity.Cluster.Deposit.Caption; @@ -296,47 +293,10 @@ namespace AsbCloudInfrastructure.Services public SimpleTimezoneDto GetTimezone(int idWell) { - var well = GetOrDefault(idWell) + var cache = GetCache(); + var cacheItem = cache.FirstOrDefault(d => d.Id == idWell) ?? throw new ArgumentInvalidException(nameof(idWell), $"idWell: {idWell} does not exist."); - return GetTimezone(well); - } - - private SimpleTimezoneDto GetTimezone(WellDto wellDto) - { - if (wellDto.Timezone is not null) - return wellDto.Timezone; - - if (wellDto.Telemetry is not null) - { - var timezone = telemetryService.GetTimezone(wellDto.Telemetry.Id); - if (timezone is not null) - return timezone; - } - - var well = GetQuery().FirstOrDefault(w => w.Id == wellDto.Id); - - if (well is not null) - { - var point = GetCoordinates(well); - if (point is not null) - { - if (point.Timezone is not null) - { - return point.Timezone.Adapt(); - } - - if (point.Latitude is not null & point.Longitude is not null) - { - var timezone = timezoneService.GetOrDefaultByCoordinates(point.Latitude!.Value, point.Longitude!.Value); - if (timezone is not null) - { - return timezone; - } - } - } - } - - throw new Exception($"Can't find timezone for well {wellDto.Caption} id: {wellDto.Id}"); + return cacheItem.Timezone.Adapt(); } private bool IsTelemetryAssignedToDifferentWell(WellDto wellDto) @@ -349,7 +309,7 @@ namespace AsbCloudInfrastructure.Services if (existingWellWithAssignedTelemetry is null) return false; - + return existingWellWithAssignedTelemetry.Id != wellDto.Id; }