From 31283922127954695af528c57a8aaeebdd94154f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Fri, 17 Nov 2023 11:19:04 +0500 Subject: [PATCH 01/19] =?UTF-8?q?=D0=98=D0=BC=D0=BF=D0=BE=D1=80=D1=82=20?= =?UTF-8?q?=D0=BE=D0=BF=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B9=20=D0=BF=D0=BE?= =?UTF-8?q?=20=D1=81=D0=BA=D0=B2=D0=B0=D0=B6=D0=B8=D0=BD=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Поправлен шаблон. В словарях секций и операций убраны пустые строки 2. Рефакторинг контроллера и сервисов. После успешного импорта операций операции в базе не сохраняются, а возвращаются списком, который отдаётся пользователю. Разделены методы вставки операций в API --- .../IWellOperationImportService.cs | 8 +- .../Files/WellOperationImportTemplate.xlsx | Bin 62838 -> 97455 bytes .../WellOperationImportService.cs | 31 +-- .../Controllers/WellOperationController.cs | 248 ++++++++++-------- 4 files changed, 150 insertions(+), 137 deletions(-) diff --git a/AsbCloudApp/Services/WellOperationImport/IWellOperationImportService.cs b/AsbCloudApp/Services/WellOperationImport/IWellOperationImportService.cs index 54e813d8..f65d8888 100644 --- a/AsbCloudApp/Services/WellOperationImport/IWellOperationImportService.cs +++ b/AsbCloudApp/Services/WellOperationImport/IWellOperationImportService.cs @@ -1,5 +1,5 @@ -using System.Threading; -using System.Threading.Tasks; +using System.Collections.Generic; +using AsbCloudApp.Data; using AsbCloudApp.Data.WellOperationImport; namespace AsbCloudApp.Services.WellOperationImport; @@ -16,7 +16,5 @@ public interface IWellOperationImportService /// /// /// - /// - /// - Task ImportAsync(int idWell, int idUser, int idType, SheetDto sheet, bool deleteBeforeImport, CancellationToken cancellationToken); + IEnumerable Import(int idWell, int idUser, int idType, SheetDto sheet); } \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/WellOperationImport/Files/WellOperationImportTemplate.xlsx b/AsbCloudInfrastructure/Services/WellOperationImport/Files/WellOperationImportTemplate.xlsx index 686f6f861af07242b0fecb124416c9b240ca097a..1e89ad3105c0e3b91c194081c382aafda1fe7386 100644 GIT binary patch literal 97455 zcmeFZc{tVG_dZUVq#~q2k4g?oC}k>CqHv;82z4|lQwR}`=_!>Vm7~a5<~e1|aE^)+ z88T+^m7P*=PC+Iz2cuY28V?frBL&$5)8X*ttM zCMKrsOy729U9e$hV)|=26B8HH$|d?oEiGFO>WUe5TvnvdfsI$rk-rvo3zp8gCCO&IbMoa1ou3Ik_Sco0 zUc%R<*O*(k()v_K*A|IHrs0;JE%#3{7(cf>(^|7Zx41Rt0&ZOHWE&biPT#@;mTN0N)c>CVr)&4WN7nP#w_jD4@+U#Xf_&#A_-+g^4@7Pz< zSCzxermw&3C7!SBU8Bn6vpctK_jR(GU|xL!r?1M-s*&X(q+XEF3;! zRp&N_4?HA3a@Bhvw`OkNo%DqO_eWhDXSp8sAL{V9IsbQTZ=XKNaP4)bj~UD5XnRjY z+z;VhcbM|=u&R}v8?|vp<~yJI?J*Tk&Tms<1N@Q6a4HrpAG zY222p%hkJhv&V48=fr*4lkE!AOPQD!7Fd{0{UcVn2$ZW!AXeKT6xkqF4Xm$Tw-FaZ zKmT8h{x1&9KaQS6QpdCG<+w+^y|BHMe6VR3f7NwyeF(lHaq`Rwy1GUuLJZ`2!CV^6@Hf7<=my|&G#%JzRK zS6O+`h9yE_D(`2Wl(c$^$!AB);^-YBk7Ja|AL~v%ZczL&CK;g}9xd?hl}kyVN68HT z6&5}ry}9S#sb-a$n#XW=gIGd)eh$biOV5i^w&8MZ4m{@6yC+YAJ@%Z1cyR=6?`!!h zl(_n>v51CfhIbjqsH7ra_o0(QJ+g}%_N6jruYqQIimS!lyEk+PCWI6b| z|GWRo^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C6&^i&rS#&MIVd^LPG?%C3nn zGp%SWwCgFGQ_)E8-jJj0*)w0#!dqp#Ml3Q%BmA*cT8&%3p~dhVc4N!>y0$vyKk9aO zb_ZFoS2ySQeN&Xo;yaynvNCtv^;5Q)wfAzFxr+01GP^GxYAC4VD&OS<+gfeBEgn;M zM0xwY=9;H1PTp7h+&W7fE_*B&bDSUZ`A*l{$wAE($)%iq3I*GSdkS5KTz(gH2rfk< zQ8m9ktIa4VWMs(PG$|-mpR3v5mgm`3!m4^yAG#^DVUVT6OK-``D<~`tD|ixI>ltl@ zK4uqGUH?|?wvxahbxuioVV%Q&!&H;ADh4%c+dS-4?%b1A(6myISr)9QxNpAZsSWik zRz>w-7OO;FZQ5P$ZwI1`54GGWuiFTv_A!# z=bul|ma0`Xq2T#s(Y?LOXxGeLm&S@9Rvn zv2k%$8u_qdyej$pG%dw6Wa|gYj6n;%iA}~e_tOXD???x gDlcxlm#c`g#;r2e(*NLLWJ&Oc4cd6U6aMS}09+?fEdT%j diff --git a/AsbCloudInfrastructure/Services/WellOperationImport/WellOperationImportService.cs b/AsbCloudInfrastructure/Services/WellOperationImport/WellOperationImportService.cs index 9da293c6..bf551edc 100644 --- a/AsbCloudInfrastructure/Services/WellOperationImport/WellOperationImportService.cs +++ b/AsbCloudInfrastructure/Services/WellOperationImport/WellOperationImportService.cs @@ -2,12 +2,9 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Threading; -using System.Threading.Tasks; using AsbCloudApp.Data; using AsbCloudApp.Data.WellOperationImport; using AsbCloudApp.Repositories; -using AsbCloudApp.Requests; using AsbCloudApp.Services.WellOperationImport; namespace AsbCloudInfrastructure.Services.WellOperationImport; @@ -25,14 +22,14 @@ public class WellOperationImportService : IWellOperationImportService this.wellOperationRepository = wellOperationRepository; } - public async Task ImportAsync(int idWell, int idUser, int idType, SheetDto sheet, bool deleteBeforeImport, CancellationToken cancellationToken) + public IEnumerable Import(int idWell, int idUser, int idType, SheetDto sheet) { var validationErrors = new List(); var sections = wellOperationRepository.GetSectionTypes(); var categories = wellOperationRepository.GetCategories(false); - var operations = new List(); + var wellOperations = new List(); foreach (var row in sheet.Rows) { @@ -62,14 +59,14 @@ public class WellOperationImportService : IWellOperationImportService throw new FileFormatException( $"Лист '{sheet.Name}'. Строка '{row.Number}' неправильно получена дата начала операции"); - if (operations.LastOrDefault()?.DateStart > row.Date) + if (wellOperations.LastOrDefault()?.DateStart > row.Date) throw new FileFormatException( $"Лист '{sheet.Name}' строка '{row.Number}' дата позднее даты предыдущей операции"); if (row.Duration is not (>= 0d and <= 240d)) throw new FileFormatException($"Лист '{sheet.Name}'. Строка '{row.Number}' некорректная длительность операции"); - operations.Add(new WellOperationDto + wellOperations.Add(new WellOperationDto { IdWell = idWell, IdUser = idUser, @@ -89,26 +86,12 @@ public class WellOperationImportService : IWellOperationImportService } } - if (operations.Any() && operations.Min(o => o.DateStart) - operations.Max(o => o.DateStart) > drillingDurationLimitMax) + if (wellOperations.Any() && wellOperations.Min(o => o.DateStart) - wellOperations.Max(o => o.DateStart) > drillingDurationLimitMax) validationErrors.Add($"Лист {sheet.Name} содержит диапазон дат больше {drillingDurationLimitMax}"); if (validationErrors.Any()) throw new FileFormatException(string.Join("\r\n", validationErrors)); - - if (!operations.Any()) - return; - - if (deleteBeforeImport) - { - var existingOperations = await wellOperationRepository.GetAsync(new WellOperationRequest - { - IdWell = idWell, - OperationType = idType - }, cancellationToken); - - await wellOperationRepository.DeleteAsync(existingOperations.Select(o => o.Id), cancellationToken); - } - - await wellOperationRepository.InsertRangeAsync(operations, cancellationToken); + + return wellOperations; } } \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/WellOperationController.cs b/AsbCloudWebApi/Controllers/WellOperationController.cs index 54270f49..45db3f0e 100644 --- a/AsbCloudWebApi/Controllers/WellOperationController.cs +++ b/AsbCloudWebApi/Controllers/WellOperationController.cs @@ -9,8 +9,10 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.IO; +using System.Linq; using System.Threading; using System.Threading.Tasks; +using AsbCloudApp.Data.WellOperationImport; using AsbCloudApp.Services.WellOperationImport; using AsbCloudApp.Data.WellOperationImport.Options; using AsbCloudApp.Exceptions; @@ -204,37 +206,87 @@ namespace AsbCloudWebApi.Controllers return Ok(result); } + ///

+ /// Добавляет новую операцию на скважину + /// + /// Id скважины + /// Тип добавляемой операции + /// Добавляемая операция + /// + /// Количество добавленных в БД записей + [HttpPost("{idType:int}")] + [Permission] + [ProducesResponseType(typeof(int), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + public async Task InsertAsync( + [Range(1, int.MaxValue, ErrorMessage = "Id скважины не может быть меньше 1")] int idWell, + [Range(0, 1, ErrorMessage = "Тип операции недопустим. Допустимые: 0, 1")] int idType, + WellOperationDto wellOperation, + CancellationToken cancellationToken) + { + if (!await CanUserAccessToWellAsync(idWell, cancellationToken)) + return Forbid(); + + if (!await CanUserEditWellOperationsAsync(idWell, cancellationToken)) + return Forbid(); + + wellOperation.IdWell = idWell; + wellOperation.LastUpdateDate = DateTimeOffset.UtcNow; + wellOperation.IdUser = User.GetUserId(); + wellOperation.IdType = idType; + + var result = await operationRepository.InsertRangeAsync(new[] { wellOperation }, cancellationToken); + + return Ok(result); + } + /// /// Добавляет новые операции на скважине /// - /// id скважины - /// Данные о добавляемых операциях - /// Токен отмены задачи - /// Количество добавленных в БД строк - [HttpPost] + /// Id скважины + /// Добавляемые операции + /// Тип добавляемых операций + /// Удалить операции перед сохранением + /// + /// Количество добавленных в БД записей + [HttpPost("{idType:int}/{deleteBeforeInsert:bool}")] [Permission] - [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(int), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] public async Task InsertRangeAsync( - [Range(1, int.MaxValue, ErrorMessage = "Id скважины не может быть меньше 1")] int idWell, - [FromBody] IEnumerable values, - CancellationToken token) + [Range(1, int.MaxValue, ErrorMessage = "Id скважины не может быть меньше 1")] int idWell, + [Range(0, 1, ErrorMessage = "Тип операции недопустим. Допустимые: 0, 1")] int idType, + bool deleteBeforeInsert, + [FromBody] IEnumerable wellOperations, + CancellationToken cancellationToken) { - if (!await CanUserAccessToWellAsync(idWell, token)) - return Forbid(); - - if (!await CanUserEditWellOperationsAsync(idWell, token)) + if (!await CanUserAccessToWellAsync(idWell, cancellationToken)) return Forbid(); - foreach (var value in values) + if (!await CanUserEditWellOperationsAsync(idWell, cancellationToken)) + return Forbid(); + + if (deleteBeforeInsert && wellOperations.Any()) { - value.IdWell = idWell; - value.LastUpdateDate = DateTimeOffset.UtcNow; - value.IdUser = User.GetUserId(); + var existingOperations = await operationRepository.GetAsync(new WellOperationRequest + { + IdWell = idWell, + OperationType = idType + }, cancellationToken); + + await operationRepository.DeleteAsync(existingOperations.Select(o => o.Id), cancellationToken); + } + + foreach (var wellOperation in wellOperations) + { + wellOperation.IdWell = idWell; + wellOperation.LastUpdateDate = DateTimeOffset.UtcNow; + wellOperation.IdUser = User.GetUserId(); + wellOperation.IdType = idType; } - var result = await operationRepository.InsertRangeAsync(values, token) - .ConfigureAwait(false); - + var result = await operationRepository.InsertRangeAsync(wellOperations, cancellationToken); + return Ok(result); } @@ -299,46 +351,19 @@ namespace AsbCloudWebApi.Controllers /// id скважины /// Параметры для парсинга файла /// Коллекция из одного файла xlsx - /// Удалить операции перед импортом = 1, если файл валидный - /// + /// /// - [HttpPost("import/default/{deleteBeforeImport}")] + [HttpPost("import/default")] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status204NoContent)] [Permission] - public async Task ImportDefaultExcelFileAsync(int idWell, + public Task ImportDefaultExcelFileAsync(int idWell, [FromQuery] WellOperationImportDefaultOptionsDto options, [FromForm] IFormFileCollection files, - [Range(0, 1, ErrorMessage = "Недопустимое значение. Допустимые: 0, 1")] int deleteBeforeImport, - CancellationToken token) - { - var idUser = User.GetUserId(); - - if (!idUser.HasValue) - throw new ForbidException("Неизвестный пользователь"); - - await AssertUserHasAccessToImportWellOperationsAsync(idWell, token); - - if (files.Count < 1) - return this.ValidationBadRequest(nameof(files), "Нет файла"); - - var file = files[0]; - if (Path.GetExtension(file.FileName).ToLower() != ".xlsx") - return this.ValidationBadRequest(nameof(files), "Требуется xlsx файл."); - - using Stream stream = file.OpenReadStream(); - - try - { - var sheet = wellOperationDefaultExcelParser.Parse(stream, options); - - await wellOperationImportService.ImportAsync(idWell, idUser.Value, options.IdType, sheet, (deleteBeforeImport & 1) > 0, token); - } - catch (FileFormatException ex) - { - return this.ValidationBadRequest(nameof(files), ex.Message); - } - - return Ok(); - } + CancellationToken cancellationToken) => ImportExcelFileAsync(idWell, files, options, + (stream, _) => wellOperationDefaultExcelParser.Parse(stream, options), + cancellationToken); /// /// Импорт операций из excel (xlsx) файла. ГПНХ (Хантос) @@ -346,46 +371,19 @@ namespace AsbCloudWebApi.Controllers /// id скважины /// Параметры для парсинга файла /// Коллекция из одного файла xlsx - /// Удалить операции перед импортом = 1, если файл валидный - /// + /// /// - [HttpPost("import/gazpromKhantos/{deleteBeforeImport}")] + [HttpPost("import/gazpromKhantos")] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status204NoContent)] [Permission] - public async Task ImportGazpromKhantosExcelFileAsync(int idWell, - [FromQuery] WellOperationImportGazpromKhantosOptionsDto options, - [FromForm] IFormFileCollection files, - [Range(0, 1, ErrorMessage = "Недопустимое значение. Допустимые: 0, 1")] int deleteBeforeImport, - CancellationToken token) - { - var idUser = User.GetUserId(); - - if (!idUser.HasValue) - throw new ForbidException("Неизвестный пользователь"); - - await AssertUserHasAccessToImportWellOperationsAsync(idWell, token); - - if (files.Count < 1) - return this.ValidationBadRequest(nameof(files), "Нет файла"); - - var file = files[0]; - if (Path.GetExtension(file.FileName).ToLower() != ".xlsx") - return this.ValidationBadRequest(nameof(files), "Требуется xlsx файл."); - - using Stream stream = file.OpenReadStream(); - - try - { - var sheet = wellOperationGazpromKhantosExcelParser.Parse(stream, options); - - await wellOperationImportService.ImportAsync(idWell, idUser.Value, options.IdType, sheet, (deleteBeforeImport & 1) > 0, token); - } - catch (FileFormatException ex) - { - return this.ValidationBadRequest(nameof(files), ex.Message); - } - - return Ok(); - } + public Task ImportGazpromKhantosExcelFileAsync(int idWell, + [FromQuery] WellOperationImportGazpromKhantosOptionsDto options, + [FromForm] IFormFileCollection files, + CancellationToken cancellationToken) => ImportExcelFileAsync(idWell, files, options, + (stream, _) => wellOperationGazpromKhantosExcelParser.Parse(stream, options), + cancellationToken); /// /// Создает excel файл с операциями по скважине @@ -453,7 +451,11 @@ namespace AsbCloudWebApi.Controllers return File(stream, "application/octet-stream", fileName); } - private async Task AssertUserHasAccessToImportWellOperationsAsync(int idWell, CancellationToken token) + private async Task ImportExcelFileAsync(int idWell, [FromForm] IFormFileCollection files, + TOptions options, + Func parseMethod, + CancellationToken cancellationToken) + where TOptions : IWellOperationImportOptions { var idCompany = User.GetCompanyId(); var idUser = User.GetUserId(); @@ -461,16 +463,54 @@ namespace AsbCloudWebApi.Controllers if (!idCompany.HasValue || !idUser.HasValue) throw new ForbidException("Неизвестный пользователь"); - if (!await CanUserAccessToWellAsync(idWell, token)) + if (!await CanUserAccessToWellAsync(idWell, cancellationToken)) throw new ForbidException("Нет доступа к скважине"); - if (!await CanUserEditWellOperationsAsync(idWell, token)) + if (!await CanUserEditWellOperationsAsync(idWell, cancellationToken)) throw new ForbidException("Недостаточно прав для редактирования ГГД на завершенной скважине"); - if (!await wellService.IsCompanyInvolvedInWellAsync(idCompany.Value, idWell, token)) + if (!await wellService.IsCompanyInvolvedInWellAsync(idCompany.Value, idWell, cancellationToken)) throw new ForbidException("Скважина недоступна для компании"); - } + if (files.Count < 1) + return this.ValidationBadRequest(nameof(files), "Нет файла"); + + var file = files[0]; + if (Path.GetExtension(file.FileName).ToLower() != ".xlsx") + return this.ValidationBadRequest(nameof(files), "Требуется xlsx файл."); + + using Stream stream = file.OpenReadStream(); + + try + { + var sheet = parseMethod(stream, options); + + var wellOperations = wellOperationImportService.Import(idWell, idUser.Value, options.IdType, sheet) + .OrderBy(w => w.DateStart); + + var dateStart = wellOperations.Min(w => w.DateStart); + + foreach (var wellOperation in wellOperations) + wellOperation.Day = (wellOperation.DateStart - dateStart).TotalDays; + + if (!wellOperations.Any()) + return NoContent(); + + return Ok(wellOperations); + } + catch (FileFormatException ex) + { + return this.ValidationBadRequest(nameof(files), ex.Message); + } + } + + private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) + { + int? idCompany = User.GetCompanyId(); + return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, + idWell, token).ConfigureAwait(false); + } + private async Task CanUserEditWellOperationsAsync(int idWell, CancellationToken token) { var idUser = User.GetUserId(); @@ -485,13 +525,5 @@ namespace AsbCloudWebApi.Controllers return well.IdState != 2 || userRepository.HasPermission(idUser.Value, "WellOperation.editCompletedWell"); } - - private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) - { - int? idCompany = User.GetCompanyId(); - return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, - idWell, token).ConfigureAwait(false); - } } - -} +} \ No newline at end of file From 98ec7637eb19bd94c66863b7f60537b7a3e42766 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Tue, 21 Nov 2023 15:10:22 +0500 Subject: [PATCH 02/19] =?UTF-8?q?=D0=98=D0=BC=D0=BF=D0=BE=D1=80=D1=82=20?= =?UTF-8?q?=D1=84=D0=B0=D0=BA=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B8?= =?UTF-8?q?=D1=85=20=D1=82=D1=80=D0=B0=D0=B5=D0=BA=D1=82=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D0=B9=20+=20=D1=80=D0=B0=D0=B7=D0=B1=D0=B8=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D1=84=D0=B0=D0=BA=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA?= =?UTF-8?q?=D0=B8=D1=85=20=D1=82=D1=80=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D0=B9=20=D0=BD=D0=B0=202=20=D1=82=D0=B0=D0=B1=D0=B0=20(=D0=B8?= =?UTF-8?q?=D0=BC=D0=BF=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D0=B5=20=D1=82=D1=80=D0=B0=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D0=B8=20=D0=B8=20=D1=82=D1=80=D0=B0=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=B8=20=D0=B8=D0=B7=20=D0=BD?= =?UTF-8?q?=D0=BD=D0=B1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/PlanFactDto.cs | 10 +- AsbCloudApp/Data/TrajectoryGeoDto.cs | 53 + AsbCloudApp/Data/TrajectoryGeoFactDto.cs | 54 +- AsbCloudApp/Data/TrajectoryGeoPlanDto.cs | 10 - ...ry.cs => ITrajectoryEditableRepository.cs} | 9 +- ...ository.cs => ITrajectoryNnbRepository.cs} | 2 +- ...ermissions_For_Trajectory_Fact.Designer.cs | 8916 ++++++++++++++++ ...303_Add_Permissions_For_Trajectory_Fact.cs | 53 + ...0948_Add_Fact_Trajectory_Table.Designer.cs | 9005 ++++++++++++++++ ...0231115120948_Add_Fact_Trajectory_Table.cs | 65 + ...Permissions_For_Trajectory_Nnb.Designer.cs | 9016 +++++++++++++++++ ...4844_Add_Permissions_For_Trajectory_Nnb.cs | 35 + .../AsbCloudDbContextModelSnapshot.cs | 152 +- AsbCloudDb/Model/AsbCloudDbContext.cs | 2 + .../DefaultData/EntityFillerPermission.cs | 4 + AsbCloudDb/Model/IAsbCloudDbContext.cs | 2 + AsbCloudDb/Model/Trajectory/FactTrajectory.cs | 10 + .../Model/Trajectory/PlannedTrajectory.cs | 13 + .../Trajectory.cs} | 5 +- .../AsbCloudInfrastructure.csproj | 4 + AsbCloudInfrastructure/DependencyInjection.cs | 11 +- .../Repository/TrajectoryFactRepository.cs | 161 +- .../Repository/TrajectoryNnbRepository.cs | 53 + .../Repository/TrajectoryPlanRepository.cs | 49 +- .../Trajectory/FactTrajectoryImportService.cs | 59 + .../Trajectory/FactTrajectoryTemplate.xlsx | Bin 0 -> 6885 bytes .../Trajectory/NnbTrajectoryImportService.cs | 59 + .../Trajectory/NnbTrajectoryTemplate.xlsx | Bin 0 -> 11279 bytes .../PlannedTrajectoryImportService.cs | 195 +- .../Trajectory/TrajectoryImportService.cs | 159 + .../Services/Trajectory/TrajectoryService.cs | 23 +- .../TrajectoryVisualizationServiceTest.cs | 21 +- .../Controllers/FactTrajectoryController.cs | 42 - .../Trajectory/FactTrajectoryController.cs | 209 + .../Trajectory/NnbTrajectoryController.cs | 80 + .../PlannedTrajectoryController.cs | 28 +- 36 files changed, 28212 insertions(+), 357 deletions(-) create mode 100644 AsbCloudApp/Data/TrajectoryGeoDto.cs rename AsbCloudApp/Repositories/{ITrajectoryPlanRepository.cs => ITrajectoryEditableRepository.cs} (84%) rename AsbCloudApp/Repositories/{ITrajectoryFactRepository.cs => ITrajectoryNnbRepository.cs} (79%) create mode 100644 AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.Designer.cs create mode 100644 AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs create mode 100644 AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.Designer.cs create mode 100644 AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.cs create mode 100644 AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.Designer.cs create mode 100644 AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs create mode 100644 AsbCloudDb/Model/Trajectory/FactTrajectory.cs create mode 100644 AsbCloudDb/Model/Trajectory/PlannedTrajectory.cs rename AsbCloudDb/Model/{PlannedTrajectory.cs => Trajectory/Trajectory.cs} (90%) create mode 100644 AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs create mode 100644 AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs create mode 100644 AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryTemplate.xlsx create mode 100644 AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryImportService.cs create mode 100644 AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryTemplate.xlsx create mode 100644 AsbCloudInfrastructure/Services/Trajectory/TrajectoryImportService.cs delete mode 100644 AsbCloudWebApi/Controllers/FactTrajectoryController.cs create mode 100644 AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs create mode 100644 AsbCloudWebApi/Controllers/Trajectory/NnbTrajectoryController.cs rename AsbCloudWebApi/Controllers/{ => Trajectory}/PlannedTrajectoryController.cs (92%) diff --git a/AsbCloudApp/Data/PlanFactDto.cs b/AsbCloudApp/Data/PlanFactDto.cs index 669121d6..02765309 100644 --- a/AsbCloudApp/Data/PlanFactDto.cs +++ b/AsbCloudApp/Data/PlanFactDto.cs @@ -4,7 +4,7 @@ /// DTO объединяющее плановые и фактические значения /// /// - public class PlanFactDto : PlanFactBase + public class PlanFactDto : PlanFactBase { } @@ -14,7 +14,8 @@ /// /// /// - public class PlanFactBase + /// + public class PlanFactBase { /// /// Плановое значение @@ -25,5 +26,10 @@ /// Фактическое значение /// public V? Fact { get; set; } + + /// + /// Фактическое ннб-значение + /// + public V? Nnb { get; set; } } } diff --git a/AsbCloudApp/Data/TrajectoryGeoDto.cs b/AsbCloudApp/Data/TrajectoryGeoDto.cs new file mode 100644 index 00000000..1574666c --- /dev/null +++ b/AsbCloudApp/Data/TrajectoryGeoDto.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AsbCloudApp.Data +{ + /// + /// Базовая географическая траектория + /// + public abstract class TrajectoryGeoDto + { + /// + /// Id скважины + /// + public int IdWell { get; set; } + + /// + /// Глубина по стволу + /// + public double WellboreDepth { get; set; } + /// + /// Угол зенитный + /// + public double ZenithAngle { get; set; } + + /// + /// Азимут Географ. + /// + public double AzimuthGeo { get; set; } + + /// + /// Азимут Магнитный + /// + public double? AzimuthMagnetic { get; set; } + + /// + /// Глубина вертикальная + /// + public double? VerticalDepth { get; set; } + + /// + /// Дата загрузки + /// + public DateTime UpdateDate { get; set; } + + /// + /// ИД пользователя + /// + public int IdUser { get; set; } + } +} diff --git a/AsbCloudApp/Data/TrajectoryGeoFactDto.cs b/AsbCloudApp/Data/TrajectoryGeoFactDto.cs index 98b141b7..0245ec7c 100644 --- a/AsbCloudApp/Data/TrajectoryGeoFactDto.cs +++ b/AsbCloudApp/Data/TrajectoryGeoFactDto.cs @@ -1,45 +1,27 @@ -namespace AsbCloudApp.Data; +using System; -/// -/// Базовая географическая траектория -/// -public abstract class TrajectoryGeoDto -{ - /// - /// Id скважины - /// - public int IdWell { get; set; } - - /// - /// Глубина по стволу - /// - public double WellboreDepth { get; set; } - /// - /// Угол зенитный - /// - public double ZenithAngle { get; set; } - - /// - /// Азимут Географ. - /// - public double AzimuthGeo { get; set; } - - /// - /// Азимут Магнитный - /// - public double? AzimuthMagnetic { get; set; } - - /// - /// Глубина вертикальная - /// - public double? VerticalDepth { get; set; } -} +namespace AsbCloudApp.Data; /// /// Формирование данных по фактической географической траектории /// public class TrajectoryGeoFactDto : TrajectoryGeoDto -{ } +{ + /// + /// ИД строки с координатами + /// + public int Id { get; set; } + + /// + /// Радиус цели + /// + public double? Radius { get; set; } + + /// + /// Комментарии + /// + public string? Comment { get; set; } +} diff --git a/AsbCloudApp/Data/TrajectoryGeoPlanDto.cs b/AsbCloudApp/Data/TrajectoryGeoPlanDto.cs index 7b3a1f41..969b204a 100644 --- a/AsbCloudApp/Data/TrajectoryGeoPlanDto.cs +++ b/AsbCloudApp/Data/TrajectoryGeoPlanDto.cs @@ -10,16 +10,6 @@ namespace AsbCloudApp.Data /// ИД строки с координатами /// public int Id { get; set; } - - /// - /// Дата загрузки - /// - public DateTime UpdateDate { get; set; } - - /// - /// ИД пользователя - /// - public int IdUser { get; set; } /// /// Радиус цели diff --git a/AsbCloudApp/Repositories/ITrajectoryPlanRepository.cs b/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs similarity index 84% rename from AsbCloudApp/Repositories/ITrajectoryPlanRepository.cs rename to AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs index 9e618351..d30bf14c 100644 --- a/AsbCloudApp/Repositories/ITrajectoryPlanRepository.cs +++ b/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs @@ -9,7 +9,8 @@ namespace AsbCloudApp.Repositories /// CRUD для работы с плановой траекторией из клиента /// /// - public interface ITrajectoryPlanRepository : ITrajectoryRepository + //TrajectoryGeoPlanDto + public interface ITrajectoryEditableRepository : ITrajectoryRepository where T : TrajectoryGeoDto { /// /// Добавить строки с координатами по одной скважине. Если в коллекции координаты для разных скважин получаем exception. @@ -17,7 +18,7 @@ namespace AsbCloudApp.Repositories /// /// /// количество записанных строк или exception с описанием - Task AddRangeAsync(IEnumerable plannedTrajectoryRows, CancellationToken token); + Task AddRangeAsync(IEnumerable plannedTrajectoryRows, CancellationToken token); /// /// Добавить одну строку с координатами @@ -25,7 +26,7 @@ namespace AsbCloudApp.Repositories /// /// /// - Task AddAsync(TrajectoryGeoPlanDto plannedTrajectoryRow, CancellationToken token); + Task AddAsync(T plannedTrajectoryRow, CancellationToken token); /// /// Обновить строку с координатами @@ -33,7 +34,7 @@ namespace AsbCloudApp.Repositories /// /// /// - Task UpdateAsync(TrajectoryGeoPlanDto row, + Task UpdateAsync(T row, CancellationToken token); /// diff --git a/AsbCloudApp/Repositories/ITrajectoryFactRepository.cs b/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs similarity index 79% rename from AsbCloudApp/Repositories/ITrajectoryFactRepository.cs rename to AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs index 95e991f5..b74229ee 100644 --- a/AsbCloudApp/Repositories/ITrajectoryFactRepository.cs +++ b/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs @@ -10,7 +10,7 @@ namespace AsbCloudApp.Repositories /// CRUD для работы с фактической траекторией из клиента /// /// - public interface ITrajectoryFactRepository : ITrajectoryRepository + public interface ITrajectoryNnbRepository : ITrajectoryRepository { } } diff --git a/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.Designer.cs b/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.Designer.cs new file mode 100644 index 00000000..4fceca63 --- /dev/null +++ b/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.Designer.cs @@ -0,0 +1,8916 @@ +// +using System; +using System.Text.Json; +using AsbCloudDb.Model; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace AsbCloudDb.Migrations +{ + [DbContext(typeof(AsbCloudDbContext))] + [Migration("20231115102303_Add_Permissions_For_Trajectory_Fact")] + partial class Add_Permissions_For_Trajectory_Fact + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseCollation("Russian_Russia.1251") + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.Property("IdDeposit") + .HasColumnType("integer") + .HasColumnName("id_deposit"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex("IdDeposit"); + + b.ToTable("t_cluster"); + + b.HasComment("Кусты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.HasIndex("IdCompanyType"); + + b.ToTable("t_company"); + + b.HasData( + new + { + Id = 1, + Caption = "ООО \"АСБ\"", + IdCompanyType = 3 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("IsContact") + .HasColumnType("boolean") + .HasColumnName("is_contact"); + + b.Property("Order") + .HasColumnType("integer") + .HasColumnName("order"); + + b.HasKey("Id"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Contact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Company") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("company") + .HasComment("компания"); + + b.Property("Email") + .IsRequired() + .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("IdCompanyType") + .HasMaxLength(255) + .HasColumnType("integer") + .HasColumnName("id_company_type") + .HasComment("вид деятельности"); + + b.Property("IdWell") + .HasMaxLength(255) + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ключ скважины"); + + b.Property("Phone") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("phone") + .HasComment("номер телефона"); + + b.Property("Position") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("position") + .HasComment("должность"); + + b.HasKey("Id"); + + b.HasIndex("IdCompanyType"); + + b.HasIndex("IdWell"); + + b.ToTable("t_contact"); + + b.HasComment("Контакты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DailyReport.DailyReport", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("StartDate") + .HasColumnType("date") + .HasColumnName("start_date") + .HasComment("Дата отчёта"); + + b.Property("Info") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("info") + .HasComment("Список параметров для отчёта"); + + b.HasKey("IdWell", "StartDate") + .HasName("t_id_well_date_start_pk"); + + b.ToTable("t_daily_report"); + + b.HasComment("Ежедневные отчёты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.ToTable("t_deposit"); + + b.HasComment("Месторождение"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина после завершения операции, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина на начало операции, м"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории операции"); + + b.Property("IdReasonOfEnd") + .HasColumnType("integer") + .HasColumnName("id_reason_of_end") + .HasComment("Код признака окончания операции"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdUsersAtStart") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя по телеметрии на момент начала операции"); + + b.Property("Value") + .HasColumnType("double precision") + .HasColumnName("value") + .HasComment("Ключевой показатель операции"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_detected_operation"); + + b.HasComment("автоматически определенные операции по телеметрии"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Driller", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Surname") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname") + .HasComment("Фамилия"); + + b.HasKey("Id"); + + b.ToTable("t_driller"); + + b.HasComment("Бурильщик"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdFileCategory") + .HasColumnType("integer") + .HasColumnName("id_file_category"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.HasKey("Id"); + + b.HasIndex("IdFileCategory"); + + b.HasIndex("IdWell", "IdFileCategory") + .IsUnique(); + + b.ToTable("t_drilling_program_part"); + + b.HasComment("части программ бурения"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .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("TimeStampStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("timestamp_start") + .HasComment("Время начала"); + + b.HasKey("Id", "IdTelemetry"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_drill_test"); + + b.HasComment("Drill_test"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Faq", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Answer") + .HasColumnType("text") + .HasColumnName("answer") + .HasComment("Текст ответа"); + + b.Property("CounterQuestion") + .HasColumnType("integer") + .HasColumnName("counter_question") + .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("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("IdAuthorQuestion") + .HasColumnType("integer") + .HasColumnName("id_author_question") + .HasComment("id автора вопроса"); + + b.Property("IdReplacementQuestion") + .HasColumnType("integer") + .HasColumnName("id_replacement_question") + .HasComment("Ключ заменяющего вопроса"); + + b.Property("IsFrequently") + .HasColumnType("boolean") + .HasColumnName("is_frequently") + .HasComment("Частый вопрос"); + + b.Property("Question") + .IsRequired() + .HasColumnType("text") + .HasColumnName("question") + .HasComment("Текст вопроса"); + + b.Property("State") + .HasColumnType("integer") + .HasColumnName("state") + .HasComment("Статус вопроса"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthorAnswer"); + + b.HasIndex("IdAuthorQuestion"); + + b.ToTable("t_faq"); + + b.HasComment("вопросы пользователей"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории"); + + b.Property("ShortName") + .HasColumnType("text") + .HasColumnName("short_name") + .HasComment("Короткое название категории"); + + b.HasKey("Id"); + + b.ToTable("t_file_category"); + + 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 = "Инструкции" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Id пользователя, загрузившего файл"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("id категории файла"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Удален ли файл"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название файла"); + + b.Property("Size") + .HasColumnType("bigint") + .HasColumnName("file_size") + .HasComment("Размер файла"); + + b.Property("UploadDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_file_info"); + + b.HasComment("Файлы всех категорий"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileMark", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("IdFile") + .HasColumnType("integer") + .HasColumnName("id_file") + .HasComment("id файла"); + + b.Property("IdMarkType") + .HasColumnType("integer") + .HasColumnName("id_mark_type") + .HasComment("0 - отклонен, 1 - согласован"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("id пользователя"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Помечен ли файл как удаленный"); + + b.HasKey("Id"); + + b.HasIndex("IdFile"); + + b.HasIndex("IdUser"); + + b.ToTable("t_file_mark"); + + b.HasComment("Действия с файлами."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .HasColumnType("real") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_float"); + + b.HasComment("таблица данных ГТИ с типом значения float"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .HasColumnType("integer") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_int"); + + b.HasComment("таблица данных ГТИ с типом значения int"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_string"); + + b.HasComment("таблица данных ГТИ с типом значения string"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории файла"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название файла"); + + b.Property("Size") + .HasColumnType("bigint") + .HasColumnName("file_size") + .HasComment("Размер файла"); + + b.Property("UrlPage") + .IsRequired() + .HasColumnType("text") + .HasColumnName("url_page") + .HasComment("Url страницы"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.ToTable("t_help_page"); + + b.HasComment("Справки"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateEnd") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_end"); + + b.Property("DateStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_start"); + + b.Property("DepthEnd") + .HasColumnType("real") + .HasColumnName("depth_end"); + + b.Property("DepthStart") + .HasColumnType("real") + .HasColumnName("depth_start"); + + b.Property("IdFeedRegulator") + .HasColumnType("smallint") + .HasColumnName("id_feed_regulator"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.HasKey("Id"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_limiting_parameter"); + + b.HasComment("Ограничения по параметрам телеметрии"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.Manual", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateDownload") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_download") + .HasComment("Дата загрузки"); + + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Id автора"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории файла"); + + b.Property("IdDirectory") + .HasColumnType("integer") + .HasColumnName("id_directory") + .HasComment("Id директории"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdDirectory"); + + b.ToTable("t_manual"); + + b.HasComment("Инструкции"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdParent") + .HasColumnType("integer") + .HasColumnName("id_parent") + .HasComment("Id родительской директории"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название"); + + b.HasKey("Id"); + + b.HasIndex("IdParent"); + + b.ToTable("t_manual_directory"); + + b.HasComment("Директория для инструкций"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Measure", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Data") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("data") + .HasComment("Данные таблицы последних данных"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("id категории"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Пометка удаленным"); + + b.Property("Timestamp") + .HasColumnType("timestamp with time zone") + .HasColumnName("timestamp") + .HasComment("время добавления"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_measure"); + + b.HasComment("Таблица c данными для вкладки 'Последние данные'"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории"); + + b.Property("ShortName") + .HasColumnType("text") + .HasColumnName("short_name") + .HasComment("Короткое название категории"); + + b.HasKey("Id"); + + b.ToTable("t_measure_category"); + + b.HasComment("Категория последних данных"); + + 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"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id получателя"); + + b.Property("Message") + .IsRequired() + .HasColumnType("text") + .HasColumnName("message") + .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("SentDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("sent_date") + .HasComment("Дата отправки уведомления"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasColumnName("title") + .HasComment("Заголовок уведомления"); + + b.HasKey("Id"); + + b.HasIndex("IdNotificationCategory"); + + b.HasIndex("IdUser"); + + b.ToTable("t_notification"); + + b.HasComment("Уведомления"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name"); + + b.HasKey("Id"); + + b.ToTable("t_notification_category"); + + b.HasComment("Категории уведомлений"); + + b.HasData( + new + { + Id = 1, + Name = "Системные уведомления" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.OperationValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Конечная глубина"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Старотовая глубина"); + + b.Property("IdOperationCategory") + .HasColumnType("integer") + .HasColumnName("id_operation_category") + .HasComment("Ид категории операции"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Ид скважины"); + + b.Property("StandardValue") + .HasColumnType("double precision") + .HasColumnName("standard_value") + .HasComment("Нормативный показатель"); + + b.Property("TargetValue") + .HasColumnType("double precision") + .HasColumnName("target_value") + .HasComment("Целевой показатель"); + + b.HasKey("Id"); + + b.HasIndex("IdOperationCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_operationvalue"); + + b.HasComment("Целевые/нормативные показатели операции"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.ToTable("t_permission"); + + 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 = 529, + Description = "Разрешение на получение отчетов drill test", + Name = "DrillTestReport.get" + }, + new + { + Id = 530, + Description = "Разрешение просматривать фактические траектории", + Name = "FactTrajectory.get" + }, + new + { + Id = 531, + Description = "Разрешение редактировать фактические траектории", + Name = "FactTrajectory.edit" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("ID пользователя который внес/изменил запись"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("Radius") + .HasColumnType("double precision") + .HasColumnName("radius") + .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("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_planned_trajectory"); + + b.HasComment("Загрузка плановой траектории"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарий"); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина по стволу до, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина по стволу от, м"); + + b.Property("FlowLimitMax") + .HasColumnType("double precision") + .HasColumnName("flow_limit_max") + .HasComment("Расход, допустимый максимум"); + + b.Property("FlowPlan") + .HasColumnType("double precision") + .HasColumnName("flow_plan") + .HasComment("Расход, план"); + + b.Property("IdMode") + .HasColumnType("integer") + .HasColumnName("id_mode") + .HasComment("Id режима (1- ротор, 2 слайд)"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_wellsection_type") + .HasComment("Тип секции"); + + b.Property("LastUpdate") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_update") + .HasComment("Дата последнего изменения"); + + b.Property("PressureLimitMax") + .HasColumnType("double precision") + .HasColumnName("pressure_limit_max") + .HasComment("Перепад давления, допустимый максимум"); + + b.Property("PressurePlan") + .HasColumnType("double precision") + .HasColumnName("pressure_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("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("TopDriveTorquePlan") + .HasColumnType("double precision") + .HasColumnName("top_drive_torque_plan") + .HasComment("Момент на ВСП, план"); + + b.Property("UsageSaub") + .HasColumnType("double precision") + .HasColumnName("usage_saub") + .HasComment("Плановый процент использования АКБ"); + + b.Property("UsageSpin") + .HasColumnType("double precision") + .HasColumnName("usage_spin") + .HasComment("Плановый процент использования spin master"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_process_map_well_drilling"); + + b.HasComment("РТК бурение скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellReam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарий"); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина по стволу до, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина по стволу от, м"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_wellsection_type") + .HasComment("Тип секции"); + + b.Property("LastUpdate") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_update") + .HasComment("Дата последнего изменения"); + + b.Property("Pressure") + .HasColumnType("double precision") + .HasColumnName("pressure") + .HasComment("Давление, атм"); + + b.Property("Repeats") + .HasColumnType("double precision") + .HasColumnName("repeats") + .HasComment("Количество повторений"); + + b.Property("SetpointDrag") + .HasColumnType("double precision") + .HasColumnName("setpoint_drag") + .HasComment("Уставка зятяжки, т"); + + b.Property("SetpointTight") + .HasColumnType("double precision") + .HasColumnName("setpoint_tight") + .HasComment("Уставка посадки, т"); + + b.Property("SpeedDownward") + .HasColumnType("double precision") + .HasColumnName("speed_downward") + .HasComment("Скорость спуска, м/ч"); + + b.Property("SpeedUpward") + .HasColumnType("double precision") + .HasColumnName("speed_upward") + .HasComment("Скорость подъёма, м/ч"); + + b.Property("SpinDownward") + .HasColumnType("double precision") + .HasColumnName("spin_downward") + .HasComment("Вращение при движении вниз, об/мин"); + + b.Property("SpinUpward") + .HasColumnType("double precision") + .HasColumnName("spin_upward") + .HasComment("Вращение при движении вверх, об/мин"); + + b.Property("Torque") + .HasColumnType("double precision") + .HasColumnName("torque") + .HasComment("Момент, кН*м"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_process_map_well_ream"); + + b.HasComment("РТК проработка скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b => + { + b.Property("IdCompany") + .HasColumnType("integer") + .HasColumnName("id_company"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.HasKey("IdCompany", "IdWell"); + + b.HasIndex("IdWell"); + + b.ToTable("t_relation_company_well"); + + b.HasComment("отношение скважин и компаний"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationContactWell", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.HasKey("IdWell", "IdUser"); + + b.HasIndex("IdUser"); + + b.ToTable("t_relation_contact_well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserDrillingProgramPart", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdDrillingProgramPart") + .HasColumnType("integer") + .HasColumnName("id_drilling_program_part"); + + 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.HasIndex("IdDrillingProgramPart"); + + b.ToTable("t_relation_user_drilling_program_part"); + + b.HasComment("Отношение пользователей и частей ПБ"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserRolePermission", b => + { + b.Property("IdUserRole") + .HasColumnType("integer") + .HasColumnName("id_user_role"); + + b.Property("IdPermission") + .HasColumnType("integer") + .HasColumnName("id_permission"); + + b.HasKey("IdUserRole", "IdPermission"); + + b.HasIndex("IdPermission"); + + b.ToTable("t_relation_user_role_permission"); + + 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 = 529 + }, + 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("IdInclude") + .HasColumnType("integer") + .HasColumnName("id_include_user_role"); + + b.HasKey("Id", "IdInclude") + .HasName("t_relation_user_role_user_role_pk"); + + b.HasIndex("IdInclude"); + + b.ToTable("t_relation_user_role_user_role"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserUserRole", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdUserRole") + .HasColumnType("integer") + .HasColumnName("id_user_role"); + + b.HasKey("IdUser", "IdUserRole"); + + b.HasIndex("IdUserRole"); + + b.ToTable("t_relation_user_user_role"); + + b.HasComment("Отношение пользователей и ролей"); + + b.HasData( + new + { + IdUser = 1, + IdUserRole = 1 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ReportProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Format") + .HasColumnType("integer") + .HasColumnName("format") + .HasComment("Формат отчета"); + + b.Property("IdFile") + .HasColumnType("integer") + .HasColumnName("id_file") + .HasComment("id файла-родителя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("Step") + .HasColumnType("integer") + .HasColumnName("step") + .HasComment("размер шага в секундах"); + + b.HasKey("Id"); + + b.HasIndex("IdFile"); + + b.HasIndex("IdWell"); + + b.ToTable("t_report_property"); + + b.HasComment("Отчеты с данными по буровым"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Schedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("IdDriller") + .HasColumnType("integer") + .HasColumnName("id_driller") + .HasComment("Идентификатор бурильщика"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .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.HasKey("Id"); + + b.HasIndex("IdDriller"); + + b.HasIndex("IdWell"); + + b.ToTable("t_schedule"); + + b.HasComment("График работы бурильщика"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.SetpointsRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("комментарий для оператора"); + + 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("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("ObsolescenceSec") + .HasColumnType("integer") + .HasColumnName("obsolescence") + .HasComment("сек. до устаревания"); + + b.Property("Setpoints") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("setpoint_set") + .HasComment("Набор уставок"); + + b.Property("UploadDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdWell"); + + b.ToTable("t_setpoints_rquest"); + + b.HasComment("Запросы на изменение уставок панели оператора"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.Subsystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("description"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); + + b.HasKey("Id"); + + b.ToTable("t_subsystem"); + + b.HasComment("Описание подсистем"); + + b.HasData( + new + { + Id = 1, + Description = "Совместная работа режимов \"Бурение в роторе\" и \"Бурение в слайде\"", + Name = "АКБ" + }, + new + { + Id = 11, + Description = "Режим работы \"Бурение в роторе\"", + Name = "АПД ротор" + }, + new + { + Id = 12, + Description = "Режим работы \"Бурение в слайде\"", + Name = "АПД слайд" + }, + new + { + Id = 2, + Description = "Алгоритм поиска оптимальных параметров бурения САУБ", + Name = "MSE" + }, + new + { + Id = 65536, + Description = "Осцилляция", + Name = "Осцилляция" + }, + new + { + Id = 65537, + Description = "Демпфер", + Name = "Демпфер" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.SubsystemOperationTime", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("DepthEnd") + .HasColumnType("real") + .HasColumnName("depth_end") + .HasComment("глубина забоя на момент выключения подсистемы"); + + b.Property("DepthStart") + .HasColumnType("real") + .HasColumnName("depth_start") + .HasComment("глубина забоя на момент включения подсистемы"); + + b.Property("IdSubsystem") + .HasColumnType("integer") + .HasColumnName("id_subsystem"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .HasComment("ИД телеметрии по которой выдается информация"); + + b.HasKey("Id"); + + b.HasIndex("IdSubsystem"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_subsystem_operation_time"); + + b.HasComment("наработки подсистем"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Info") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("info") + .HasComment("Информация с панели о скважине"); + + b.Property("RemoteUid") + .IsRequired() + .HasColumnType("text") + .HasColumnName("remote_uid") + .HasComment("Идентификатор передающего устройства. Может повторяться в списке, так как комплекты оборудования переезжают от скв. к скв."); + + b.Property("TimeZone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "RemoteUid" }, "t_telemetry_remote_uid_index"); + + b.ToTable("t_telemetry"); + + b.HasComment("таблица привязки телеметрии от комплектов к конкретной скважине."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaub", b => + { + 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("AxialLoad") + .HasColumnType("real") + .HasColumnName("axial_load") + .HasComment("Осевая нагрузка"); + + b.Property("AxialLoadLimitMax") + .HasColumnType("real") + .HasColumnName("axial_load_limit_max") + .HasComment("Осевая нагрузка. Аварийная макс."); + + b.Property("AxialLoadSp") + .HasColumnType("real") + .HasColumnName("axial_load_sp") + .HasComment("Осевая нагрузка. Задание"); + + b.Property("BitDepth") + .HasColumnType("real") + .HasColumnName("bit_depth") + .HasComment("Положение инструмента"); + + b.Property("BlockPosition") + .HasColumnType("real") + .HasColumnName("block_position") + .HasComment("Высота талевого блока"); + + b.Property("BlockPositionMax") + .HasColumnType("real") + .HasColumnName("block_position_max") + .HasComment("Талевый блок. Макс положение"); + + b.Property("BlockPositionMin") + .HasColumnType("real") + .HasColumnName("block_position_min") + .HasComment("Талевый блок. Мин положение"); + + b.Property("BlockSpeed") + .HasColumnType("real") + .HasColumnName("block_speed") + .HasComment("Скорость талевого блока"); + + b.Property("BlockSpeedSp") + .HasColumnType("real") + .HasColumnName("block_speed_sp") + .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("BlockSpeedSpSlide") + .HasColumnType("real") + .HasColumnName("block_speed_sp_slide") + .HasComment("Талевый блок. Задание скорости для режима слайда"); + + b.Property("Flow") + .HasColumnType("real") + .HasColumnName("flow") + .HasComment("Расход"); + + b.Property("FlowDeltaLimitMax") + .HasColumnType("real") + .HasColumnName("flow_delta_limit_max") + .HasComment("Расход. Аварийный макс."); + + b.Property("FlowIdle") + .HasColumnType("real") + .HasColumnName("flow_idle") + .HasComment("Расход. Холостой ход"); + + b.Property("HookWeight") + .HasColumnType("real") + .HasColumnName("hook_weight") + .HasComment("Вес на крюке"); + + b.Property("HookWeightIdle") + .HasColumnType("real") + .HasColumnName("hook_weight_idle") + .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("IdFeedRegulator") + .HasColumnType("smallint") + .HasColumnName("id_feed_regulator") + .HasComment("Текущий критерий бурения"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Пользователь САУБ"); + + b.Property("Mode") + .HasColumnType("smallint") + .HasColumnName("mode") + .HasComment("Режим САУБ"); + + b.Property("Mse") + .HasColumnType("real") + .HasColumnName("mse") + .HasComment("MSE"); + + b.Property("MseState") + .HasColumnType("smallint") + .HasColumnName("mse_state") + .HasComment("Текущее состояние работы MSE"); + + b.Property("Pressure") + .HasColumnType("real") + .HasColumnName("pressure") + .HasComment("Давление"); + + b.Property("PressureDeltaLimitMax") + .HasColumnType("real") + .HasColumnName("pressure_delta_limit_max") + .HasComment("Давление дифф. Аварийное макс."); + + b.Property("PressureIdle") + .HasColumnType("real") + .HasColumnName("pressure_idle") + .HasComment("Давление. Холостой ход"); + + b.Property("PressureSp") + .HasColumnType("real") + .HasColumnName("pressure_sp") + .HasComment("Давление. Задание"); + + b.Property("PressureSpDevelop") + .HasColumnType("real") + .HasColumnName("pressure_sp_develop") + .HasComment("Давление. Задание для проработки"); + + b.Property("PressureSpRotor") + .HasColumnType("real") + .HasColumnName("pressure_sp_rotor") + .HasComment("Давление. Задание для роторного бурения"); + + b.Property("PressureSpSlide") + .HasColumnType("real") + .HasColumnName("pressure_sp_slide") + .HasComment("Давление. Задание для режима слайда"); + + b.Property("Pump0Flow") + .HasColumnType("real") + .HasColumnName("pump0_flow") + .HasComment("Расход. Буровой насос 1"); + + b.Property("Pump1Flow") + .HasColumnType("real") + .HasColumnName("pump1_flow") + .HasComment("Расход. Буровой насос 2"); + + b.Property("Pump2Flow") + .HasColumnType("real") + .HasColumnName("pump2_flow") + .HasComment("Расход. Буровой насос 3"); + + b.Property("RotorSpeed") + .HasColumnType("real") + .HasColumnName("rotor_speed") + .HasComment("Обороты ротора"); + + b.Property("RotorTorque") + .HasColumnType("real") + .HasColumnName("rotor_torque") + .HasComment("Момент на роторе"); + + b.Property("RotorTorqueIdle") + .HasColumnType("real") + .HasColumnName("rotor_torque_idle") + .HasComment("Момент на роторе. Холостой ход"); + + b.Property("RotorTorqueLimitMax") + .HasColumnType("real") + .HasColumnName("rotor_torque_limit_max") + .HasComment("Момент на роторе. Аварийный макс."); + + b.Property("RotorTorqueSp") + .HasColumnType("real") + .HasColumnName("rotor_torque_sp") + .HasComment("Момент на роторе. Задание"); + + b.Property("WellDepth") + .HasColumnType("real") + .HasColumnName("well_depth") + .HasComment("Глубина забоя"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_data_saub"); + + b.HasComment("набор основных данных по SAUB"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaubStat", b => + { + b.Property("Count") + .HasColumnType("bigint") + .HasColumnName("count_items"); + + b.Property("DateMax") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_max"); + + b.Property("DateMin") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_min"); + + b.Property("DepthMax") + .HasColumnType("real") + .HasColumnName("depth_max"); + + b.Property("DepthMin") + .HasColumnType("real") + .HasColumnName("depth_min"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.ToView("mw_telemetry_datas_saub_stat"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSpin", b => + { + 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("Mode") + .HasColumnType("smallint") + .HasColumnName("mode") + .HasComment("Выбранный режим управления"); + + b.Property("PositionRight") + .HasColumnType("real") + .HasColumnName("position_right") + .HasComment("Крайний правый угол осцилляции"); + + b.Property("PositionZero") + .HasColumnType("real") + .HasColumnName("position_zero") + .HasComment("Нулевая позиция осцилляции"); + + b.Property("RevolsLeftLimit") + .HasColumnType("real") + .HasColumnName("revols_left_limit") + .HasComment("Ограничение числа оборотов влево"); + + b.Property("RevolsLeftTotal") + .HasColumnType("real") + .HasColumnName("revols_left_total") + .HasComment("Суммарное количество оборотов влево"); + + b.Property("RevolsRightLimit") + .HasColumnType("real") + .HasColumnName("revols_right_limit") + .HasComment("Ограничение числа оборотов вправо"); + + b.Property("RevolsRightTotal") + .HasColumnType("real") + .HasColumnName("revols_right_total") + .HasComment("Суммарное количество оборотов вправо"); + + b.Property("SpeedLeftSp") + .HasColumnType("real") + .HasColumnName("speed_left_sp") + .HasComment("Заданная скорость вращения влево"); + + b.Property("SpeedRightSp") + .HasColumnType("real") + .HasColumnName("speed_right_sp") + .HasComment("Заданная скорость вращения вправо"); + + b.Property("State") + .HasColumnType("smallint") + .HasColumnName("state") + .HasComment("Переменная этапа"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_data_spin"); + + b.HasComment("набор основных данных по SpinMaster"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryEvent", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdEvent") + .HasColumnType("integer") + .HasColumnName("id_event"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category"); + + b.Property("MessageTemplate") + .IsRequired() + .HasColumnType("text") + .HasColumnName("message_template"); + + b.HasKey("IdTelemetry", "IdEvent"); + + b.ToTable("t_telemetry_event"); + + b.HasComment("Справочник событий. События формируют сообщения. Разделено по версиям посылок от телеметрии."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Arg2") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg2"); + + b.Property("Arg3") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg3"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("IdEvent") + .HasColumnType("integer") + .HasColumnName("id_event"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdTelemetryUser") + .HasColumnType("integer") + .HasColumnName("id_telemetry_user") + .HasComment("Пользователь панели отправляющей телеметрию. не пользователь облака."); + + b.Property("WellDepth") + .HasColumnType("double precision") + .HasColumnName("well_depth"); + + b.HasKey("Id"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_telemetry_message"); + + b.HasComment("Сообщения на буровых"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryUser", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level"); + + b.Property("Name") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); + + b.Property("Patronymic") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("patronymic"); + + b.Property("Surname") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname"); + + b.HasKey("IdTelemetry", "IdUser"); + + b.ToTable("t_telemetry_user"); + + b.HasComment("Пользователи панели САУБ. Для сообщений."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryWirelineRunOut", b => + { + b.Property("IdTelemetry") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .HasComment("Идентификатор телеметрии"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("IdTelemetry")); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_time") + .HasComment("Отметка времени"); + + b.Property("Hauling") + .HasColumnType("real") + .HasColumnName("hauling") + .HasComment("Наработка талевого каната с момента перетяжки каната, т*км"); + + b.Property("HaulingWarnSp") + .HasColumnType("real") + .HasColumnName("hauling_warn_sp") + .HasComment("Наработка талевого каната до сигнализации о необходимости перетяжки, т*км"); + + b.Property("Replace") + .HasColumnType("real") + .HasColumnName("replace") + .HasComment("Наработка талевого каната с момента замены каната, т*км"); + + b.Property("ReplaceWarnSp") + .HasColumnType("real") + .HasColumnName("replace_warn_sp") + .HasComment("Наработка талевого каната до сигнализации о необходимости замены, т*км"); + + b.HasKey("IdTelemetry"); + + b.ToTable("t_telemetry_wireline_run_out"); + + b.HasComment("Наработка талевого каната"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Email") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("email") + .HasComment("должность"); + + b.Property("IdCompany") + .HasColumnType("integer") + .HasColumnName("id_company"); + + 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("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("Patronymic") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("patronymic") + .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("Surname") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname") + .HasComment("фамилия"); + + b.HasKey("Id"); + + b.HasIndex("IdCompany"); + + b.HasIndex("Login") + .IsUnique(); + + b.ToTable("t_user"); + + b.HasComment("Пользователи облака"); + + 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"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.ToTable("t_user_role"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("Key") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("key") + .HasComment("Ключ настроек пользователя"); + + b.Property("Value") + .HasColumnType("jsonb") + .HasColumnName("setting_value") + .HasComment("Значение настроек пользователя"); + + b.HasKey("IdUser", "Key"); + + b.ToTable("t_user_settings"); + + b.HasComment("настройки интерфейса пользователя"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Well", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("IdCluster") + .HasColumnType("integer") + .HasColumnName("id_cluster"); + + b.Property("IdState") + .HasColumnType("integer") + .HasColumnName("state") + .HasComment("0 - неизвестно, 1 - в работе, 2 - завершена"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdWellType") + .HasColumnType("integer") + .HasColumnName("id_well_type"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex("IdCluster"); + + b.HasIndex("IdTelemetry") + .IsUnique(); + + b.HasIndex("IdWellType"); + + b.ToTable("t_well"); + + b.HasComment("скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellComposite", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .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.HasKey("IdWell", "IdWellSrc", "IdWellSectionType"); + + b.HasIndex("IdWellSectionType"); + + b.HasIndex("IdWellSrc"); + + b.ToTable("t_well_composite"); + + b.HasComment("Композитная скважина"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellFinalDocument", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category"); + + b.HasKey("IdWell", "IdUser", "IdCategory") + .HasName("t_well_final_documents_pk"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdUser"); + + b.ToTable("t_well_final_documents"); + + b.HasComment("Дело скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CategoryInfo") + .HasColumnType("text") + .HasColumnName("category_info") + .HasComment("Доп. информация к выбраной категории"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .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("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина на начало операции, м"); + + b.Property("DurationHours") + .HasColumnType("double precision") + .HasColumnName("duration_hours") + .HasComment("Продолжительность, часы"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .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("IdUser") + .HasColumnType("integer"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_well_section_type") + .HasComment("Id тип секции скважины"); + + b.Property("LastUpdateDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("DateStart"); + + b.HasIndex("DepthEnd"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdPlan"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_well_operation"); + + b.HasComment("Данные по операциям на скважине"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("KeyValueUnits") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("key_value_units") + .HasComment("Единицы измерения ключевого показателя операции"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории операции"); + + b.HasKey("Id"); + + b.HasIndex("IdParent"); + + b.ToTable("t_well_operation_category"); + + 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 = 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 = "Ремонт" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.Property("Order") + .HasColumnType("real") + .HasColumnName("order") + .HasComment("Порядок"); + + b.HasKey("Id"); + + b.ToTable("t_well_section_type"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.HasKey("Id"); + + b.ToTable("t_well_type"); + + b.HasComment("конструкция скважины"); + + 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("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Actcod") + .HasColumnType("smallint") + .HasColumnName("ACTCOD"); + + b.Property("Date") + .HasColumnType("integer") + .HasColumnName("DATE"); + + b.Property("Recid") + .HasColumnType("smallint") + .HasColumnName("RECID"); + + b.Property("Seqid") + .HasColumnType("integer") + .HasColumnName("SEQID"); + + b.Property("Stknum") + .HasColumnType("smallint") + .HasColumnName("STKNUM"); + + b.Property("Time") + .HasColumnType("integer") + .HasColumnName("TIME"); + + b.Property("Wellid") + .HasColumnType("text") + .HasColumnName("WELLID"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_wits_base"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Blkpos") + .HasColumnType("real") + .HasColumnName("BLKPOS"); + + b.Property("Chkp") + .HasColumnType("real") + .HasColumnName("CHKP"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptbitv") + .HasColumnType("real") + .HasColumnName("DEPTBITV"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptretm") + .HasColumnType("real") + .HasColumnName("DEPTRETM"); + + b.Property("Deptvert") + .HasColumnType("real") + .HasColumnName("DEPTVERT"); + + b.Property("Gasa") + .HasColumnType("real") + .HasColumnName("GASA"); + + b.Property("Hkla") + .HasColumnType("real") + .HasColumnName("HKLA"); + + b.Property("Hklx") + .HasColumnType("real") + .HasColumnName("HKLX"); + + b.Property("Lagstks") + .HasColumnType("smallint") + .HasColumnName("LAGSTKS"); + + b.Property("Mcia") + .HasColumnType("real") + .HasColumnName("MCIA"); + + b.Property("Mcoa") + .HasColumnType("real") + .HasColumnName("MCOA"); + + b.Property("Mdia") + .HasColumnType("real") + .HasColumnName("MDIA"); + + b.Property("Mdoa") + .HasColumnType("real") + .HasColumnName("MDOA"); + + b.Property("Mfia") + .HasColumnType("real") + .HasColumnName("MFIA"); + + b.Property("Mfoa") + .HasColumnType("real") + .HasColumnName("MFOA"); + + b.Property("Mfop") + .HasColumnType("smallint") + .HasColumnName("MFOP"); + + b.Property("Mtia") + .HasColumnType("real") + .HasColumnName("MTIA"); + + b.Property("Mtoa") + .HasColumnType("real") + .HasColumnName("MTOA"); + + b.Property("Ropa") + .HasColumnType("real") + .HasColumnName("ROPA"); + + b.Property("Rpma") + .HasColumnType("smallint") + .HasColumnName("RPMA"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Spm1") + .HasColumnType("smallint") + .HasColumnName("SPM1"); + + b.Property("Spm2") + .HasColumnType("smallint") + .HasColumnName("SPM2"); + + b.Property("Spm3") + .HasColumnType("smallint") + .HasColumnName("SPM3"); + + b.Property("Sppa") + .HasColumnType("real") + .HasColumnName("SPPA"); + + b.Property("Stkc") + .HasColumnType("integer") + .HasColumnName("STKC"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.Property("Torqa") + .HasColumnType("real") + .HasColumnName("TORQA"); + + b.Property("Torqx") + .HasColumnType("real") + .HasColumnName("TORQX"); + + b.Property("Tvolact") + .HasColumnType("real") + .HasColumnName("TVOLACT"); + + b.Property("Tvolcact") + .HasColumnType("real") + .HasColumnName("TVOLCACT"); + + b.Property("Woba") + .HasColumnType("real") + .HasColumnName("WOBA"); + + b.Property("Wobx") + .HasColumnType("real") + .HasColumnName("WOBX"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_1"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("DeptmeasGdpMc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_GDP_mc"); + + b.Property("DeptmeasMcrstat") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_MCRSTAT"); + + b.Property("DeptmeasRa33Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33_mc"); + + b.Property("DeptmeasRa33f2Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33F2_mc"); + + b.Property("DeptmeasRa33f4Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33F4_mc"); + + b.Property("DeptmeasRp33Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33_mc"); + + b.Property("DeptmeasRp33f2Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33F2_mc"); + + b.Property("DeptmeasRp33f4Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33F4_mc"); + + b.Property("DeptmeasSlvlMc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_SLVL_mc"); + + b.Property("GdpMc") + .HasColumnType("real") + .HasColumnName("GDP_mc"); + + b.Property("Mcrstat") + .HasColumnType("real") + .HasColumnName("MCRSTAT"); + + b.Property("Ra33Mc") + .HasColumnType("real") + .HasColumnName("RA33_mc"); + + b.Property("Ra33f2Mc") + .HasColumnType("real") + .HasColumnName("RA33F2_mc"); + + b.Property("Ra33f4Mc") + .HasColumnType("real") + .HasColumnName("RA33F4_mc"); + + b.Property("Rp33Mc") + .HasColumnType("real") + .HasColumnName("RP33_mc"); + + b.Property("Rp33f2Mc") + .HasColumnType("real") + .HasColumnName("RP33F2_mc"); + + b.Property("Rp33f4Mc") + .HasColumnType("real") + .HasColumnName("RP33F4_mc"); + + b.Property("SlvlMc") + .HasColumnType("real") + .HasColumnName("SLVL_mc"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_50"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Btot") + .HasColumnType("real") + .HasColumnName("Btot"); + + b.Property("Bx") + .HasColumnType("real") + .HasColumnName("Bx"); + + b.Property("By") + .HasColumnType("real") + .HasColumnName("By"); + + b.Property("Bz") + .HasColumnType("real") + .HasColumnName("Bz"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Gtot") + .HasColumnType("real") + .HasColumnName("Gtot"); + + b.Property("Gx") + .HasColumnType("real") + .HasColumnName("Gx"); + + b.Property("Gy") + .HasColumnType("real") + .HasColumnName("Gy"); + + b.Property("Gz") + .HasColumnType("real") + .HasColumnName("Gz"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_60"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Att06h") + .HasColumnType("real") + .HasColumnName("ATT06H"); + + b.Property("Att06l") + .HasColumnType("real") + .HasColumnName("ATT06L"); + + b.Property("Att10h") + .HasColumnType("real") + .HasColumnName("ATT10H"); + + b.Property("Att10l") + .HasColumnType("real") + .HasColumnName("ATT10L"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Phl1f1") + .HasColumnType("real") + .HasColumnName("PHL1F1"); + + b.Property("Phl1f2") + .HasColumnType("real") + .HasColumnName("PHL1F2"); + + b.Property("Phl2f1") + .HasColumnType("real") + .HasColumnName("PHL2F1"); + + b.Property("Phl2f2") + .HasColumnType("real") + .HasColumnName("PHL2F2"); + + b.Property("Status") + .HasColumnType("real") + .HasColumnName("Status"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_61"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptsvym") + .HasColumnType("real") + .HasColumnName("DEPTSVYM"); + + b.Property("Deptsvyv") + .HasColumnType("real") + .HasColumnName("DEPTSVYV"); + + b.Property("Passnum") + .HasColumnType("smallint") + .HasColumnName("PASSNUM"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Svyazc") + .HasColumnType("real") + .HasColumnName("SVYAZC"); + + b.Property("Svyazu") + .HasColumnType("real") + .HasColumnName("SVYAZU"); + + b.Property("Svydls") + .HasColumnType("real") + .HasColumnName("SVYDLS"); + + b.Property("Svyew") + .HasColumnType("real") + .HasColumnName("SVYEW"); + + b.Property("Svygtf") + .HasColumnType("real") + .HasColumnName("SVYGTF"); + + b.Property("Svyinc") + .HasColumnType("real") + .HasColumnName("SVYINC"); + + b.Property("Svymtf") + .HasColumnType("real") + .HasColumnName("SVYMTF"); + + b.Property("Svyns") + .HasColumnType("real") + .HasColumnName("SVYNS"); + + b.Property("Svytype") + .HasColumnType("text") + .HasColumnName("SVYTYPE"); + + b.Property("Svywalk") + .HasColumnType("real") + .HasColumnName("SVYWALK"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_7"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptbitv") + .HasColumnType("real") + .HasColumnName("DEPTBITV"); + + b.Property("Deptcalm") + .HasColumnType("real") + .HasColumnName("DEPTCALM"); + + b.Property("Deptcalv") + .HasColumnType("real") + .HasColumnName("DEPTCALV"); + + b.Property("Deptfdm") + .HasColumnType("real") + .HasColumnName("DEPTFDM"); + + b.Property("Deptfdv") + .HasColumnType("real") + .HasColumnName("DEPTFDV"); + + b.Property("Deptgr1m") + .HasColumnType("real") + .HasColumnName("DEPTGR1M"); + + b.Property("Deptgr1v") + .HasColumnType("real") + .HasColumnName("DEPTGR1V"); + + b.Property("Deptgr2m") + .HasColumnType("real") + .HasColumnName("DEPTGR2M"); + + b.Property("Deptgr2v") + .HasColumnType("real") + .HasColumnName("DEPTGR2V"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptp1m") + .HasColumnType("real") + .HasColumnName("DEPTP1M"); + + b.Property("Deptp1v") + .HasColumnType("real") + .HasColumnName("DEPTP1V"); + + b.Property("Deptp2m") + .HasColumnType("real") + .HasColumnName("DEPTP2M"); + + b.Property("Deptp2v") + .HasColumnType("real") + .HasColumnName("DEPTP2V"); + + b.Property("Deptrs1m") + .HasColumnType("real") + .HasColumnName("DEPTRS1M"); + + b.Property("Deptrs1v") + .HasColumnType("real") + .HasColumnName("DEPTRS1V"); + + b.Property("Deptrs2m") + .HasColumnType("real") + .HasColumnName("DEPTRS2M"); + + b.Property("Deptrs2v") + .HasColumnType("real") + .HasColumnName("DEPTRS2V"); + + b.Property("Deptvert") + .HasColumnType("real") + .HasColumnName("DEPTVERT"); + + b.Property("Mclp") + .HasColumnType("real") + .HasColumnName("MCLP"); + + b.Property("Mfd") + .HasColumnType("real") + .HasColumnName("MFD"); + + b.Property("Mffp") + .HasColumnType("real") + .HasColumnName("MFFP"); + + b.Property("Mfpp") + .HasColumnType("real") + .HasColumnName("MFPP"); + + b.Property("Mfrann") + .HasColumnType("real") + .HasColumnName("MFRANN"); + + b.Property("Mfrpipe") + .HasColumnType("real") + .HasColumnName("MFRPIPE"); + + b.Property("Mftann") + .HasColumnType("real") + .HasColumnName("MFTANN"); + + b.Property("Mftpipe") + .HasColumnType("real") + .HasColumnName("MFTPIPE"); + + b.Property("Mg1") + .HasColumnType("real") + .HasColumnName("MG1"); + + b.Property("Mg1c") + .HasColumnType("real") + .HasColumnName("MG1C"); + + b.Property("Mg2") + .HasColumnType("real") + .HasColumnName("MG2"); + + b.Property("Mg2c") + .HasColumnType("real") + .HasColumnName("MG2C"); + + b.Property("Mpo1") + .HasColumnType("real") + .HasColumnName("MPO1"); + + b.Property("Mpo2") + .HasColumnType("real") + .HasColumnName("MPO2"); + + b.Property("Mr1") + .HasColumnType("real") + .HasColumnName("MR1"); + + b.Property("Mr1c") + .HasColumnType("real") + .HasColumnName("MR1C"); + + b.Property("Mr2") + .HasColumnType("real") + .HasColumnName("MR2"); + + b.Property("Mr2c") + .HasColumnType("real") + .HasColumnName("MR2C"); + + b.Property("Passnum") + .HasColumnType("smallint") + .HasColumnName("PASSNUM"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Spare6") + .HasColumnType("real") + .HasColumnName("SPARE6"); + + b.Property("Spare7") + .HasColumnType("real") + .HasColumnName("SPARE7"); + + b.Property("Spare8") + .HasColumnType("real") + .HasColumnName("SPARE8"); + + b.Property("Spare9") + .HasColumnType("real") + .HasColumnName("SPARE9"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + 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.Navigation("Deposit"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.HasOne("AsbCloudDb.Model.CompanyType", "CompanyType") + .WithMany("Companies") + .HasForeignKey("IdCompanyType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.Well", "Well") + .WithMany("Contacts") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CompanyType"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DailyReport.DailyReport", b => + { + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => + { + 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.Navigation("OperationCategory"); + + 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.Well", "Well") + .WithMany("DrillingProgramParts") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FileCategory"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Faq", b => + { + b.HasOne("AsbCloudDb.Model.User", "AuthorAnswer") + .WithMany() + .HasForeignKey("IdAuthorAnswer"); + + b.HasOne("AsbCloudDb.Model.User", "AuthorQuestion") + .WithMany() + .HasForeignKey("IdAuthorQuestion") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AuthorAnswer"); + + b.Navigation("AuthorQuestion"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("FileCategory"); + + 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.User", "User") + .WithMany("FileMarks") + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_user_t_file_mark_fk"); + + b.Navigation("FileInfo"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => + { + b.HasOne("AsbCloudDb.Model.FileCategory", "FileCategory") + .WithMany() + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FileCategory"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.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.Navigation("Author"); + + b.Navigation("Category"); + + 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.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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NotificationCategory"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OperationCategory"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => + { + 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.Navigation("User"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => + { + 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.WellSectionType", "WellSectionType") + .WithMany() + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Well"); + + b.Navigation("WellSectionType"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellReam", b => + { + 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.WellSectionType", "WellSectionType") + .WithMany() + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Well"); + + 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.Well", "Well") + .WithMany("RelationCompaniesWells") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_relation_company_well_t_well_id_fk"); + + b.Navigation("Company"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DrillingProgramPart"); + + 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.UserRole", "UserRole") + .WithMany("RelationUserRolePermissions") + .HasForeignKey("IdUserRole") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + 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", "IncludeRole") + .WithMany() + .HasForeignKey("IdInclude") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("IncludeRole"); + + 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.UserRole", "UserRole") + .WithMany("RelationUsersUserRoles") + .HasForeignKey("IdUserRole") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("File"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Driller"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.SubsystemOperationTime", b => + { + b.HasOne("AsbCloudDb.Model.Subsystems.Subsystem", "Subsystem") + .WithMany() + .HasForeignKey("IdSubsystem") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Subsystem"); + + b.Navigation("Telemetry"); + }); + + 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.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.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.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.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.Navigation("Telemetry"); + }); + + 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.Navigation("Company"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => + { + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.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.Navigation("Cluster"); + + b.Navigation("Telemetry"); + + 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.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.Navigation("Well"); + + b.Navigation("WellSectionType"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("User"); + + 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.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.WellSectionType", "WellSectionType") + .WithMany("WellOperations") + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OperationCategory"); + + b.Navigation("OperationPlan"); + + b.Navigation("Well"); + + b.Navigation("WellSectionType"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => + { + b.HasOne("AsbCloudDb.Model.WellOperationCategory", "Parent") + .WithMany() + .HasForeignKey("IdParent"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => + { + b.Navigation("Wells"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.Navigation("RelationCompaniesWells"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => + { + b.Navigation("Companies"); + + b.Navigation("Contacts"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => + { + b.Navigation("Clusters"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Driller", b => + { + b.Navigation("Schedule"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => + { + b.Navigation("RelatedUsers"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + b.Navigation("FileMarks"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => + { + b.Navigation("Children"); + + b.Navigation("Manuals"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => + { + b.Navigation("Measures"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => + { + b.Navigation("Notifications"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Permission", b => + { + b.Navigation("RelationUserRolePermissions"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => + { + b.Navigation("DataSaub"); + + b.Navigation("DataSpin"); + + b.Navigation("Events"); + + b.Navigation("Messages"); + + b.Navigation("Users"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.User", b => + { + b.Navigation("FileMarks"); + + b.Navigation("Files"); + + b.Navigation("RelationContactsWells"); + + b.Navigation("RelationUsersUserRoles"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserRole", b => + { + b.Navigation("RelationUserRolePermissions"); + + b.Navigation("RelationUserRoleUserRoles"); + + b.Navigation("RelationUsersUserRoles"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Well", b => + { + b.Navigation("Contacts"); + + b.Navigation("DrillingProgramParts"); + + b.Navigation("RelationCompaniesWells"); + + b.Navigation("WellCompositeSrcs"); + + b.Navigation("WellComposites"); + + b.Navigation("WellOperations"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => + { + b.Navigation("WellComposites"); + + b.Navigation("WellOperations"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellType", b => + { + b.Navigation("Wells"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs b/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs new file mode 100644 index 00000000..af56dae7 --- /dev/null +++ b/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs @@ -0,0 +1,53 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AsbCloudDb.Migrations +{ + public partial class Add_Permissions_For_Trajectory_Fact : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.InsertData( + table: "t_permission", + columns: new[] { "id", "description", "name" }, + values: new object[,] + { + { 530, "Разрешение просматривать фактические траектории", "FactTrajectory.get" }, + { 531, "Разрешение редактировать фактические траектории", "FactTrajectory.edit" } + }); + + migrationBuilder.InsertData( + table: "t_relation_user_role_permission", + columns: new[] { "id_permission", "id_user_role" }, + values: new object[,] + { + { 530, 1 }, + { 531, 1 } + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "t_relation_user_role_permission", + keyColumns: new[] { "id_permission", "id_user_role" }, + keyValues: new object[] { 530, 1 }); + + migrationBuilder.DeleteData( + table: "t_relation_user_role_permission", + keyColumns: new[] { "id_permission", "id_user_role" }, + keyValues: new object[] { 531, 1 }); + + migrationBuilder.DeleteData( + table: "t_permission", + keyColumn: "id", + keyValue: 530); + + migrationBuilder.DeleteData( + table: "t_permission", + keyColumn: "id", + keyValue: 531); + } + } +} diff --git a/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.Designer.cs b/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.Designer.cs new file mode 100644 index 00000000..138f115b --- /dev/null +++ b/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.Designer.cs @@ -0,0 +1,9005 @@ +// +using System; +using System.Text.Json; +using AsbCloudDb.Model; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace AsbCloudDb.Migrations +{ + [DbContext(typeof(AsbCloudDbContext))] + [Migration("20231115120948_Add_Fact_Trajectory_Table")] + partial class Add_Fact_Trajectory_Table + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseCollation("Russian_Russia.1251") + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.Property("IdDeposit") + .HasColumnType("integer") + .HasColumnName("id_deposit"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex("IdDeposit"); + + b.ToTable("t_cluster"); + + b.HasComment("Кусты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.HasIndex("IdCompanyType"); + + b.ToTable("t_company"); + + b.HasData( + new + { + Id = 1, + Caption = "ООО \"АСБ\"", + IdCompanyType = 3 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("IsContact") + .HasColumnType("boolean") + .HasColumnName("is_contact"); + + b.Property("Order") + .HasColumnType("integer") + .HasColumnName("order"); + + b.HasKey("Id"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Contact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Company") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("company") + .HasComment("компания"); + + b.Property("Email") + .IsRequired() + .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("IdCompanyType") + .HasMaxLength(255) + .HasColumnType("integer") + .HasColumnName("id_company_type") + .HasComment("вид деятельности"); + + b.Property("IdWell") + .HasMaxLength(255) + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ключ скважины"); + + b.Property("Phone") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("phone") + .HasComment("номер телефона"); + + b.Property("Position") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("position") + .HasComment("должность"); + + b.HasKey("Id"); + + b.HasIndex("IdCompanyType"); + + b.HasIndex("IdWell"); + + b.ToTable("t_contact"); + + b.HasComment("Контакты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DailyReport.DailyReport", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("StartDate") + .HasColumnType("date") + .HasColumnName("start_date") + .HasComment("Дата отчёта"); + + b.Property("Info") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("info") + .HasComment("Список параметров для отчёта"); + + b.HasKey("IdWell", "StartDate") + .HasName("t_id_well_date_start_pk"); + + b.ToTable("t_daily_report"); + + b.HasComment("Ежедневные отчёты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.ToTable("t_deposit"); + + b.HasComment("Месторождение"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина после завершения операции, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина на начало операции, м"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории операции"); + + b.Property("IdReasonOfEnd") + .HasColumnType("integer") + .HasColumnName("id_reason_of_end") + .HasComment("Код признака окончания операции"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdUsersAtStart") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя по телеметрии на момент начала операции"); + + b.Property("Value") + .HasColumnType("double precision") + .HasColumnName("value") + .HasComment("Ключевой показатель операции"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_detected_operation"); + + b.HasComment("автоматически определенные операции по телеметрии"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Driller", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Surname") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname") + .HasComment("Фамилия"); + + b.HasKey("Id"); + + b.ToTable("t_driller"); + + b.HasComment("Бурильщик"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdFileCategory") + .HasColumnType("integer") + .HasColumnName("id_file_category"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.HasKey("Id"); + + b.HasIndex("IdFileCategory"); + + b.HasIndex("IdWell", "IdFileCategory") + .IsUnique(); + + b.ToTable("t_drilling_program_part"); + + b.HasComment("части программ бурения"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .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("TimeStampStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("timestamp_start") + .HasComment("Время начала"); + + b.HasKey("Id", "IdTelemetry"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_drill_test"); + + b.HasComment("Drill_test"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FactTrajectory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("ID пользователя который внес/изменил запись"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("Radius") + .HasColumnType("double precision") + .HasColumnName("radius") + .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("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_fact_trajectory"); + + b.HasComment("Загрузка фактической траектории"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Faq", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Answer") + .HasColumnType("text") + .HasColumnName("answer") + .HasComment("Текст ответа"); + + b.Property("CounterQuestion") + .HasColumnType("integer") + .HasColumnName("counter_question") + .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("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("IdAuthorQuestion") + .HasColumnType("integer") + .HasColumnName("id_author_question") + .HasComment("id автора вопроса"); + + b.Property("IdReplacementQuestion") + .HasColumnType("integer") + .HasColumnName("id_replacement_question") + .HasComment("Ключ заменяющего вопроса"); + + b.Property("IsFrequently") + .HasColumnType("boolean") + .HasColumnName("is_frequently") + .HasComment("Частый вопрос"); + + b.Property("Question") + .IsRequired() + .HasColumnType("text") + .HasColumnName("question") + .HasComment("Текст вопроса"); + + b.Property("State") + .HasColumnType("integer") + .HasColumnName("state") + .HasComment("Статус вопроса"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthorAnswer"); + + b.HasIndex("IdAuthorQuestion"); + + b.ToTable("t_faq"); + + b.HasComment("вопросы пользователей"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории"); + + b.Property("ShortName") + .HasColumnType("text") + .HasColumnName("short_name") + .HasComment("Короткое название категории"); + + b.HasKey("Id"); + + b.ToTable("t_file_category"); + + 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 = "Инструкции" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Id пользователя, загрузившего файл"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("id категории файла"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Удален ли файл"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название файла"); + + b.Property("Size") + .HasColumnType("bigint") + .HasColumnName("file_size") + .HasComment("Размер файла"); + + b.Property("UploadDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_file_info"); + + b.HasComment("Файлы всех категорий"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileMark", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("IdFile") + .HasColumnType("integer") + .HasColumnName("id_file") + .HasComment("id файла"); + + b.Property("IdMarkType") + .HasColumnType("integer") + .HasColumnName("id_mark_type") + .HasComment("0 - отклонен, 1 - согласован"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("id пользователя"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Помечен ли файл как удаленный"); + + b.HasKey("Id"); + + b.HasIndex("IdFile"); + + b.HasIndex("IdUser"); + + b.ToTable("t_file_mark"); + + b.HasComment("Действия с файлами."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .HasColumnType("real") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_float"); + + b.HasComment("таблица данных ГТИ с типом значения float"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .HasColumnType("integer") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_int"); + + b.HasComment("таблица данных ГТИ с типом значения int"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_string"); + + b.HasComment("таблица данных ГТИ с типом значения string"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории файла"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название файла"); + + b.Property("Size") + .HasColumnType("bigint") + .HasColumnName("file_size") + .HasComment("Размер файла"); + + b.Property("UrlPage") + .IsRequired() + .HasColumnType("text") + .HasColumnName("url_page") + .HasComment("Url страницы"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.ToTable("t_help_page"); + + b.HasComment("Справки"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateEnd") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_end"); + + b.Property("DateStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_start"); + + b.Property("DepthEnd") + .HasColumnType("real") + .HasColumnName("depth_end"); + + b.Property("DepthStart") + .HasColumnType("real") + .HasColumnName("depth_start"); + + b.Property("IdFeedRegulator") + .HasColumnType("smallint") + .HasColumnName("id_feed_regulator"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.HasKey("Id"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_limiting_parameter"); + + b.HasComment("Ограничения по параметрам телеметрии"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.Manual", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateDownload") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_download") + .HasComment("Дата загрузки"); + + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Id автора"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории файла"); + + b.Property("IdDirectory") + .HasColumnType("integer") + .HasColumnName("id_directory") + .HasComment("Id директории"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdDirectory"); + + b.ToTable("t_manual"); + + b.HasComment("Инструкции"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdParent") + .HasColumnType("integer") + .HasColumnName("id_parent") + .HasComment("Id родительской директории"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название"); + + b.HasKey("Id"); + + b.HasIndex("IdParent"); + + b.ToTable("t_manual_directory"); + + b.HasComment("Директория для инструкций"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Measure", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Data") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("data") + .HasComment("Данные таблицы последних данных"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("id категории"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Пометка удаленным"); + + b.Property("Timestamp") + .HasColumnType("timestamp with time zone") + .HasColumnName("timestamp") + .HasComment("время добавления"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_measure"); + + b.HasComment("Таблица c данными для вкладки 'Последние данные'"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории"); + + b.Property("ShortName") + .HasColumnType("text") + .HasColumnName("short_name") + .HasComment("Короткое название категории"); + + b.HasKey("Id"); + + b.ToTable("t_measure_category"); + + b.HasComment("Категория последних данных"); + + 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"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id получателя"); + + b.Property("Message") + .IsRequired() + .HasColumnType("text") + .HasColumnName("message") + .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("SentDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("sent_date") + .HasComment("Дата отправки уведомления"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasColumnName("title") + .HasComment("Заголовок уведомления"); + + b.HasKey("Id"); + + b.HasIndex("IdNotificationCategory"); + + b.HasIndex("IdUser"); + + b.ToTable("t_notification"); + + b.HasComment("Уведомления"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name"); + + b.HasKey("Id"); + + b.ToTable("t_notification_category"); + + b.HasComment("Категории уведомлений"); + + b.HasData( + new + { + Id = 1, + Name = "Системные уведомления" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.OperationValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Конечная глубина"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Старотовая глубина"); + + b.Property("IdOperationCategory") + .HasColumnType("integer") + .HasColumnName("id_operation_category") + .HasComment("Ид категории операции"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Ид скважины"); + + b.Property("StandardValue") + .HasColumnType("double precision") + .HasColumnName("standard_value") + .HasComment("Нормативный показатель"); + + b.Property("TargetValue") + .HasColumnType("double precision") + .HasColumnName("target_value") + .HasComment("Целевой показатель"); + + b.HasKey("Id"); + + b.HasIndex("IdOperationCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_operationvalue"); + + b.HasComment("Целевые/нормативные показатели операции"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.ToTable("t_permission"); + + 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 = 529, + Description = "Разрешение на получение отчетов drill test", + Name = "DrillTestReport.get" + }, + new + { + Id = 530, + Description = "Разрешение просматривать фактические траектории", + Name = "FactTrajectory.get" + }, + new + { + Id = 531, + Description = "Разрешение редактировать фактические траектории", + Name = "FactTrajectory.edit" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("ID пользователя который внес/изменил запись"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("Radius") + .HasColumnType("double precision") + .HasColumnName("radius") + .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("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_planned_trajectory"); + + b.HasComment("Загрузка плановой траектории"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарий"); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина по стволу до, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина по стволу от, м"); + + b.Property("FlowLimitMax") + .HasColumnType("double precision") + .HasColumnName("flow_limit_max") + .HasComment("Расход, допустимый максимум"); + + b.Property("FlowPlan") + .HasColumnType("double precision") + .HasColumnName("flow_plan") + .HasComment("Расход, план"); + + b.Property("IdMode") + .HasColumnType("integer") + .HasColumnName("id_mode") + .HasComment("Id режима (1- ротор, 2 слайд)"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_wellsection_type") + .HasComment("Тип секции"); + + b.Property("LastUpdate") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_update") + .HasComment("Дата последнего изменения"); + + b.Property("PressureLimitMax") + .HasColumnType("double precision") + .HasColumnName("pressure_limit_max") + .HasComment("Перепад давления, допустимый максимум"); + + b.Property("PressurePlan") + .HasColumnType("double precision") + .HasColumnName("pressure_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("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("TopDriveTorquePlan") + .HasColumnType("double precision") + .HasColumnName("top_drive_torque_plan") + .HasComment("Момент на ВСП, план"); + + b.Property("UsageSaub") + .HasColumnType("double precision") + .HasColumnName("usage_saub") + .HasComment("Плановый процент использования АКБ"); + + b.Property("UsageSpin") + .HasColumnType("double precision") + .HasColumnName("usage_spin") + .HasComment("Плановый процент использования spin master"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_process_map_well_drilling"); + + b.HasComment("РТК бурение скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellReam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарий"); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина по стволу до, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина по стволу от, м"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_wellsection_type") + .HasComment("Тип секции"); + + b.Property("LastUpdate") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_update") + .HasComment("Дата последнего изменения"); + + b.Property("Pressure") + .HasColumnType("double precision") + .HasColumnName("pressure") + .HasComment("Давление, атм"); + + b.Property("Repeats") + .HasColumnType("double precision") + .HasColumnName("repeats") + .HasComment("Количество повторений"); + + b.Property("SetpointDrag") + .HasColumnType("double precision") + .HasColumnName("setpoint_drag") + .HasComment("Уставка зятяжки, т"); + + b.Property("SetpointTight") + .HasColumnType("double precision") + .HasColumnName("setpoint_tight") + .HasComment("Уставка посадки, т"); + + b.Property("SpeedDownward") + .HasColumnType("double precision") + .HasColumnName("speed_downward") + .HasComment("Скорость спуска, м/ч"); + + b.Property("SpeedUpward") + .HasColumnType("double precision") + .HasColumnName("speed_upward") + .HasComment("Скорость подъёма, м/ч"); + + b.Property("SpinDownward") + .HasColumnType("double precision") + .HasColumnName("spin_downward") + .HasComment("Вращение при движении вниз, об/мин"); + + b.Property("SpinUpward") + .HasColumnType("double precision") + .HasColumnName("spin_upward") + .HasComment("Вращение при движении вверх, об/мин"); + + b.Property("Torque") + .HasColumnType("double precision") + .HasColumnName("torque") + .HasComment("Момент, кН*м"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_process_map_well_ream"); + + b.HasComment("РТК проработка скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b => + { + b.Property("IdCompany") + .HasColumnType("integer") + .HasColumnName("id_company"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.HasKey("IdCompany", "IdWell"); + + b.HasIndex("IdWell"); + + b.ToTable("t_relation_company_well"); + + b.HasComment("отношение скважин и компаний"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationContactWell", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.HasKey("IdWell", "IdUser"); + + b.HasIndex("IdUser"); + + b.ToTable("t_relation_contact_well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserDrillingProgramPart", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdDrillingProgramPart") + .HasColumnType("integer") + .HasColumnName("id_drilling_program_part"); + + 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.HasIndex("IdDrillingProgramPart"); + + b.ToTable("t_relation_user_drilling_program_part"); + + b.HasComment("Отношение пользователей и частей ПБ"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserRolePermission", b => + { + b.Property("IdUserRole") + .HasColumnType("integer") + .HasColumnName("id_user_role"); + + b.Property("IdPermission") + .HasColumnType("integer") + .HasColumnName("id_permission"); + + b.HasKey("IdUserRole", "IdPermission"); + + b.HasIndex("IdPermission"); + + b.ToTable("t_relation_user_role_permission"); + + 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 = 529 + }, + 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("IdInclude") + .HasColumnType("integer") + .HasColumnName("id_include_user_role"); + + b.HasKey("Id", "IdInclude") + .HasName("t_relation_user_role_user_role_pk"); + + b.HasIndex("IdInclude"); + + b.ToTable("t_relation_user_role_user_role"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserUserRole", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdUserRole") + .HasColumnType("integer") + .HasColumnName("id_user_role"); + + b.HasKey("IdUser", "IdUserRole"); + + b.HasIndex("IdUserRole"); + + b.ToTable("t_relation_user_user_role"); + + b.HasComment("Отношение пользователей и ролей"); + + b.HasData( + new + { + IdUser = 1, + IdUserRole = 1 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ReportProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Format") + .HasColumnType("integer") + .HasColumnName("format") + .HasComment("Формат отчета"); + + b.Property("IdFile") + .HasColumnType("integer") + .HasColumnName("id_file") + .HasComment("id файла-родителя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("Step") + .HasColumnType("integer") + .HasColumnName("step") + .HasComment("размер шага в секундах"); + + b.HasKey("Id"); + + b.HasIndex("IdFile"); + + b.HasIndex("IdWell"); + + b.ToTable("t_report_property"); + + b.HasComment("Отчеты с данными по буровым"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Schedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("IdDriller") + .HasColumnType("integer") + .HasColumnName("id_driller") + .HasComment("Идентификатор бурильщика"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .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.HasKey("Id"); + + b.HasIndex("IdDriller"); + + b.HasIndex("IdWell"); + + b.ToTable("t_schedule"); + + b.HasComment("График работы бурильщика"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.SetpointsRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("комментарий для оператора"); + + 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("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("ObsolescenceSec") + .HasColumnType("integer") + .HasColumnName("obsolescence") + .HasComment("сек. до устаревания"); + + b.Property("Setpoints") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("setpoint_set") + .HasComment("Набор уставок"); + + b.Property("UploadDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdWell"); + + b.ToTable("t_setpoints_rquest"); + + b.HasComment("Запросы на изменение уставок панели оператора"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.Subsystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("description"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); + + b.HasKey("Id"); + + b.ToTable("t_subsystem"); + + b.HasComment("Описание подсистем"); + + b.HasData( + new + { + Id = 1, + Description = "Совместная работа режимов \"Бурение в роторе\" и \"Бурение в слайде\"", + Name = "АКБ" + }, + new + { + Id = 11, + Description = "Режим работы \"Бурение в роторе\"", + Name = "АПД ротор" + }, + new + { + Id = 12, + Description = "Режим работы \"Бурение в слайде\"", + Name = "АПД слайд" + }, + new + { + Id = 2, + Description = "Алгоритм поиска оптимальных параметров бурения САУБ", + Name = "MSE" + }, + new + { + Id = 65536, + Description = "Осцилляция", + Name = "Осцилляция" + }, + new + { + Id = 65537, + Description = "Демпфер", + Name = "Демпфер" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.SubsystemOperationTime", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("DepthEnd") + .HasColumnType("real") + .HasColumnName("depth_end") + .HasComment("глубина забоя на момент выключения подсистемы"); + + b.Property("DepthStart") + .HasColumnType("real") + .HasColumnName("depth_start") + .HasComment("глубина забоя на момент включения подсистемы"); + + b.Property("IdSubsystem") + .HasColumnType("integer") + .HasColumnName("id_subsystem"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .HasComment("ИД телеметрии по которой выдается информация"); + + b.HasKey("Id"); + + b.HasIndex("IdSubsystem"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_subsystem_operation_time"); + + b.HasComment("наработки подсистем"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Info") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("info") + .HasComment("Информация с панели о скважине"); + + b.Property("RemoteUid") + .IsRequired() + .HasColumnType("text") + .HasColumnName("remote_uid") + .HasComment("Идентификатор передающего устройства. Может повторяться в списке, так как комплекты оборудования переезжают от скв. к скв."); + + b.Property("TimeZone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "RemoteUid" }, "t_telemetry_remote_uid_index"); + + b.ToTable("t_telemetry"); + + b.HasComment("таблица привязки телеметрии от комплектов к конкретной скважине."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaub", b => + { + 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("AxialLoad") + .HasColumnType("real") + .HasColumnName("axial_load") + .HasComment("Осевая нагрузка"); + + b.Property("AxialLoadLimitMax") + .HasColumnType("real") + .HasColumnName("axial_load_limit_max") + .HasComment("Осевая нагрузка. Аварийная макс."); + + b.Property("AxialLoadSp") + .HasColumnType("real") + .HasColumnName("axial_load_sp") + .HasComment("Осевая нагрузка. Задание"); + + b.Property("BitDepth") + .HasColumnType("real") + .HasColumnName("bit_depth") + .HasComment("Положение инструмента"); + + b.Property("BlockPosition") + .HasColumnType("real") + .HasColumnName("block_position") + .HasComment("Высота талевого блока"); + + b.Property("BlockPositionMax") + .HasColumnType("real") + .HasColumnName("block_position_max") + .HasComment("Талевый блок. Макс положение"); + + b.Property("BlockPositionMin") + .HasColumnType("real") + .HasColumnName("block_position_min") + .HasComment("Талевый блок. Мин положение"); + + b.Property("BlockSpeed") + .HasColumnType("real") + .HasColumnName("block_speed") + .HasComment("Скорость талевого блока"); + + b.Property("BlockSpeedSp") + .HasColumnType("real") + .HasColumnName("block_speed_sp") + .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("BlockSpeedSpSlide") + .HasColumnType("real") + .HasColumnName("block_speed_sp_slide") + .HasComment("Талевый блок. Задание скорости для режима слайда"); + + b.Property("Flow") + .HasColumnType("real") + .HasColumnName("flow") + .HasComment("Расход"); + + b.Property("FlowDeltaLimitMax") + .HasColumnType("real") + .HasColumnName("flow_delta_limit_max") + .HasComment("Расход. Аварийный макс."); + + b.Property("FlowIdle") + .HasColumnType("real") + .HasColumnName("flow_idle") + .HasComment("Расход. Холостой ход"); + + b.Property("HookWeight") + .HasColumnType("real") + .HasColumnName("hook_weight") + .HasComment("Вес на крюке"); + + b.Property("HookWeightIdle") + .HasColumnType("real") + .HasColumnName("hook_weight_idle") + .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("IdFeedRegulator") + .HasColumnType("smallint") + .HasColumnName("id_feed_regulator") + .HasComment("Текущий критерий бурения"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Пользователь САУБ"); + + b.Property("Mode") + .HasColumnType("smallint") + .HasColumnName("mode") + .HasComment("Режим САУБ"); + + b.Property("Mse") + .HasColumnType("real") + .HasColumnName("mse") + .HasComment("MSE"); + + b.Property("MseState") + .HasColumnType("smallint") + .HasColumnName("mse_state") + .HasComment("Текущее состояние работы MSE"); + + b.Property("Pressure") + .HasColumnType("real") + .HasColumnName("pressure") + .HasComment("Давление"); + + b.Property("PressureDeltaLimitMax") + .HasColumnType("real") + .HasColumnName("pressure_delta_limit_max") + .HasComment("Давление дифф. Аварийное макс."); + + b.Property("PressureIdle") + .HasColumnType("real") + .HasColumnName("pressure_idle") + .HasComment("Давление. Холостой ход"); + + b.Property("PressureSp") + .HasColumnType("real") + .HasColumnName("pressure_sp") + .HasComment("Давление. Задание"); + + b.Property("PressureSpDevelop") + .HasColumnType("real") + .HasColumnName("pressure_sp_develop") + .HasComment("Давление. Задание для проработки"); + + b.Property("PressureSpRotor") + .HasColumnType("real") + .HasColumnName("pressure_sp_rotor") + .HasComment("Давление. Задание для роторного бурения"); + + b.Property("PressureSpSlide") + .HasColumnType("real") + .HasColumnName("pressure_sp_slide") + .HasComment("Давление. Задание для режима слайда"); + + b.Property("Pump0Flow") + .HasColumnType("real") + .HasColumnName("pump0_flow") + .HasComment("Расход. Буровой насос 1"); + + b.Property("Pump1Flow") + .HasColumnType("real") + .HasColumnName("pump1_flow") + .HasComment("Расход. Буровой насос 2"); + + b.Property("Pump2Flow") + .HasColumnType("real") + .HasColumnName("pump2_flow") + .HasComment("Расход. Буровой насос 3"); + + b.Property("RotorSpeed") + .HasColumnType("real") + .HasColumnName("rotor_speed") + .HasComment("Обороты ротора"); + + b.Property("RotorTorque") + .HasColumnType("real") + .HasColumnName("rotor_torque") + .HasComment("Момент на роторе"); + + b.Property("RotorTorqueIdle") + .HasColumnType("real") + .HasColumnName("rotor_torque_idle") + .HasComment("Момент на роторе. Холостой ход"); + + b.Property("RotorTorqueLimitMax") + .HasColumnType("real") + .HasColumnName("rotor_torque_limit_max") + .HasComment("Момент на роторе. Аварийный макс."); + + b.Property("RotorTorqueSp") + .HasColumnType("real") + .HasColumnName("rotor_torque_sp") + .HasComment("Момент на роторе. Задание"); + + b.Property("WellDepth") + .HasColumnType("real") + .HasColumnName("well_depth") + .HasComment("Глубина забоя"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_data_saub"); + + b.HasComment("набор основных данных по SAUB"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaubStat", b => + { + b.Property("Count") + .HasColumnType("bigint") + .HasColumnName("count_items"); + + b.Property("DateMax") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_max"); + + b.Property("DateMin") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_min"); + + b.Property("DepthMax") + .HasColumnType("real") + .HasColumnName("depth_max"); + + b.Property("DepthMin") + .HasColumnType("real") + .HasColumnName("depth_min"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.ToView("mw_telemetry_datas_saub_stat"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSpin", b => + { + 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("Mode") + .HasColumnType("smallint") + .HasColumnName("mode") + .HasComment("Выбранный режим управления"); + + b.Property("PositionRight") + .HasColumnType("real") + .HasColumnName("position_right") + .HasComment("Крайний правый угол осцилляции"); + + b.Property("PositionZero") + .HasColumnType("real") + .HasColumnName("position_zero") + .HasComment("Нулевая позиция осцилляции"); + + b.Property("RevolsLeftLimit") + .HasColumnType("real") + .HasColumnName("revols_left_limit") + .HasComment("Ограничение числа оборотов влево"); + + b.Property("RevolsLeftTotal") + .HasColumnType("real") + .HasColumnName("revols_left_total") + .HasComment("Суммарное количество оборотов влево"); + + b.Property("RevolsRightLimit") + .HasColumnType("real") + .HasColumnName("revols_right_limit") + .HasComment("Ограничение числа оборотов вправо"); + + b.Property("RevolsRightTotal") + .HasColumnType("real") + .HasColumnName("revols_right_total") + .HasComment("Суммарное количество оборотов вправо"); + + b.Property("SpeedLeftSp") + .HasColumnType("real") + .HasColumnName("speed_left_sp") + .HasComment("Заданная скорость вращения влево"); + + b.Property("SpeedRightSp") + .HasColumnType("real") + .HasColumnName("speed_right_sp") + .HasComment("Заданная скорость вращения вправо"); + + b.Property("State") + .HasColumnType("smallint") + .HasColumnName("state") + .HasComment("Переменная этапа"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_data_spin"); + + b.HasComment("набор основных данных по SpinMaster"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryEvent", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdEvent") + .HasColumnType("integer") + .HasColumnName("id_event"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category"); + + b.Property("MessageTemplate") + .IsRequired() + .HasColumnType("text") + .HasColumnName("message_template"); + + b.HasKey("IdTelemetry", "IdEvent"); + + b.ToTable("t_telemetry_event"); + + b.HasComment("Справочник событий. События формируют сообщения. Разделено по версиям посылок от телеметрии."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Arg2") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg2"); + + b.Property("Arg3") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg3"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("IdEvent") + .HasColumnType("integer") + .HasColumnName("id_event"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdTelemetryUser") + .HasColumnType("integer") + .HasColumnName("id_telemetry_user") + .HasComment("Пользователь панели отправляющей телеметрию. не пользователь облака."); + + b.Property("WellDepth") + .HasColumnType("double precision") + .HasColumnName("well_depth"); + + b.HasKey("Id"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_telemetry_message"); + + b.HasComment("Сообщения на буровых"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryUser", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level"); + + b.Property("Name") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); + + b.Property("Patronymic") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("patronymic"); + + b.Property("Surname") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname"); + + b.HasKey("IdTelemetry", "IdUser"); + + b.ToTable("t_telemetry_user"); + + b.HasComment("Пользователи панели САУБ. Для сообщений."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryWirelineRunOut", b => + { + b.Property("IdTelemetry") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .HasComment("Идентификатор телеметрии"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("IdTelemetry")); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_time") + .HasComment("Отметка времени"); + + b.Property("Hauling") + .HasColumnType("real") + .HasColumnName("hauling") + .HasComment("Наработка талевого каната с момента перетяжки каната, т*км"); + + b.Property("HaulingWarnSp") + .HasColumnType("real") + .HasColumnName("hauling_warn_sp") + .HasComment("Наработка талевого каната до сигнализации о необходимости перетяжки, т*км"); + + b.Property("Replace") + .HasColumnType("real") + .HasColumnName("replace") + .HasComment("Наработка талевого каната с момента замены каната, т*км"); + + b.Property("ReplaceWarnSp") + .HasColumnType("real") + .HasColumnName("replace_warn_sp") + .HasComment("Наработка талевого каната до сигнализации о необходимости замены, т*км"); + + b.HasKey("IdTelemetry"); + + b.ToTable("t_telemetry_wireline_run_out"); + + b.HasComment("Наработка талевого каната"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Email") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("email") + .HasComment("должность"); + + b.Property("IdCompany") + .HasColumnType("integer") + .HasColumnName("id_company"); + + 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("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("Patronymic") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("patronymic") + .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("Surname") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname") + .HasComment("фамилия"); + + b.HasKey("Id"); + + b.HasIndex("IdCompany"); + + b.HasIndex("Login") + .IsUnique(); + + b.ToTable("t_user"); + + b.HasComment("Пользователи облака"); + + 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"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.ToTable("t_user_role"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("Key") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("key") + .HasComment("Ключ настроек пользователя"); + + b.Property("Value") + .HasColumnType("jsonb") + .HasColumnName("setting_value") + .HasComment("Значение настроек пользователя"); + + b.HasKey("IdUser", "Key"); + + b.ToTable("t_user_settings"); + + b.HasComment("настройки интерфейса пользователя"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Well", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("IdCluster") + .HasColumnType("integer") + .HasColumnName("id_cluster"); + + b.Property("IdState") + .HasColumnType("integer") + .HasColumnName("state") + .HasComment("0 - неизвестно, 1 - в работе, 2 - завершена"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdWellType") + .HasColumnType("integer") + .HasColumnName("id_well_type"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex("IdCluster"); + + b.HasIndex("IdTelemetry") + .IsUnique(); + + b.HasIndex("IdWellType"); + + b.ToTable("t_well"); + + b.HasComment("скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellComposite", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .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.HasKey("IdWell", "IdWellSrc", "IdWellSectionType"); + + b.HasIndex("IdWellSectionType"); + + b.HasIndex("IdWellSrc"); + + b.ToTable("t_well_composite"); + + b.HasComment("Композитная скважина"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellFinalDocument", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category"); + + b.HasKey("IdWell", "IdUser", "IdCategory") + .HasName("t_well_final_documents_pk"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdUser"); + + b.ToTable("t_well_final_documents"); + + b.HasComment("Дело скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CategoryInfo") + .HasColumnType("text") + .HasColumnName("category_info") + .HasComment("Доп. информация к выбраной категории"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .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("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина на начало операции, м"); + + b.Property("DurationHours") + .HasColumnType("double precision") + .HasColumnName("duration_hours") + .HasComment("Продолжительность, часы"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .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("IdUser") + .HasColumnType("integer"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_well_section_type") + .HasComment("Id тип секции скважины"); + + b.Property("LastUpdateDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("DateStart"); + + b.HasIndex("DepthEnd"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdPlan"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_well_operation"); + + b.HasComment("Данные по операциям на скважине"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("KeyValueUnits") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("key_value_units") + .HasComment("Единицы измерения ключевого показателя операции"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории операции"); + + b.HasKey("Id"); + + b.HasIndex("IdParent"); + + b.ToTable("t_well_operation_category"); + + 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 = 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 = "Ремонт" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.Property("Order") + .HasColumnType("real") + .HasColumnName("order") + .HasComment("Порядок"); + + b.HasKey("Id"); + + b.ToTable("t_well_section_type"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.HasKey("Id"); + + b.ToTable("t_well_type"); + + b.HasComment("конструкция скважины"); + + 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("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Actcod") + .HasColumnType("smallint") + .HasColumnName("ACTCOD"); + + b.Property("Date") + .HasColumnType("integer") + .HasColumnName("DATE"); + + b.Property("Recid") + .HasColumnType("smallint") + .HasColumnName("RECID"); + + b.Property("Seqid") + .HasColumnType("integer") + .HasColumnName("SEQID"); + + b.Property("Stknum") + .HasColumnType("smallint") + .HasColumnName("STKNUM"); + + b.Property("Time") + .HasColumnType("integer") + .HasColumnName("TIME"); + + b.Property("Wellid") + .HasColumnType("text") + .HasColumnName("WELLID"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_wits_base"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Blkpos") + .HasColumnType("real") + .HasColumnName("BLKPOS"); + + b.Property("Chkp") + .HasColumnType("real") + .HasColumnName("CHKP"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptbitv") + .HasColumnType("real") + .HasColumnName("DEPTBITV"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptretm") + .HasColumnType("real") + .HasColumnName("DEPTRETM"); + + b.Property("Deptvert") + .HasColumnType("real") + .HasColumnName("DEPTVERT"); + + b.Property("Gasa") + .HasColumnType("real") + .HasColumnName("GASA"); + + b.Property("Hkla") + .HasColumnType("real") + .HasColumnName("HKLA"); + + b.Property("Hklx") + .HasColumnType("real") + .HasColumnName("HKLX"); + + b.Property("Lagstks") + .HasColumnType("smallint") + .HasColumnName("LAGSTKS"); + + b.Property("Mcia") + .HasColumnType("real") + .HasColumnName("MCIA"); + + b.Property("Mcoa") + .HasColumnType("real") + .HasColumnName("MCOA"); + + b.Property("Mdia") + .HasColumnType("real") + .HasColumnName("MDIA"); + + b.Property("Mdoa") + .HasColumnType("real") + .HasColumnName("MDOA"); + + b.Property("Mfia") + .HasColumnType("real") + .HasColumnName("MFIA"); + + b.Property("Mfoa") + .HasColumnType("real") + .HasColumnName("MFOA"); + + b.Property("Mfop") + .HasColumnType("smallint") + .HasColumnName("MFOP"); + + b.Property("Mtia") + .HasColumnType("real") + .HasColumnName("MTIA"); + + b.Property("Mtoa") + .HasColumnType("real") + .HasColumnName("MTOA"); + + b.Property("Ropa") + .HasColumnType("real") + .HasColumnName("ROPA"); + + b.Property("Rpma") + .HasColumnType("smallint") + .HasColumnName("RPMA"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Spm1") + .HasColumnType("smallint") + .HasColumnName("SPM1"); + + b.Property("Spm2") + .HasColumnType("smallint") + .HasColumnName("SPM2"); + + b.Property("Spm3") + .HasColumnType("smallint") + .HasColumnName("SPM3"); + + b.Property("Sppa") + .HasColumnType("real") + .HasColumnName("SPPA"); + + b.Property("Stkc") + .HasColumnType("integer") + .HasColumnName("STKC"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.Property("Torqa") + .HasColumnType("real") + .HasColumnName("TORQA"); + + b.Property("Torqx") + .HasColumnType("real") + .HasColumnName("TORQX"); + + b.Property("Tvolact") + .HasColumnType("real") + .HasColumnName("TVOLACT"); + + b.Property("Tvolcact") + .HasColumnType("real") + .HasColumnName("TVOLCACT"); + + b.Property("Woba") + .HasColumnType("real") + .HasColumnName("WOBA"); + + b.Property("Wobx") + .HasColumnType("real") + .HasColumnName("WOBX"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_1"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("DeptmeasGdpMc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_GDP_mc"); + + b.Property("DeptmeasMcrstat") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_MCRSTAT"); + + b.Property("DeptmeasRa33Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33_mc"); + + b.Property("DeptmeasRa33f2Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33F2_mc"); + + b.Property("DeptmeasRa33f4Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33F4_mc"); + + b.Property("DeptmeasRp33Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33_mc"); + + b.Property("DeptmeasRp33f2Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33F2_mc"); + + b.Property("DeptmeasRp33f4Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33F4_mc"); + + b.Property("DeptmeasSlvlMc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_SLVL_mc"); + + b.Property("GdpMc") + .HasColumnType("real") + .HasColumnName("GDP_mc"); + + b.Property("Mcrstat") + .HasColumnType("real") + .HasColumnName("MCRSTAT"); + + b.Property("Ra33Mc") + .HasColumnType("real") + .HasColumnName("RA33_mc"); + + b.Property("Ra33f2Mc") + .HasColumnType("real") + .HasColumnName("RA33F2_mc"); + + b.Property("Ra33f4Mc") + .HasColumnType("real") + .HasColumnName("RA33F4_mc"); + + b.Property("Rp33Mc") + .HasColumnType("real") + .HasColumnName("RP33_mc"); + + b.Property("Rp33f2Mc") + .HasColumnType("real") + .HasColumnName("RP33F2_mc"); + + b.Property("Rp33f4Mc") + .HasColumnType("real") + .HasColumnName("RP33F4_mc"); + + b.Property("SlvlMc") + .HasColumnType("real") + .HasColumnName("SLVL_mc"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_50"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Btot") + .HasColumnType("real") + .HasColumnName("Btot"); + + b.Property("Bx") + .HasColumnType("real") + .HasColumnName("Bx"); + + b.Property("By") + .HasColumnType("real") + .HasColumnName("By"); + + b.Property("Bz") + .HasColumnType("real") + .HasColumnName("Bz"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Gtot") + .HasColumnType("real") + .HasColumnName("Gtot"); + + b.Property("Gx") + .HasColumnType("real") + .HasColumnName("Gx"); + + b.Property("Gy") + .HasColumnType("real") + .HasColumnName("Gy"); + + b.Property("Gz") + .HasColumnType("real") + .HasColumnName("Gz"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_60"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Att06h") + .HasColumnType("real") + .HasColumnName("ATT06H"); + + b.Property("Att06l") + .HasColumnType("real") + .HasColumnName("ATT06L"); + + b.Property("Att10h") + .HasColumnType("real") + .HasColumnName("ATT10H"); + + b.Property("Att10l") + .HasColumnType("real") + .HasColumnName("ATT10L"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Phl1f1") + .HasColumnType("real") + .HasColumnName("PHL1F1"); + + b.Property("Phl1f2") + .HasColumnType("real") + .HasColumnName("PHL1F2"); + + b.Property("Phl2f1") + .HasColumnType("real") + .HasColumnName("PHL2F1"); + + b.Property("Phl2f2") + .HasColumnType("real") + .HasColumnName("PHL2F2"); + + b.Property("Status") + .HasColumnType("real") + .HasColumnName("Status"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_61"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptsvym") + .HasColumnType("real") + .HasColumnName("DEPTSVYM"); + + b.Property("Deptsvyv") + .HasColumnType("real") + .HasColumnName("DEPTSVYV"); + + b.Property("Passnum") + .HasColumnType("smallint") + .HasColumnName("PASSNUM"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Svyazc") + .HasColumnType("real") + .HasColumnName("SVYAZC"); + + b.Property("Svyazu") + .HasColumnType("real") + .HasColumnName("SVYAZU"); + + b.Property("Svydls") + .HasColumnType("real") + .HasColumnName("SVYDLS"); + + b.Property("Svyew") + .HasColumnType("real") + .HasColumnName("SVYEW"); + + b.Property("Svygtf") + .HasColumnType("real") + .HasColumnName("SVYGTF"); + + b.Property("Svyinc") + .HasColumnType("real") + .HasColumnName("SVYINC"); + + b.Property("Svymtf") + .HasColumnType("real") + .HasColumnName("SVYMTF"); + + b.Property("Svyns") + .HasColumnType("real") + .HasColumnName("SVYNS"); + + b.Property("Svytype") + .HasColumnType("text") + .HasColumnName("SVYTYPE"); + + b.Property("Svywalk") + .HasColumnType("real") + .HasColumnName("SVYWALK"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_7"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptbitv") + .HasColumnType("real") + .HasColumnName("DEPTBITV"); + + b.Property("Deptcalm") + .HasColumnType("real") + .HasColumnName("DEPTCALM"); + + b.Property("Deptcalv") + .HasColumnType("real") + .HasColumnName("DEPTCALV"); + + b.Property("Deptfdm") + .HasColumnType("real") + .HasColumnName("DEPTFDM"); + + b.Property("Deptfdv") + .HasColumnType("real") + .HasColumnName("DEPTFDV"); + + b.Property("Deptgr1m") + .HasColumnType("real") + .HasColumnName("DEPTGR1M"); + + b.Property("Deptgr1v") + .HasColumnType("real") + .HasColumnName("DEPTGR1V"); + + b.Property("Deptgr2m") + .HasColumnType("real") + .HasColumnName("DEPTGR2M"); + + b.Property("Deptgr2v") + .HasColumnType("real") + .HasColumnName("DEPTGR2V"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptp1m") + .HasColumnType("real") + .HasColumnName("DEPTP1M"); + + b.Property("Deptp1v") + .HasColumnType("real") + .HasColumnName("DEPTP1V"); + + b.Property("Deptp2m") + .HasColumnType("real") + .HasColumnName("DEPTP2M"); + + b.Property("Deptp2v") + .HasColumnType("real") + .HasColumnName("DEPTP2V"); + + b.Property("Deptrs1m") + .HasColumnType("real") + .HasColumnName("DEPTRS1M"); + + b.Property("Deptrs1v") + .HasColumnType("real") + .HasColumnName("DEPTRS1V"); + + b.Property("Deptrs2m") + .HasColumnType("real") + .HasColumnName("DEPTRS2M"); + + b.Property("Deptrs2v") + .HasColumnType("real") + .HasColumnName("DEPTRS2V"); + + b.Property("Deptvert") + .HasColumnType("real") + .HasColumnName("DEPTVERT"); + + b.Property("Mclp") + .HasColumnType("real") + .HasColumnName("MCLP"); + + b.Property("Mfd") + .HasColumnType("real") + .HasColumnName("MFD"); + + b.Property("Mffp") + .HasColumnType("real") + .HasColumnName("MFFP"); + + b.Property("Mfpp") + .HasColumnType("real") + .HasColumnName("MFPP"); + + b.Property("Mfrann") + .HasColumnType("real") + .HasColumnName("MFRANN"); + + b.Property("Mfrpipe") + .HasColumnType("real") + .HasColumnName("MFRPIPE"); + + b.Property("Mftann") + .HasColumnType("real") + .HasColumnName("MFTANN"); + + b.Property("Mftpipe") + .HasColumnType("real") + .HasColumnName("MFTPIPE"); + + b.Property("Mg1") + .HasColumnType("real") + .HasColumnName("MG1"); + + b.Property("Mg1c") + .HasColumnType("real") + .HasColumnName("MG1C"); + + b.Property("Mg2") + .HasColumnType("real") + .HasColumnName("MG2"); + + b.Property("Mg2c") + .HasColumnType("real") + .HasColumnName("MG2C"); + + b.Property("Mpo1") + .HasColumnType("real") + .HasColumnName("MPO1"); + + b.Property("Mpo2") + .HasColumnType("real") + .HasColumnName("MPO2"); + + b.Property("Mr1") + .HasColumnType("real") + .HasColumnName("MR1"); + + b.Property("Mr1c") + .HasColumnType("real") + .HasColumnName("MR1C"); + + b.Property("Mr2") + .HasColumnType("real") + .HasColumnName("MR2"); + + b.Property("Mr2c") + .HasColumnType("real") + .HasColumnName("MR2C"); + + b.Property("Passnum") + .HasColumnType("smallint") + .HasColumnName("PASSNUM"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Spare6") + .HasColumnType("real") + .HasColumnName("SPARE6"); + + b.Property("Spare7") + .HasColumnType("real") + .HasColumnName("SPARE7"); + + b.Property("Spare8") + .HasColumnType("real") + .HasColumnName("SPARE8"); + + b.Property("Spare9") + .HasColumnType("real") + .HasColumnName("SPARE9"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + 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.Navigation("Deposit"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.HasOne("AsbCloudDb.Model.CompanyType", "CompanyType") + .WithMany("Companies") + .HasForeignKey("IdCompanyType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.Well", "Well") + .WithMany("Contacts") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CompanyType"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DailyReport.DailyReport", b => + { + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => + { + 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.Navigation("OperationCategory"); + + 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.Well", "Well") + .WithMany("DrillingProgramParts") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FileCategory"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FactTrajectory", b => + { + 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.Navigation("User"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Faq", b => + { + b.HasOne("AsbCloudDb.Model.User", "AuthorAnswer") + .WithMany() + .HasForeignKey("IdAuthorAnswer"); + + b.HasOne("AsbCloudDb.Model.User", "AuthorQuestion") + .WithMany() + .HasForeignKey("IdAuthorQuestion") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AuthorAnswer"); + + b.Navigation("AuthorQuestion"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("FileCategory"); + + 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.User", "User") + .WithMany("FileMarks") + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_user_t_file_mark_fk"); + + b.Navigation("FileInfo"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => + { + b.HasOne("AsbCloudDb.Model.FileCategory", "FileCategory") + .WithMany() + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FileCategory"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.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.Navigation("Author"); + + b.Navigation("Category"); + + 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.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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NotificationCategory"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OperationCategory"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => + { + 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.Navigation("User"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => + { + 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.WellSectionType", "WellSectionType") + .WithMany() + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Well"); + + b.Navigation("WellSectionType"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellReam", b => + { + 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.WellSectionType", "WellSectionType") + .WithMany() + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Well"); + + 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.Well", "Well") + .WithMany("RelationCompaniesWells") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_relation_company_well_t_well_id_fk"); + + b.Navigation("Company"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DrillingProgramPart"); + + 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.UserRole", "UserRole") + .WithMany("RelationUserRolePermissions") + .HasForeignKey("IdUserRole") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + 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", "IncludeRole") + .WithMany() + .HasForeignKey("IdInclude") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("IncludeRole"); + + 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.UserRole", "UserRole") + .WithMany("RelationUsersUserRoles") + .HasForeignKey("IdUserRole") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("File"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Driller"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.SubsystemOperationTime", b => + { + b.HasOne("AsbCloudDb.Model.Subsystems.Subsystem", "Subsystem") + .WithMany() + .HasForeignKey("IdSubsystem") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Subsystem"); + + b.Navigation("Telemetry"); + }); + + 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.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.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.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.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.Navigation("Telemetry"); + }); + + 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.Navigation("Company"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => + { + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.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.Navigation("Cluster"); + + b.Navigation("Telemetry"); + + 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.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.Navigation("Well"); + + b.Navigation("WellSectionType"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("User"); + + 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.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.WellSectionType", "WellSectionType") + .WithMany("WellOperations") + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OperationCategory"); + + b.Navigation("OperationPlan"); + + b.Navigation("Well"); + + b.Navigation("WellSectionType"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => + { + b.HasOne("AsbCloudDb.Model.WellOperationCategory", "Parent") + .WithMany() + .HasForeignKey("IdParent"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => + { + b.Navigation("Wells"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.Navigation("RelationCompaniesWells"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => + { + b.Navigation("Companies"); + + b.Navigation("Contacts"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => + { + b.Navigation("Clusters"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Driller", b => + { + b.Navigation("Schedule"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => + { + b.Navigation("RelatedUsers"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + b.Navigation("FileMarks"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => + { + b.Navigation("Children"); + + b.Navigation("Manuals"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => + { + b.Navigation("Measures"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => + { + b.Navigation("Notifications"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Permission", b => + { + b.Navigation("RelationUserRolePermissions"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => + { + b.Navigation("DataSaub"); + + b.Navigation("DataSpin"); + + b.Navigation("Events"); + + b.Navigation("Messages"); + + b.Navigation("Users"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.User", b => + { + b.Navigation("FileMarks"); + + b.Navigation("Files"); + + b.Navigation("RelationContactsWells"); + + b.Navigation("RelationUsersUserRoles"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserRole", b => + { + b.Navigation("RelationUserRolePermissions"); + + b.Navigation("RelationUserRoleUserRoles"); + + b.Navigation("RelationUsersUserRoles"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Well", b => + { + b.Navigation("Contacts"); + + b.Navigation("DrillingProgramParts"); + + b.Navigation("RelationCompaniesWells"); + + b.Navigation("WellCompositeSrcs"); + + b.Navigation("WellComposites"); + + b.Navigation("WellOperations"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => + { + b.Navigation("WellComposites"); + + b.Navigation("WellOperations"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellType", b => + { + b.Navigation("Wells"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.cs b/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.cs new file mode 100644 index 00000000..653c38a5 --- /dev/null +++ b/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.cs @@ -0,0 +1,65 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace AsbCloudDb.Migrations +{ + public partial class Add_Fact_Trajectory_Table : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "t_fact_trajectory", + columns: table => new + { + id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id_user = table.Column(type: "integer", nullable: false, comment: "ID пользователя который внес/изменил запись"), + id_well = table.Column(type: "integer", nullable: false, comment: "ID скважины"), + update_date = table.Column(type: "timestamp with time zone", nullable: false, comment: "Дата загрузки траектории"), + wellbore_depth = table.Column(type: "double precision", nullable: false, comment: "Глубина по стволу"), + zenith_angle = table.Column(type: "double precision", nullable: false, comment: "Угол зенитный"), + azimuth_geo = table.Column(type: "double precision", nullable: false, comment: "Азимут Географ."), + azimuth_magnetic = table.Column(type: "double precision", nullable: false, comment: "Азимут Магнитный"), + vertical_depth = table.Column(type: "double precision", nullable: false, comment: "Глубина вертикальная"), + comment = table.Column(type: "text", nullable: true, comment: "Комментарии"), + radius = table.Column(type: "double precision", nullable: true, comment: "Радиус цели") + }, + constraints: table => + { + table.PrimaryKey("PK_t_fact_trajectory", x => x.id); + table.ForeignKey( + name: "FK_t_fact_trajectory_t_user_id_user", + column: x => x.id_user, + principalTable: "t_user", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_t_fact_trajectory_t_well_id_well", + column: x => x.id_well, + principalTable: "t_well", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }, + comment: "Загрузка фактической траектории"); + + migrationBuilder.CreateIndex( + name: "IX_t_fact_trajectory_id_user", + table: "t_fact_trajectory", + column: "id_user"); + + migrationBuilder.CreateIndex( + name: "IX_t_fact_trajectory_id_well", + table: "t_fact_trajectory", + column: "id_well"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "t_fact_trajectory"); + } + } +} diff --git a/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.Designer.cs b/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.Designer.cs new file mode 100644 index 00000000..ae6055cb --- /dev/null +++ b/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.Designer.cs @@ -0,0 +1,9016 @@ +// +using System; +using System.Text.Json; +using AsbCloudDb.Model; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace AsbCloudDb.Migrations +{ + [DbContext(typeof(AsbCloudDbContext))] + [Migration("20231116094844_Add_Permissions_For_Trajectory_Nnb")] + partial class Add_Permissions_For_Trajectory_Nnb + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseCollation("Russian_Russia.1251") + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.Property("IdDeposit") + .HasColumnType("integer") + .HasColumnName("id_deposit"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex("IdDeposit"); + + b.ToTable("t_cluster"); + + b.HasComment("Кусты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.HasIndex("IdCompanyType"); + + b.ToTable("t_company"); + + b.HasData( + new + { + Id = 1, + Caption = "ООО \"АСБ\"", + IdCompanyType = 3 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("IsContact") + .HasColumnType("boolean") + .HasColumnName("is_contact"); + + b.Property("Order") + .HasColumnType("integer") + .HasColumnName("order"); + + b.HasKey("Id"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Contact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Company") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("company") + .HasComment("компания"); + + b.Property("Email") + .IsRequired() + .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("IdCompanyType") + .HasMaxLength(255) + .HasColumnType("integer") + .HasColumnName("id_company_type") + .HasComment("вид деятельности"); + + b.Property("IdWell") + .HasMaxLength(255) + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ключ скважины"); + + b.Property("Phone") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("phone") + .HasComment("номер телефона"); + + b.Property("Position") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("position") + .HasComment("должность"); + + b.HasKey("Id"); + + b.HasIndex("IdCompanyType"); + + b.HasIndex("IdWell"); + + b.ToTable("t_contact"); + + b.HasComment("Контакты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DailyReport.DailyReport", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("StartDate") + .HasColumnType("date") + .HasColumnName("start_date") + .HasComment("Дата отчёта"); + + b.Property("Info") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("info") + .HasComment("Список параметров для отчёта"); + + b.HasKey("IdWell", "StartDate") + .HasName("t_id_well_date_start_pk"); + + b.ToTable("t_daily_report"); + + b.HasComment("Ежедневные отчёты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.ToTable("t_deposit"); + + b.HasComment("Месторождение"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина после завершения операции, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина на начало операции, м"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории операции"); + + b.Property("IdReasonOfEnd") + .HasColumnType("integer") + .HasColumnName("id_reason_of_end") + .HasComment("Код признака окончания операции"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdUsersAtStart") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя по телеметрии на момент начала операции"); + + b.Property("Value") + .HasColumnType("double precision") + .HasColumnName("value") + .HasComment("Ключевой показатель операции"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_detected_operation"); + + b.HasComment("автоматически определенные операции по телеметрии"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Driller", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Surname") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname") + .HasComment("Фамилия"); + + b.HasKey("Id"); + + b.ToTable("t_driller"); + + b.HasComment("Бурильщик"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdFileCategory") + .HasColumnType("integer") + .HasColumnName("id_file_category"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.HasKey("Id"); + + b.HasIndex("IdFileCategory"); + + b.HasIndex("IdWell", "IdFileCategory") + .IsUnique(); + + b.ToTable("t_drilling_program_part"); + + b.HasComment("части программ бурения"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .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("TimeStampStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("timestamp_start") + .HasComment("Время начала"); + + b.HasKey("Id", "IdTelemetry"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_drill_test"); + + b.HasComment("Drill_test"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FactTrajectory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("ID пользователя который внес/изменил запись"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("Radius") + .HasColumnType("double precision") + .HasColumnName("radius") + .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("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_fact_trajectory"); + + b.HasComment("Загрузка фактической траектории"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Faq", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Answer") + .HasColumnType("text") + .HasColumnName("answer") + .HasComment("Текст ответа"); + + b.Property("CounterQuestion") + .HasColumnType("integer") + .HasColumnName("counter_question") + .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("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("IdAuthorQuestion") + .HasColumnType("integer") + .HasColumnName("id_author_question") + .HasComment("id автора вопроса"); + + b.Property("IdReplacementQuestion") + .HasColumnType("integer") + .HasColumnName("id_replacement_question") + .HasComment("Ключ заменяющего вопроса"); + + b.Property("IsFrequently") + .HasColumnType("boolean") + .HasColumnName("is_frequently") + .HasComment("Частый вопрос"); + + b.Property("Question") + .IsRequired() + .HasColumnType("text") + .HasColumnName("question") + .HasComment("Текст вопроса"); + + b.Property("State") + .HasColumnType("integer") + .HasColumnName("state") + .HasComment("Статус вопроса"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthorAnswer"); + + b.HasIndex("IdAuthorQuestion"); + + b.ToTable("t_faq"); + + b.HasComment("вопросы пользователей"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории"); + + b.Property("ShortName") + .HasColumnType("text") + .HasColumnName("short_name") + .HasComment("Короткое название категории"); + + b.HasKey("Id"); + + b.ToTable("t_file_category"); + + 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 = "Инструкции" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Id пользователя, загрузившего файл"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("id категории файла"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Удален ли файл"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название файла"); + + b.Property("Size") + .HasColumnType("bigint") + .HasColumnName("file_size") + .HasComment("Размер файла"); + + b.Property("UploadDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_file_info"); + + b.HasComment("Файлы всех категорий"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileMark", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("IdFile") + .HasColumnType("integer") + .HasColumnName("id_file") + .HasComment("id файла"); + + b.Property("IdMarkType") + .HasColumnType("integer") + .HasColumnName("id_mark_type") + .HasComment("0 - отклонен, 1 - согласован"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("id пользователя"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Помечен ли файл как удаленный"); + + b.HasKey("Id"); + + b.HasIndex("IdFile"); + + b.HasIndex("IdUser"); + + b.ToTable("t_file_mark"); + + b.HasComment("Действия с файлами."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .HasColumnType("real") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_float"); + + b.HasComment("таблица данных ГТИ с типом значения float"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .HasColumnType("integer") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_int"); + + b.HasComment("таблица данных ГТИ с типом значения int"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_string"); + + b.HasComment("таблица данных ГТИ с типом значения string"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории файла"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название файла"); + + b.Property("Size") + .HasColumnType("bigint") + .HasColumnName("file_size") + .HasComment("Размер файла"); + + b.Property("UrlPage") + .IsRequired() + .HasColumnType("text") + .HasColumnName("url_page") + .HasComment("Url страницы"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.ToTable("t_help_page"); + + b.HasComment("Справки"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateEnd") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_end"); + + b.Property("DateStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_start"); + + b.Property("DepthEnd") + .HasColumnType("real") + .HasColumnName("depth_end"); + + b.Property("DepthStart") + .HasColumnType("real") + .HasColumnName("depth_start"); + + b.Property("IdFeedRegulator") + .HasColumnType("smallint") + .HasColumnName("id_feed_regulator"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.HasKey("Id"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_limiting_parameter"); + + b.HasComment("Ограничения по параметрам телеметрии"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.Manual", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateDownload") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_download") + .HasComment("Дата загрузки"); + + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Id автора"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории файла"); + + b.Property("IdDirectory") + .HasColumnType("integer") + .HasColumnName("id_directory") + .HasComment("Id директории"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdDirectory"); + + b.ToTable("t_manual"); + + b.HasComment("Инструкции"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdParent") + .HasColumnType("integer") + .HasColumnName("id_parent") + .HasComment("Id родительской директории"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название"); + + b.HasKey("Id"); + + b.HasIndex("IdParent"); + + b.ToTable("t_manual_directory"); + + b.HasComment("Директория для инструкций"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Measure", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Data") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("data") + .HasComment("Данные таблицы последних данных"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("id категории"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Пометка удаленным"); + + b.Property("Timestamp") + .HasColumnType("timestamp with time zone") + .HasColumnName("timestamp") + .HasComment("время добавления"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_measure"); + + b.HasComment("Таблица c данными для вкладки 'Последние данные'"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории"); + + b.Property("ShortName") + .HasColumnType("text") + .HasColumnName("short_name") + .HasComment("Короткое название категории"); + + b.HasKey("Id"); + + b.ToTable("t_measure_category"); + + b.HasComment("Категория последних данных"); + + 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"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id получателя"); + + b.Property("Message") + .IsRequired() + .HasColumnType("text") + .HasColumnName("message") + .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("SentDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("sent_date") + .HasComment("Дата отправки уведомления"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasColumnName("title") + .HasComment("Заголовок уведомления"); + + b.HasKey("Id"); + + b.HasIndex("IdNotificationCategory"); + + b.HasIndex("IdUser"); + + b.ToTable("t_notification"); + + b.HasComment("Уведомления"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name"); + + b.HasKey("Id"); + + b.ToTable("t_notification_category"); + + b.HasComment("Категории уведомлений"); + + b.HasData( + new + { + Id = 1, + Name = "Системные уведомления" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.OperationValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Конечная глубина"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Старотовая глубина"); + + b.Property("IdOperationCategory") + .HasColumnType("integer") + .HasColumnName("id_operation_category") + .HasComment("Ид категории операции"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Ид скважины"); + + b.Property("StandardValue") + .HasColumnType("double precision") + .HasColumnName("standard_value") + .HasComment("Нормативный показатель"); + + b.Property("TargetValue") + .HasColumnType("double precision") + .HasColumnName("target_value") + .HasComment("Целевой показатель"); + + b.HasKey("Id"); + + b.HasIndex("IdOperationCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_operationvalue"); + + b.HasComment("Целевые/нормативные показатели операции"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.ToTable("t_permission"); + + 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 = 529, + Description = "Разрешение на получение отчетов drill test", + Name = "DrillTestReport.get" + }, + new + { + Id = 530, + Description = "Разрешение просматривать фактические траектории", + Name = "FactTrajectory.get" + }, + new + { + Id = 531, + Description = "Разрешение редактировать фактические траектории", + Name = "FactTrajectory.edit" + }, + new + { + Id = 532, + Description = "Разрешение просматривать фактические ннб-траектории", + Name = "NnbTrajectory.get" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("ID пользователя который внес/изменил запись"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("Radius") + .HasColumnType("double precision") + .HasColumnName("radius") + .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("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_planned_trajectory"); + + b.HasComment("Загрузка плановой траектории"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарий"); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина по стволу до, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина по стволу от, м"); + + b.Property("FlowLimitMax") + .HasColumnType("double precision") + .HasColumnName("flow_limit_max") + .HasComment("Расход, допустимый максимум"); + + b.Property("FlowPlan") + .HasColumnType("double precision") + .HasColumnName("flow_plan") + .HasComment("Расход, план"); + + b.Property("IdMode") + .HasColumnType("integer") + .HasColumnName("id_mode") + .HasComment("Id режима (1- ротор, 2 слайд)"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_wellsection_type") + .HasComment("Тип секции"); + + b.Property("LastUpdate") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_update") + .HasComment("Дата последнего изменения"); + + b.Property("PressureLimitMax") + .HasColumnType("double precision") + .HasColumnName("pressure_limit_max") + .HasComment("Перепад давления, допустимый максимум"); + + b.Property("PressurePlan") + .HasColumnType("double precision") + .HasColumnName("pressure_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("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("TopDriveTorquePlan") + .HasColumnType("double precision") + .HasColumnName("top_drive_torque_plan") + .HasComment("Момент на ВСП, план"); + + b.Property("UsageSaub") + .HasColumnType("double precision") + .HasColumnName("usage_saub") + .HasComment("Плановый процент использования АКБ"); + + b.Property("UsageSpin") + .HasColumnType("double precision") + .HasColumnName("usage_spin") + .HasComment("Плановый процент использования spin master"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_process_map_well_drilling"); + + b.HasComment("РТК бурение скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellReam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарий"); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина по стволу до, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина по стволу от, м"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_wellsection_type") + .HasComment("Тип секции"); + + b.Property("LastUpdate") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_update") + .HasComment("Дата последнего изменения"); + + b.Property("Pressure") + .HasColumnType("double precision") + .HasColumnName("pressure") + .HasComment("Давление, атм"); + + b.Property("Repeats") + .HasColumnType("double precision") + .HasColumnName("repeats") + .HasComment("Количество повторений"); + + b.Property("SetpointDrag") + .HasColumnType("double precision") + .HasColumnName("setpoint_drag") + .HasComment("Уставка зятяжки, т"); + + b.Property("SetpointTight") + .HasColumnType("double precision") + .HasColumnName("setpoint_tight") + .HasComment("Уставка посадки, т"); + + b.Property("SpeedDownward") + .HasColumnType("double precision") + .HasColumnName("speed_downward") + .HasComment("Скорость спуска, м/ч"); + + b.Property("SpeedUpward") + .HasColumnType("double precision") + .HasColumnName("speed_upward") + .HasComment("Скорость подъёма, м/ч"); + + b.Property("SpinDownward") + .HasColumnType("double precision") + .HasColumnName("spin_downward") + .HasComment("Вращение при движении вниз, об/мин"); + + b.Property("SpinUpward") + .HasColumnType("double precision") + .HasColumnName("spin_upward") + .HasComment("Вращение при движении вверх, об/мин"); + + b.Property("Torque") + .HasColumnType("double precision") + .HasColumnName("torque") + .HasComment("Момент, кН*м"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_process_map_well_ream"); + + b.HasComment("РТК проработка скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b => + { + b.Property("IdCompany") + .HasColumnType("integer") + .HasColumnName("id_company"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.HasKey("IdCompany", "IdWell"); + + b.HasIndex("IdWell"); + + b.ToTable("t_relation_company_well"); + + b.HasComment("отношение скважин и компаний"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationContactWell", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.HasKey("IdWell", "IdUser"); + + b.HasIndex("IdUser"); + + b.ToTable("t_relation_contact_well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserDrillingProgramPart", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdDrillingProgramPart") + .HasColumnType("integer") + .HasColumnName("id_drilling_program_part"); + + 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.HasIndex("IdDrillingProgramPart"); + + b.ToTable("t_relation_user_drilling_program_part"); + + b.HasComment("Отношение пользователей и частей ПБ"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserRolePermission", b => + { + b.Property("IdUserRole") + .HasColumnType("integer") + .HasColumnName("id_user_role"); + + b.Property("IdPermission") + .HasColumnType("integer") + .HasColumnName("id_permission"); + + b.HasKey("IdUserRole", "IdPermission"); + + b.HasIndex("IdPermission"); + + b.ToTable("t_relation_user_role_permission"); + + 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 = 529 + }, + new + { + IdUserRole = 1, + IdPermission = 530 + }, + new + { + IdUserRole = 1, + IdPermission = 531 + }, + new + { + IdUserRole = 1, + IdPermission = 532 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserRoleUserRole", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id_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.HasIndex("IdInclude"); + + b.ToTable("t_relation_user_role_user_role"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserUserRole", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdUserRole") + .HasColumnType("integer") + .HasColumnName("id_user_role"); + + b.HasKey("IdUser", "IdUserRole"); + + b.HasIndex("IdUserRole"); + + b.ToTable("t_relation_user_user_role"); + + b.HasComment("Отношение пользователей и ролей"); + + b.HasData( + new + { + IdUser = 1, + IdUserRole = 1 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ReportProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Format") + .HasColumnType("integer") + .HasColumnName("format") + .HasComment("Формат отчета"); + + b.Property("IdFile") + .HasColumnType("integer") + .HasColumnName("id_file") + .HasComment("id файла-родителя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("Step") + .HasColumnType("integer") + .HasColumnName("step") + .HasComment("размер шага в секундах"); + + b.HasKey("Id"); + + b.HasIndex("IdFile"); + + b.HasIndex("IdWell"); + + b.ToTable("t_report_property"); + + b.HasComment("Отчеты с данными по буровым"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Schedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("IdDriller") + .HasColumnType("integer") + .HasColumnName("id_driller") + .HasComment("Идентификатор бурильщика"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .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.HasKey("Id"); + + b.HasIndex("IdDriller"); + + b.HasIndex("IdWell"); + + b.ToTable("t_schedule"); + + b.HasComment("График работы бурильщика"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.SetpointsRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("комментарий для оператора"); + + 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("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("ObsolescenceSec") + .HasColumnType("integer") + .HasColumnName("obsolescence") + .HasComment("сек. до устаревания"); + + b.Property("Setpoints") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("setpoint_set") + .HasComment("Набор уставок"); + + b.Property("UploadDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdWell"); + + b.ToTable("t_setpoints_rquest"); + + b.HasComment("Запросы на изменение уставок панели оператора"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.Subsystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("description"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); + + b.HasKey("Id"); + + b.ToTable("t_subsystem"); + + b.HasComment("Описание подсистем"); + + b.HasData( + new + { + Id = 1, + Description = "Совместная работа режимов \"Бурение в роторе\" и \"Бурение в слайде\"", + Name = "АКБ" + }, + new + { + Id = 11, + Description = "Режим работы \"Бурение в роторе\"", + Name = "АПД ротор" + }, + new + { + Id = 12, + Description = "Режим работы \"Бурение в слайде\"", + Name = "АПД слайд" + }, + new + { + Id = 2, + Description = "Алгоритм поиска оптимальных параметров бурения САУБ", + Name = "MSE" + }, + new + { + Id = 65536, + Description = "Осцилляция", + Name = "Осцилляция" + }, + new + { + Id = 65537, + Description = "Демпфер", + Name = "Демпфер" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.SubsystemOperationTime", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("DepthEnd") + .HasColumnType("real") + .HasColumnName("depth_end") + .HasComment("глубина забоя на момент выключения подсистемы"); + + b.Property("DepthStart") + .HasColumnType("real") + .HasColumnName("depth_start") + .HasComment("глубина забоя на момент включения подсистемы"); + + b.Property("IdSubsystem") + .HasColumnType("integer") + .HasColumnName("id_subsystem"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .HasComment("ИД телеметрии по которой выдается информация"); + + b.HasKey("Id"); + + b.HasIndex("IdSubsystem"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_subsystem_operation_time"); + + b.HasComment("наработки подсистем"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Info") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("info") + .HasComment("Информация с панели о скважине"); + + b.Property("RemoteUid") + .IsRequired() + .HasColumnType("text") + .HasColumnName("remote_uid") + .HasComment("Идентификатор передающего устройства. Может повторяться в списке, так как комплекты оборудования переезжают от скв. к скв."); + + b.Property("TimeZone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "RemoteUid" }, "t_telemetry_remote_uid_index"); + + b.ToTable("t_telemetry"); + + b.HasComment("таблица привязки телеметрии от комплектов к конкретной скважине."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaub", b => + { + 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("AxialLoad") + .HasColumnType("real") + .HasColumnName("axial_load") + .HasComment("Осевая нагрузка"); + + b.Property("AxialLoadLimitMax") + .HasColumnType("real") + .HasColumnName("axial_load_limit_max") + .HasComment("Осевая нагрузка. Аварийная макс."); + + b.Property("AxialLoadSp") + .HasColumnType("real") + .HasColumnName("axial_load_sp") + .HasComment("Осевая нагрузка. Задание"); + + b.Property("BitDepth") + .HasColumnType("real") + .HasColumnName("bit_depth") + .HasComment("Положение инструмента"); + + b.Property("BlockPosition") + .HasColumnType("real") + .HasColumnName("block_position") + .HasComment("Высота талевого блока"); + + b.Property("BlockPositionMax") + .HasColumnType("real") + .HasColumnName("block_position_max") + .HasComment("Талевый блок. Макс положение"); + + b.Property("BlockPositionMin") + .HasColumnType("real") + .HasColumnName("block_position_min") + .HasComment("Талевый блок. Мин положение"); + + b.Property("BlockSpeed") + .HasColumnType("real") + .HasColumnName("block_speed") + .HasComment("Скорость талевого блока"); + + b.Property("BlockSpeedSp") + .HasColumnType("real") + .HasColumnName("block_speed_sp") + .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("BlockSpeedSpSlide") + .HasColumnType("real") + .HasColumnName("block_speed_sp_slide") + .HasComment("Талевый блок. Задание скорости для режима слайда"); + + b.Property("Flow") + .HasColumnType("real") + .HasColumnName("flow") + .HasComment("Расход"); + + b.Property("FlowDeltaLimitMax") + .HasColumnType("real") + .HasColumnName("flow_delta_limit_max") + .HasComment("Расход. Аварийный макс."); + + b.Property("FlowIdle") + .HasColumnType("real") + .HasColumnName("flow_idle") + .HasComment("Расход. Холостой ход"); + + b.Property("HookWeight") + .HasColumnType("real") + .HasColumnName("hook_weight") + .HasComment("Вес на крюке"); + + b.Property("HookWeightIdle") + .HasColumnType("real") + .HasColumnName("hook_weight_idle") + .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("IdFeedRegulator") + .HasColumnType("smallint") + .HasColumnName("id_feed_regulator") + .HasComment("Текущий критерий бурения"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Пользователь САУБ"); + + b.Property("Mode") + .HasColumnType("smallint") + .HasColumnName("mode") + .HasComment("Режим САУБ"); + + b.Property("Mse") + .HasColumnType("real") + .HasColumnName("mse") + .HasComment("MSE"); + + b.Property("MseState") + .HasColumnType("smallint") + .HasColumnName("mse_state") + .HasComment("Текущее состояние работы MSE"); + + b.Property("Pressure") + .HasColumnType("real") + .HasColumnName("pressure") + .HasComment("Давление"); + + b.Property("PressureDeltaLimitMax") + .HasColumnType("real") + .HasColumnName("pressure_delta_limit_max") + .HasComment("Давление дифф. Аварийное макс."); + + b.Property("PressureIdle") + .HasColumnType("real") + .HasColumnName("pressure_idle") + .HasComment("Давление. Холостой ход"); + + b.Property("PressureSp") + .HasColumnType("real") + .HasColumnName("pressure_sp") + .HasComment("Давление. Задание"); + + b.Property("PressureSpDevelop") + .HasColumnType("real") + .HasColumnName("pressure_sp_develop") + .HasComment("Давление. Задание для проработки"); + + b.Property("PressureSpRotor") + .HasColumnType("real") + .HasColumnName("pressure_sp_rotor") + .HasComment("Давление. Задание для роторного бурения"); + + b.Property("PressureSpSlide") + .HasColumnType("real") + .HasColumnName("pressure_sp_slide") + .HasComment("Давление. Задание для режима слайда"); + + b.Property("Pump0Flow") + .HasColumnType("real") + .HasColumnName("pump0_flow") + .HasComment("Расход. Буровой насос 1"); + + b.Property("Pump1Flow") + .HasColumnType("real") + .HasColumnName("pump1_flow") + .HasComment("Расход. Буровой насос 2"); + + b.Property("Pump2Flow") + .HasColumnType("real") + .HasColumnName("pump2_flow") + .HasComment("Расход. Буровой насос 3"); + + b.Property("RotorSpeed") + .HasColumnType("real") + .HasColumnName("rotor_speed") + .HasComment("Обороты ротора"); + + b.Property("RotorTorque") + .HasColumnType("real") + .HasColumnName("rotor_torque") + .HasComment("Момент на роторе"); + + b.Property("RotorTorqueIdle") + .HasColumnType("real") + .HasColumnName("rotor_torque_idle") + .HasComment("Момент на роторе. Холостой ход"); + + b.Property("RotorTorqueLimitMax") + .HasColumnType("real") + .HasColumnName("rotor_torque_limit_max") + .HasComment("Момент на роторе. Аварийный макс."); + + b.Property("RotorTorqueSp") + .HasColumnType("real") + .HasColumnName("rotor_torque_sp") + .HasComment("Момент на роторе. Задание"); + + b.Property("WellDepth") + .HasColumnType("real") + .HasColumnName("well_depth") + .HasComment("Глубина забоя"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_data_saub"); + + b.HasComment("набор основных данных по SAUB"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaubStat", b => + { + b.Property("Count") + .HasColumnType("bigint") + .HasColumnName("count_items"); + + b.Property("DateMax") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_max"); + + b.Property("DateMin") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_min"); + + b.Property("DepthMax") + .HasColumnType("real") + .HasColumnName("depth_max"); + + b.Property("DepthMin") + .HasColumnType("real") + .HasColumnName("depth_min"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.ToView("mw_telemetry_datas_saub_stat"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSpin", b => + { + 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("Mode") + .HasColumnType("smallint") + .HasColumnName("mode") + .HasComment("Выбранный режим управления"); + + b.Property("PositionRight") + .HasColumnType("real") + .HasColumnName("position_right") + .HasComment("Крайний правый угол осцилляции"); + + b.Property("PositionZero") + .HasColumnType("real") + .HasColumnName("position_zero") + .HasComment("Нулевая позиция осцилляции"); + + b.Property("RevolsLeftLimit") + .HasColumnType("real") + .HasColumnName("revols_left_limit") + .HasComment("Ограничение числа оборотов влево"); + + b.Property("RevolsLeftTotal") + .HasColumnType("real") + .HasColumnName("revols_left_total") + .HasComment("Суммарное количество оборотов влево"); + + b.Property("RevolsRightLimit") + .HasColumnType("real") + .HasColumnName("revols_right_limit") + .HasComment("Ограничение числа оборотов вправо"); + + b.Property("RevolsRightTotal") + .HasColumnType("real") + .HasColumnName("revols_right_total") + .HasComment("Суммарное количество оборотов вправо"); + + b.Property("SpeedLeftSp") + .HasColumnType("real") + .HasColumnName("speed_left_sp") + .HasComment("Заданная скорость вращения влево"); + + b.Property("SpeedRightSp") + .HasColumnType("real") + .HasColumnName("speed_right_sp") + .HasComment("Заданная скорость вращения вправо"); + + b.Property("State") + .HasColumnType("smallint") + .HasColumnName("state") + .HasComment("Переменная этапа"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_data_spin"); + + b.HasComment("набор основных данных по SpinMaster"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryEvent", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdEvent") + .HasColumnType("integer") + .HasColumnName("id_event"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category"); + + b.Property("MessageTemplate") + .IsRequired() + .HasColumnType("text") + .HasColumnName("message_template"); + + b.HasKey("IdTelemetry", "IdEvent"); + + b.ToTable("t_telemetry_event"); + + b.HasComment("Справочник событий. События формируют сообщения. Разделено по версиям посылок от телеметрии."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Arg2") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg2"); + + b.Property("Arg3") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg3"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("IdEvent") + .HasColumnType("integer") + .HasColumnName("id_event"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdTelemetryUser") + .HasColumnType("integer") + .HasColumnName("id_telemetry_user") + .HasComment("Пользователь панели отправляющей телеметрию. не пользователь облака."); + + b.Property("WellDepth") + .HasColumnType("double precision") + .HasColumnName("well_depth"); + + b.HasKey("Id"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_telemetry_message"); + + b.HasComment("Сообщения на буровых"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryUser", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level"); + + b.Property("Name") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); + + b.Property("Patronymic") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("patronymic"); + + b.Property("Surname") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname"); + + b.HasKey("IdTelemetry", "IdUser"); + + b.ToTable("t_telemetry_user"); + + b.HasComment("Пользователи панели САУБ. Для сообщений."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryWirelineRunOut", b => + { + b.Property("IdTelemetry") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .HasComment("Идентификатор телеметрии"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("IdTelemetry")); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_time") + .HasComment("Отметка времени"); + + b.Property("Hauling") + .HasColumnType("real") + .HasColumnName("hauling") + .HasComment("Наработка талевого каната с момента перетяжки каната, т*км"); + + b.Property("HaulingWarnSp") + .HasColumnType("real") + .HasColumnName("hauling_warn_sp") + .HasComment("Наработка талевого каната до сигнализации о необходимости перетяжки, т*км"); + + b.Property("Replace") + .HasColumnType("real") + .HasColumnName("replace") + .HasComment("Наработка талевого каната с момента замены каната, т*км"); + + b.Property("ReplaceWarnSp") + .HasColumnType("real") + .HasColumnName("replace_warn_sp") + .HasComment("Наработка талевого каната до сигнализации о необходимости замены, т*км"); + + b.HasKey("IdTelemetry"); + + b.ToTable("t_telemetry_wireline_run_out"); + + b.HasComment("Наработка талевого каната"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Email") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("email") + .HasComment("должность"); + + b.Property("IdCompany") + .HasColumnType("integer") + .HasColumnName("id_company"); + + 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("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("Patronymic") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("patronymic") + .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("Surname") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname") + .HasComment("фамилия"); + + b.HasKey("Id"); + + b.HasIndex("IdCompany"); + + b.HasIndex("Login") + .IsUnique(); + + b.ToTable("t_user"); + + b.HasComment("Пользователи облака"); + + 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"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.ToTable("t_user_role"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("Key") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("key") + .HasComment("Ключ настроек пользователя"); + + b.Property("Value") + .HasColumnType("jsonb") + .HasColumnName("setting_value") + .HasComment("Значение настроек пользователя"); + + b.HasKey("IdUser", "Key"); + + b.ToTable("t_user_settings"); + + b.HasComment("настройки интерфейса пользователя"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Well", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("IdCluster") + .HasColumnType("integer") + .HasColumnName("id_cluster"); + + b.Property("IdState") + .HasColumnType("integer") + .HasColumnName("state") + .HasComment("0 - неизвестно, 1 - в работе, 2 - завершена"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdWellType") + .HasColumnType("integer") + .HasColumnName("id_well_type"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex("IdCluster"); + + b.HasIndex("IdTelemetry") + .IsUnique(); + + b.HasIndex("IdWellType"); + + b.ToTable("t_well"); + + b.HasComment("скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellComposite", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .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.HasKey("IdWell", "IdWellSrc", "IdWellSectionType"); + + b.HasIndex("IdWellSectionType"); + + b.HasIndex("IdWellSrc"); + + b.ToTable("t_well_composite"); + + b.HasComment("Композитная скважина"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellFinalDocument", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category"); + + b.HasKey("IdWell", "IdUser", "IdCategory") + .HasName("t_well_final_documents_pk"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdUser"); + + b.ToTable("t_well_final_documents"); + + b.HasComment("Дело скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CategoryInfo") + .HasColumnType("text") + .HasColumnName("category_info") + .HasComment("Доп. информация к выбраной категории"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .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("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина на начало операции, м"); + + b.Property("DurationHours") + .HasColumnType("double precision") + .HasColumnName("duration_hours") + .HasComment("Продолжительность, часы"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .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("IdUser") + .HasColumnType("integer"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_well_section_type") + .HasComment("Id тип секции скважины"); + + b.Property("LastUpdateDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("DateStart"); + + b.HasIndex("DepthEnd"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdPlan"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_well_operation"); + + b.HasComment("Данные по операциям на скважине"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("KeyValueUnits") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("key_value_units") + .HasComment("Единицы измерения ключевого показателя операции"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории операции"); + + b.HasKey("Id"); + + b.HasIndex("IdParent"); + + b.ToTable("t_well_operation_category"); + + 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 = 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 = "Ремонт" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.Property("Order") + .HasColumnType("real") + .HasColumnName("order") + .HasComment("Порядок"); + + b.HasKey("Id"); + + b.ToTable("t_well_section_type"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.HasKey("Id"); + + b.ToTable("t_well_type"); + + b.HasComment("конструкция скважины"); + + 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("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Actcod") + .HasColumnType("smallint") + .HasColumnName("ACTCOD"); + + b.Property("Date") + .HasColumnType("integer") + .HasColumnName("DATE"); + + b.Property("Recid") + .HasColumnType("smallint") + .HasColumnName("RECID"); + + b.Property("Seqid") + .HasColumnType("integer") + .HasColumnName("SEQID"); + + b.Property("Stknum") + .HasColumnType("smallint") + .HasColumnName("STKNUM"); + + b.Property("Time") + .HasColumnType("integer") + .HasColumnName("TIME"); + + b.Property("Wellid") + .HasColumnType("text") + .HasColumnName("WELLID"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_wits_base"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Blkpos") + .HasColumnType("real") + .HasColumnName("BLKPOS"); + + b.Property("Chkp") + .HasColumnType("real") + .HasColumnName("CHKP"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptbitv") + .HasColumnType("real") + .HasColumnName("DEPTBITV"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptretm") + .HasColumnType("real") + .HasColumnName("DEPTRETM"); + + b.Property("Deptvert") + .HasColumnType("real") + .HasColumnName("DEPTVERT"); + + b.Property("Gasa") + .HasColumnType("real") + .HasColumnName("GASA"); + + b.Property("Hkla") + .HasColumnType("real") + .HasColumnName("HKLA"); + + b.Property("Hklx") + .HasColumnType("real") + .HasColumnName("HKLX"); + + b.Property("Lagstks") + .HasColumnType("smallint") + .HasColumnName("LAGSTKS"); + + b.Property("Mcia") + .HasColumnType("real") + .HasColumnName("MCIA"); + + b.Property("Mcoa") + .HasColumnType("real") + .HasColumnName("MCOA"); + + b.Property("Mdia") + .HasColumnType("real") + .HasColumnName("MDIA"); + + b.Property("Mdoa") + .HasColumnType("real") + .HasColumnName("MDOA"); + + b.Property("Mfia") + .HasColumnType("real") + .HasColumnName("MFIA"); + + b.Property("Mfoa") + .HasColumnType("real") + .HasColumnName("MFOA"); + + b.Property("Mfop") + .HasColumnType("smallint") + .HasColumnName("MFOP"); + + b.Property("Mtia") + .HasColumnType("real") + .HasColumnName("MTIA"); + + b.Property("Mtoa") + .HasColumnType("real") + .HasColumnName("MTOA"); + + b.Property("Ropa") + .HasColumnType("real") + .HasColumnName("ROPA"); + + b.Property("Rpma") + .HasColumnType("smallint") + .HasColumnName("RPMA"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Spm1") + .HasColumnType("smallint") + .HasColumnName("SPM1"); + + b.Property("Spm2") + .HasColumnType("smallint") + .HasColumnName("SPM2"); + + b.Property("Spm3") + .HasColumnType("smallint") + .HasColumnName("SPM3"); + + b.Property("Sppa") + .HasColumnType("real") + .HasColumnName("SPPA"); + + b.Property("Stkc") + .HasColumnType("integer") + .HasColumnName("STKC"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.Property("Torqa") + .HasColumnType("real") + .HasColumnName("TORQA"); + + b.Property("Torqx") + .HasColumnType("real") + .HasColumnName("TORQX"); + + b.Property("Tvolact") + .HasColumnType("real") + .HasColumnName("TVOLACT"); + + b.Property("Tvolcact") + .HasColumnType("real") + .HasColumnName("TVOLCACT"); + + b.Property("Woba") + .HasColumnType("real") + .HasColumnName("WOBA"); + + b.Property("Wobx") + .HasColumnType("real") + .HasColumnName("WOBX"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_1"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("DeptmeasGdpMc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_GDP_mc"); + + b.Property("DeptmeasMcrstat") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_MCRSTAT"); + + b.Property("DeptmeasRa33Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33_mc"); + + b.Property("DeptmeasRa33f2Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33F2_mc"); + + b.Property("DeptmeasRa33f4Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33F4_mc"); + + b.Property("DeptmeasRp33Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33_mc"); + + b.Property("DeptmeasRp33f2Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33F2_mc"); + + b.Property("DeptmeasRp33f4Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33F4_mc"); + + b.Property("DeptmeasSlvlMc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_SLVL_mc"); + + b.Property("GdpMc") + .HasColumnType("real") + .HasColumnName("GDP_mc"); + + b.Property("Mcrstat") + .HasColumnType("real") + .HasColumnName("MCRSTAT"); + + b.Property("Ra33Mc") + .HasColumnType("real") + .HasColumnName("RA33_mc"); + + b.Property("Ra33f2Mc") + .HasColumnType("real") + .HasColumnName("RA33F2_mc"); + + b.Property("Ra33f4Mc") + .HasColumnType("real") + .HasColumnName("RA33F4_mc"); + + b.Property("Rp33Mc") + .HasColumnType("real") + .HasColumnName("RP33_mc"); + + b.Property("Rp33f2Mc") + .HasColumnType("real") + .HasColumnName("RP33F2_mc"); + + b.Property("Rp33f4Mc") + .HasColumnType("real") + .HasColumnName("RP33F4_mc"); + + b.Property("SlvlMc") + .HasColumnType("real") + .HasColumnName("SLVL_mc"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_50"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Btot") + .HasColumnType("real") + .HasColumnName("Btot"); + + b.Property("Bx") + .HasColumnType("real") + .HasColumnName("Bx"); + + b.Property("By") + .HasColumnType("real") + .HasColumnName("By"); + + b.Property("Bz") + .HasColumnType("real") + .HasColumnName("Bz"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Gtot") + .HasColumnType("real") + .HasColumnName("Gtot"); + + b.Property("Gx") + .HasColumnType("real") + .HasColumnName("Gx"); + + b.Property("Gy") + .HasColumnType("real") + .HasColumnName("Gy"); + + b.Property("Gz") + .HasColumnType("real") + .HasColumnName("Gz"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_60"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Att06h") + .HasColumnType("real") + .HasColumnName("ATT06H"); + + b.Property("Att06l") + .HasColumnType("real") + .HasColumnName("ATT06L"); + + b.Property("Att10h") + .HasColumnType("real") + .HasColumnName("ATT10H"); + + b.Property("Att10l") + .HasColumnType("real") + .HasColumnName("ATT10L"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Phl1f1") + .HasColumnType("real") + .HasColumnName("PHL1F1"); + + b.Property("Phl1f2") + .HasColumnType("real") + .HasColumnName("PHL1F2"); + + b.Property("Phl2f1") + .HasColumnType("real") + .HasColumnName("PHL2F1"); + + b.Property("Phl2f2") + .HasColumnType("real") + .HasColumnName("PHL2F2"); + + b.Property("Status") + .HasColumnType("real") + .HasColumnName("Status"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_61"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptsvym") + .HasColumnType("real") + .HasColumnName("DEPTSVYM"); + + b.Property("Deptsvyv") + .HasColumnType("real") + .HasColumnName("DEPTSVYV"); + + b.Property("Passnum") + .HasColumnType("smallint") + .HasColumnName("PASSNUM"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Svyazc") + .HasColumnType("real") + .HasColumnName("SVYAZC"); + + b.Property("Svyazu") + .HasColumnType("real") + .HasColumnName("SVYAZU"); + + b.Property("Svydls") + .HasColumnType("real") + .HasColumnName("SVYDLS"); + + b.Property("Svyew") + .HasColumnType("real") + .HasColumnName("SVYEW"); + + b.Property("Svygtf") + .HasColumnType("real") + .HasColumnName("SVYGTF"); + + b.Property("Svyinc") + .HasColumnType("real") + .HasColumnName("SVYINC"); + + b.Property("Svymtf") + .HasColumnType("real") + .HasColumnName("SVYMTF"); + + b.Property("Svyns") + .HasColumnType("real") + .HasColumnName("SVYNS"); + + b.Property("Svytype") + .HasColumnType("text") + .HasColumnName("SVYTYPE"); + + b.Property("Svywalk") + .HasColumnType("real") + .HasColumnName("SVYWALK"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_7"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptbitv") + .HasColumnType("real") + .HasColumnName("DEPTBITV"); + + b.Property("Deptcalm") + .HasColumnType("real") + .HasColumnName("DEPTCALM"); + + b.Property("Deptcalv") + .HasColumnType("real") + .HasColumnName("DEPTCALV"); + + b.Property("Deptfdm") + .HasColumnType("real") + .HasColumnName("DEPTFDM"); + + b.Property("Deptfdv") + .HasColumnType("real") + .HasColumnName("DEPTFDV"); + + b.Property("Deptgr1m") + .HasColumnType("real") + .HasColumnName("DEPTGR1M"); + + b.Property("Deptgr1v") + .HasColumnType("real") + .HasColumnName("DEPTGR1V"); + + b.Property("Deptgr2m") + .HasColumnType("real") + .HasColumnName("DEPTGR2M"); + + b.Property("Deptgr2v") + .HasColumnType("real") + .HasColumnName("DEPTGR2V"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptp1m") + .HasColumnType("real") + .HasColumnName("DEPTP1M"); + + b.Property("Deptp1v") + .HasColumnType("real") + .HasColumnName("DEPTP1V"); + + b.Property("Deptp2m") + .HasColumnType("real") + .HasColumnName("DEPTP2M"); + + b.Property("Deptp2v") + .HasColumnType("real") + .HasColumnName("DEPTP2V"); + + b.Property("Deptrs1m") + .HasColumnType("real") + .HasColumnName("DEPTRS1M"); + + b.Property("Deptrs1v") + .HasColumnType("real") + .HasColumnName("DEPTRS1V"); + + b.Property("Deptrs2m") + .HasColumnType("real") + .HasColumnName("DEPTRS2M"); + + b.Property("Deptrs2v") + .HasColumnType("real") + .HasColumnName("DEPTRS2V"); + + b.Property("Deptvert") + .HasColumnType("real") + .HasColumnName("DEPTVERT"); + + b.Property("Mclp") + .HasColumnType("real") + .HasColumnName("MCLP"); + + b.Property("Mfd") + .HasColumnType("real") + .HasColumnName("MFD"); + + b.Property("Mffp") + .HasColumnType("real") + .HasColumnName("MFFP"); + + b.Property("Mfpp") + .HasColumnType("real") + .HasColumnName("MFPP"); + + b.Property("Mfrann") + .HasColumnType("real") + .HasColumnName("MFRANN"); + + b.Property("Mfrpipe") + .HasColumnType("real") + .HasColumnName("MFRPIPE"); + + b.Property("Mftann") + .HasColumnType("real") + .HasColumnName("MFTANN"); + + b.Property("Mftpipe") + .HasColumnType("real") + .HasColumnName("MFTPIPE"); + + b.Property("Mg1") + .HasColumnType("real") + .HasColumnName("MG1"); + + b.Property("Mg1c") + .HasColumnType("real") + .HasColumnName("MG1C"); + + b.Property("Mg2") + .HasColumnType("real") + .HasColumnName("MG2"); + + b.Property("Mg2c") + .HasColumnType("real") + .HasColumnName("MG2C"); + + b.Property("Mpo1") + .HasColumnType("real") + .HasColumnName("MPO1"); + + b.Property("Mpo2") + .HasColumnType("real") + .HasColumnName("MPO2"); + + b.Property("Mr1") + .HasColumnType("real") + .HasColumnName("MR1"); + + b.Property("Mr1c") + .HasColumnType("real") + .HasColumnName("MR1C"); + + b.Property("Mr2") + .HasColumnType("real") + .HasColumnName("MR2"); + + b.Property("Mr2c") + .HasColumnType("real") + .HasColumnName("MR2C"); + + b.Property("Passnum") + .HasColumnType("smallint") + .HasColumnName("PASSNUM"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Spare6") + .HasColumnType("real") + .HasColumnName("SPARE6"); + + b.Property("Spare7") + .HasColumnType("real") + .HasColumnName("SPARE7"); + + b.Property("Spare8") + .HasColumnType("real") + .HasColumnName("SPARE8"); + + b.Property("Spare9") + .HasColumnType("real") + .HasColumnName("SPARE9"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + 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.Navigation("Deposit"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.HasOne("AsbCloudDb.Model.CompanyType", "CompanyType") + .WithMany("Companies") + .HasForeignKey("IdCompanyType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.Well", "Well") + .WithMany("Contacts") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CompanyType"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DailyReport.DailyReport", b => + { + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => + { + 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.Navigation("OperationCategory"); + + 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.Well", "Well") + .WithMany("DrillingProgramParts") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FileCategory"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FactTrajectory", b => + { + 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.Navigation("User"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Faq", b => + { + b.HasOne("AsbCloudDb.Model.User", "AuthorAnswer") + .WithMany() + .HasForeignKey("IdAuthorAnswer"); + + b.HasOne("AsbCloudDb.Model.User", "AuthorQuestion") + .WithMany() + .HasForeignKey("IdAuthorQuestion") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AuthorAnswer"); + + b.Navigation("AuthorQuestion"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("FileCategory"); + + 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.User", "User") + .WithMany("FileMarks") + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_user_t_file_mark_fk"); + + b.Navigation("FileInfo"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => + { + b.HasOne("AsbCloudDb.Model.FileCategory", "FileCategory") + .WithMany() + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FileCategory"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.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.Navigation("Author"); + + b.Navigation("Category"); + + 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.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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NotificationCategory"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OperationCategory"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => + { + 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.Navigation("User"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => + { + 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.WellSectionType", "WellSectionType") + .WithMany() + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Well"); + + b.Navigation("WellSectionType"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellReam", b => + { + 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.WellSectionType", "WellSectionType") + .WithMany() + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Well"); + + 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.Well", "Well") + .WithMany("RelationCompaniesWells") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_relation_company_well_t_well_id_fk"); + + b.Navigation("Company"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DrillingProgramPart"); + + 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.UserRole", "UserRole") + .WithMany("RelationUserRolePermissions") + .HasForeignKey("IdUserRole") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + 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", "IncludeRole") + .WithMany() + .HasForeignKey("IdInclude") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("IncludeRole"); + + 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.UserRole", "UserRole") + .WithMany("RelationUsersUserRoles") + .HasForeignKey("IdUserRole") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("File"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Driller"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.SubsystemOperationTime", b => + { + b.HasOne("AsbCloudDb.Model.Subsystems.Subsystem", "Subsystem") + .WithMany() + .HasForeignKey("IdSubsystem") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Subsystem"); + + b.Navigation("Telemetry"); + }); + + 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.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.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.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.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.Navigation("Telemetry"); + }); + + 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.Navigation("Company"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => + { + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.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.Navigation("Cluster"); + + b.Navigation("Telemetry"); + + 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.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.Navigation("Well"); + + b.Navigation("WellSectionType"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("User"); + + 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.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.WellSectionType", "WellSectionType") + .WithMany("WellOperations") + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OperationCategory"); + + b.Navigation("OperationPlan"); + + b.Navigation("Well"); + + b.Navigation("WellSectionType"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => + { + b.HasOne("AsbCloudDb.Model.WellOperationCategory", "Parent") + .WithMany() + .HasForeignKey("IdParent"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => + { + b.Navigation("Wells"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.Navigation("RelationCompaniesWells"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => + { + b.Navigation("Companies"); + + b.Navigation("Contacts"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => + { + b.Navigation("Clusters"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Driller", b => + { + b.Navigation("Schedule"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => + { + b.Navigation("RelatedUsers"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + b.Navigation("FileMarks"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => + { + b.Navigation("Children"); + + b.Navigation("Manuals"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => + { + b.Navigation("Measures"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => + { + b.Navigation("Notifications"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Permission", b => + { + b.Navigation("RelationUserRolePermissions"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => + { + b.Navigation("DataSaub"); + + b.Navigation("DataSpin"); + + b.Navigation("Events"); + + b.Navigation("Messages"); + + b.Navigation("Users"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.User", b => + { + b.Navigation("FileMarks"); + + b.Navigation("Files"); + + b.Navigation("RelationContactsWells"); + + b.Navigation("RelationUsersUserRoles"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserRole", b => + { + b.Navigation("RelationUserRolePermissions"); + + b.Navigation("RelationUserRoleUserRoles"); + + b.Navigation("RelationUsersUserRoles"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Well", b => + { + b.Navigation("Contacts"); + + b.Navigation("DrillingProgramParts"); + + b.Navigation("RelationCompaniesWells"); + + b.Navigation("WellCompositeSrcs"); + + b.Navigation("WellComposites"); + + b.Navigation("WellOperations"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => + { + b.Navigation("WellComposites"); + + b.Navigation("WellOperations"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellType", b => + { + b.Navigation("Wells"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs b/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs new file mode 100644 index 00000000..3c6e6bbd --- /dev/null +++ b/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs @@ -0,0 +1,35 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AsbCloudDb.Migrations +{ + public partial class Add_Permissions_For_Trajectory_Nnb : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.InsertData( + table: "t_permission", + columns: new[] { "id", "description", "name" }, + values: new object[] { 532, "Разрешение просматривать фактические ннб-траектории", "NnbTrajectory.get" }); + + migrationBuilder.InsertData( + table: "t_relation_user_role_permission", + columns: new[] { "id_permission", "id_user_role" }, + values: new object[] { 532, 1 }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "t_relation_user_role_permission", + keyColumns: new[] { "id_permission", "id_user_role" }, + keyValues: new object[] { 532, 1 }); + + migrationBuilder.DeleteData( + table: "t_permission", + keyColumn: "id", + keyValue: 532); + } + } +} diff --git a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs index a8c68cd8..69d2336b 100644 --- a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs +++ b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs @@ -19,7 +19,7 @@ namespace AsbCloudDb.Migrations #pragma warning disable 612, 618 modelBuilder .UseCollation("Russian_Russia.1251") - .HasAnnotation("ProductVersion", "6.0.22") + .HasAnnotation("ProductVersion", "6.0.7") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); @@ -136,21 +136,21 @@ namespace AsbCloudDb.Migrations { Id = 1, Caption = "Недропользователь", - IsContact = false, + IsContact = true, Order = 3 }, new { Id = 2, Caption = "Буровой подрядчик", - IsContact = false, + IsContact = true, Order = 2 }, new { Id = 3, Caption = "Сервис автоматизации бурения", - IsContact = false, + IsContact = true, Order = 0 }, new @@ -178,7 +178,7 @@ namespace AsbCloudDb.Migrations { Id = 7, Caption = "Служба супервайзинга", - IsContact = true, + IsContact = false, Order = 1 }, new @@ -189,11 +189,18 @@ namespace AsbCloudDb.Migrations Order = 7 }, new + { + Id = 11, + Caption = "Дизельный сервис", + IsContact = false, + Order = 9 + }, + new { Id = 12, Caption = "Сервис по обслуживанию верхних силовых приводов", IsContact = true, - Order = 7 + Order = 8 }); }); @@ -493,6 +500,76 @@ namespace AsbCloudDb.Migrations b.HasComment("Drill_test"); }); + modelBuilder.Entity("AsbCloudDb.Model.FactTrajectory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("ID пользователя который внес/изменил запись"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("Radius") + .HasColumnType("double precision") + .HasColumnName("radius") + .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("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_fact_trajectory"); + + b.HasComment("Загрузка фактической траектории"); + }); + modelBuilder.Entity("AsbCloudDb.Model.Faq", b => { b.Property("Id") @@ -2415,6 +2492,30 @@ namespace AsbCloudDb.Migrations Id = 528, Description = "Разрешение на удаление контакта", Name = "WellContact.delete" + }, + new + { + Id = 529, + Description = "Разрешение на получение отчетов drill test", + Name = "DrillTestReport.get" + }, + new + { + Id = 530, + Description = "Разрешение просматривать фактические траектории", + Name = "FactTrajectory.get" + }, + new + { + Id = 531, + Description = "Разрешение редактировать фактические траектории", + Name = "FactTrajectory.edit" + }, + new + { + Id = 532, + Description = "Разрешение просматривать фактические ннб-траектории", + Name = "NnbTrajectory.get" }); }); @@ -4081,6 +4182,26 @@ namespace AsbCloudDb.Migrations { IdUserRole = 1, IdPermission = 528 + }, + new + { + IdUserRole = 1, + IdPermission = 529 + }, + new + { + IdUserRole = 1, + IdPermission = 530 + }, + new + { + IdUserRole = 1, + IdPermission = 531 + }, + new + { + IdUserRole = 1, + IdPermission = 532 }); }); @@ -7967,6 +8088,25 @@ namespace AsbCloudDb.Migrations b.Navigation("Telemetry"); }); + modelBuilder.Entity("AsbCloudDb.Model.FactTrajectory", b => + { + 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.Navigation("User"); + + b.Navigation("Well"); + }); + modelBuilder.Entity("AsbCloudDb.Model.Faq", b => { b.HasOne("AsbCloudDb.Model.User", "AuthorAnswer") diff --git a/AsbCloudDb/Model/AsbCloudDbContext.cs b/AsbCloudDb/Model/AsbCloudDbContext.cs index b26c7a25..6b111c96 100644 --- a/AsbCloudDb/Model/AsbCloudDbContext.cs +++ b/AsbCloudDb/Model/AsbCloudDbContext.cs @@ -5,6 +5,7 @@ using System.Threading; using System.Threading.Tasks; using AsbCloudDb.Model.Manuals; using AsbCloudDb.Model.ProcessMaps; +using AsbCloudDb.Model.Trajectory; namespace AsbCloudDb.Model { @@ -59,6 +60,7 @@ namespace AsbCloudDb.Model public virtual DbSet LimitingParameter => Set(); public virtual DbSet TelemetryWirelineRunOut => Set(); + public virtual DbSet FactTrajectories => Set(); // GTR WITS public DbSet WitsItemFloat => Set(); diff --git a/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs b/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs index 713fc6f0..67e50993 100644 --- a/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs +++ b/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs @@ -163,6 +163,10 @@ new (){ Id = 528, Name="WellContact.delete", Description="Разрешение на удаление контакта"}, new (){ Id = 529, Name="DrillTestReport.get", Description="Разрешение на получение отчетов drill test"}, + + new (){ Id = 530, Name="FactTrajectory.get", Description="Разрешение просматривать фактические траектории"}, + new (){ Id = 531, Name="FactTrajectory.edit", Description="Разрешение редактировать фактические траектории"}, + new (){ Id = 532, Name="NnbTrajectory.get", Description="Разрешение просматривать фактические ннб-траектории"}, }; } } diff --git a/AsbCloudDb/Model/IAsbCloudDbContext.cs b/AsbCloudDb/Model/IAsbCloudDbContext.cs index 74e61356..e985dcbc 100644 --- a/AsbCloudDb/Model/IAsbCloudDbContext.cs +++ b/AsbCloudDb/Model/IAsbCloudDbContext.cs @@ -9,6 +9,7 @@ using System.Threading; using System.Threading.Tasks; using AsbCloudDb.Model.Manuals; using AsbCloudDb.Model.ProcessMaps; +using AsbCloudDb.Model.Trajectory; namespace AsbCloudDb.Model { @@ -77,6 +78,7 @@ namespace AsbCloudDb.Model DbSet ManualDirectories { get; } DbSet Contacts { get; } DbSet DrillTests { get; } + DbSet FactTrajectories { get; } DatabaseFacade Database { get; } Task RefreshMaterializedViewAsync(string mwName, CancellationToken token); diff --git a/AsbCloudDb/Model/Trajectory/FactTrajectory.cs b/AsbCloudDb/Model/Trajectory/FactTrajectory.cs new file mode 100644 index 00000000..793c9fd9 --- /dev/null +++ b/AsbCloudDb/Model/Trajectory/FactTrajectory.cs @@ -0,0 +1,10 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AsbCloudDb.Model.Trajectory +{ + [Table("t_fact_trajectory"), Comment("Загрузка фактической траектории")] + public class FactTrajectory : Trajectory + { + } +} diff --git a/AsbCloudDb/Model/Trajectory/PlannedTrajectory.cs b/AsbCloudDb/Model/Trajectory/PlannedTrajectory.cs new file mode 100644 index 00000000..6f66d977 --- /dev/null +++ b/AsbCloudDb/Model/Trajectory/PlannedTrajectory.cs @@ -0,0 +1,13 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AsbCloudDb.Model.Trajectory +{ + [Table("t_planned_trajectory"), Comment("Загрузка плановой траектории")] + public class PlannedTrajectory : Trajectory + { + + } +} diff --git a/AsbCloudDb/Model/PlannedTrajectory.cs b/AsbCloudDb/Model/Trajectory/Trajectory.cs similarity index 90% rename from AsbCloudDb/Model/PlannedTrajectory.cs rename to AsbCloudDb/Model/Trajectory/Trajectory.cs index 647c15b8..21276e07 100644 --- a/AsbCloudDb/Model/PlannedTrajectory.cs +++ b/AsbCloudDb/Model/Trajectory/Trajectory.cs @@ -3,10 +3,9 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace AsbCloudDb.Model +namespace AsbCloudDb.Model.Trajectory { - [Table("t_planned_trajectory"), Comment("Загрузка плановой траектории")] - public class PlannedTrajectory : IId, IWellRelated + public class Trajectory : IId, IWellRelated { [Column("id"), Key] public int Id { get; set; } diff --git a/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj b/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj index 2c2bd528..3ff14745 100644 --- a/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj +++ b/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj @@ -14,6 +14,8 @@ + + @@ -32,6 +34,8 @@ + + diff --git a/AsbCloudInfrastructure/DependencyInjection.cs b/AsbCloudInfrastructure/DependencyInjection.cs index 28bde671..58a99260 100644 --- a/AsbCloudInfrastructure/DependencyInjection.cs +++ b/AsbCloudInfrastructure/DependencyInjection.cs @@ -18,6 +18,7 @@ using AsbCloudDb.Model; using AsbCloudDb.Model.Manuals; using AsbCloudDb.Model.ProcessMaps; using AsbCloudDb.Model.Subsystems; +using AsbCloudDb.Model.Trajectory; using AsbCloudInfrastructure.Background; using AsbCloudInfrastructure.Repository; using AsbCloudInfrastructure.Services; @@ -188,7 +189,10 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + //services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -251,8 +255,9 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient, TrajectoryPlanRepository>(); + services.AddTransient, TrajectoryPlanRepository>(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/AsbCloudInfrastructure/Repository/TrajectoryFactRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryFactRepository.cs index 5eb7b57d..b8d5bfad 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryFactRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryFactRepository.cs @@ -1,53 +1,116 @@ -using AsbCloudApp.Data; -using AsbCloudApp.Repositories; -using AsbCloudApp.Services; -using AsbCloudDb.Model; -using Microsoft.EntityFrameworkCore; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; +//using AsbCloudApp.Data; +//using AsbCloudApp.Exceptions; +//using AsbCloudApp.Repositories; +//using AsbCloudApp.Services; +//using AsbCloudDb.Model; +//using Mapster; +//using Microsoft.EntityFrameworkCore; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Threading; +//using System.Threading.Tasks; -namespace AsbCloudInfrastructure.Repository -{ - internal class TrajectoryFactRepository : ITrajectoryFactRepository - { - private readonly IAsbCloudDbContext db; - private readonly IWellService wellService; - public TrajectoryFactRepository(IAsbCloudDbContext db, IWellService wellService) - { - this.db = db; - this.wellService = wellService; - } - - public async Task> GetAsync(int idWell, CancellationToken token) - { - var well = await wellService.GetOrDefaultAsync(idWell, - token); - - if (well is null) - return Enumerable.Empty(); +//namespace AsbCloudInfrastructure.Repository +//{ +// internal class TrajectoryFactRepository : ITrajectoryEditableRepository +// { +// private readonly IAsbCloudDbContext db; +// private readonly IWellService wellService; +// public TrajectoryFactRepository(IAsbCloudDbContext db, IWellService wellService) +// { +// this.db = db; +// this.wellService = wellService; +// } - var entities = await db.Record7 - .AsNoTracking() - .Where(x => x.IdTelemetry == well.IdTelemetry) - .Where(coord => coord.Deptsvym != null && coord.Svyinc != null && coord.Svyazc != null) - .OrderBy(e => e.Deptsvym) - .ToArrayAsync(token); +// public async Task AddAsync(TrajectoryGeoFactDto importedFactTrajectoryRow, CancellationToken token) +// { +// var offsetHours = wellService.GetTimezone(importedFactTrajectoryRow.IdWell).Hours; +// var entity = Convert(importedFactTrajectoryRow, offsetHours); +// entity.Id = 0; +// db.FactTrajectories.Add(entity); +// return await db.SaveChangesAsync(token) +// .ConfigureAwait(false); +// } - var result = entities - .Select(coord => new TrajectoryGeoFactDto - { - IdWell = idWell, - AzimuthMagnetic = coord.Svymtf, - VerticalDepth = coord.Deptsvyv, - WellboreDepth = coord.Deptsvym!.Value, - ZenithAngle = coord.Svyinc!.Value, - AzimuthGeo = coord.Svyazc!.Value - }) - .ToArray(); +// public async Task AddRangeAsync(IEnumerable trajectoryRows, CancellationToken token) +// { +// var idWell = trajectoryRows.First().IdWell; +// if (!trajectoryRows.All(r => r.IdWell == idWell)) +// throw new ArgumentInvalidException(nameof(trajectoryRows), "Все строки должны относиться к одной скважине"); - return result; - } - } -} +// var offsetHours = wellService.GetTimezone(idWell).Hours; +// var entities = trajectoryRows +// .Select(e => +// { +// var entity = Convert(e, offsetHours); +// entity.Id = 0; +// return entity; +// }); + +// db.FactTrajectories.AddRange(entities); + +// return await db.SaveChangesAsync(token) +// .ConfigureAwait(false); +// } + +// public async Task DeleteByIdWellAsync(int idWell, CancellationToken token) +// { +// var query = db.FactTrajectories +// .Where(e => e.IdWell == idWell); +// db.FactTrajectories.RemoveRange(query); + +// return await db.SaveChangesAsync(token) +// .ConfigureAwait(false); +// } + +// public async Task DeleteRangeAsync(IEnumerable ids, CancellationToken token) +// { +// var query = db.FactTrajectories +// .Where(e => ids.Contains(e.Id)); +// db.FactTrajectories.RemoveRange(query); +// return await db.SaveChangesAsync(token) +// .ConfigureAwait(false); +// } + +// public async Task> GetAsync(int idWell, CancellationToken token) +// { +// var well = wellService.GetOrDefault(idWell) +// ?? throw new ArgumentInvalidException(nameof(idWell), "idWell doesn`t exist"); + +// var offsetHours = well.Timezone.Hours; +// var query = db.FactTrajectories +// .AsNoTracking() +// .Where(x => x.IdWell == idWell); +// var entities = await query +// .OrderBy(e => e.WellboreDepth) +// .ToArrayAsync(token); +// var result = entities +// .Select(r => Convert(r, offsetHours)); +// return result; +// } + +// public async Task UpdateAsync(TrajectoryGeoFactDto row, CancellationToken token) +// { +// var offsetHours = wellService.GetTimezone(row.IdWell).Hours; +// var entity = Convert(row, offsetHours); +// db.FactTrajectories.Update(entity); +// return await db.SaveChangesAsync(token) +// .ConfigureAwait(false); +// } + +// private TrajectoryGeoFactDto Convert(FactTrajectory entity, double offsetHours) +// { +// var dto = entity.Adapt(); +// dto.UpdateDate = entity.UpdateDate.ToRemoteDateTime(offsetHours); +// return dto; +// } + +// private FactTrajectory Convert(TrajectoryGeoFactDto dto, double offsetHours) +// { +// var entity = dto.Adapt(); +// entity.UpdateDate = DateTime.Now.ToUtcDateTimeOffset(offsetHours); +// return entity; +// } +// } +//} diff --git a/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs new file mode 100644 index 00000000..57095d4e --- /dev/null +++ b/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs @@ -0,0 +1,53 @@ +using AsbCloudApp.Data; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using AsbCloudDb.Model; +using Microsoft.EntityFrameworkCore; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace AsbCloudInfrastructure.Repository +{ + internal class TrajectoryNnbRepository : ITrajectoryNnbRepository + { + private readonly IAsbCloudDbContext db; + private readonly IWellService wellService; + public TrajectoryNnbRepository(IAsbCloudDbContext db, IWellService wellService) + { + this.db = db; + this.wellService = wellService; + } + + public async Task> GetAsync(int idWell, CancellationToken token) + { + var well = await wellService.GetOrDefaultAsync(idWell, + token); + + if (well is null) + return Enumerable.Empty(); + + var entities = await db.Record7 + .AsNoTracking() + .Where(x => x.IdTelemetry == well.IdTelemetry) + .Where(coord => coord.Deptsvym != null && coord.Svyinc != null && coord.Svyazc != null) + .OrderBy(e => e.Deptsvym) + .ToArrayAsync(token); + + var result = entities + .Select(coord => new TrajectoryGeoFactDto + { + IdWell = idWell, + AzimuthMagnetic = coord.Svymtf, + VerticalDepth = coord.Deptsvyv, + WellboreDepth = coord.Deptsvym!.Value, + ZenithAngle = coord.Svyinc!.Value, + AzimuthGeo = coord.Svyazc!.Value + }) + .ToArray(); + + return result; + } + } +} diff --git a/AsbCloudInfrastructure/Repository/TrajectoryPlanRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryPlanRepository.cs index bab706b3..676fde93 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryPlanRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryPlanRepository.cs @@ -3,6 +3,7 @@ using AsbCloudApp.Exceptions; using AsbCloudApp.Repositories; using AsbCloudApp.Services; using AsbCloudDb.Model; +using AsbCloudDb.Model.Trajectory; using Mapster; using Microsoft.EntityFrameworkCore; using System; @@ -14,7 +15,9 @@ using System.Threading.Tasks; namespace AsbCloudInfrastructure.Repository { - public class TrajectoryPlanRepository : ITrajectoryPlanRepository + public class TrajectoryPlanRepository : ITrajectoryEditableRepository + where TEntity : Trajectory + where Tdto : TrajectoryGeoDto { private readonly IAsbCloudDbContext db; private readonly IWellService wellService; @@ -24,14 +27,14 @@ namespace AsbCloudInfrastructure.Repository this.wellService = wellService; } /// - public async Task AddRangeAsync(IEnumerable plannedTrajectoryRows, CancellationToken token) + public async Task AddRangeAsync(IEnumerable trajectoryRows, CancellationToken token) { - var idWell = plannedTrajectoryRows.First().IdWell; - if (!plannedTrajectoryRows.All(r => r.IdWell == idWell)) - throw new ArgumentInvalidException(nameof(plannedTrajectoryRows), "Все строки должны относиться к одной скважине"); + var idWell = trajectoryRows.First().IdWell; + if (!trajectoryRows.All(r => r.IdWell == idWell)) + throw new ArgumentInvalidException(nameof(trajectoryRows), "Все строки должны относиться к одной скважине"); var offsetHours = wellService.GetTimezone(idWell).Hours; - var entities = plannedTrajectoryRows + var entities = trajectoryRows .Select(e => { var entity = Convert(e, offsetHours); @@ -39,18 +42,18 @@ namespace AsbCloudInfrastructure.Repository return entity; }); - db.PlannedTrajectories.AddRange(entities); + db.Set().AddRange(entities); return await db.SaveChangesAsync(token) .ConfigureAwait(false); } /// - public async Task AddAsync(TrajectoryGeoPlanDto plannedTrajectoryRow, CancellationToken token) + public async Task AddAsync(Tdto trajectoryRow, CancellationToken token) { - var offsetHours = wellService.GetTimezone(plannedTrajectoryRow.IdWell).Hours; - var entity = Convert(plannedTrajectoryRow, offsetHours); + var offsetHours = wellService.GetTimezone(trajectoryRow.IdWell).Hours; + var entity = Convert(trajectoryRow, offsetHours); entity.Id = 0; - db.PlannedTrajectories.Add(entity); + db.Set().Add(entity); return await db.SaveChangesAsync(token) .ConfigureAwait(false); } @@ -58,9 +61,9 @@ namespace AsbCloudInfrastructure.Repository /// public async Task DeleteRangeAsync(IEnumerable ids, CancellationToken token) { - var query = db.PlannedTrajectories + var query = db.Set() .Where(e => ids.Contains(e.Id)); - db.PlannedTrajectories.RemoveRange(query); + db.Set().RemoveRange(query); return await db.SaveChangesAsync(token) .ConfigureAwait(false); } @@ -68,21 +71,21 @@ namespace AsbCloudInfrastructure.Repository /// public async Task DeleteByIdWellAsync(int idWell, CancellationToken token) { - var query = db.PlannedTrajectories + var query = db.Set() .Where(e => e.IdWell == idWell); - db.PlannedTrajectories.RemoveRange(query); + db.Set().RemoveRange(query); return await db.SaveChangesAsync(token) .ConfigureAwait(false); } /// - public async Task> GetAsync(int idWell, CancellationToken token) + public async Task> GetAsync(int idWell, CancellationToken token) { var well = wellService.GetOrDefault(idWell) ?? throw new ArgumentInvalidException(nameof(idWell), "idWell doesn`t exist"); var offsetHours = well.Timezone.Hours; - var query = db.PlannedTrajectories + var query = db.Set() .AsNoTracking() .Where(x => x.IdWell == idWell); var entities = await query @@ -94,25 +97,25 @@ namespace AsbCloudInfrastructure.Repository } /// - public async Task UpdateAsync(TrajectoryGeoPlanDto row, CancellationToken token) + public async Task UpdateAsync(Tdto row, CancellationToken token) { var offsetHours = wellService.GetTimezone(row.IdWell).Hours; var entity = Convert(row, offsetHours); - db.PlannedTrajectories.Update(entity); + db.Set().Update(entity); return await db.SaveChangesAsync(token) .ConfigureAwait(false); } - private TrajectoryGeoPlanDto Convert(PlannedTrajectory entity, double offsetHours) + private Tdto Convert(TEntity entity, double offsetHours) { - var dto = entity.Adapt(); + var dto = entity.Adapt(); dto.UpdateDate = entity.UpdateDate.ToRemoteDateTime(offsetHours); return dto; } - private PlannedTrajectory Convert(TrajectoryGeoPlanDto dto, double offsetHours) + private TEntity Convert(Tdto dto, double offsetHours) { - var entity = dto.Adapt(); + var entity = dto.Adapt(); entity.UpdateDate = DateTime.Now.ToUtcDateTimeOffset(offsetHours); return entity; } diff --git a/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs new file mode 100644 index 00000000..64699835 --- /dev/null +++ b/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs @@ -0,0 +1,59 @@ +using AsbCloudApp.Data; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using ClosedXML.Excel; + +namespace AsbCloudInfrastructure.Services.Trajectory +{ + + public class FactTrajectoryImportService : TrajectoryImportService + { + public override string templateFileName { get; set; } = "FactTrajectoryTemplate.xlsx"; + public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory"; + public override string sheetNamePlannedTrajectory { get; set; } = "Плановая траектория"; + public override int headerRowsCount { get; set; } = 2; + public override int ColumnWellboreDepth { get; set; } = 1; + public override int ColumnZenithAngle { get; set; } = 2; + public override int ColumnAzimuthGeo { get; set; } = 3; + public override int ColumnAzimuthMagnetic { get; set; } = 4; + public override int ColumnVerticalDepth { get; set; } = 5; + public override int ColumnRadius { get; set; } = 6; + public override int ColumnComment { get; set; } = 7; + + public FactTrajectoryImportService( + IWellService wellService, + ITrajectoryEditableRepository factTrajectoryService) + : base(factTrajectoryService, wellService) + { + + } + + protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoFactDto trajectory) + { + row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; + row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; + row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; + row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; + row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; + row.Cell(ColumnRadius).Value = trajectory.Radius; + row.Cell(ColumnComment).Value = trajectory.Comment; + } + + protected override TrajectoryGeoFactDto ParseRow(IXLRow row) + { + var trajectoryRow = new TrajectoryGeoFactDto + { + WellboreDepth = row.Cell(ColumnWellboreDepth).GetCellValue(), + ZenithAngle = row.Cell(ColumnZenithAngle).GetCellValue(), + AzimuthGeo = row.Cell(ColumnAzimuthGeo).GetCellValue(), + AzimuthMagnetic = row.Cell(ColumnAzimuthMagnetic).GetCellValue(), + VerticalDepth = row.Cell(ColumnVerticalDepth).GetCellValue(), + Radius = row.Cell(ColumnRadius).GetCellValue(), + Comment = row.Cell(ColumnComment).GetCellValue() + }; + + return trajectoryRow; + } + } +} + diff --git a/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryTemplate.xlsx b/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryTemplate.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..219043d6c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W(aEFx%djzTY&9^M4e=KiMDV zmiv_an|$u{`ga}uSAzbN`{5USpMQSS82$t9-`VI-0S`m#KLvmZU|{}_&t63y5$S#w Pw7bjiuD~e&^5OpgT_E7< literal 0 HcmV?d00001 diff --git a/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryImportService.cs new file mode 100644 index 00000000..fd87606e --- /dev/null +++ b/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryImportService.cs @@ -0,0 +1,59 @@ +using AsbCloudApp.Data; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using ClosedXML.Excel; + +namespace AsbCloudInfrastructure.Services.Trajectory +{ + + public class NnbTrajectoryImportService : TrajectoryImportService + { + public override string templateFileName { get; set; } = "NnbTrajectoryTemplate.xlsx"; + public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory"; + public override string sheetNamePlannedTrajectory { get; set; } = "Плановая траектория"; + public override int headerRowsCount { get; set; } = 2; + public override int ColumnWellboreDepth { get; set; } = 1; + public override int ColumnZenithAngle { get; set; } = 2; + public override int ColumnAzimuthGeo { get; set; } = 3; + public override int ColumnAzimuthMagnetic { get; set; } = 4; + public override int ColumnVerticalDepth { get; set; } = 5; + public override int ColumnRadius { get; set; } = 6; + public override int ColumnComment { get; set; } = 7; + + public NnbTrajectoryImportService( + IWellService wellService, + ITrajectoryNnbRepository nnbTrajectoryService) + : base(nnbTrajectoryService, wellService) + { + + } + + protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoFactDto trajectory) + { + row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; + row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; + row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; + row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; + row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; + row.Cell(ColumnRadius).Value = trajectory.Radius; + row.Cell(ColumnComment).Value = trajectory.Comment; + } + + protected override TrajectoryGeoFactDto ParseRow(IXLRow row) + { + var trajectoryRow = new TrajectoryGeoFactDto + { + WellboreDepth = row.Cell(ColumnWellboreDepth).GetCellValue(), + ZenithAngle = row.Cell(ColumnZenithAngle).GetCellValue(), + AzimuthGeo = row.Cell(ColumnAzimuthGeo).GetCellValue(), + AzimuthMagnetic = row.Cell(ColumnAzimuthMagnetic).GetCellValue(), + VerticalDepth = row.Cell(ColumnVerticalDepth).GetCellValue(), + Radius = row.Cell(ColumnRadius).GetCellValue(), + Comment = row.Cell(ColumnComment).GetCellValue() + }; + + return trajectoryRow; + } + } +} + diff --git a/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryTemplate.xlsx b/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryTemplate.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..8d01c25bb7dd02cd541c93b6977d580584b77b78 GIT binary patch literal 11279 zcmeHtggn%^2rW=WOd+xoj9z5Uo z54?Bn-(ES#GuK>e#9ZSU%5qT9Sb%2$H~;`Z4iM!I8n=T00H9$2089WJq>i|~oeR*; z#X#ND0qCs9;$dq;mIn<dtznb!s68J4BMrU zH}m^~gFRZ1a`div#ylRus>}qkE3ewxRMb_1kO1W&2kyA(sF=)PUKtxxeI@CuE~vijQb-AC1!?)CpL2tkm7EH8(+zHfdn0h z1QK_$n7@o7x+z;iS^8=Egw`V82RU)&IAs9Eq@RvW)};-m01FtzDA zlgQ}Ay!T;N%p6dq;KaCQAD8}2opa%@UC((koaNca4c}Wfa6A|kNm{%Dj#z&hNuW?t z${F~Hw1AC-000N!VZ-__J8`#nvNpE2xBeN;{$n!`;E)DJ`MTr=x4VpE|hgB%!_Wu;s^|A zFHD;wei-}Fvr#BGJ+z%b(&e-4AWzcCGkka%0c20W zCERJ-otc8?n00slEz%ZInH)(em!MCm3t8BJG^sy*g7a2hTC2vNkbBeTuH&$FxGH~pu|5YmMUNrKfy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qgo70%9#rR@$+3qQ`L1J{sd1Lf<5JFBX6 z*z%*recEeZisi9O;d}iwrHAq%kWACmXNxPz#@Fz$ymlsp_nL-9sio6dgD0}7)SLe1 z?_ac#uK9S72zc_oEqZ?FQSiLQ8}9BWWB;%42?5CrW>f#UsPR89{6E`&C~;Jl`#Zqj z%dP$+_;XtXwyNKXubvA2y#(cV!4WY3_Wv$Od5ZJ2F5wr_Be-t!NtMD=;inYyFJVW- zzl8rFoSz~*rA&VzY#{w__y0cv^(o*}2J#o+7C1)>9?w%g@+rX6tnM#>DKLu;2KbfZ zeJc7iC-O^l9RKNHeq~6WqWpbQ_6q|5NFoOZy{A*Or{Yhe<1YYNs=sdHNo@SbSosw6 l@2>tABmgi){o6hL+wm*Q!GLuT06+r&XuxVbP51NYe*m+(pnCuS literal 0 HcmV?d00001 diff --git a/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs index 771396dc..bbfbf7a1 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs @@ -1,6 +1,7 @@ using AsbCloudApp.Data; using AsbCloudApp.Repositories; using AsbCloudApp.Services; +using AsbCloudDb.Model; using ClosedXML.Excel; using System; using System.Collections.Generic; @@ -12,170 +13,47 @@ using System.Threading.Tasks; namespace AsbCloudInfrastructure.Services.Trajectory { - public class PlannedTrajectoryImportService : IPlannedTrajectoryImportService + public class PlannedTrajectoryImportService : TrajectoryImportService //IPlannedTrajectoryImportService { /* * password for PlannedTrajectoryTemplate.xlsx is Drill2022 */ private readonly IWellService wellService; - private readonly ITrajectoryPlanRepository plannedTrajectoryService; + private readonly ITrajectoryEditableRepository plannedTrajectoryService; - private const string templateFileName = "PlannedTrajectoryTemplate.xlsx"; - private const string usingTemplateFile = "AsbCloudInfrastructure.Services.Trajectory"; - private const string sheetNamePlannedTrajectory = "Плановая траектория"; - private const int headerRowsCount = 2; - private const int ColumnWellboreDepth = 1; - private const int ColumnZenithAngle = 2; - private const int ColumnAzimuthGeo = 3; - private const int ColumnAzimuthMagnetic = 4; - private const int ColumnVerticalDepth = 5; - private const int ColumnRadius = 6; - private const int ColumnComment = 7; + //private const string templateFileName = "PlannedTrajectoryTemplate.xlsx"; + //private const string usingTemplateFile = "AsbCloudInfrastructure.Services.Trajectory"; + //private const string sheetNamePlannedTrajectory = "Плановая траектория"; + //private const int headerRowsCount = 2; + //private const int ColumnWellboreDepth = 1; + //private const int ColumnZenithAngle = 2; + //private const int ColumnAzimuthGeo = 3; + //private const int ColumnAzimuthMagnetic = 4; + //private const int ColumnVerticalDepth = 5; + //private const int ColumnRadius = 6; + //private const int ColumnComment = 7; + public override string templateFileName { get; set; } = "PlannedTrajectoryTemplate.xlsx"; + public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory"; + public override string sheetNamePlannedTrajectory { get; set; } = "Плановая траектория"; + public override int headerRowsCount { get; set; } = 2; + public override int ColumnWellboreDepth { get; set; } = 1; + public override int ColumnZenithAngle { get; set; } = 2; + public override int ColumnAzimuthGeo { get; set; } = 3; + public override int ColumnAzimuthMagnetic { get; set; } = 4; + public override int ColumnVerticalDepth { get; set; } = 5; + public override int ColumnRadius { get; set; } = 6; + public override int ColumnComment { get; set; } = 7; - public PlannedTrajectoryImportService(IWellService wellService, ITrajectoryPlanRepository plannedTrajectoryService) + public PlannedTrajectoryImportService( + IWellService wellService, + ITrajectoryEditableRepository plannedTrajectoryService) + : base(plannedTrajectoryService, wellService) { - this.wellService = wellService; - this.plannedTrajectoryService = plannedTrajectoryService; - } + } - public Stream GetTemplateFile() - { - var stream = System.Reflection.Assembly.GetExecutingAssembly() - .GetManifestResourceStream($"{usingTemplateFile}.{templateFileName}"); - if (stream is null) - throw new Exception($"Область {usingTemplateFile} не содержит файла с названием {templateFileName}"); - return stream; - } - - public async Task GetFileNameAsync(int idWell, CancellationToken token) - { - var fileName = await wellService.GetWellCaptionByIdAsync(idWell, token) + "_plannedTrajectory.xlsx"; - return fileName; - } - - public async Task ExportAsync(int idWell, CancellationToken token) - { - var plannedTrajectorys = await plannedTrajectoryService.GetAsync(idWell, token); - return MakeExelFileStream(plannedTrajectorys); - } - - private Stream MakeExelFileStream(IEnumerable plannedTrajectories) - { - using Stream ecxelTemplateStream = GetTemplateFile(); - using var workbook = new XLWorkbook(ecxelTemplateStream, XLEventTracking.Disabled); - AddPlannedTrajecoryToWorkbook(workbook, plannedTrajectories); - MemoryStream memoryStream = new MemoryStream(); - workbook.SaveAs(memoryStream, new SaveOptions { }); - memoryStream.Seek(0, SeekOrigin.Begin); - return memoryStream; - } - - private static void AddPlannedTrajecoryToWorkbook(XLWorkbook workbook, IEnumerable plannedTrajectories) - { - if (plannedTrajectories.Any()) - { - var sheet = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetNamePlannedTrajectory); - if (sheet is null) - throw new FileFormatException($"Лист с именем {sheetNamePlannedTrajectory} отсутствует, либо имеет некорректное название"); - AddPlannedTrajecoryToSheet(sheet, plannedTrajectories); - } - } - - private static void AddPlannedTrajecoryToSheet(IXLWorksheet sheet, IEnumerable plannedTrajectories) - { - var rowList = plannedTrajectories.ToList(); - for (int i = 0; i < rowList.Count; i++) - { - var row = sheet.Row(1 + i + headerRowsCount); - AddCoordinatesToRow(row, rowList[i]); - } - } - private static void AddCoordinatesToRow(IXLRow row, TrajectoryGeoPlanDto trajectory) - { - row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; - row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; - row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; - row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; - row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; - row.Cell(ColumnRadius).Value = trajectory.Radius; - row.Cell(ColumnComment).Value = trajectory.Comment; - } - - public async Task ImportAsync(int idWell, int idUser, Stream stream, bool deletePrevRows, CancellationToken token) - { - using var workbook = new XLWorkbook(stream, XLEventTracking.Disabled); - var trajectoryRows = ParseFileStream(stream); - foreach (var row in trajectoryRows) - { - row.IdWell = idWell; - row.IdUser = idUser; - } - - var rowsCount = await SavePlannedTrajectoryAsync(idWell, trajectoryRows, deletePrevRows, token); - return rowsCount; - } - - private async Task SavePlannedTrajectoryAsync(int idWell, IEnumerable newRows, bool deletePrevRow, CancellationToken token) - { - if (deletePrevRow) - await plannedTrajectoryService.DeleteByIdWellAsync(idWell, token); - var rowsCount = await plannedTrajectoryService.AddRangeAsync(newRows, token); - return rowsCount; - } - - private IEnumerable ParseFileStream(Stream stream) - { - using var workbook = new XLWorkbook(stream, XLEventTracking.Disabled); - return ParseWorkbook(workbook); - } - - private IEnumerable ParseWorkbook(IXLWorkbook workbook) - { - var sheetPlannedTrajectory = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetNamePlannedTrajectory); - if (sheetPlannedTrajectory is null) - throw new FileFormatException($"Книга excel не содержит листа {sheetNamePlannedTrajectory}."); - var plannedTrajectoryRows = ParseSheet(sheetPlannedTrajectory); - return plannedTrajectoryRows; - } - - private IEnumerable ParseSheet(IXLWorksheet sheet) - { - if (sheet.RangeUsed().RangeAddress.LastAddress.ColumnNumber < 7) - throw new FileFormatException($"Лист {sheet.Name} содержит меньшее количество столбцов."); - - var count = sheet.RowsUsed().Count() - headerRowsCount; - - if (count > 1024) - throw new FileFormatException($"Лист {sheet.Name} содержит слишком большое количество строк."); - - if (count <= 0) - throw new FileFormatException($"Лист {sheet.Name} некорректного формата либо пустой"); - - var trajectoryRows = new List(count); - var parseErrors = new List(); - for (int i = 0; i < count; i++) - { - var row = sheet.Row(1 + i + headerRowsCount); - try - { - var trajectoryRow = ParseRow(row); - trajectoryRows.Add(trajectoryRow); - } - catch (FileFormatException ex) - { - parseErrors.Add(ex.Message); - } - } - - if (parseErrors.Any()) - throw new FileFormatException(string.Join("\r\n", parseErrors)); - - return trajectoryRows; - } - - private TrajectoryGeoPlanDto ParseRow(IXLRow row) + protected override TrajectoryGeoPlanDto ParseRow(IXLRow row) { var trajectoryRow = new TrajectoryGeoPlanDto { @@ -190,6 +68,17 @@ namespace AsbCloudInfrastructure.Services.Trajectory return trajectoryRow; } + + protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoPlanDto trajectory) + { + row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; + row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; + row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; + row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; + row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; + row.Cell(ColumnRadius).Value = trajectory.Radius; + row.Cell(ColumnComment).Value = trajectory.Comment; + } } } diff --git a/AsbCloudInfrastructure/Services/Trajectory/TrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/TrajectoryImportService.cs new file mode 100644 index 00000000..6f719f85 --- /dev/null +++ b/AsbCloudInfrastructure/Services/Trajectory/TrajectoryImportService.cs @@ -0,0 +1,159 @@ +using AsbCloudApp.Data; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using AsbCloudDb.Model; +using AsbCloudInfrastructure.Services.SAUB; +using ClosedXML.Excel; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace AsbCloudInfrastructure.Services.Trajectory +{ + public abstract class TrajectoryImportService where T: TrajectoryGeoDto + { + protected readonly IWellService wellService; + + protected readonly ITrajectoryRepository trajectoryService; + public abstract string templateFileName { get; set; } + public abstract string usingTemplateFile { get; set; } + public abstract string sheetNamePlannedTrajectory { get; set; } + public abstract int headerRowsCount { get; set; } + public abstract int ColumnWellboreDepth { get; set; } + public abstract int ColumnZenithAngle { get; set; } + public abstract int ColumnAzimuthGeo { get; set; } + public abstract int ColumnAzimuthMagnetic { get; set; } + public abstract int ColumnVerticalDepth { get; set; } + public abstract int ColumnRadius { get; set; } + public abstract int ColumnComment { get; set; } + protected abstract void AddCoordinatesToRow(IXLRow row, T trajectory); + protected abstract T ParseRow(IXLRow row); + + public TrajectoryImportService(ITrajectoryRepository trajectoryService, IWellService wellService) + { + this.trajectoryService = trajectoryService; + this.wellService = wellService; + } + + public Stream GetTemplateFile() + { + var stream = System.Reflection.Assembly.GetExecutingAssembly() + .GetManifestResourceStream($"{usingTemplateFile}.{templateFileName}"); + if (stream is null) + throw new Exception($"Область {usingTemplateFile} не содержит файла с названием {templateFileName}"); + return stream; + } + + public async Task ExportAsync(int idWell, CancellationToken token) + { + var plannedTrajectorys = await trajectoryService.GetAsync(idWell, token); + return MakeExelFileStream(plannedTrajectorys); + } + + private Stream MakeExelFileStream(IEnumerable plannedTrajectories) + { + using Stream ecxelTemplateStream = GetTemplateFile(); + using var workbook = new XLWorkbook(ecxelTemplateStream, XLEventTracking.Disabled); + AddPlannedTrajecoryToWorkbook(workbook, plannedTrajectories); + MemoryStream memoryStream = new MemoryStream(); + workbook.SaveAs(memoryStream, new SaveOptions { }); + memoryStream.Seek(0, SeekOrigin.Begin); + return memoryStream; + } + + private void AddPlannedTrajecoryToWorkbook(XLWorkbook workbook, IEnumerable plannedTrajectories) + { + if (plannedTrajectories.Any()) + { + var sheet = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetNamePlannedTrajectory); + if (sheet is null) + throw new FileFormatException($"Лист с именем {sheetNamePlannedTrajectory} отсутствует, либо имеет некорректное название"); + AddPlannedTrajecoryToSheet(sheet, plannedTrajectories); + } + } + + private void AddPlannedTrajecoryToSheet(IXLWorksheet sheet, IEnumerable plannedTrajectories) + { + var rowList = plannedTrajectories.ToList(); + for (int i = 0; i < rowList.Count; i++) + { + var row = sheet.Row(1 + i + headerRowsCount); + AddCoordinatesToRow(row, rowList[i]); + } + } + + public async Task GetFileNameAsync(int idWell, CancellationToken token) + { + var caption = await wellService.GetWellCaptionByIdAsync(idWell, token); + return string.Format("{0}_{1}", caption, templateFileName); + } + + public async Task> ImportAsync(int idWell, int idUser, Stream stream, CancellationToken token) + { + using var workbook = new XLWorkbook(stream, XLEventTracking.Disabled); + var trajectoryRows = ParseFileStream(stream); + foreach (var row in trajectoryRows) + { + row.IdWell = idWell; + row.IdUser = idUser; + } + + return trajectoryRows; + } + + + private IEnumerable ParseFileStream(Stream stream) + { + using var workbook = new XLWorkbook(stream, XLEventTracking.Disabled); + return ParseWorkbook(workbook); + } + + private IEnumerable ParseWorkbook(IXLWorkbook workbook) + { + var sheetTrajectory = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetNamePlannedTrajectory); + if (sheetTrajectory is null) + throw new FileFormatException($"Книга excel не содержит листа {sheetNamePlannedTrajectory}."); + var trajectoryRows = ParseSheet(sheetTrajectory); + return trajectoryRows; + } + + private IEnumerable ParseSheet(IXLWorksheet sheet) + { + if (sheet.RangeUsed().RangeAddress.LastAddress.ColumnNumber < 7) + throw new FileFormatException($"Лист {sheet.Name} содержит меньшее количество столбцов."); + + var count = sheet.RowsUsed().Count() - headerRowsCount; + + if (count > 1024) + throw new FileFormatException($"Лист {sheet.Name} содержит слишком большое количество строк."); + + if (count <= 0) + throw new FileFormatException($"Лист {sheet.Name} некорректного формата либо пустой"); + + var trajectoryRows = new List(count); + var parseErrors = new List(); + for (int i = 0; i < count; i++) + { + var row = sheet.Row(1 + i + headerRowsCount); + try + { + var trajectoryRow = ParseRow(row); + trajectoryRows.Add(trajectoryRow); + } + catch (FileFormatException ex) + { + parseErrors.Add(ex.Message); + } + } + + if (parseErrors.Any()) + throw new FileFormatException(string.Join("\r\n", parseErrors)); + + return trajectoryRows; + } + } +} diff --git a/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs b/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs index e3adac11..3e31523b 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs @@ -91,7 +91,7 @@ abstract class TrajectoryBaseService class TrajectoryPlanService: TrajectoryBaseService { - public TrajectoryPlanService(ITrajectoryPlanRepository repository) + public TrajectoryPlanService(ITrajectoryEditableRepository repository) :base(repository) {} @@ -109,7 +109,14 @@ class TrajectoryPlanService: TrajectoryBaseService { - public TrajectoryFactService(ITrajectoryFactRepository repository) + public TrajectoryFactService(ITrajectoryEditableRepository repository) + : base(repository) + { } +} + +class TrajectoryNnbService : TrajectoryBaseService +{ + public TrajectoryNnbService(ITrajectoryNnbRepository repository) : base(repository) { } } @@ -119,11 +126,16 @@ public class TrajectoryService { private TrajectoryPlanService trajectoryPlanService; private TrajectoryFactService trajectoryFactService; + private TrajectoryNnbService trajectoryNnbService; - public TrajectoryService(ITrajectoryPlanRepository plannedRepository, ITrajectoryFactRepository factRepository) + public TrajectoryService( + ITrajectoryEditableRepository plannedRepository, + ITrajectoryEditableRepository factRepository, + ITrajectoryNnbRepository nnbRepository) { trajectoryPlanService = new TrajectoryPlanService(plannedRepository); trajectoryFactService = new TrajectoryFactService(factRepository); + trajectoryNnbService = new TrajectoryNnbService(nnbRepository); } /// @@ -132,12 +144,13 @@ public class TrajectoryService /// ключ скважины /// /// - public async Task, IEnumerable>> GetTrajectoryCartesianAsync(int idWell, CancellationToken token) + public async Task, IEnumerable, IEnumerable>> GetTrajectoryCartesianAsync(int idWell, CancellationToken token) { - var result = new PlanFactBase, IEnumerable>(); + var result = new PlanFactBase, IEnumerable, IEnumerable>(); result.Plan = await trajectoryPlanService.GetAsync(idWell, token); result.Fact = await trajectoryFactService.GetAsync(idWell, token); + result.Nnb = await trajectoryNnbService.GetAsync(idWell, token); return result; } diff --git a/AsbCloudWebApi.Tests/Services/TrajectoryVisualizationServiceTest.cs b/AsbCloudWebApi.Tests/Services/TrajectoryVisualizationServiceTest.cs index e3740ebd..c256e4ab 100644 --- a/AsbCloudWebApi.Tests/Services/TrajectoryVisualizationServiceTest.cs +++ b/AsbCloudWebApi.Tests/Services/TrajectoryVisualizationServiceTest.cs @@ -44,9 +44,10 @@ namespace AsbCloudWebApi.Tests.ServicesTests new TrajectoryGeoFactDto() { WellboreDepth = 0, ZenithAngle = 0, AzimuthGeo = 20 }, }; - var mockPlan = MakeTrajectoryRepositoryMock(plannedTrajectory); - var mockFact = MakeTrajectoryRepositoryMock(actualTrajectory); - var service = new TrajectoryService(mockPlan.Object, mockFact.Object); + var mockPlan = MakeTrajectoryRepositoryMock, TrajectoryGeoPlanDto>(plannedTrajectory); + var mockFact = MakeTrajectoryRepositoryMock, TrajectoryGeoFactDto>(actualTrajectory); + var mockNnb = MakeTrajectoryRepositoryMock(actualTrajectory); + var service = new TrajectoryService(mockPlan.Object, mockFact.Object, mockNnb.Object); var result = await service.GetTrajectoryCartesianAsync(1, CancellationToken.None); Assert.Equal(plannedTrajectory.Length, result.Plan?.Count()); Assert.Equal(actualTrajectory.Length, result.Fact?.Count()); @@ -75,9 +76,10 @@ namespace AsbCloudWebApi.Tests.ServicesTests new TrajectoryGeoFactDto() { WellboreDepth = 50, ZenithAngle = 0, AzimuthGeo = 0 }, }; - var mockPlan = MakeTrajectoryRepositoryMock(plannedTrajectory); - var mockFact = MakeTrajectoryRepositoryMock(actualTrajectory); - var service = new TrajectoryService(mockPlan.Object, mockFact.Object); + var mockPlan = MakeTrajectoryRepositoryMock, TrajectoryGeoPlanDto>(plannedTrajectory); + var mockFact = MakeTrajectoryRepositoryMock, TrajectoryGeoFactDto>(actualTrajectory); + var mockNnb = MakeTrajectoryRepositoryMock(actualTrajectory); + var service = new TrajectoryService(mockPlan.Object, mockFact.Object, mockNnb.Object); var result = await service.GetTrajectoryCartesianAsync(1, CancellationToken.None); var lastPointPlan = result.Plan!.Last(); var lastPointFact = result.Fact!.Last(); @@ -108,9 +110,10 @@ namespace AsbCloudWebApi.Tests.ServicesTests new TrajectoryGeoFactDto() { WellboreDepth = 20, ZenithAngle = 0, AzimuthGeo = 0 }, }; - var mockPlanned = MakeTrajectoryRepositoryMock(plannedTrajectory); - var mockFactual = MakeTrajectoryRepositoryMock(actualTrajectory); - var service = new TrajectoryService(mockPlanned.Object, mockFactual.Object); + var mockPlanned = MakeTrajectoryRepositoryMock, TrajectoryGeoPlanDto>(plannedTrajectory); + var mockFactual = MakeTrajectoryRepositoryMock, TrajectoryGeoFactDto>(actualTrajectory); + var mockNnb = MakeTrajectoryRepositoryMock(actualTrajectory); + var service = new TrajectoryService(mockPlanned.Object, mockFactual.Object, mockNnb.Object); var result = await service.GetTrajectoryCartesianAsync(1, CancellationToken.None); var lastPointPlan = result.Plan!.Last(); var lastPointFact = result.Fact!.Last(); diff --git a/AsbCloudWebApi/Controllers/FactTrajectoryController.cs b/AsbCloudWebApi/Controllers/FactTrajectoryController.cs deleted file mode 100644 index fbdb6703..00000000 --- a/AsbCloudWebApi/Controllers/FactTrajectoryController.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using AsbCloudApp.Data; -using AsbCloudApp.Repositories; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace AsbCloudWebApi.Controllers; - -/// -/// Фактическая траектория -/// -[Authorize] -[ApiController] -[Route("api/well/{idWell}/[controller]")] -public class FactTrajectoryController : ControllerBase -{ - private readonly ITrajectoryFactRepository trajectoryFactRepository; - - public FactTrajectoryController(ITrajectoryFactRepository trajectoryFactRepository) - { - this.trajectoryFactRepository = trajectoryFactRepository; - } - - /// - /// Метод получения всех строк траекторий по id скважины - /// - /// Id скважины - /// Токен отмены операции - /// - [HttpGet] - [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetRowsAsync([FromRoute] int idWell, - CancellationToken cancellationToken) - { - var factTrajectories = await trajectoryFactRepository.GetAsync(idWell, - cancellationToken); - - return Ok(factTrajectories); - } -} \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs new file mode 100644 index 00000000..e06dcad0 --- /dev/null +++ b/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs @@ -0,0 +1,209 @@ +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using AsbCloudApp.Data; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using AsbCloudInfrastructure.Services; +using AsbCloudInfrastructure.Services.Trajectory; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace AsbCloudWebApi.Controllers.Trajectory; + +/// +/// Фактическая траектория +/// +[Authorize] +[ApiController] +[Route("api/well/{idWell}/[controller]")] +public class FactTrajectoryController : ControllerBase +{ + private readonly ITrajectoryEditableRepository trajectoryFactRepository; + private readonly IWellService wellService; + private readonly FactTrajectoryImportService factTrajectoryImportService; + + public FactTrajectoryController( + ITrajectoryEditableRepository trajectoryFactRepository, + IWellService wellService, + FactTrajectoryImportService factTrajectoryImportService) + { + this.trajectoryFactRepository = trajectoryFactRepository; + this.wellService = wellService; + this.factTrajectoryImportService = factTrajectoryImportService; + } + + /// + /// Метод получения всех строк фактических траекторий по id скважины + /// + /// Id скважины + /// Токен отмены операции + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] + public async Task GetRowsAsync([FromRoute] int idWell, + CancellationToken cancellationToken) + { + var importedFactTrajectories = await trajectoryFactRepository.GetAsync(idWell, + cancellationToken); + + return Ok(importedFactTrajectories); + } + + /// + /// Добавить одну новую строчку координат для фактической траектории + /// + /// + /// + /// + /// количество успешно записанных строк в БД + [HttpPost] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + public async Task AddAsync(int idWell, [FromBody] TrajectoryGeoFactDto row, + CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) + return Forbid(); + var idUser = User.GetUserId(); + if (!idUser.HasValue) + return Forbid(); + row.IdUser = idUser.Value; + row.IdWell = idWell; + var result = await trajectoryFactRepository.AddAsync(row, token); + return Ok(result); + } + + /// + /// Изменить выбранную строку с координатами + /// + /// + /// + /// + /// + /// количество успешно обновленных строк в БД + [HttpPut("{idRow}")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + public async Task UpdateAsync(int idWell, int idRow, + [FromBody] TrajectoryGeoFactDto row, CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) + return Forbid(); + int? idUser = User.GetUserId(); + if (!idUser.HasValue) + return Forbid(); + row.Id = idRow; + row.IdUser = idUser.Value; + row.IdWell = idWell; + var result = await trajectoryFactRepository.UpdateAsync(row, token); + return Ok(result); + } + + /// + /// Удалить выбранную строку с координатами + /// + /// + /// + /// + /// количество успешно удаленных строк из БД + [HttpDelete("{idRow}")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + public async Task DeleteAsync(int idWell, int idRow, CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, + token).ConfigureAwait(false)) + return Forbid(); + + var result = await trajectoryFactRepository.DeleteRangeAsync(new int[] { idRow }, token); + + return Ok(result); + } + + /// + /// Формируем excel файл с текущими строками фактической траектории + /// + /// id скважины + /// Токен отмены задачи + /// Запрашиваемый файл + [HttpGet("export")] + [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + public async Task ExportAsync([FromRoute] int idWell, CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, + token).ConfigureAwait(false)) + return Forbid(); + var stream = await factTrajectoryImportService.ExportAsync(idWell, token); + var fileName = await factTrajectoryImportService.GetFileNameAsync(idWell, token); + return File(stream, "application/octet-stream", fileName); + } + + /// + /// Возвращает excel шаблон для заполнения строк фактической траектории + /// + /// Запрашиваемый файл + [HttpGet("template")] + [AllowAnonymous] + [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + public IActionResult GetTemplate() + { + var stream = factTrajectoryImportService.GetTemplateFile(); + var fileName = "ЕЦП_шаблон_файла_фактическая_импортируемая_траектория.xlsx"; + return File(stream, "application/octet-stream", fileName); + } + + /// + /// Импортирует координаты из excel (xlsx) файла + /// + /// id скважины + /// Коллекция из одного файла xlsx + /// Удалить операции перед импортом, если фал валидный + /// Токен отмены задачи + /// количество успешно записанных строк в БД + [HttpPost("import/{deleteBeforeImport}")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), (int)System.Net.HttpStatusCode.BadRequest)] + public async Task ImportAsync(int idWell, + [FromForm] IFormFileCollection files, + bool deleteBeforeImport, + CancellationToken token) + { + int? idUser = User.GetUserId(); + if (!idUser.HasValue) + return Forbid(); + if (!await CanUserAccessToWellAsync(idWell, + token).ConfigureAwait(false)) + return Forbid(); + if (files.Count < 1) + return this.ValidationBadRequest(nameof(files), "нет файла"); + var file = files[0]; + if (Path.GetExtension(file.FileName).ToLower() != ".xlsx") + return this.ValidationBadRequest(nameof(files), "Требуется xlsx файл."); + using Stream stream = file.OpenReadStream(); + + try + { + var trajectoryRows = await factTrajectoryImportService.ImportAsync(idWell, idUser.Value, stream, token); + + if (deleteBeforeImport) + await trajectoryFactRepository.DeleteByIdWellAsync(idWell, token); + + var rowsCount = await trajectoryFactRepository.AddRangeAsync(trajectoryRows, token); + + return Ok(rowsCount); + } + catch (FileFormatException ex) + { + return this.ValidationBadRequest(nameof(files), ex.Message); + } + } + + private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) + { + int? idCompany = User.GetCompanyId(); + return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, + idWell, token).ConfigureAwait(false); + } +} \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/Trajectory/NnbTrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/NnbTrajectoryController.cs new file mode 100644 index 00000000..72dea0ef --- /dev/null +++ b/AsbCloudWebApi/Controllers/Trajectory/NnbTrajectoryController.cs @@ -0,0 +1,80 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using AsbCloudApp.Data; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using AsbCloudInfrastructure.Services; +using AsbCloudInfrastructure.Services.Trajectory; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace AsbCloudWebApi.Controllers.Trajectory; + +/// +/// Фактическая траектория из ННБ +/// +[Authorize] +[ApiController] +[Route("api/well/{idWell}/[controller]")] +public class NnbTrajectoryController : ControllerBase +{ + private readonly ITrajectoryNnbRepository trajectoryNnbRepository; + private readonly NnbTrajectoryImportService factNnbTrajectoryImportService; + private readonly IWellService wellService; + + public NnbTrajectoryController( + ITrajectoryNnbRepository trajectoryNnbRepository, + NnbTrajectoryImportService factNnbTrajectoryImportService, + IWellService wellService) + { + this.trajectoryNnbRepository = trajectoryNnbRepository; + this.factNnbTrajectoryImportService = factNnbTrajectoryImportService; + this.wellService = wellService; + this.wellService = wellService; + } + + /// + /// Метод получения всех строк фактических траекторий по id скважины из ННБ + /// + /// Id скважины + /// Токен отмены операции + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] + public async Task GetRowsAsync([FromRoute] int idWell, + CancellationToken cancellationToken) + { + var nnbFactTrajectories = await trajectoryNnbRepository.GetAsync(idWell, + cancellationToken); + + return Ok(nnbFactTrajectories); + } + + /// + /// Формируем excel файл с текущими строками фактической ннб-траектории + /// + /// id скважины + /// Токен отмены задачи + /// Запрашиваемый файл + [HttpGet("export")] + [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + public async Task ExportAsync([FromRoute] int idWell, CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, + token).ConfigureAwait(false)) + return Forbid(); + var stream = await factNnbTrajectoryImportService.ExportAsync(idWell, token); + var fileName = await factNnbTrajectoryImportService.GetFileNameAsync(idWell, token); + return File(stream, "application/octet-stream", fileName); + } + + private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) + { + int? idCompany = User.GetCompanyId(); + return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, + idWell, token).ConfigureAwait(false); + } +} \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/PlannedTrajectoryController.cs similarity index 92% rename from AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs rename to AsbCloudWebApi/Controllers/Trajectory/PlannedTrajectoryController.cs index 389f301c..40759b1c 100644 --- a/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/PlannedTrajectoryController.cs @@ -10,7 +10,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace AsbCloudWebApi.Controllers +namespace AsbCloudWebApi.Controllers.Trajectory { /// @@ -22,13 +22,13 @@ namespace AsbCloudWebApi.Controllers public class PlannedTrajectoryController : ControllerBase { private readonly IWellService wellService; - private readonly IPlannedTrajectoryImportService plannedTrajectoryImportService; - private readonly ITrajectoryPlanRepository plannedTrajectoryRepository; + private readonly PlannedTrajectoryImportService plannedTrajectoryImportService; + private readonly ITrajectoryEditableRepository plannedTrajectoryRepository; private readonly TrajectoryService trajectoryVisualizationService; - public PlannedTrajectoryController(IWellService wellService, - IPlannedTrajectoryImportService plannedTrajectoryImportService, - ITrajectoryPlanRepository plannedTrajectoryRepository, + public PlannedTrajectoryController(IWellService wellService, + PlannedTrajectoryImportService plannedTrajectoryImportService, + ITrajectoryEditableRepository plannedTrajectoryRepository, TrajectoryService trajectoryVisualizationService) { this.plannedTrajectoryImportService = plannedTrajectoryImportService; @@ -43,7 +43,7 @@ namespace AsbCloudWebApi.Controllers /// Запрашиваемый файл [HttpGet("template")] [AllowAnonymous] - [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK,"application/octet-stream")] + [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] [ProducesResponseType(StatusCodes.Status204NoContent)] public IActionResult GetTemplate() { @@ -102,8 +102,14 @@ namespace AsbCloudWebApi.Controllers try { - var result = await plannedTrajectoryImportService.ImportAsync(idWell, idUser.Value, stream, deleteBeforeImport, token); - return Ok(result); + var trajectoryRows = await plannedTrajectoryImportService.ImportAsync(idWell, idUser.Value, stream, token); + + if (deleteBeforeImport) + await plannedTrajectoryRepository.DeleteByIdWellAsync(idWell, token); + + var rowsCount = await plannedTrajectoryRepository.AddRangeAsync(trajectoryRows, token); + + return Ok(rowsCount); } catch (FileFormatException ex) { @@ -229,7 +235,7 @@ namespace AsbCloudWebApi.Controllers /// /// [HttpGet("trajectoryCartesianPlanFact")] - [ProducesResponseType(typeof(PlanFactBase, IEnumerable>), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(PlanFactBase, IEnumerable, IEnumerable>), (int)System.Net.HttpStatusCode.OK)] public async Task GetTrajectoryCartesianPlanFactAsync(int idWell, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, @@ -245,7 +251,7 @@ namespace AsbCloudWebApi.Controllers int? idCompany = User.GetCompanyId(); return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, idWell, token).ConfigureAwait(false); - } + } } } From 0817dbc689e1c672afdabbb5f0e47652f6a0e30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Wed, 22 Nov 2023 10:01:07 +0500 Subject: [PATCH 03/19] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=20ITrajectoryEditableRepository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repositories/ITrajectoryEditableRepository.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs b/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs index d30bf14c..1cdd2742 100644 --- a/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs +++ b/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs @@ -15,18 +15,18 @@ namespace AsbCloudApp.Repositories /// /// Добавить строки с координатами по одной скважине. Если в коллекции координаты для разных скважин получаем exception. /// - /// + /// /// /// количество записанных строк или exception с описанием - Task AddRangeAsync(IEnumerable plannedTrajectoryRows, CancellationToken token); + Task AddRangeAsync(IEnumerable trajectoryRows, CancellationToken token); /// /// Добавить одну строку с координатами /// - /// + /// /// /// - Task AddAsync(T plannedTrajectoryRow, CancellationToken token); + Task AddAsync(T trajectoryRow, CancellationToken token); /// /// Обновить строку с координатами @@ -46,7 +46,7 @@ namespace AsbCloudApp.Repositories Task DeleteRangeAsync(IEnumerable ids, CancellationToken token); /// - /// Удалить всю плановую траекторию по ИД скважины + /// Удалить всю траекторию по ИД скважины /// /// /// From 81bd89aafce65633d233aa4c29dc8352fb1d94b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Wed, 22 Nov 2023 10:31:41 +0500 Subject: [PATCH 04/19] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ITrajectoryEditableRepository.cs | 2 +- .../Repositories/ITrajectoryNnbRepository.cs | 6 +- .../Repositories/ITrajectoryRepository.cs | 5 +- AsbCloudInfrastructure/DependencyInjection.cs | 4 +- ...ory.cs => TrajectoryEditableRepository.cs} | 10 +- .../Repository/TrajectoryFactRepository.cs | 116 ------------------ .../Trajectory/FactTrajectoryController.cs | 16 +-- 7 files changed, 20 insertions(+), 139 deletions(-) rename AsbCloudInfrastructure/Repository/{TrajectoryPlanRepository.cs => TrajectoryEditableRepository.cs} (90%) delete mode 100644 AsbCloudInfrastructure/Repository/TrajectoryFactRepository.cs diff --git a/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs b/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs index 1cdd2742..58738f83 100644 --- a/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs +++ b/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace AsbCloudApp.Repositories { /// - /// CRUD для работы с плановой траекторией из клиента + /// CRUD-репозиторий для работы с траекторией из клиента (плановой и фактической) /// /// //TrajectoryGeoPlanDto diff --git a/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs b/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs index b74229ee..65a3efcc 100644 --- a/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs +++ b/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs @@ -1,13 +1,9 @@ using AsbCloudApp.Data; -using AsbCloudApp.Data.WITS; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; namespace AsbCloudApp.Repositories { /// - /// CRUD для работы с фактической траекторией из клиента + /// репозиторий для работы с траекторией из ннб (фактической) /// /// public interface ITrajectoryNnbRepository : ITrajectoryRepository diff --git a/AsbCloudApp/Repositories/ITrajectoryRepository.cs b/AsbCloudApp/Repositories/ITrajectoryRepository.cs index ab4e5d59..4202bd0a 100644 --- a/AsbCloudApp/Repositories/ITrajectoryRepository.cs +++ b/AsbCloudApp/Repositories/ITrajectoryRepository.cs @@ -1,8 +1,5 @@ using AsbCloudApp.Data; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; @@ -15,7 +12,7 @@ namespace AsbCloudApp.Repositories where T : TrajectoryGeoDto { /// - /// Получить все добавленные по скважине координаты плановой траектории + /// Получить все добавленные по скважине координаты траектории /// /// /// diff --git a/AsbCloudInfrastructure/DependencyInjection.cs b/AsbCloudInfrastructure/DependencyInjection.cs index 58a99260..d993f260 100644 --- a/AsbCloudInfrastructure/DependencyInjection.cs +++ b/AsbCloudInfrastructure/DependencyInjection.cs @@ -255,8 +255,8 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient, TrajectoryPlanRepository>(); - services.AddTransient, TrajectoryPlanRepository>(); + services.AddTransient, TrajectoryEditableRepository>(); + services.AddTransient, TrajectoryEditableRepository>(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/AsbCloudInfrastructure/Repository/TrajectoryPlanRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs similarity index 90% rename from AsbCloudInfrastructure/Repository/TrajectoryPlanRepository.cs rename to AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs index 676fde93..a48312ba 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryPlanRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs @@ -14,14 +14,18 @@ using System.Threading.Tasks; namespace AsbCloudInfrastructure.Repository { - - public class TrajectoryPlanRepository : ITrajectoryEditableRepository + /// + /// CRUD-репозиторий для работы с траекториями (плановыми и фактическими) + /// + /// + /// + public class TrajectoryEditableRepository : ITrajectoryEditableRepository where TEntity : Trajectory where Tdto : TrajectoryGeoDto { private readonly IAsbCloudDbContext db; private readonly IWellService wellService; - public TrajectoryPlanRepository(IAsbCloudDbContext db, IWellService wellService) + public TrajectoryEditableRepository(IAsbCloudDbContext db, IWellService wellService) { this.db = db; this.wellService = wellService; diff --git a/AsbCloudInfrastructure/Repository/TrajectoryFactRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryFactRepository.cs deleted file mode 100644 index b8d5bfad..00000000 --- a/AsbCloudInfrastructure/Repository/TrajectoryFactRepository.cs +++ /dev/null @@ -1,116 +0,0 @@ -//using AsbCloudApp.Data; -//using AsbCloudApp.Exceptions; -//using AsbCloudApp.Repositories; -//using AsbCloudApp.Services; -//using AsbCloudDb.Model; -//using Mapster; -//using Microsoft.EntityFrameworkCore; -//using System; -//using System.Collections.Generic; -//using System.Linq; -//using System.Threading; -//using System.Threading.Tasks; - -//namespace AsbCloudInfrastructure.Repository -//{ -// internal class TrajectoryFactRepository : ITrajectoryEditableRepository -// { -// private readonly IAsbCloudDbContext db; -// private readonly IWellService wellService; -// public TrajectoryFactRepository(IAsbCloudDbContext db, IWellService wellService) -// { -// this.db = db; -// this.wellService = wellService; -// } - -// public async Task AddAsync(TrajectoryGeoFactDto importedFactTrajectoryRow, CancellationToken token) -// { -// var offsetHours = wellService.GetTimezone(importedFactTrajectoryRow.IdWell).Hours; -// var entity = Convert(importedFactTrajectoryRow, offsetHours); -// entity.Id = 0; -// db.FactTrajectories.Add(entity); -// return await db.SaveChangesAsync(token) -// .ConfigureAwait(false); -// } - -// public async Task AddRangeAsync(IEnumerable trajectoryRows, CancellationToken token) -// { -// var idWell = trajectoryRows.First().IdWell; -// 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); -// entity.Id = 0; -// return entity; -// }); - -// db.FactTrajectories.AddRange(entities); - -// return await db.SaveChangesAsync(token) -// .ConfigureAwait(false); -// } - -// public async Task DeleteByIdWellAsync(int idWell, CancellationToken token) -// { -// var query = db.FactTrajectories -// .Where(e => e.IdWell == idWell); -// db.FactTrajectories.RemoveRange(query); - -// return await db.SaveChangesAsync(token) -// .ConfigureAwait(false); -// } - -// public async Task DeleteRangeAsync(IEnumerable ids, CancellationToken token) -// { -// var query = db.FactTrajectories -// .Where(e => ids.Contains(e.Id)); -// db.FactTrajectories.RemoveRange(query); -// return await db.SaveChangesAsync(token) -// .ConfigureAwait(false); -// } - -// public async Task> GetAsync(int idWell, CancellationToken token) -// { -// var well = wellService.GetOrDefault(idWell) -// ?? throw new ArgumentInvalidException(nameof(idWell), "idWell doesn`t exist"); - -// var offsetHours = well.Timezone.Hours; -// var query = db.FactTrajectories -// .AsNoTracking() -// .Where(x => x.IdWell == idWell); -// var entities = await query -// .OrderBy(e => e.WellboreDepth) -// .ToArrayAsync(token); -// var result = entities -// .Select(r => Convert(r, offsetHours)); -// return result; -// } - -// public async Task UpdateAsync(TrajectoryGeoFactDto row, CancellationToken token) -// { -// var offsetHours = wellService.GetTimezone(row.IdWell).Hours; -// var entity = Convert(row, offsetHours); -// db.FactTrajectories.Update(entity); -// return await db.SaveChangesAsync(token) -// .ConfigureAwait(false); -// } - -// private TrajectoryGeoFactDto Convert(FactTrajectory entity, double offsetHours) -// { -// var dto = entity.Adapt(); -// dto.UpdateDate = entity.UpdateDate.ToRemoteDateTime(offsetHours); -// return dto; -// } - -// private FactTrajectory Convert(TrajectoryGeoFactDto dto, double offsetHours) -// { -// var entity = dto.Adapt(); -// entity.UpdateDate = DateTime.Now.ToUtcDateTimeOffset(offsetHours); -// return entity; -// } -// } -//} diff --git a/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs index e06dcad0..73716012 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs @@ -21,7 +21,7 @@ namespace AsbCloudWebApi.Controllers.Trajectory; [Route("api/well/{idWell}/[controller]")] public class FactTrajectoryController : ControllerBase { - private readonly ITrajectoryEditableRepository trajectoryFactRepository; + private readonly ITrajectoryEditableRepository factTrajectoryRepository; private readonly IWellService wellService; private readonly FactTrajectoryImportService factTrajectoryImportService; @@ -30,7 +30,7 @@ public class FactTrajectoryController : ControllerBase IWellService wellService, FactTrajectoryImportService factTrajectoryImportService) { - this.trajectoryFactRepository = trajectoryFactRepository; + this.factTrajectoryRepository = trajectoryFactRepository; this.wellService = wellService; this.factTrajectoryImportService = factTrajectoryImportService; } @@ -46,7 +46,7 @@ public class FactTrajectoryController : ControllerBase public async Task GetRowsAsync([FromRoute] int idWell, CancellationToken cancellationToken) { - var importedFactTrajectories = await trajectoryFactRepository.GetAsync(idWell, + var importedFactTrajectories = await factTrajectoryRepository.GetAsync(idWell, cancellationToken); return Ok(importedFactTrajectories); @@ -71,7 +71,7 @@ public class FactTrajectoryController : ControllerBase return Forbid(); row.IdUser = idUser.Value; row.IdWell = idWell; - var result = await trajectoryFactRepository.AddAsync(row, token); + var result = await factTrajectoryRepository.AddAsync(row, token); return Ok(result); } @@ -96,7 +96,7 @@ public class FactTrajectoryController : ControllerBase row.Id = idRow; row.IdUser = idUser.Value; row.IdWell = idWell; - var result = await trajectoryFactRepository.UpdateAsync(row, token); + var result = await factTrajectoryRepository.UpdateAsync(row, token); return Ok(result); } @@ -115,7 +115,7 @@ public class FactTrajectoryController : ControllerBase token).ConfigureAwait(false)) return Forbid(); - var result = await trajectoryFactRepository.DeleteRangeAsync(new int[] { idRow }, token); + var result = await factTrajectoryRepository.DeleteRangeAsync(new int[] { idRow }, token); return Ok(result); } @@ -188,9 +188,9 @@ public class FactTrajectoryController : ControllerBase var trajectoryRows = await factTrajectoryImportService.ImportAsync(idWell, idUser.Value, stream, token); if (deleteBeforeImport) - await trajectoryFactRepository.DeleteByIdWellAsync(idWell, token); + await factTrajectoryRepository.DeleteByIdWellAsync(idWell, token); - var rowsCount = await trajectoryFactRepository.AddRangeAsync(trajectoryRows, token); + var rowsCount = await factTrajectoryRepository.AddRangeAsync(trajectoryRows, token); return Ok(rowsCount); } From 454945e2dc789c93d20c7b52803f8a109a58fd37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Wed, 22 Nov 2023 13:14:37 +0500 Subject: [PATCH 05/19] =?UTF-8?q?=D0=9A=D0=BE=D0=BD=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=BB=D0=BB=D0=B5=D1=80=D1=8B=20=D0=BF=D0=BE=20=D1=84=D0=BE?= =?UTF-8?q?=D1=80=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8E=20?= =?UTF-8?q?=D0=BF=D0=BB=D0=B0=D0=BD=D0=BE=D0=B2=D1=8B=D1=85=20=D0=B8=20?= =?UTF-8?q?=D1=84=D0=B0=D0=BA=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B8?= =?UTF-8?q?=D1=85=20=D1=82=D1=80=D0=B0=D0=B5=D0=BA=D1=82=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D0=B9=20=D0=BD=D0=B0=D1=81=D0=BB=D0=B5=D0=B4=D1=83=D1=8E=D1=82?= =?UTF-8?q?=D1=81=D1=8F=20=D0=BE=D1=82=20=D0=BE=D0=B4=D0=BD=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20TrajectoryController?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/TrajectoryGeoDto.cs | 4 + AsbCloudApp/Data/TrajectoryGeoFactDto.cs | 5 - AsbCloudApp/Data/TrajectoryGeoPlanDto.cs | 5 - .../Trajectory/FactTrajectoryImportService.cs | 2 +- .../Trajectory/FactTrajectoryController.cs | 201 +-------------- .../Trajectory/PlannedTrajectoryController.cs | 217 +--------------- .../Trajectory/TrajectoryController.cs | 237 ++++++++++++++++++ 7 files changed, 258 insertions(+), 413 deletions(-) create mode 100644 AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs diff --git a/AsbCloudApp/Data/TrajectoryGeoDto.cs b/AsbCloudApp/Data/TrajectoryGeoDto.cs index 1574666c..3f36aad6 100644 --- a/AsbCloudApp/Data/TrajectoryGeoDto.cs +++ b/AsbCloudApp/Data/TrajectoryGeoDto.cs @@ -11,6 +11,10 @@ namespace AsbCloudApp.Data /// public abstract class TrajectoryGeoDto { + /// + /// ИД строки с координатами + /// + public int Id { get; set; } /// /// Id скважины /// diff --git a/AsbCloudApp/Data/TrajectoryGeoFactDto.cs b/AsbCloudApp/Data/TrajectoryGeoFactDto.cs index 0245ec7c..a78811e4 100644 --- a/AsbCloudApp/Data/TrajectoryGeoFactDto.cs +++ b/AsbCloudApp/Data/TrajectoryGeoFactDto.cs @@ -7,11 +7,6 @@ namespace AsbCloudApp.Data; /// public class TrajectoryGeoFactDto : TrajectoryGeoDto { - /// - /// ИД строки с координатами - /// - public int Id { get; set; } - /// /// Радиус цели /// diff --git a/AsbCloudApp/Data/TrajectoryGeoPlanDto.cs b/AsbCloudApp/Data/TrajectoryGeoPlanDto.cs index 969b204a..ba9ffb86 100644 --- a/AsbCloudApp/Data/TrajectoryGeoPlanDto.cs +++ b/AsbCloudApp/Data/TrajectoryGeoPlanDto.cs @@ -6,11 +6,6 @@ namespace AsbCloudApp.Data /// public class TrajectoryGeoPlanDto: TrajectoryGeoDto { - /// - /// ИД строки с координатами - /// - public int Id { get; set; } - /// /// Радиус цели /// diff --git a/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs index 64699835..95b39bfc 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs @@ -10,7 +10,7 @@ namespace AsbCloudInfrastructure.Services.Trajectory { public override string templateFileName { get; set; } = "FactTrajectoryTemplate.xlsx"; public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory"; - public override string sheetNamePlannedTrajectory { get; set; } = "Плановая траектория"; + public override string sheetNamePlannedTrajectory { get; set; } = "Фактическая траектория"; public override int headerRowsCount { get; set; } = 2; public override int ColumnWellboreDepth { get; set; } = 1; public override int ColumnZenithAngle { get; set; } = 2; diff --git a/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs index 73716012..6504da73 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs @@ -1,14 +1,7 @@ -using System.Collections.Generic; -using System.IO; -using System.Threading; -using System.Threading.Tasks; using AsbCloudApp.Data; using AsbCloudApp.Repositories; using AsbCloudApp.Services; -using AsbCloudInfrastructure.Services; using AsbCloudInfrastructure.Services.Trajectory; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace AsbCloudWebApi.Controllers.Trajectory; @@ -16,194 +9,18 @@ namespace AsbCloudWebApi.Controllers.Trajectory; /// /// Фактическая траектория /// -[Authorize] [ApiController] [Route("api/well/{idWell}/[controller]")] -public class FactTrajectoryController : ControllerBase +public class FactTrajectoryController : TrajectoryController { - private readonly ITrajectoryEditableRepository factTrajectoryRepository; - private readonly IWellService wellService; - private readonly FactTrajectoryImportService factTrajectoryImportService; - - public FactTrajectoryController( - ITrajectoryEditableRepository trajectoryFactRepository, - IWellService wellService, - FactTrajectoryImportService factTrajectoryImportService) + public FactTrajectoryController(IWellService wellService, + FactTrajectoryImportService factTrajectoryImportService, + ITrajectoryEditableRepository trajectoryFactRepository) + : base( + wellService, + factTrajectoryImportService, + trajectoryFactRepository) { - this.factTrajectoryRepository = trajectoryFactRepository; - this.wellService = wellService; - this.factTrajectoryImportService = factTrajectoryImportService; - } - - /// - /// Метод получения всех строк фактических траекторий по id скважины - /// - /// Id скважины - /// Токен отмены операции - /// - [HttpGet] - [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetRowsAsync([FromRoute] int idWell, - CancellationToken cancellationToken) - { - var importedFactTrajectories = await factTrajectoryRepository.GetAsync(idWell, - cancellationToken); - - return Ok(importedFactTrajectories); - } - - /// - /// Добавить одну новую строчку координат для фактической траектории - /// - /// - /// - /// - /// количество успешно записанных строк в БД - [HttpPost] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task AddAsync(int idWell, [FromBody] TrajectoryGeoFactDto row, - CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) - return Forbid(); - var idUser = User.GetUserId(); - if (!idUser.HasValue) - return Forbid(); - row.IdUser = idUser.Value; - row.IdWell = idWell; - var result = await factTrajectoryRepository.AddAsync(row, token); - return Ok(result); - } - - /// - /// Изменить выбранную строку с координатами - /// - /// - /// - /// - /// - /// количество успешно обновленных строк в БД - [HttpPut("{idRow}")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task UpdateAsync(int idWell, int idRow, - [FromBody] TrajectoryGeoFactDto row, CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) - return Forbid(); - int? idUser = User.GetUserId(); - if (!idUser.HasValue) - return Forbid(); - row.Id = idRow; - row.IdUser = idUser.Value; - row.IdWell = idWell; - var result = await factTrajectoryRepository.UpdateAsync(row, token); - return Ok(result); - } - - /// - /// Удалить выбранную строку с координатами - /// - /// - /// - /// - /// количество успешно удаленных строк из БД - [HttpDelete("{idRow}")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task DeleteAsync(int idWell, int idRow, CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, - token).ConfigureAwait(false)) - return Forbid(); - - var result = await factTrajectoryRepository.DeleteRangeAsync(new int[] { idRow }, token); - - return Ok(result); - } - - /// - /// Формируем excel файл с текущими строками фактической траектории - /// - /// id скважины - /// Токен отмены задачи - /// Запрашиваемый файл - [HttpGet("export")] - [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public async Task ExportAsync([FromRoute] int idWell, CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, - token).ConfigureAwait(false)) - return Forbid(); - var stream = await factTrajectoryImportService.ExportAsync(idWell, token); - var fileName = await factTrajectoryImportService.GetFileNameAsync(idWell, token); - return File(stream, "application/octet-stream", fileName); - } - - /// - /// Возвращает excel шаблон для заполнения строк фактической траектории - /// - /// Запрашиваемый файл - [HttpGet("template")] - [AllowAnonymous] - [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public IActionResult GetTemplate() - { - var stream = factTrajectoryImportService.GetTemplateFile(); - var fileName = "ЕЦП_шаблон_файла_фактическая_импортируемая_траектория.xlsx"; - return File(stream, "application/octet-stream", fileName); - } - - /// - /// Импортирует координаты из excel (xlsx) файла - /// - /// id скважины - /// Коллекция из одного файла xlsx - /// Удалить операции перед импортом, если фал валидный - /// Токен отмены задачи - /// количество успешно записанных строк в БД - [HttpPost("import/{deleteBeforeImport}")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), (int)System.Net.HttpStatusCode.BadRequest)] - public async Task ImportAsync(int idWell, - [FromForm] IFormFileCollection files, - bool deleteBeforeImport, - CancellationToken token) - { - int? idUser = User.GetUserId(); - if (!idUser.HasValue) - return Forbid(); - if (!await CanUserAccessToWellAsync(idWell, - token).ConfigureAwait(false)) - return Forbid(); - if (files.Count < 1) - return this.ValidationBadRequest(nameof(files), "нет файла"); - var file = files[0]; - if (Path.GetExtension(file.FileName).ToLower() != ".xlsx") - return this.ValidationBadRequest(nameof(files), "Требуется xlsx файл."); - using Stream stream = file.OpenReadStream(); - - try - { - var trajectoryRows = await factTrajectoryImportService.ImportAsync(idWell, idUser.Value, stream, token); - - if (deleteBeforeImport) - await factTrajectoryRepository.DeleteByIdWellAsync(idWell, token); - - var rowsCount = await factTrajectoryRepository.AddRangeAsync(trajectoryRows, token); - - return Ok(rowsCount); - } - catch (FileFormatException ex) - { - return this.ValidationBadRequest(nameof(files), ex.Message); - } - } - - private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) - { - int? idCompany = User.GetCompanyId(); - return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, - idWell, token).ConfigureAwait(false); + fileName = "ЕЦП_шаблон_файла_фактическая_траектория.xlsx"; } } \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/Trajectory/PlannedTrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/PlannedTrajectoryController.cs index 40759b1c..01b87365 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/PlannedTrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/PlannedTrajectoryController.cs @@ -2,11 +2,8 @@ using AsbCloudApp.Repositories; using AsbCloudApp.Services; using AsbCloudInfrastructure.Services.Trajectory; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; -using System.IO; using System.Threading; using System.Threading.Tasks; @@ -18,216 +15,23 @@ namespace AsbCloudWebApi.Controllers.Trajectory /// [Route("api/well/{idWell}/plannedTrajectory")] [ApiController] - [Authorize] - public class PlannedTrajectoryController : ControllerBase + public class PlannedTrajectoryController : TrajectoryController { - private readonly IWellService wellService; - private readonly PlannedTrajectoryImportService plannedTrajectoryImportService; - private readonly ITrajectoryEditableRepository plannedTrajectoryRepository; private readonly TrajectoryService trajectoryVisualizationService; public PlannedTrajectoryController(IWellService wellService, PlannedTrajectoryImportService plannedTrajectoryImportService, ITrajectoryEditableRepository plannedTrajectoryRepository, TrajectoryService trajectoryVisualizationService) + : base( + wellService, + plannedTrajectoryImportService, + plannedTrajectoryRepository) { - this.plannedTrajectoryImportService = plannedTrajectoryImportService; - this.wellService = wellService; - this.plannedTrajectoryRepository = plannedTrajectoryRepository; + fileName = "ЕЦП_шаблон_файла_плановая_траектория.xlsx"; this.trajectoryVisualizationService = trajectoryVisualizationService; } - /// - /// Возвращает excel шаблон для заполнения строк плановой траектории - /// - /// Запрашиваемый файл - [HttpGet("template")] - [AllowAnonymous] - [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public IActionResult GetTemplate() - { - var stream = plannedTrajectoryImportService.GetTemplateFile(); - var fileName = "ЕЦП_шаблон_файла_плановая_траектория.xlsx"; - return File(stream, "application/octet-stream", fileName); - } - - /// - /// Формируем excel файл с текущими строками плановой траектории - /// - /// id скважины - /// Токен отмены задачи - /// Запрашиваемый файл - [HttpGet("export")] - [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public async Task ExportAsync([FromRoute] int idWell, CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, - token).ConfigureAwait(false)) - return Forbid(); - var stream = await plannedTrajectoryImportService.ExportAsync(idWell, token); - var fileName = await plannedTrajectoryImportService.GetFileNameAsync(idWell, token); - return File(stream, "application/octet-stream", fileName); - } - - /// - /// Импортирует координаты из excel (xlsx) файла - /// - /// id скважины - /// Коллекция из одного файла xlsx - /// Удалить операции перед импортом, если фал валидный - /// Токен отмены задачи - /// количество успешно записанных строк в БД - [HttpPost("import/{deleteBeforeImport}")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), (int)System.Net.HttpStatusCode.BadRequest)] - public async Task ImportAsync(int idWell, - [FromForm] IFormFileCollection files, - bool deleteBeforeImport, - CancellationToken token) - { - int? idUser = User.GetUserId(); - if (!idUser.HasValue) - return Forbid(); - if (!await CanUserAccessToWellAsync(idWell, - token).ConfigureAwait(false)) - return Forbid(); - if (files.Count < 1) - return this.ValidationBadRequest(nameof(files), "нет файла"); - var file = files[0]; - if (Path.GetExtension(file.FileName).ToLower() != ".xlsx") - return this.ValidationBadRequest(nameof(files), "Требуется xlsx файл."); - using Stream stream = file.OpenReadStream(); - - try - { - var trajectoryRows = await plannedTrajectoryImportService.ImportAsync(idWell, idUser.Value, stream, token); - - if (deleteBeforeImport) - await plannedTrajectoryRepository.DeleteByIdWellAsync(idWell, token); - - var rowsCount = await plannedTrajectoryRepository.AddRangeAsync(trajectoryRows, token); - - return Ok(rowsCount); - } - catch (FileFormatException ex) - { - return this.ValidationBadRequest(nameof(files), ex.Message); - } - } - - /// - /// Получаем список всех строк координат плановой траектории (для клиента) - /// - /// id скважины - /// Токен отмены задачи - /// Список добавленных координат плановой траектории - [HttpGet] - [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetAsync([FromRoute] int idWell, CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, - token).ConfigureAwait(false)) - return Forbid(); - var result = await plannedTrajectoryRepository.GetAsync(idWell, token); - return Ok(result); - } - - /// - /// Добавить одну новую строчку координат для плановой траектории - /// - /// - /// - /// - /// количество успешно записанных строк в БД - [HttpPost] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task AddAsync(int idWell, [FromBody] TrajectoryGeoPlanDto row, - CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) - return Forbid(); - var idUser = User.GetUserId(); - if (!idUser.HasValue) - return Forbid(); - row.IdUser = idUser.Value; - row.IdWell = idWell; - var result = await plannedTrajectoryRepository.AddAsync(row, token); - return Ok(result); - } - - /// - /// Добавить массив строчек координат для плановой траектории - /// - /// - /// - /// - /// количество успешно записанных строк в БД - [HttpPost("range")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task AddRangeAsync(int idWell, [FromBody] IEnumerable rows, - CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) - return Forbid(); - int? idUser = User.GetUserId(); - if (!idUser.HasValue) - return Forbid(); - foreach (var item in rows) - { - item.IdUser = idUser.Value; - item.IdWell = idWell; - } - var result = await plannedTrajectoryRepository.AddRangeAsync(rows, token); - return Ok(result); - } - - /// - /// Изменить выбранную строку с координатами - /// - /// - /// - /// - /// - /// количество успешно обновленных строк в БД - [HttpPut("{idRow}")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task UpdateAsync(int idWell, int idRow, - [FromBody] TrajectoryGeoPlanDto row, CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) - return Forbid(); - int? idUser = User.GetUserId(); - if (!idUser.HasValue) - return Forbid(); - row.Id = idRow; - row.IdUser = idUser.Value; - row.IdWell = idWell; - var result = await plannedTrajectoryRepository.UpdateAsync(row, token); - return Ok(result); - } - - /// - /// Удалить выбранную строку с координатами - /// - /// - /// - /// - /// количество успешно удаленных строк из БД - [HttpDelete("{idRow}")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task DeleteAsync(int idWell, int idRow, CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, - token).ConfigureAwait(false)) - return Forbid(); - - var result = await plannedTrajectoryRepository.DeleteRangeAsync(new int[] { idRow }, token); - - return Ok(result); - } - /// /// Получение координат для визуализации траектории (плановой и фактической) /// @@ -238,20 +42,13 @@ namespace AsbCloudWebApi.Controllers.Trajectory [ProducesResponseType(typeof(PlanFactBase, IEnumerable, IEnumerable>), (int)System.Net.HttpStatusCode.OK)] public async Task GetTrajectoryCartesianPlanFactAsync(int idWell, CancellationToken token) { - if (!await CanUserAccessToWellAsync(idWell, + if (!await base.CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); var result = await trajectoryVisualizationService.GetTrajectoryCartesianAsync(idWell, token); return Ok(result); } - - private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) - { - int? idCompany = User.GetCompanyId(); - return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, - idWell, token).ConfigureAwait(false); - } } } diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs new file mode 100644 index 00000000..8bd2cca6 --- /dev/null +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs @@ -0,0 +1,237 @@ +using AsbCloudApp.Data; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using AsbCloudInfrastructure.Services.Trajectory; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace AsbCloudWebApi.Controllers.Trajectory +{ + + /// + /// Плановые и фактические траектории (загрузка и хранение) + /// + [ApiController] + [Authorize] + public abstract class TrajectoryController : ControllerBase + where Tdto : TrajectoryGeoDto + { + protected string fileName; + + private readonly IWellService wellService; + private readonly TrajectoryImportService trajectoryImportService; + private readonly ITrajectoryEditableRepository trajectoryRepository; + + public TrajectoryController(IWellService wellService, + TrajectoryImportService trajectoryImportService, + ITrajectoryEditableRepository trajectoryRepository) + { + this.trajectoryImportService = trajectoryImportService; + this.wellService = wellService; + this.trajectoryRepository = trajectoryRepository; + } + + /// + /// Возвращает excel шаблон для заполнения строк траектории + /// + /// Запрашиваемый файл + [HttpGet("template")] + [AllowAnonymous] + [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + public IActionResult GetTemplate() + { + var stream = trajectoryImportService.GetTemplateFile(); + return File(stream, "application/octet-stream", fileName); + } + + /// + /// Формируем excel файл с текущими строками траектории + /// + /// id скважины + /// Токен отмены задачи + /// Запрашиваемый файл + [HttpGet("export")] + [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + public async Task ExportAsync([FromRoute] int idWell, CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, + token).ConfigureAwait(false)) + return Forbid(); + var stream = await trajectoryImportService.ExportAsync(idWell, token); + var fileName = await trajectoryImportService.GetFileNameAsync(idWell, token); + return File(stream, "application/octet-stream", fileName); + } + + /// + /// Импортирует координаты из excel (xlsx) файла + /// + /// id скважины + /// Коллекция из одного файла xlsx + /// Удалить операции перед импортом, если фал валидный + /// Токен отмены задачи + /// количество успешно записанных строк в БД + [HttpPost("import/{deleteBeforeImport}")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), (int)System.Net.HttpStatusCode.BadRequest)] + public async Task ImportAsync(int idWell, + [FromForm] IFormFileCollection files, + bool deleteBeforeImport, + CancellationToken token) + { + int? idUser = User.GetUserId(); + if (!idUser.HasValue) + return Forbid(); + if (!await CanUserAccessToWellAsync(idWell, + token).ConfigureAwait(false)) + return Forbid(); + if (files.Count < 1) + return this.ValidationBadRequest(nameof(files), "нет файла"); + var file = files[0]; + if (Path.GetExtension(file.FileName).ToLower() != ".xlsx") + return this.ValidationBadRequest(nameof(files), "Требуется xlsx файл."); + using Stream stream = file.OpenReadStream(); + + try + { + var trajectoryRows = await trajectoryImportService.ImportAsync(idWell, idUser.Value, stream, token); + + if (deleteBeforeImport) + await trajectoryRepository.DeleteByIdWellAsync(idWell, token); + + var rowsCount = await trajectoryRepository.AddRangeAsync(trajectoryRows, token); + + return Ok(rowsCount); + } + catch (FileFormatException ex) + { + return this.ValidationBadRequest(nameof(files), ex.Message); + } + } + + /// + /// Получаем список всех строк координат траектории (для клиента) + /// + /// id скважины + /// Токен отмены задачи + /// Список добавленных координат траектории + [HttpGet] + //[ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] + public virtual async Task GetAsync([FromRoute] int idWell, CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, + token).ConfigureAwait(false)) + return Forbid(); + var result = await trajectoryRepository.GetAsync(idWell, token); + return Ok(result); + } + + /// + /// Добавить одну новую строчку координат для плановой траектории + /// + /// + /// + /// + /// количество успешно записанных строк в БД + [HttpPost] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + public async Task AddAsync(int idWell, [FromBody] Tdto row, + CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) + return Forbid(); + var idUser = User.GetUserId(); + if (!idUser.HasValue) + return Forbid(); + row.IdUser = idUser.Value; + row.IdWell = idWell; + var result = await trajectoryRepository.AddAsync(row, token); + return Ok(result); + } + + /// + /// Добавить массив строчек координат для плановой траектории + /// + /// + /// + /// + /// количество успешно записанных строк в БД + [HttpPost("range")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + public async Task AddRangeAsync(int idWell, [FromBody] IEnumerable rows, + CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) + return Forbid(); + int? idUser = User.GetUserId(); + if (!idUser.HasValue) + return Forbid(); + foreach (var item in rows) + { + item.IdUser = idUser.Value; + item.IdWell = idWell; + } + var result = await trajectoryRepository.AddRangeAsync(rows, token); + return Ok(result); + } + + /// + /// Изменить выбранную строку с координатами + /// + /// + /// + /// + /// + /// количество успешно обновленных строк в БД + [HttpPut("{idRow}")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + public async Task UpdateAsync(int idWell, int idRow, + [FromBody] Tdto row, CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) + return Forbid(); + int? idUser = User.GetUserId(); + if (!idUser.HasValue) + return Forbid(); + row.Id = idRow; + row.IdUser = idUser.Value; + row.IdWell = idWell; + var result = await trajectoryRepository.UpdateAsync(row, token); + return Ok(result); + } + + /// + /// Удалить выбранную строку с координатами + /// + /// + /// + /// + /// количество успешно удаленных строк из БД + [HttpDelete("{idRow}")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + public async Task DeleteAsync(int idWell, int idRow, CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, + token).ConfigureAwait(false)) + return Forbid(); + + var result = await trajectoryRepository.DeleteRangeAsync(new int[] { idRow }, token); + + return Ok(result); + } + + protected async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) + { + int? idCompany = User.GetCompanyId(); + return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, + idWell, token).ConfigureAwait(false); + } + } + +} From e10823c8685af808ff27c36ba773c2677f39d1b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Wed, 22 Nov 2023 17:30:30 +0500 Subject: [PATCH 06/19] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80,=20=D0=BA=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=BD=D1=8B=D0=B5=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AsbCloudInfrastructure.csproj | 6 +-- .../Trajectory/FactTrajectoryImportService.cs | 2 +- .../Trajectory/NnbTrajectoryImportService.cs | 4 +- .../Trajectory/NnbTrajectoryTemplate.xlsx | Bin 11279 -> 0 bytes .../PlannedTrajectoryImportService.cs | 35 +++--------------- .../FactTrajectoryTemplate.xlsx | Bin .../Templates/NnbTrajectoryTemplate.xlsx | Bin 0 -> 11600 bytes .../PlannedTrajectoryTemplate.xlsx | Bin .../Trajectory/TrajectoryImportService.cs | 29 +++++++-------- 9 files changed, 25 insertions(+), 51 deletions(-) delete mode 100644 AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryTemplate.xlsx rename AsbCloudInfrastructure/Services/Trajectory/{ => Templates}/FactTrajectoryTemplate.xlsx (100%) create mode 100644 AsbCloudInfrastructure/Services/Trajectory/Templates/NnbTrajectoryTemplate.xlsx rename AsbCloudInfrastructure/Services/Trajectory/{ => Templates}/PlannedTrajectoryTemplate.xlsx (100%) diff --git a/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj b/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj index 3ff14745..8d110e66 100644 --- a/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj +++ b/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj @@ -34,9 +34,9 @@ - - - + + + diff --git a/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs index 95b39bfc..defc5207 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs @@ -9,7 +9,7 @@ namespace AsbCloudInfrastructure.Services.Trajectory public class FactTrajectoryImportService : TrajectoryImportService { public override string templateFileName { get; set; } = "FactTrajectoryTemplate.xlsx"; - public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory"; + public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; public override string sheetNamePlannedTrajectory { get; set; } = "Фактическая траектория"; public override int headerRowsCount { get; set; } = 2; public override int ColumnWellboreDepth { get; set; } = 1; diff --git a/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryImportService.cs index fd87606e..869de4d7 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryImportService.cs @@ -9,8 +9,8 @@ namespace AsbCloudInfrastructure.Services.Trajectory public class NnbTrajectoryImportService : TrajectoryImportService { public override string templateFileName { get; set; } = "NnbTrajectoryTemplate.xlsx"; - public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory"; - public override string sheetNamePlannedTrajectory { get; set; } = "Плановая траектория"; + public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; + public override string sheetNamePlannedTrajectory { get; set; } = "Фактическая ннб-траектория"; public override int headerRowsCount { get; set; } = 2; public override int ColumnWellboreDepth { get; set; } = 1; public override int ColumnZenithAngle { get; set; } = 2; diff --git a/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryTemplate.xlsx b/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryTemplate.xlsx deleted file mode 100644 index 8d01c25bb7dd02cd541c93b6977d580584b77b78..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11279 zcmeHtggn%^2rW=WOd+xoj9z5Uo z54?Bn-(ES#GuK>e#9ZSU%5qT9Sb%2$H~;`Z4iM!I8n=T00H9$2089WJq>i|~oeR*; z#X#ND0qCs9;$dq;mIn<dtznb!s68J4BMrU zH}m^~gFRZ1a`div#ylRus>}qkE3ewxRMb_1kO1W&2kyA(sF=)PUKtxxeI@CuE~vijQb-AC1!?)CpL2tkm7EH8(+zHfdn0h z1QK_$n7@o7x+z;iS^8=Egw`V82RU)&IAs9Eq@RvW)};-m01FtzDA zlgQ}Ay!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;0qi+Rczisfxg-OyfmpR4G~p;C!XgRQJz zKKrai{P2adsdnRRXW@gG;TSs|BQvCflsnKYcp{Amr9TtSi8flWt z+!BR^{TB?*{0*AkeI^loKI|6)W-dOai1eI9l<;7duWMJ)u!yWBX-ABAT#ML@Yrs%% zbJl$1CQbskNBnbkf;JDee3!S2NpEhI>sIi_=+$=R{i1%uD&D6+QPA)Ss9BTMV+z%< zMtB|{iEMsedPIHVn=p>^T90se;&aDwwqqgo70%9#rR@$+3qQ`L1J{sd1Lf<5JFBX6 z*z%*recEeZisi9O;d}iwrHAq%kWACmXNxPz#@Fz$ymlsp_nL-9sio6dgD0}7)SLe1 z?_ac#uK9S72zc_oEqZ?FQSiLQ8}9BWWB;%42?5CrW>f#UsPR89{6E`&C~;Jl`#Zqj z%dP$+_;XtXwyNKXubvA2y#(cV!4WY3_Wv$Od5ZJ2F5wr_Be-t!NtMD=;inYyFJVW- zzl8rFoSz~*rA&VzY#{w__y0cv^(o*}2J#o+7C1)>9?w%g@+rX6tnM#>DKLu;2KbfZ zeJc7iC-O^l9RKNHeq~6WqWpbQ_6q|5NFoOZy{A*Or{Yhe<1YYNs=sdHNo@SbSosw6 l@2>tABmgi){o6hL+wm*Q!GLuT06+r&XuxVbP51NYe*m+(pnCuS diff --git a/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs index bbfbf7a1..296a4002 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs @@ -1,40 +1,18 @@ using AsbCloudApp.Data; using AsbCloudApp.Repositories; using AsbCloudApp.Services; -using AsbCloudDb.Model; using ClosedXML.Excel; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; namespace AsbCloudInfrastructure.Services.Trajectory { - public class PlannedTrajectoryImportService : TrajectoryImportService //IPlannedTrajectoryImportService + public class PlannedTrajectoryImportService : TrajectoryImportService { /* * password for PlannedTrajectoryTemplate.xlsx is Drill2022 */ - - private readonly IWellService wellService; - private readonly ITrajectoryEditableRepository plannedTrajectoryService; - - //private const string templateFileName = "PlannedTrajectoryTemplate.xlsx"; - //private const string usingTemplateFile = "AsbCloudInfrastructure.Services.Trajectory"; - //private const string sheetNamePlannedTrajectory = "Плановая траектория"; - //private const int headerRowsCount = 2; - //private const int ColumnWellboreDepth = 1; - //private const int ColumnZenithAngle = 2; - //private const int ColumnAzimuthGeo = 3; - //private const int ColumnAzimuthMagnetic = 4; - //private const int ColumnVerticalDepth = 5; - //private const int ColumnRadius = 6; - //private const int ColumnComment = 7; public override string templateFileName { get; set; } = "PlannedTrajectoryTemplate.xlsx"; - public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory"; + public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; public override string sheetNamePlannedTrajectory { get; set; } = "Плановая траектория"; public override int headerRowsCount { get; set; } = 2; public override int ColumnWellboreDepth { get; set; } = 1; @@ -46,12 +24,11 @@ namespace AsbCloudInfrastructure.Services.Trajectory public override int ColumnComment { get; set; } = 7; public PlannedTrajectoryImportService( - IWellService wellService, - ITrajectoryEditableRepository plannedTrajectoryService) + IWellService wellService, + ITrajectoryEditableRepository plannedTrajectoryService) : base(plannedTrajectoryService, wellService) { - this.wellService = wellService; - } + } protected override TrajectoryGeoPlanDto ParseRow(IXLRow row) { @@ -65,7 +42,7 @@ namespace AsbCloudInfrastructure.Services.Trajectory Radius = row.Cell(ColumnRadius).GetCellValue(), Comment = row.Cell(ColumnComment).GetCellValue() }; - + return trajectoryRow; } diff --git a/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryTemplate.xlsx b/AsbCloudInfrastructure/Services/Trajectory/Templates/FactTrajectoryTemplate.xlsx similarity index 100% rename from AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryTemplate.xlsx rename to AsbCloudInfrastructure/Services/Trajectory/Templates/FactTrajectoryTemplate.xlsx diff --git a/AsbCloudInfrastructure/Services/Trajectory/Templates/NnbTrajectoryTemplate.xlsx b/AsbCloudInfrastructure/Services/Trajectory/Templates/NnbTrajectoryTemplate.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..b6bc4bbf778127584baf9acdf27bfe3b6f93a6df GIT binary patch literal 11600 zcmeHt1AATT*7k~R+iq;zcG9Sg?KHOS22Io0w%yohjK*x#Sl`+>r+a7b?-#shu4_$? z`<;+EkTRC zVF!o$(VNOtS-l#%n?l)oLWlB_54(JcQd>l5%bMX{Tao-7Tw!#%<2nD6)EDu9yfTgG z+PFyeENq0+Q^=WmD7mI3Lk3II7g7pL_BvSBz3vNz1Ci1&K~ai!+T9Y+yM-hEp&o5e zSsE8?LoT;K6?$BmHO;m*WfoQq^2$$61nLY)H_yQ-c%h4C^5YF=m#FD>h>ZkmC9tE53r~3Le}a{#ew}eBn9@ z|E_cyarJYKFww@xb40vnpr5_GfB}^L=BD-POk_WSwkHR?3I}vk14k2UCq{BdJG-BnOluR7Lj!omTDzY^YN2jL8_0=CC6Lsq{2s5!wm$J z^lkTf99~}Ki#{AAx!z;BenRBsfLw-q3BBC03lAyti>S%--e zpM2*(791c5hH=XsPp4rFIvJWRR(K6slU&{5s;ioFTT~flI`WXZ8yH)6U5b6`M0@h0 zSI8JtA!S3oWtos1pvb!NeOt$NKJwYUj}xZ1bnt8_Ad;wP4Vbb1=_Ca$@!kM10KgX# z06+q2#?6}1)y~n%(9X{4w>*}oKBj=jjNGAl$Xn)Ra2-mHK!*tqqfAzhv3Y|E!>u3c zvRL0}#0VoIMV~_G9xedjCnm|e#!28jbQ1;jhYOZB^yC}gv*TNL)0~%d-_3BG6d6hd zmlbemGNwhj;G%r+Bxsbzw<(e{FCdQ{!kIVrK6z@L%MM8FP@zHul_E%-O(nhH8&ke_?)<)^CdDEiwn2ey$%Gu$h(YJXFoq89CV?LQ%<%nYaN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N?aQ8WmKD~5@LhoIt$M@^E^mBy5D+){q@A(WZ_K4Q!Pn&~ETS3D8gHwSUIy7&2(OdTCy`+M01I+i0-gI)#cQhkJ zK;{2)dTWVmY-k2(w>rT2Qslqd?R$Is|CudNWq&RiiPg5tOvoWOpx#jat@1Ps0XwEzLhHWE^jPZJ8%2V1Cxg=DN)c+a08@D4TxgQ?UAPSt~CS$^%+V7 zlK{mCatTeoK0`LTPgIR?epLlJh-zb219egm8XcnylRshKIZ3b!AW>AHqya&C-Ju2c zWtpw9X6JHmu|VYAI14o$J*d5e>wD9{$uwGjDhHOdtUCHCSM~g4bddQTL7IcIM)9z< zN(ys{P|{w9U1G)zSUf^j9=SzbScCzo9=L3NrWU#?RpgV8W+L1Zi?ni@#DOmHn(Oux zP~`Wde07gB+AxJdFkF&WM~MvIl96KOI}aarYnm;6SRz6?7J@}jnKbO&rg4}SI2#Z= zkkPMESTWdcC%(!xogr-+ORX^fY*UQlys~+k)FnBHy{~94BRX8(sVdspax2L30Wy+__~MZm*^<4xcsW4=e6+Pdm4U;0swbF#_<2|aCnXLdZPOm z(i`~yKEyw!yD?vi2JE?_A>-BmkgF4rGF_na6AK lzlZ$4io*dJ where T: TrajectoryGeoDto + public abstract class TrajectoryImportService where T : TrajectoryGeoDto { - protected readonly IWellService wellService; + private readonly IWellService wellService; - protected readonly ITrajectoryRepository trajectoryService; + private readonly ITrajectoryRepository trajectoryService; + protected abstract void AddCoordinatesToRow(IXLRow row, T trajectory); + protected abstract T ParseRow(IXLRow row); public abstract string templateFileName { get; set; } public abstract string usingTemplateFile { get; set; } public abstract string sheetNamePlannedTrajectory { get; set; } @@ -30,8 +29,6 @@ namespace AsbCloudInfrastructure.Services.Trajectory public abstract int ColumnVerticalDepth { get; set; } public abstract int ColumnRadius { get; set; } public abstract int ColumnComment { get; set; } - protected abstract void AddCoordinatesToRow(IXLRow row, T trajectory); - protected abstract T ParseRow(IXLRow row); public TrajectoryImportService(ITrajectoryRepository trajectoryService, IWellService wellService) { @@ -54,37 +51,37 @@ namespace AsbCloudInfrastructure.Services.Trajectory return MakeExelFileStream(plannedTrajectorys); } - private Stream MakeExelFileStream(IEnumerable plannedTrajectories) + private Stream MakeExelFileStream(IEnumerable trajectories) { using Stream ecxelTemplateStream = GetTemplateFile(); using var workbook = new XLWorkbook(ecxelTemplateStream, XLEventTracking.Disabled); - AddPlannedTrajecoryToWorkbook(workbook, plannedTrajectories); + AddPlannedTrajecoryToWorkbook(workbook, trajectories); MemoryStream memoryStream = new MemoryStream(); workbook.SaveAs(memoryStream, new SaveOptions { }); memoryStream.Seek(0, SeekOrigin.Begin); return memoryStream; } - private void AddPlannedTrajecoryToWorkbook(XLWorkbook workbook, IEnumerable plannedTrajectories) + private void AddPlannedTrajecoryToWorkbook(XLWorkbook workbook, IEnumerable trajectories) { - if (plannedTrajectories.Any()) + if (trajectories.Any()) { var sheet = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetNamePlannedTrajectory); if (sheet is null) throw new FileFormatException($"Лист с именем {sheetNamePlannedTrajectory} отсутствует, либо имеет некорректное название"); - AddPlannedTrajecoryToSheet(sheet, plannedTrajectories); + AddTrajecoryToSheet(sheet, trajectories); } } - private void AddPlannedTrajecoryToSheet(IXLWorksheet sheet, IEnumerable plannedTrajectories) + private void AddTrajecoryToSheet(IXLWorksheet sheet, IEnumerable trajectories) { - var rowList = plannedTrajectories.ToList(); + var rowList = trajectories.ToList(); for (int i = 0; i < rowList.Count; i++) { var row = sheet.Row(1 + i + headerRowsCount); AddCoordinatesToRow(row, rowList[i]); } - } + } public async Task GetFileNameAsync(int idWell, CancellationToken token) { From e751ae212670b53fab894bcdcf0298baaad6fdfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Wed, 22 Nov 2023 21:23:23 +0500 Subject: [PATCH 07/19] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=20TrajectoryImportService?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Trajectory/TrajectoryImportService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AsbCloudInfrastructure/Services/Trajectory/TrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/TrajectoryImportService.cs index 132ffd63..5587789e 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/TrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/TrajectoryImportService.cs @@ -47,22 +47,22 @@ namespace AsbCloudInfrastructure.Services.Trajectory public async Task ExportAsync(int idWell, CancellationToken token) { - var plannedTrajectorys = await trajectoryService.GetAsync(idWell, token); - return MakeExelFileStream(plannedTrajectorys); + var trajectorys = await trajectoryService.GetAsync(idWell, token); + return MakeExelFileStream(trajectorys); } private Stream MakeExelFileStream(IEnumerable trajectories) { using Stream ecxelTemplateStream = GetTemplateFile(); using var workbook = new XLWorkbook(ecxelTemplateStream, XLEventTracking.Disabled); - AddPlannedTrajecoryToWorkbook(workbook, trajectories); + AddTrajecoryToWorkbook(workbook, trajectories); MemoryStream memoryStream = new MemoryStream(); workbook.SaveAs(memoryStream, new SaveOptions { }); memoryStream.Seek(0, SeekOrigin.Begin); return memoryStream; } - private void AddPlannedTrajecoryToWorkbook(XLWorkbook workbook, IEnumerable trajectories) + private void AddTrajecoryToWorkbook(XLWorkbook workbook, IEnumerable trajectories) { if (trajectories.Any()) { From f3dfea8b9b254119315b59afb30be9f510407e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Wed, 22 Nov 2023 21:57:13 +0500 Subject: [PATCH 08/19] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B8=D1=85=20=D0=B8?= =?UTF-8?q?=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AsbCloudDbContextModelSnapshot.cs | 30 ++++--------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs index 69d2336b..acbe5e45 100644 --- a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs +++ b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs @@ -19,7 +19,7 @@ namespace AsbCloudDb.Migrations #pragma warning disable 612, 618 modelBuilder .UseCollation("Russian_Russia.1251") - .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("ProductVersion", "6.0.22") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); @@ -136,21 +136,21 @@ namespace AsbCloudDb.Migrations { Id = 1, Caption = "Недропользователь", - IsContact = true, + IsContact = false, Order = 3 }, new { Id = 2, Caption = "Буровой подрядчик", - IsContact = true, + IsContact = false, Order = 2 }, new { Id = 3, Caption = "Сервис автоматизации бурения", - IsContact = true, + IsContact = false, Order = 0 }, new @@ -178,7 +178,7 @@ namespace AsbCloudDb.Migrations { Id = 7, Caption = "Служба супервайзинга", - IsContact = false, + IsContact = true, Order = 1 }, new @@ -189,18 +189,11 @@ namespace AsbCloudDb.Migrations Order = 7 }, new - { - Id = 11, - Caption = "Дизельный сервис", - IsContact = false, - Order = 9 - }, - new { Id = 12, Caption = "Сервис по обслуживанию верхних силовых приводов", IsContact = true, - Order = 8 + Order = 7 }); }); @@ -2494,12 +2487,6 @@ namespace AsbCloudDb.Migrations Name = "WellContact.delete" }, new - { - Id = 529, - Description = "Разрешение на получение отчетов drill test", - Name = "DrillTestReport.get" - }, - new { Id = 530, Description = "Разрешение просматривать фактические траектории", @@ -4184,11 +4171,6 @@ namespace AsbCloudDb.Migrations IdPermission = 528 }, new - { - IdUserRole = 1, - IdPermission = 529 - }, - new { IdUserRole = 1, IdPermission = 530 From f15dd87d97e325f718c62668c211f3392c350f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Thu, 23 Nov 2023 12:01:12 +0500 Subject: [PATCH 09/19] =?UTF-8?q?1.=20=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=B9=20=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D1=80=D0=B5=D1=88=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=81=D0=BC=D0=BE=D1=82=D1=80,=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D1=84=D0=B0=D0=BA=D1=82=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=B8=D1=85=20=D0=B8=20=D0=BD=D0=BD=D0=B1-=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D0=B5=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=B9=202.=20?= =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B7=D1=80=D0=B5=D1=88=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BD=D0=B0?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BE=D1=82=D1=87=D0=B5=D1=82=D0=BE=D0=B2=20drill=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...303_Add_Permissions_For_Trajectory_Fact.cs | 22 +++++++++---------- ...4844_Add_Permissions_For_Trajectory_Nnb.cs | 8 +++---- .../AsbCloudDbContextModelSnapshot.cs | 6 ++--- .../DefaultData/EntityFillerPermission.cs | 8 +++---- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs b/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs index af56dae7..27d98155 100644 --- a/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs +++ b/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs @@ -13,8 +13,8 @@ namespace AsbCloudDb.Migrations columns: new[] { "id", "description", "name" }, values: new object[,] { - { 530, "Разрешение просматривать фактические траектории", "FactTrajectory.get" }, - { 531, "Разрешение редактировать фактические траектории", "FactTrajectory.edit" } + { 529, "Разрешение просматривать фактические траектории", "FactTrajectory.get" }, + { 530, "Разрешение редактировать фактические траектории", "FactTrajectory.edit" } }); migrationBuilder.InsertData( @@ -22,8 +22,8 @@ namespace AsbCloudDb.Migrations columns: new[] { "id_permission", "id_user_role" }, values: new object[,] { - { 530, 1 }, - { 531, 1 } + { 529, 1 }, + { 530, 1 } }); } @@ -32,22 +32,22 @@ namespace AsbCloudDb.Migrations migrationBuilder.DeleteData( table: "t_relation_user_role_permission", keyColumns: new[] { "id_permission", "id_user_role" }, - keyValues: new object[] { 530, 1 }); + keyValues: new object[] { 529, 1 }); migrationBuilder.DeleteData( table: "t_relation_user_role_permission", keyColumns: new[] { "id_permission", "id_user_role" }, - keyValues: new object[] { 531, 1 }); + keyValues: new object[] { 530, 1 }); + + migrationBuilder.DeleteData( + table: "t_permission", + keyColumn: "id", + keyValue: 529); migrationBuilder.DeleteData( table: "t_permission", keyColumn: "id", keyValue: 530); - - migrationBuilder.DeleteData( - table: "t_permission", - keyColumn: "id", - keyValue: 531); } } } diff --git a/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs b/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs index 3c6e6bbd..506bc8f4 100644 --- a/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs +++ b/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs @@ -11,12 +11,12 @@ namespace AsbCloudDb.Migrations migrationBuilder.InsertData( table: "t_permission", columns: new[] { "id", "description", "name" }, - values: new object[] { 532, "Разрешение просматривать фактические ннб-траектории", "NnbTrajectory.get" }); + values: new object[] { 531, "Разрешение просматривать фактические ннб-траектории", "NnbTrajectory.get" }); migrationBuilder.InsertData( table: "t_relation_user_role_permission", columns: new[] { "id_permission", "id_user_role" }, - values: new object[] { 532, 1 }); + values: new object[] { 531, 1 }); } protected override void Down(MigrationBuilder migrationBuilder) @@ -24,12 +24,12 @@ namespace AsbCloudDb.Migrations migrationBuilder.DeleteData( table: "t_relation_user_role_permission", keyColumns: new[] { "id_permission", "id_user_role" }, - keyValues: new object[] { 532, 1 }); + keyValues: new object[] { 531, 1 }); migrationBuilder.DeleteData( table: "t_permission", keyColumn: "id", - keyValue: 532); + keyValue: 531); } } } diff --git a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs index acbe5e45..a8c0ed61 100644 --- a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs +++ b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs @@ -2488,19 +2488,19 @@ namespace AsbCloudDb.Migrations }, new { - Id = 530, + Id = 529, Description = "Разрешение просматривать фактические траектории", Name = "FactTrajectory.get" }, new { - Id = 531, + Id = 530, Description = "Разрешение редактировать фактические траектории", Name = "FactTrajectory.edit" }, new { - Id = 532, + Id = 531, Description = "Разрешение просматривать фактические ннб-траектории", Name = "NnbTrajectory.get" }); diff --git a/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs b/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs index 67e50993..c21b05c1 100644 --- a/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs +++ b/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs @@ -162,11 +162,9 @@ new() { Id = 527, Name = "Manual.delete", Description = "Разрешение на удаление инструкций"}, new (){ Id = 528, Name="WellContact.delete", Description="Разрешение на удаление контакта"}, - new (){ Id = 529, Name="DrillTestReport.get", Description="Разрешение на получение отчетов drill test"}, - - new (){ Id = 530, Name="FactTrajectory.get", Description="Разрешение просматривать фактические траектории"}, - new (){ Id = 531, Name="FactTrajectory.edit", Description="Разрешение редактировать фактические траектории"}, - new (){ Id = 532, Name="NnbTrajectory.get", Description="Разрешение просматривать фактические ннб-траектории"}, + new (){ Id = 529, Name="FactTrajectory.get", Description="Разрешение просматривать фактические траектории"}, + new (){ Id = 530, Name="FactTrajectory.edit", Description="Разрешение редактировать фактические траектории"}, + new (){ Id = 531, Name="NnbTrajectory.get", Description="Разрешение просматривать фактические ннб-траектории"}, }; } } From 84bf9fa0026d5c51f01d3372928f378d32a953d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Thu, 23 Nov 2023 12:02:34 +0500 Subject: [PATCH 10/19] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=B9=20=D1=80=D0=B0=D0=B7=D1=80?= =?UTF-8?q?=D0=B5=D1=88=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=BD=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=81=D0=BC=D0=BE=D1=82=D1=80/=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=84=D0=B0=D0=BA=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA?= =?UTF-8?q?=D0=B8=D1=85=20=D0=B8=20=D0=BD=D0=BD=D0=B1-=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Migrations/AsbCloudDbContextModelSnapshot.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs index bbd48006..2e93c841 100644 --- a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs +++ b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs @@ -4169,6 +4169,11 @@ namespace AsbCloudDb.Migrations IdPermission = 528 }, new + { + IdUserRole = 1, + IdPermission = 529 + }, + new { IdUserRole = 1, IdPermission = 530 @@ -4177,11 +4182,6 @@ namespace AsbCloudDb.Migrations { IdUserRole = 1, IdPermission = 531 - }, - new - { - IdUserRole = 1, - IdPermission = 532 }); }); From e6329b76da04b4ff6ee65b6ab3470461c2ac2e50 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Tue, 28 Nov 2023 15:54:47 +0500 Subject: [PATCH 11/19] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=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/Data/PlanFactDto.cs | 9 +- .../TrajectoryCartesianFactDto.cs | 2 +- .../TrajectoryCartesianPlanDto.cs | 4 +- .../Data/{ => Trajectory}/TrajectoryGeoDto.cs | 6 +- .../{ => Trajectory}/TrajectoryGeoFactDto.cs | 9 +- .../{ => Trajectory}/TrajectoryGeoPlanDto.cs | 5 +- .../Data/Trajectory/TrajectoryPlanFactDto.cs | 25 + .../ITrajectoryEditableRepository.cs | 2 +- .../Repositories/ITrajectoryNnbRepository.cs | 2 +- .../Repositories/ITrajectoryRepository.cs | 2 +- ...303_Add_Permissions_For_Trajectory_Fact.cs | 14 +- ...0948_Add_Fact_Trajectory_Table.Designer.cs | 2 +- ...0231115120948_Add_Fact_Trajectory_Table.cs | 21 +- ...4844_Add_Permissions_For_Trajectory_Nnb.cs | 35 -- ...7_Update_t_planned_trajectory.Designer.cs} | 486 ++++++++++-------- ...31127114017_Update_t_planned_trajectory.cs | 109 ++++ .../AsbCloudDbContextModelSnapshot.cs | 373 +++++++------- AsbCloudDb/Model/AsbCloudDbContext.cs | 4 +- .../DefaultData/EntityFillerPermission.cs | 4 +- AsbCloudDb/Model/IAsbCloudDbContext.cs | 4 +- .../Model/Trajectory/PlannedTrajectory.cs | 13 - AsbCloudDb/Model/Trajectory/Trajectory.cs | 5 +- .../{FactTrajectory.cs => TrajectoryFact.cs} | 4 +- .../Model/Trajectory/TrajectoryPlanned.cs | 12 + .../AsbCloudInfrastructure.csproj | 7 +- AsbCloudInfrastructure/DependencyInjection.cs | 16 +- .../TrajectoryEditableRepository.cs | 2 +- .../Repository/TrajectoryNnbRepository.cs | 2 +- .../TrajectoryExportService.cs} | 106 +--- .../TrajectoryFactManualExportService.cs | 41 ++ .../Export/TrajectoryFactNnbExportService.cs | 41 ++ .../TrajectoryPlannedExportService.cs} | 42 +- .../TrajectoryFactManualImportService.cs} | 28 +- .../Import/TrajectoryImportService.cs | 92 ++++ .../TrajectoryPlannedImportService.cs} | 27 +- .../Templates/FactTrajectoryTemplate.xlsx | Bin 6885 -> 0 bytes .../Templates/NnbTrajectoryTemplate.xlsx | Bin 11600 -> 0 bytes .../TrajectoryFactManualTemplate.xlsx | Bin 0 -> 6875 bytes .../Templates/TrajectoryFactNnbTemplate.xlsx | Bin 0 -> 6881 bytes ...te.xlsx => TrajectoryPlannedTemplate.xlsx} | Bin .../Services/Trajectory/TrajectoryService.cs | 10 +- .../AsbCloudWebApi.Tests.csproj | 10 + .../TrajectoryFactManualTemplate.xlsx | Bin 0 -> 6962 bytes .../Templates/TrajectoryPlannedTemplate.xlsx | Bin 0 -> 7118 bytes .../Trajectory/TrajectoryExportTest.cs | 128 +++++ .../Trajectory/TrajectoryImportTest.cs | 53 ++ .../TrajectoryVisualizationServiceTest.cs | 8 +- .../Trajectory/NnbTrajectoryController.cs | 80 --- .../Trajectory/TrajectoryController.cs | 178 +------ .../TrajectoryEditableController.cs | 206 ++++++++ ...r.cs => TrajectoryFactManualController.cs} | 14 +- .../Trajectory/TrajectoryFactNnbController.cs | 30 ++ ...ller.cs => TrajectoryPlannedController.cs} | 16 +- 53 files changed, 1325 insertions(+), 964 deletions(-) rename AsbCloudApp/Data/{ => Trajectory}/TrajectoryCartesianFactDto.cs (95%) rename AsbCloudApp/Data/{ => Trajectory}/TrajectoryCartesianPlanDto.cs (83%) rename AsbCloudApp/Data/{ => Trajectory}/TrajectoryGeoDto.cs (91%) rename AsbCloudApp/Data/{ => Trajectory}/TrajectoryGeoFactDto.cs (67%) rename AsbCloudApp/Data/{ => Trajectory}/TrajectoryGeoPlanDto.cs (82%) create mode 100644 AsbCloudApp/Data/Trajectory/TrajectoryPlanFactDto.cs delete mode 100644 AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs rename AsbCloudDb/Migrations/{20231116094844_Add_Permissions_For_Trajectory_Nnb.Designer.cs => 20231127114017_Update_t_planned_trajectory.Designer.cs} (98%) create mode 100644 AsbCloudDb/Migrations/20231127114017_Update_t_planned_trajectory.cs delete mode 100644 AsbCloudDb/Model/Trajectory/PlannedTrajectory.cs rename AsbCloudDb/Model/Trajectory/{FactTrajectory.cs => TrajectoryFact.cs} (63%) create mode 100644 AsbCloudDb/Model/Trajectory/TrajectoryPlanned.cs rename AsbCloudInfrastructure/Services/Trajectory/{TrajectoryImportService.cs => Export/TrajectoryExportService.cs} (51%) create mode 100644 AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs create mode 100644 AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs rename AsbCloudInfrastructure/Services/Trajectory/{NnbTrajectoryImportService.cs => Export/TrajectoryPlannedExportService.cs} (50%) rename AsbCloudInfrastructure/Services/Trajectory/{FactTrajectoryImportService.cs => Import/TrajectoryFactManualImportService.cs} (55%) create mode 100644 AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryImportService.cs rename AsbCloudInfrastructure/Services/Trajectory/{PlannedTrajectoryImportService.cs => Import/TrajectoryPlannedImportService.cs} (60%) delete mode 100644 AsbCloudInfrastructure/Services/Trajectory/Templates/FactTrajectoryTemplate.xlsx delete mode 100644 AsbCloudInfrastructure/Services/Trajectory/Templates/NnbTrajectoryTemplate.xlsx create mode 100644 AsbCloudInfrastructure/Services/Trajectory/Templates/TrajectoryFactManualTemplate.xlsx create mode 100644 AsbCloudInfrastructure/Services/Trajectory/Templates/TrajectoryFactNnbTemplate.xlsx rename AsbCloudInfrastructure/Services/Trajectory/Templates/{PlannedTrajectoryTemplate.xlsx => TrajectoryPlannedTemplate.xlsx} (100%) create mode 100644 AsbCloudWebApi.Tests/Services/Trajectory/Templates/TrajectoryFactManualTemplate.xlsx create mode 100644 AsbCloudWebApi.Tests/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx create mode 100644 AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs create mode 100644 AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryImportTest.cs delete mode 100644 AsbCloudWebApi/Controllers/Trajectory/NnbTrajectoryController.cs create mode 100644 AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs rename AsbCloudWebApi/Controllers/Trajectory/{FactTrajectoryController.cs => TrajectoryFactManualController.cs} (52%) create mode 100644 AsbCloudWebApi/Controllers/Trajectory/TrajectoryFactNnbController.cs rename AsbCloudWebApi/Controllers/Trajectory/{PlannedTrajectoryController.cs => TrajectoryPlannedController.cs} (70%) diff --git a/AsbCloudApp/Data/PlanFactDto.cs b/AsbCloudApp/Data/PlanFactDto.cs index 02765309..74c0281b 100644 --- a/AsbCloudApp/Data/PlanFactDto.cs +++ b/AsbCloudApp/Data/PlanFactDto.cs @@ -4,7 +4,7 @@ /// DTO объединяющее плановые и фактические значения /// /// - public class PlanFactDto : PlanFactBase + public class PlanFactDto : PlanFactBase { } @@ -15,7 +15,7 @@ /// /// /// - public class PlanFactBase + public class PlanFactBase { /// /// Плановое значение @@ -26,10 +26,5 @@ /// Фактическое значение /// public V? Fact { get; set; } - - /// - /// Фактическое ннб-значение - /// - public V? Nnb { get; set; } } } diff --git a/AsbCloudApp/Data/TrajectoryCartesianFactDto.cs b/AsbCloudApp/Data/Trajectory/TrajectoryCartesianFactDto.cs similarity index 95% rename from AsbCloudApp/Data/TrajectoryCartesianFactDto.cs rename to AsbCloudApp/Data/Trajectory/TrajectoryCartesianFactDto.cs index 64f3291b..c9df8dfd 100644 --- a/AsbCloudApp/Data/TrajectoryCartesianFactDto.cs +++ b/AsbCloudApp/Data/Trajectory/TrajectoryCartesianFactDto.cs @@ -1,4 +1,4 @@ -namespace AsbCloudApp.Data +namespace AsbCloudApp.Data.Trajectory { diff --git a/AsbCloudApp/Data/TrajectoryCartesianPlanDto.cs b/AsbCloudApp/Data/Trajectory/TrajectoryCartesianPlanDto.cs similarity index 83% rename from AsbCloudApp/Data/TrajectoryCartesianPlanDto.cs rename to AsbCloudApp/Data/Trajectory/TrajectoryCartesianPlanDto.cs index ed7755df..923498eb 100644 --- a/AsbCloudApp/Data/TrajectoryCartesianPlanDto.cs +++ b/AsbCloudApp/Data/Trajectory/TrajectoryCartesianPlanDto.cs @@ -1,7 +1,7 @@ -namespace AsbCloudApp.Data +namespace AsbCloudApp.Data.Trajectory { /// - /// Визуализация траектории 3D для посторения радиуса цели + /// Визуализация траектории 3D для построения радиуса цели /// public class TrajectoryCartesianPlanDto : TrajectoryCartesianFactDto { diff --git a/AsbCloudApp/Data/TrajectoryGeoDto.cs b/AsbCloudApp/Data/Trajectory/TrajectoryGeoDto.cs similarity index 91% rename from AsbCloudApp/Data/TrajectoryGeoDto.cs rename to AsbCloudApp/Data/Trajectory/TrajectoryGeoDto.cs index 3f36aad6..47563011 100644 --- a/AsbCloudApp/Data/TrajectoryGeoDto.cs +++ b/AsbCloudApp/Data/Trajectory/TrajectoryGeoDto.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -namespace AsbCloudApp.Data +namespace AsbCloudApp.Data.Trajectory { /// /// Базовая географическая траектория diff --git a/AsbCloudApp/Data/TrajectoryGeoFactDto.cs b/AsbCloudApp/Data/Trajectory/TrajectoryGeoFactDto.cs similarity index 67% rename from AsbCloudApp/Data/TrajectoryGeoFactDto.cs rename to AsbCloudApp/Data/Trajectory/TrajectoryGeoFactDto.cs index a78811e4..8ab23fc6 100644 --- a/AsbCloudApp/Data/TrajectoryGeoFactDto.cs +++ b/AsbCloudApp/Data/Trajectory/TrajectoryGeoFactDto.cs @@ -1,17 +1,10 @@ -using System; - -namespace AsbCloudApp.Data; +namespace AsbCloudApp.Data.Trajectory; /// /// Формирование данных по фактической географической траектории /// public class TrajectoryGeoFactDto : TrajectoryGeoDto { - /// - /// Радиус цели - /// - public double? Radius { get; set; } - /// /// Комментарии /// diff --git a/AsbCloudApp/Data/TrajectoryGeoPlanDto.cs b/AsbCloudApp/Data/Trajectory/TrajectoryGeoPlanDto.cs similarity index 82% rename from AsbCloudApp/Data/TrajectoryGeoPlanDto.cs rename to AsbCloudApp/Data/Trajectory/TrajectoryGeoPlanDto.cs index ba9ffb86..292add96 100644 --- a/AsbCloudApp/Data/TrajectoryGeoPlanDto.cs +++ b/AsbCloudApp/Data/Trajectory/TrajectoryGeoPlanDto.cs @@ -1,10 +1,11 @@ using System; -namespace AsbCloudApp.Data + +namespace AsbCloudApp.Data.Trajectory { /// /// Формирование данных по плановой географической траектории /// - public class TrajectoryGeoPlanDto: TrajectoryGeoDto + public class TrajectoryGeoPlanDto : TrajectoryGeoDto { /// /// Радиус цели diff --git a/AsbCloudApp/Data/Trajectory/TrajectoryPlanFactDto.cs b/AsbCloudApp/Data/Trajectory/TrajectoryPlanFactDto.cs new file mode 100644 index 00000000..7176f36f --- /dev/null +++ b/AsbCloudApp/Data/Trajectory/TrajectoryPlanFactDto.cs @@ -0,0 +1,25 @@ +namespace AsbCloudApp.Data.Trajectory +{ + /// + /// DTO объединяющее плановые и фактические значения траекторий + /// + /// + /// + public class TrajectoryPlanFactDto + { + /// + /// Плановое значение + /// + public T? Plan { get; set; } + + /// + /// Фактическое значение + /// + public V? FactManual { get; set; } + + /// + /// Фактическое ннб-значение + /// + public V? FactNnb { get; set; } + } +} diff --git a/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs b/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs index 58738f83..f1bf0671 100644 --- a/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs +++ b/AsbCloudApp/Repositories/ITrajectoryEditableRepository.cs @@ -1,4 +1,4 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; diff --git a/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs b/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs index 65a3efcc..6f383fea 100644 --- a/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs +++ b/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs @@ -1,4 +1,4 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; namespace AsbCloudApp.Repositories { diff --git a/AsbCloudApp/Repositories/ITrajectoryRepository.cs b/AsbCloudApp/Repositories/ITrajectoryRepository.cs index 4202bd0a..ee5df79d 100644 --- a/AsbCloudApp/Repositories/ITrajectoryRepository.cs +++ b/AsbCloudApp/Repositories/ITrajectoryRepository.cs @@ -1,4 +1,4 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; diff --git a/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs b/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs index 27d98155..c3e87ce6 100644 --- a/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs +++ b/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs @@ -13,8 +13,7 @@ namespace AsbCloudDb.Migrations columns: new[] { "id", "description", "name" }, values: new object[,] { - { 529, "Разрешение просматривать фактические траектории", "FactTrajectory.get" }, - { 530, "Разрешение редактировать фактические траектории", "FactTrajectory.edit" } + { 529, "Разрешение просматривать фактические траектории", "FactTrajectory.edit" }, }); migrationBuilder.InsertData( @@ -23,7 +22,6 @@ namespace AsbCloudDb.Migrations values: new object[,] { { 529, 1 }, - { 530, 1 } }); } @@ -34,20 +32,10 @@ namespace AsbCloudDb.Migrations keyColumns: new[] { "id_permission", "id_user_role" }, keyValues: new object[] { 529, 1 }); - migrationBuilder.DeleteData( - table: "t_relation_user_role_permission", - keyColumns: new[] { "id_permission", "id_user_role" }, - keyValues: new object[] { 530, 1 }); - migrationBuilder.DeleteData( table: "t_permission", keyColumn: "id", keyValue: 529); - - migrationBuilder.DeleteData( - table: "t_permission", - keyColumn: "id", - keyValue: 530); } } } diff --git a/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.Designer.cs b/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.Designer.cs index 138f115b..ed795ae6 100644 --- a/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.Designer.cs +++ b/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.Designer.cs @@ -567,7 +567,7 @@ namespace AsbCloudDb.Migrations b.HasIndex("IdWell"); - b.ToTable("t_fact_trajectory"); + b.ToTable("t_trajectory_fact"); b.HasComment("Загрузка фактической траектории"); }); diff --git a/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.cs b/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.cs index 653c38a5..e61f52c8 100644 --- a/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.cs +++ b/AsbCloudDb/Migrations/20231115120948_Add_Fact_Trajectory_Table.cs @@ -11,7 +11,7 @@ namespace AsbCloudDb.Migrations protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( - name: "t_fact_trajectory", + name: "t_trajectory_fact", columns: table => new { id = table.Column(type: "integer", nullable: false) @@ -24,20 +24,19 @@ namespace AsbCloudDb.Migrations azimuth_geo = table.Column(type: "double precision", nullable: false, comment: "Азимут Географ."), azimuth_magnetic = table.Column(type: "double precision", nullable: false, comment: "Азимут Магнитный"), vertical_depth = table.Column(type: "double precision", nullable: false, comment: "Глубина вертикальная"), - comment = table.Column(type: "text", nullable: true, comment: "Комментарии"), - radius = table.Column(type: "double precision", nullable: true, comment: "Радиус цели") + comment = table.Column(type: "text", nullable: true, comment: "Комментарии") }, constraints: table => { - table.PrimaryKey("PK_t_fact_trajectory", x => x.id); + table.PrimaryKey("PK_t_trajectory_fact", x => x.id); table.ForeignKey( - name: "FK_t_fact_trajectory_t_user_id_user", + name: "FK_t_trajectory_fact_t_user_id_user", column: x => x.id_user, principalTable: "t_user", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_t_fact_trajectory_t_well_id_well", + name: "FK_t_trajectory_fact_t_well_id_well", column: x => x.id_well, principalTable: "t_well", principalColumn: "id", @@ -46,20 +45,20 @@ namespace AsbCloudDb.Migrations comment: "Загрузка фактической траектории"); migrationBuilder.CreateIndex( - name: "IX_t_fact_trajectory_id_user", - table: "t_fact_trajectory", + name: "IX_t_trajectory_fact_id_user", + table: "t_trajectory_fact", column: "id_user"); migrationBuilder.CreateIndex( - name: "IX_t_fact_trajectory_id_well", - table: "t_fact_trajectory", + name: "IX_t_trajectory_fact_id_well", + table: "t_trajectory_fact", column: "id_well"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( - name: "t_fact_trajectory"); + name: "t_trajectory_fact"); } } } diff --git a/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs b/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs deleted file mode 100644 index 506bc8f4..00000000 --- a/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace AsbCloudDb.Migrations -{ - public partial class Add_Permissions_For_Trajectory_Nnb : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "t_permission", - columns: new[] { "id", "description", "name" }, - values: new object[] { 531, "Разрешение просматривать фактические ннб-траектории", "NnbTrajectory.get" }); - - migrationBuilder.InsertData( - table: "t_relation_user_role_permission", - columns: new[] { "id_permission", "id_user_role" }, - values: new object[] { 531, 1 }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "t_relation_user_role_permission", - keyColumns: new[] { "id_permission", "id_user_role" }, - keyValues: new object[] { 531, 1 }); - - migrationBuilder.DeleteData( - table: "t_permission", - keyColumn: "id", - keyValue: 531); - } - } -} diff --git a/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.Designer.cs b/AsbCloudDb/Migrations/20231127114017_Update_t_planned_trajectory.Designer.cs similarity index 98% rename from AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.Designer.cs rename to AsbCloudDb/Migrations/20231127114017_Update_t_planned_trajectory.Designer.cs index ae6055cb..52768caa 100644 --- a/AsbCloudDb/Migrations/20231116094844_Add_Permissions_For_Trajectory_Nnb.Designer.cs +++ b/AsbCloudDb/Migrations/20231127114017_Update_t_planned_trajectory.Designer.cs @@ -13,8 +13,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace AsbCloudDb.Migrations { [DbContext(typeof(AsbCloudDbContext))] - [Migration("20231116094844_Add_Permissions_For_Trajectory_Nnb")] - partial class Add_Permissions_For_Trajectory_Nnb + [Migration("20231127114017_Update_t_planned_trajectory")] + partial class Update_t_planned_trajectory { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -223,7 +223,6 @@ namespace AsbCloudDb.Migrations .HasComment("компания"); b.Property("Email") - .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("email") @@ -249,7 +248,6 @@ namespace AsbCloudDb.Migrations .HasComment("ключ скважины"); b.Property("Phone") - .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)") .HasColumnName("phone") @@ -502,76 +500,6 @@ namespace AsbCloudDb.Migrations b.HasComment("Drill_test"); }); - modelBuilder.Entity("AsbCloudDb.Model.FactTrajectory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AzimuthGeo") - .HasColumnType("double precision") - .HasColumnName("azimuth_geo") - .HasComment("Азимут Географ."); - - b.Property("AzimuthMagnetic") - .HasColumnType("double precision") - .HasColumnName("azimuth_magnetic") - .HasComment("Азимут Магнитный"); - - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("Комментарии"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("ID пользователя который внес/изменил запись"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("ID скважины"); - - b.Property("Radius") - .HasColumnType("double precision") - .HasColumnName("radius") - .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("WellboreDepth") - .HasColumnType("double precision") - .HasColumnName("wellbore_depth") - .HasComment("Глубина по стволу"); - - b.Property("ZenithAngle") - .HasColumnType("double precision") - .HasColumnName("zenith_angle") - .HasComment("Угол зенитный"); - - b.HasKey("Id"); - - b.HasIndex("IdUser"); - - b.HasIndex("IdWell"); - - b.ToTable("t_fact_trajectory"); - - b.HasComment("Загрузка фактической траектории"); - }); - modelBuilder.Entity("AsbCloudDb.Model.Faq", b => { b.Property("Id") @@ -2498,99 +2426,11 @@ namespace AsbCloudDb.Migrations new { Id = 529, - Description = "Разрешение на получение отчетов drill test", - Name = "DrillTestReport.get" - }, - new - { - Id = 530, - Description = "Разрешение просматривать фактические траектории", - Name = "FactTrajectory.get" - }, - new - { - Id = 531, Description = "Разрешение редактировать фактические траектории", Name = "FactTrajectory.edit" - }, - new - { - Id = 532, - Description = "Разрешение просматривать фактические ннб-траектории", - Name = "NnbTrajectory.get" }); }); - modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AzimuthGeo") - .HasColumnType("double precision") - .HasColumnName("azimuth_geo") - .HasComment("Азимут Географ."); - - b.Property("AzimuthMagnetic") - .HasColumnType("double precision") - .HasColumnName("azimuth_magnetic") - .HasComment("Азимут Магнитный"); - - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("Комментарии"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("ID пользователя который внес/изменил запись"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("ID скважины"); - - b.Property("Radius") - .HasColumnType("double precision") - .HasColumnName("radius") - .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("WellboreDepth") - .HasColumnType("double precision") - .HasColumnName("wellbore_depth") - .HasComment("Глубина по стволу"); - - b.Property("ZenithAngle") - .HasColumnType("double precision") - .HasColumnName("zenith_angle") - .HasComment("Угол зенитный"); - - b.HasKey("Id"); - - b.HasIndex("IdUser"); - - b.HasIndex("IdWell"); - - b.ToTable("t_planned_trajectory"); - - b.HasComment("Загрузка плановой траектории"); - }); - modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => { b.Property("Id") @@ -4189,21 +4029,6 @@ namespace AsbCloudDb.Migrations { IdUserRole = 1, IdPermission = 529 - }, - new - { - IdUserRole = 1, - IdPermission = 530 - }, - new - { - IdUserRole = 1, - IdPermission = 531 - }, - new - { - IdUserRole = 1, - IdPermission = 532 }); }); @@ -5310,6 +5135,141 @@ namespace AsbCloudDb.Migrations b.HasComment("Наработка талевого каната"); }); + modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryFact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .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("VerticalDepth") + .HasColumnType("double precision") + .HasColumnName("vertical_depth") + .HasComment("Глубина вертикальная"); + + b.Property("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_trajectory_fact"); + + b.HasComment("Загрузка фактической траектории"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlanned", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("ID пользователя который внес/изменил запись"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("Radius") + .HasColumnType("double precision") + .HasColumnName("radius") + .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("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_trajectory_planned"); + + b.HasComment("Загрузка плановой траектории"); + }); + modelBuilder.Entity("AsbCloudDb.Model.User", b => { b.Property("Id") @@ -6111,6 +6071,14 @@ namespace AsbCloudDb.Migrations Name = "Спуск обсадной колонны" }, new + { + Id = 4018, + IdParent = 3002, + KeyValueName = "dT", + KeyValueUnits = "мин", + Name = "Крепление" + }, + new { Id = 4007, IdParent = 3002, @@ -6997,6 +6965,94 @@ namespace AsbCloudDb.Migrations 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 = "Работа пакером в обсадной колонне" }); }); @@ -8090,25 +8146,6 @@ namespace AsbCloudDb.Migrations b.Navigation("Telemetry"); }); - modelBuilder.Entity("AsbCloudDb.Model.FactTrajectory", b => - { - 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.Navigation("User"); - - b.Navigation("Well"); - }); - modelBuilder.Entity("AsbCloudDb.Model.Faq", b => { b.HasOne("AsbCloudDb.Model.User", "AuthorAnswer") @@ -8321,25 +8358,6 @@ namespace AsbCloudDb.Migrations b.Navigation("Well"); }); - modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => - { - 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.Navigation("User"); - - b.Navigation("Well"); - }); - modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => { b.HasOne("AsbCloudDb.Model.User", "User") @@ -8647,6 +8665,44 @@ namespace AsbCloudDb.Migrations 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlanned", b => + { + 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.Navigation("User"); + + b.Navigation("Well"); + }); + modelBuilder.Entity("AsbCloudDb.Model.User", b => { b.HasOne("AsbCloudDb.Model.Company", "Company") diff --git a/AsbCloudDb/Migrations/20231127114017_Update_t_planned_trajectory.cs b/AsbCloudDb/Migrations/20231127114017_Update_t_planned_trajectory.cs new file mode 100644 index 00000000..3175bb9e --- /dev/null +++ b/AsbCloudDb/Migrations/20231127114017_Update_t_planned_trajectory.cs @@ -0,0 +1,109 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AsbCloudDb.Migrations +{ + public partial class Update_t_planned_trajectory : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_t_planned_trajectory_t_user_id_user", + table: "t_planned_trajectory"); + + migrationBuilder.DropForeignKey( + name: "FK_t_planned_trajectory_t_well_id_well", + table: "t_planned_trajectory"); + + migrationBuilder.DropPrimaryKey( + name: "PK_t_planned_trajectory", + table: "t_planned_trajectory"); + + migrationBuilder.RenameTable( + name: "t_planned_trajectory", + newName: "t_trajectory_planned"); + + migrationBuilder.RenameIndex( + name: "IX_t_planned_trajectory_id_well", + table: "t_trajectory_planned", + newName: "IX_t_trajectory_planned_id_well"); + + migrationBuilder.RenameIndex( + name: "IX_t_planned_trajectory_id_user", + table: "t_trajectory_planned", + newName: "IX_t_trajectory_planned_id_user"); + + migrationBuilder.AddPrimaryKey( + name: "PK_t_trajectory_planned", + table: "t_trajectory_planned", + column: "id"); + + migrationBuilder.AddForeignKey( + name: "FK_t_trajectory_planned_t_user_id_user", + table: "t_trajectory_planned", + column: "id_user", + principalTable: "t_user", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_t_trajectory_planned_t_well_id_well", + table: "t_trajectory_planned", + column: "id_well", + principalTable: "t_well", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_t_trajectory_planned_t_user_id_user", + table: "t_trajectory_planned"); + + migrationBuilder.DropForeignKey( + name: "FK_t_trajectory_planned_t_well_id_well", + table: "t_trajectory_planned"); + + migrationBuilder.DropPrimaryKey( + name: "PK_t_trajectory_planned", + table: "t_trajectory_planned"); + + migrationBuilder.RenameTable( + name: "t_trajectory_planned", + newName: "t_planned_trajectory"); + + migrationBuilder.RenameIndex( + name: "IX_t_trajectory_planned_id_well", + table: "t_planned_trajectory", + newName: "IX_t_planned_trajectory_id_well"); + + migrationBuilder.RenameIndex( + name: "IX_t_trajectory_planned_id_user", + table: "t_planned_trajectory", + newName: "IX_t_planned_trajectory_id_user"); + + migrationBuilder.AddPrimaryKey( + name: "PK_t_planned_trajectory", + table: "t_planned_trajectory", + column: "id"); + + migrationBuilder.AddForeignKey( + name: "FK_t_planned_trajectory_t_user_id_user", + table: "t_planned_trajectory", + column: "id_user", + principalTable: "t_user", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_t_planned_trajectory_t_well_id_well", + table: "t_planned_trajectory", + column: "id_well", + principalTable: "t_well", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + } + } +} diff --git a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs index 71f6087c..ff169691 100644 --- a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs +++ b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs @@ -491,76 +491,6 @@ namespace AsbCloudDb.Migrations b.HasComment("Drill_test"); }); - modelBuilder.Entity("AsbCloudDb.Model.FactTrajectory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AzimuthGeo") - .HasColumnType("double precision") - .HasColumnName("azimuth_geo") - .HasComment("Азимут Географ."); - - b.Property("AzimuthMagnetic") - .HasColumnType("double precision") - .HasColumnName("azimuth_magnetic") - .HasComment("Азимут Магнитный"); - - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("Комментарии"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("ID пользователя который внес/изменил запись"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("ID скважины"); - - b.Property("Radius") - .HasColumnType("double precision") - .HasColumnName("radius") - .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("WellboreDepth") - .HasColumnType("double precision") - .HasColumnName("wellbore_depth") - .HasComment("Глубина по стволу"); - - b.Property("ZenithAngle") - .HasColumnType("double precision") - .HasColumnName("zenith_angle") - .HasComment("Угол зенитный"); - - b.HasKey("Id"); - - b.HasIndex("IdUser"); - - b.HasIndex("IdWell"); - - b.ToTable("t_fact_trajectory"); - - b.HasComment("Загрузка фактической траектории"); - }); - modelBuilder.Entity("AsbCloudDb.Model.Faq", b => { b.Property("Id") @@ -2487,93 +2417,11 @@ namespace AsbCloudDb.Migrations new { Id = 529, - Description = "Разрешение просматривать фактические траектории", - Name = "FactTrajectory.get" - }, - new - { - Id = 530, Description = "Разрешение редактировать фактические траектории", Name = "FactTrajectory.edit" - }, - new - { - Id = 531, - Description = "Разрешение просматривать фактические ннб-траектории", - Name = "NnbTrajectory.get" }); }); - modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AzimuthGeo") - .HasColumnType("double precision") - .HasColumnName("azimuth_geo") - .HasComment("Азимут Географ."); - - b.Property("AzimuthMagnetic") - .HasColumnType("double precision") - .HasColumnName("azimuth_magnetic") - .HasComment("Азимут Магнитный"); - - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("Комментарии"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("ID пользователя который внес/изменил запись"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("ID скважины"); - - b.Property("Radius") - .HasColumnType("double precision") - .HasColumnName("radius") - .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("WellboreDepth") - .HasColumnType("double precision") - .HasColumnName("wellbore_depth") - .HasComment("Глубина по стволу"); - - b.Property("ZenithAngle") - .HasColumnType("double precision") - .HasColumnName("zenith_angle") - .HasComment("Угол зенитный"); - - b.HasKey("Id"); - - b.HasIndex("IdUser"); - - b.HasIndex("IdWell"); - - b.ToTable("t_planned_trajectory"); - - b.HasComment("Загрузка плановой траектории"); - }); - modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => { b.Property("Id") @@ -4172,16 +4020,6 @@ namespace AsbCloudDb.Migrations { IdUserRole = 1, IdPermission = 529 - }, - new - { - IdUserRole = 1, - IdPermission = 530 - }, - new - { - IdUserRole = 1, - IdPermission = 531 }); }); @@ -5288,6 +5126,141 @@ namespace AsbCloudDb.Migrations b.HasComment("Наработка талевого каната"); }); + modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryFact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .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("VerticalDepth") + .HasColumnType("double precision") + .HasColumnName("vertical_depth") + .HasComment("Глубина вертикальная"); + + b.Property("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_trajectory_fact"); + + b.HasComment("Загрузка фактической траектории"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlanned", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("ID пользователя который внес/изменил запись"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("Radius") + .HasColumnType("double precision") + .HasColumnName("radius") + .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("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_trajectory_planned"); + + b.HasComment("Загрузка плановой траектории"); + }); + modelBuilder.Entity("AsbCloudDb.Model.User", b => { b.Property("Id") @@ -8164,25 +8137,6 @@ namespace AsbCloudDb.Migrations b.Navigation("Telemetry"); }); - modelBuilder.Entity("AsbCloudDb.Model.FactTrajectory", b => - { - 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.Navigation("User"); - - b.Navigation("Well"); - }); - modelBuilder.Entity("AsbCloudDb.Model.Faq", b => { b.HasOne("AsbCloudDb.Model.User", "AuthorAnswer") @@ -8395,25 +8349,6 @@ namespace AsbCloudDb.Migrations b.Navigation("Well"); }); - modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => - { - 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.Navigation("User"); - - b.Navigation("Well"); - }); - modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => { b.HasOne("AsbCloudDb.Model.User", "User") @@ -8721,6 +8656,44 @@ namespace AsbCloudDb.Migrations 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlanned", b => + { + 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.Navigation("User"); + + b.Navigation("Well"); + }); + modelBuilder.Entity("AsbCloudDb.Model.User", b => { b.HasOne("AsbCloudDb.Model.Company", "Company") diff --git a/AsbCloudDb/Model/AsbCloudDbContext.cs b/AsbCloudDb/Model/AsbCloudDbContext.cs index 6b111c96..e6b4b362 100644 --- a/AsbCloudDb/Model/AsbCloudDbContext.cs +++ b/AsbCloudDb/Model/AsbCloudDbContext.cs @@ -17,7 +17,7 @@ namespace AsbCloudDb.Model public virtual DbSet DailyReports => Set (); public virtual DbSet Deposits => Set(); public virtual DbSet DetectedOperations => Set(); - public virtual DbSet PlannedTrajectories => Set(); + public virtual DbSet PlannedTrajectories => Set(); public virtual DbSet ProcessMapWellDrillings => Set(); public virtual DbSet ProcessMapWellReams => Set(); public virtual DbSet DrillingProgramParts => Set(); @@ -60,7 +60,7 @@ namespace AsbCloudDb.Model public virtual DbSet LimitingParameter => Set(); public virtual DbSet TelemetryWirelineRunOut => Set(); - public virtual DbSet FactTrajectories => Set(); + public virtual DbSet FactTrajectories => Set(); // GTR WITS public DbSet WitsItemFloat => Set(); diff --git a/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs b/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs index c21b05c1..4b6bc2c8 100644 --- a/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs +++ b/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs @@ -162,9 +162,7 @@ new() { Id = 527, Name = "Manual.delete", Description = "Разрешение на удаление инструкций"}, new (){ Id = 528, Name="WellContact.delete", Description="Разрешение на удаление контакта"}, - new (){ Id = 529, Name="FactTrajectory.get", Description="Разрешение просматривать фактические траектории"}, - new (){ Id = 530, Name="FactTrajectory.edit", Description="Разрешение редактировать фактические траектории"}, - new (){ Id = 531, Name="NnbTrajectory.get", Description="Разрешение просматривать фактические ннб-траектории"}, + new (){ Id = 529, Name="FactTrajectory.edit", Description="Разрешение редактировать фактические траектории"} }; } } diff --git a/AsbCloudDb/Model/IAsbCloudDbContext.cs b/AsbCloudDb/Model/IAsbCloudDbContext.cs index e985dcbc..f30adffa 100644 --- a/AsbCloudDb/Model/IAsbCloudDbContext.cs +++ b/AsbCloudDb/Model/IAsbCloudDbContext.cs @@ -21,7 +21,7 @@ namespace AsbCloudDb.Model DbSet DailyReports { get; } DbSet Deposits { get; } DbSet DetectedOperations { get; } - DbSet PlannedTrajectories { get; } + DbSet PlannedTrajectories { get; } DbSet ProcessMapWellDrillings { get; } DbSet ProcessMapWellReams { get; } DbSet DrillingProgramParts { get; } @@ -78,7 +78,7 @@ namespace AsbCloudDb.Model DbSet ManualDirectories { get; } DbSet Contacts { get; } DbSet DrillTests { get; } - DbSet FactTrajectories { get; } + DbSet FactTrajectories { get; } DatabaseFacade Database { get; } Task RefreshMaterializedViewAsync(string mwName, CancellationToken token); diff --git a/AsbCloudDb/Model/Trajectory/PlannedTrajectory.cs b/AsbCloudDb/Model/Trajectory/PlannedTrajectory.cs deleted file mode 100644 index 6f66d977..00000000 --- a/AsbCloudDb/Model/Trajectory/PlannedTrajectory.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace AsbCloudDb.Model.Trajectory -{ - [Table("t_planned_trajectory"), Comment("Загрузка плановой траектории")] - public class PlannedTrajectory : Trajectory - { - - } -} diff --git a/AsbCloudDb/Model/Trajectory/Trajectory.cs b/AsbCloudDb/Model/Trajectory/Trajectory.cs index 21276e07..7d62ba41 100644 --- a/AsbCloudDb/Model/Trajectory/Trajectory.cs +++ b/AsbCloudDb/Model/Trajectory/Trajectory.cs @@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema; namespace AsbCloudDb.Model.Trajectory { - public class Trajectory : IId, IWellRelated + public abstract class Trajectory : IId, IWellRelated { [Column("id"), Key] public int Id { get; set; } @@ -37,9 +37,6 @@ namespace AsbCloudDb.Model.Trajectory [Column("comment"), Comment("Комментарии")] public string? Comment { get; set; } - [Column("radius"), Comment("Радиус цели")] - public double? Radius { get; set; } - [ForeignKey(nameof(IdWell))] public virtual Well Well { get; set; } = null!; diff --git a/AsbCloudDb/Model/Trajectory/FactTrajectory.cs b/AsbCloudDb/Model/Trajectory/TrajectoryFact.cs similarity index 63% rename from AsbCloudDb/Model/Trajectory/FactTrajectory.cs rename to AsbCloudDb/Model/Trajectory/TrajectoryFact.cs index 793c9fd9..26165da9 100644 --- a/AsbCloudDb/Model/Trajectory/FactTrajectory.cs +++ b/AsbCloudDb/Model/Trajectory/TrajectoryFact.cs @@ -3,8 +3,8 @@ using System.ComponentModel.DataAnnotations.Schema; namespace AsbCloudDb.Model.Trajectory { - [Table("t_fact_trajectory"), Comment("Загрузка фактической траектории")] - public class FactTrajectory : Trajectory + [Table("t_trajectory_fact"), Comment("Загрузка фактической траектории")] + public class TrajectoryFact : Trajectory { } } diff --git a/AsbCloudDb/Model/Trajectory/TrajectoryPlanned.cs b/AsbCloudDb/Model/Trajectory/TrajectoryPlanned.cs new file mode 100644 index 00000000..20f54025 --- /dev/null +++ b/AsbCloudDb/Model/Trajectory/TrajectoryPlanned.cs @@ -0,0 +1,12 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AsbCloudDb.Model.Trajectory +{ + [Table("t_trajectory_planned"), Comment("Загрузка плановой траектории")] + public class TrajectoryPlanned : Trajectory + { + [Column("radius"), Comment("Радиус цели")] + public double? Radius { get; set; } + } +} diff --git a/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj b/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj index 500a98cd..3c1998a9 100644 --- a/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj +++ b/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj @@ -17,6 +17,7 @@ + @@ -35,9 +36,9 @@ - - - + + + diff --git a/AsbCloudInfrastructure/DependencyInjection.cs b/AsbCloudInfrastructure/DependencyInjection.cs index 167139af..f5e42563 100644 --- a/AsbCloudInfrastructure/DependencyInjection.cs +++ b/AsbCloudInfrastructure/DependencyInjection.cs @@ -6,6 +6,7 @@ using AsbCloudApp.Data.Manuals; using AsbCloudApp.Data.ProcessMaps; using AsbCloudApp.Data.SAUB; using AsbCloudApp.Data.Subsystems; +using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Data.WellOperationImport.Options; using AsbCloudApp.Repositories; using AsbCloudApp.Services; @@ -33,6 +34,8 @@ using AsbCloudInfrastructure.Services.ProcessMaps.WellDrilling; using AsbCloudInfrastructure.Services.SAUB; using AsbCloudInfrastructure.Services.Subsystems; using AsbCloudInfrastructure.Services.Trajectory; +using AsbCloudInfrastructure.Services.Trajectory.Export; +using AsbCloudInfrastructure.Services.Trajectory.Import; using AsbCloudInfrastructure.Services.WellOperationImport; using AsbCloudInfrastructure.Services.WellOperationImport.FileParser; using AsbCloudInfrastructure.Services.WellOperationService; @@ -182,10 +185,11 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - //services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -248,8 +252,8 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient, TrajectoryEditableRepository>(); - services.AddTransient, TrajectoryEditableRepository>(); + services.AddTransient, TrajectoryEditableRepository>(); + services.AddTransient, TrajectoryEditableRepository>(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs index a48312ba..8656039f 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs @@ -1,4 +1,4 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Exceptions; using AsbCloudApp.Repositories; using AsbCloudApp.Services; diff --git a/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs index 57095d4e..b131fa19 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs @@ -1,4 +1,4 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Repositories; using AsbCloudApp.Services; using AsbCloudDb.Model; diff --git a/AsbCloudInfrastructure/Services/Trajectory/TrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryExportService.cs similarity index 51% rename from AsbCloudInfrastructure/Services/Trajectory/TrajectoryImportService.cs rename to AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryExportService.cs index 5587789e..5f8b8fdd 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/TrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryExportService.cs @@ -1,4 +1,4 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Repositories; using AsbCloudApp.Services; using ClosedXML.Excel; @@ -9,31 +9,41 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace AsbCloudInfrastructure.Services.Trajectory +namespace AsbCloudInfrastructure.Services.Trajectory.Export { - public abstract class TrajectoryImportService where T : TrajectoryGeoDto + public abstract class TrajectoryExportService where T : TrajectoryGeoDto { private readonly IWellService wellService; private readonly ITrajectoryRepository trajectoryService; protected abstract void AddCoordinatesToRow(IXLRow row, T trajectory); - protected abstract T ParseRow(IXLRow row); public abstract string templateFileName { get; set; } public abstract string usingTemplateFile { get; set; } - public abstract string sheetNamePlannedTrajectory { get; set; } + public abstract string sheetTrajectory { get; set; } public abstract int headerRowsCount { get; set; } public abstract int ColumnWellboreDepth { get; set; } public abstract int ColumnZenithAngle { get; set; } public abstract int ColumnAzimuthGeo { get; set; } public abstract int ColumnAzimuthMagnetic { get; set; } public abstract int ColumnVerticalDepth { get; set; } - public abstract int ColumnRadius { get; set; } public abstract int ColumnComment { get; set; } - public TrajectoryImportService(ITrajectoryRepository trajectoryService, IWellService wellService) + public TrajectoryExportService(IWellService wellService, ITrajectoryRepository trajectoryService) { - this.trajectoryService = trajectoryService; this.wellService = wellService; + this.trajectoryService = trajectoryService; + } + + public async Task ExportAsync(int idWell, CancellationToken token) + { + var trajectorys = await trajectoryService.GetAsync(idWell, token); + return MakeExelFileStream(trajectorys); + } + + public async Task GetFileNameAsync(int idWell, CancellationToken token) + { + var caption = await wellService.GetWellCaptionByIdAsync(idWell, token); + return string.Format("{0}_{1}", caption, templateFileName); } public Stream GetTemplateFile() @@ -45,12 +55,6 @@ namespace AsbCloudInfrastructure.Services.Trajectory return stream; } - public async Task ExportAsync(int idWell, CancellationToken token) - { - var trajectorys = await trajectoryService.GetAsync(idWell, token); - return MakeExelFileStream(trajectorys); - } - private Stream MakeExelFileStream(IEnumerable trajectories) { using Stream ecxelTemplateStream = GetTemplateFile(); @@ -66,9 +70,9 @@ namespace AsbCloudInfrastructure.Services.Trajectory { if (trajectories.Any()) { - var sheet = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetNamePlannedTrajectory); + var sheet = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetTrajectory); if (sheet is null) - throw new FileFormatException($"Лист с именем {sheetNamePlannedTrajectory} отсутствует, либо имеет некорректное название"); + throw new FileFormatException($"Лист с именем {sheetTrajectory} отсутствует, либо имеет некорректное название"); AddTrajecoryToSheet(sheet, trajectories); } } @@ -82,75 +86,5 @@ namespace AsbCloudInfrastructure.Services.Trajectory AddCoordinatesToRow(row, rowList[i]); } } - - public async Task GetFileNameAsync(int idWell, CancellationToken token) - { - var caption = await wellService.GetWellCaptionByIdAsync(idWell, token); - return string.Format("{0}_{1}", caption, templateFileName); - } - - public async Task> ImportAsync(int idWell, int idUser, Stream stream, CancellationToken token) - { - using var workbook = new XLWorkbook(stream, XLEventTracking.Disabled); - var trajectoryRows = ParseFileStream(stream); - foreach (var row in trajectoryRows) - { - row.IdWell = idWell; - row.IdUser = idUser; - } - - return trajectoryRows; - } - - - private IEnumerable ParseFileStream(Stream stream) - { - using var workbook = new XLWorkbook(stream, XLEventTracking.Disabled); - return ParseWorkbook(workbook); - } - - private IEnumerable ParseWorkbook(IXLWorkbook workbook) - { - var sheetTrajectory = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetNamePlannedTrajectory); - if (sheetTrajectory is null) - throw new FileFormatException($"Книга excel не содержит листа {sheetNamePlannedTrajectory}."); - var trajectoryRows = ParseSheet(sheetTrajectory); - return trajectoryRows; - } - - private IEnumerable ParseSheet(IXLWorksheet sheet) - { - if (sheet.RangeUsed().RangeAddress.LastAddress.ColumnNumber < 7) - throw new FileFormatException($"Лист {sheet.Name} содержит меньшее количество столбцов."); - - var count = sheet.RowsUsed().Count() - headerRowsCount; - - if (count > 1024) - throw new FileFormatException($"Лист {sheet.Name} содержит слишком большое количество строк."); - - if (count <= 0) - throw new FileFormatException($"Лист {sheet.Name} некорректного формата либо пустой"); - - var trajectoryRows = new List(count); - var parseErrors = new List(); - for (int i = 0; i < count; i++) - { - var row = sheet.Row(1 + i + headerRowsCount); - try - { - var trajectoryRow = ParseRow(row); - trajectoryRows.Add(trajectoryRow); - } - catch (FileFormatException ex) - { - parseErrors.Add(ex.Message); - } - } - - if (parseErrors.Any()) - throw new FileFormatException(string.Join("\r\n", parseErrors)); - - return trajectoryRows; - } } } diff --git a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs new file mode 100644 index 00000000..3a7ebf12 --- /dev/null +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs @@ -0,0 +1,41 @@ +using AsbCloudApp.Data.Trajectory; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using ClosedXML.Excel; + +namespace AsbCloudInfrastructure.Services.Trajectory.Export +{ + + public class TrajectoryFactManualExportService : TrajectoryExportService + { + public override string templateFileName { get; set; } = "TrajectoryFactManualTemplate.xlsx"; + public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; + public override string sheetTrajectory { get; set; } = "Фактическая траектория"; + public override int headerRowsCount { get; set; } = 2; + public override int ColumnWellboreDepth { get; set; } = 1; + public override int ColumnZenithAngle { get; set; } = 2; + public override int ColumnAzimuthGeo { get; set; } = 3; + public override int ColumnAzimuthMagnetic { get; set; } = 4; + public override int ColumnVerticalDepth { get; set; } = 5; + public override int ColumnComment { get; set; } = 6; + + public TrajectoryFactManualExportService( + IWellService wellService, + ITrajectoryEditableRepository factTrajectoryService) + : base(wellService, factTrajectoryService) + { + + } + + protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoFactDto trajectory) + { + row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; + row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; + row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; + row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; + row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; + row.Cell(ColumnComment).Value = trajectory.Comment; + } + } +} + diff --git a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs new file mode 100644 index 00000000..5c34fc21 --- /dev/null +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs @@ -0,0 +1,41 @@ +using AsbCloudApp.Data.Trajectory; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using ClosedXML.Excel; + +namespace AsbCloudInfrastructure.Services.Trajectory.Export +{ + + public class TrajectoryFactNnbExportService : TrajectoryExportService + { + public override string templateFileName { get; set; } = "TrajectoryFactNnbTemplate.xlsx"; + public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; + public override string sheetTrajectory { get; set; } = "Фактическая ннб-траектория"; + public override int headerRowsCount { get; set; } = 2; + public override int ColumnWellboreDepth { get; set; } = 1; + public override int ColumnZenithAngle { get; set; } = 2; + public override int ColumnAzimuthGeo { get; set; } = 3; + public override int ColumnAzimuthMagnetic { get; set; } = 4; + public override int ColumnVerticalDepth { get; set; } = 5; + public override int ColumnComment { get; set; } = 6; + + public TrajectoryFactNnbExportService( + IWellService wellService, + ITrajectoryNnbRepository nnbTrajectoryService) + : base(wellService, nnbTrajectoryService) + { + + } + + protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoFactDto trajectory) + { + row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; + row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; + row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; + row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; + row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; + row.Cell(ColumnComment).Value = trajectory.Comment; + } + } +} + diff --git a/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlannedExportService.cs similarity index 50% rename from AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryImportService.cs rename to AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlannedExportService.cs index 869de4d7..26160885 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/NnbTrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlannedExportService.cs @@ -1,34 +1,35 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Repositories; using AsbCloudApp.Services; using ClosedXML.Excel; -namespace AsbCloudInfrastructure.Services.Trajectory +namespace AsbCloudInfrastructure.Services.Trajectory.Export { - - public class NnbTrajectoryImportService : TrajectoryImportService + public class TrajectoryPlannedExportService : TrajectoryExportService { - public override string templateFileName { get; set; } = "NnbTrajectoryTemplate.xlsx"; + /* + * password for PlannedTrajectoryTemplate.xlsx is Drill2022 + */ + public override string templateFileName { get; set; } = "TrajectoryPlannedTemplate.xlsx"; public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; - public override string sheetNamePlannedTrajectory { get; set; } = "Фактическая ннб-траектория"; + public override string sheetTrajectory { get; set; } = "Плановая траектория"; public override int headerRowsCount { get; set; } = 2; public override int ColumnWellboreDepth { get; set; } = 1; public override int ColumnZenithAngle { get; set; } = 2; public override int ColumnAzimuthGeo { get; set; } = 3; public override int ColumnAzimuthMagnetic { get; set; } = 4; public override int ColumnVerticalDepth { get; set; } = 5; - public override int ColumnRadius { get; set; } = 6; + public int ColumnRadius { get; set; } = 6; public override int ColumnComment { get; set; } = 7; - public NnbTrajectoryImportService( + public TrajectoryPlannedExportService( IWellService wellService, - ITrajectoryNnbRepository nnbTrajectoryService) - : base(nnbTrajectoryService, wellService) + ITrajectoryEditableRepository plannedTrajectoryService) + : base(wellService, plannedTrajectoryService) { - } - protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoFactDto trajectory) + protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoPlanDto trajectory) { row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; @@ -38,22 +39,7 @@ namespace AsbCloudInfrastructure.Services.Trajectory row.Cell(ColumnRadius).Value = trajectory.Radius; row.Cell(ColumnComment).Value = trajectory.Comment; } - - protected override TrajectoryGeoFactDto ParseRow(IXLRow row) - { - var trajectoryRow = new TrajectoryGeoFactDto - { - WellboreDepth = row.Cell(ColumnWellboreDepth).GetCellValue(), - ZenithAngle = row.Cell(ColumnZenithAngle).GetCellValue(), - AzimuthGeo = row.Cell(ColumnAzimuthGeo).GetCellValue(), - AzimuthMagnetic = row.Cell(ColumnAzimuthMagnetic).GetCellValue(), - VerticalDepth = row.Cell(ColumnVerticalDepth).GetCellValue(), - Radius = row.Cell(ColumnRadius).GetCellValue(), - Comment = row.Cell(ColumnComment).GetCellValue() - }; - - return trajectoryRow; - } } + } diff --git a/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualImportService.cs similarity index 55% rename from AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs rename to AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualImportService.cs index defc5207..fb22794e 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/FactTrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualImportService.cs @@ -1,14 +1,14 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Repositories; using AsbCloudApp.Services; using ClosedXML.Excel; -namespace AsbCloudInfrastructure.Services.Trajectory +namespace AsbCloudInfrastructure.Services.Trajectory.Import { - public class FactTrajectoryImportService : TrajectoryImportService + public class TrajectoryFactManualImportService : TrajectoryImportService { - public override string templateFileName { get; set; } = "FactTrajectoryTemplate.xlsx"; + public override string templateFileName { get; set; } = "TrajectoryFactManualTemplate.xlsx"; public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; public override string sheetNamePlannedTrajectory { get; set; } = "Фактическая траектория"; public override int headerRowsCount { get; set; } = 2; @@ -17,28 +17,13 @@ namespace AsbCloudInfrastructure.Services.Trajectory public override int ColumnAzimuthGeo { get; set; } = 3; public override int ColumnAzimuthMagnetic { get; set; } = 4; public override int ColumnVerticalDepth { get; set; } = 5; - public override int ColumnRadius { get; set; } = 6; - public override int ColumnComment { get; set; } = 7; + public override int ColumnComment { get; set; } = 6; - public FactTrajectoryImportService( - IWellService wellService, - ITrajectoryEditableRepository factTrajectoryService) - : base(factTrajectoryService, wellService) + public TrajectoryFactManualImportService() : base() { } - protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoFactDto trajectory) - { - row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; - row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; - row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; - row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; - row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; - row.Cell(ColumnRadius).Value = trajectory.Radius; - row.Cell(ColumnComment).Value = trajectory.Comment; - } - protected override TrajectoryGeoFactDto ParseRow(IXLRow row) { var trajectoryRow = new TrajectoryGeoFactDto @@ -48,7 +33,6 @@ namespace AsbCloudInfrastructure.Services.Trajectory AzimuthGeo = row.Cell(ColumnAzimuthGeo).GetCellValue(), AzimuthMagnetic = row.Cell(ColumnAzimuthMagnetic).GetCellValue(), VerticalDepth = row.Cell(ColumnVerticalDepth).GetCellValue(), - Radius = row.Cell(ColumnRadius).GetCellValue(), Comment = row.Cell(ColumnComment).GetCellValue() }; diff --git a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryImportService.cs new file mode 100644 index 00000000..9c357dcb --- /dev/null +++ b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryImportService.cs @@ -0,0 +1,92 @@ +using AsbCloudApp.Data.Trajectory; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using ClosedXML.Excel; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace AsbCloudInfrastructure.Services.Trajectory.Import +{ + public abstract class TrajectoryImportService where T : TrajectoryGeoDto + { + private readonly IWellService wellService; + + protected abstract T ParseRow(IXLRow row); + public abstract string templateFileName { get; set; } + public abstract string usingTemplateFile { get; set; } + public abstract string sheetNamePlannedTrajectory { get; set; } + public abstract int headerRowsCount { get; set; } + public abstract int ColumnWellboreDepth { get; set; } + public abstract int ColumnZenithAngle { get; set; } + public abstract int ColumnAzimuthGeo { get; set; } + public abstract int ColumnAzimuthMagnetic { get; set; } + public abstract int ColumnVerticalDepth { get; set; } + public abstract int ColumnComment { get; set; } + + public TrajectoryImportService() + { + } + + public async Task> ImportAsync(Stream stream, CancellationToken token) + { + using var workbook = new XLWorkbook(stream, XLEventTracking.Disabled); + var trajectoryRows = ParseFileStream(stream); + + return trajectoryRows; + } + + + private IEnumerable ParseFileStream(Stream stream) + { + using var workbook = new XLWorkbook(stream, XLEventTracking.Disabled); + return ParseWorkbook(workbook); + } + + private IEnumerable ParseWorkbook(IXLWorkbook workbook) + { + var sheetTrajectory = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetNamePlannedTrajectory); + if (sheetTrajectory is null) + throw new FileFormatException($"Книга excel не содержит листа {sheetNamePlannedTrajectory}."); + var trajectoryRows = ParseSheet(sheetTrajectory); + return trajectoryRows; + } + + private IEnumerable ParseSheet(IXLWorksheet sheet) + { + if (sheet.RangeUsed().RangeAddress.LastAddress.ColumnNumber < 6) + throw new FileFormatException($"Лист {sheet.Name} содержит меньшее количество столбцов."); + + var count = sheet.RowsUsed().Count() - headerRowsCount; + + if (count > 1024) + throw new FileFormatException($"Лист {sheet.Name} содержит слишком большое количество строк."); + + if (count <= 0) + throw new FileFormatException($"Лист {sheet.Name} некорректного формата либо пустой"); + + var trajectoryRows = new List(count); + var parseErrors = new List(); + for (int i = 0; i < count; i++) + { + var row = sheet.Row(1 + i + headerRowsCount); + try + { + var trajectoryRow = ParseRow(row); + trajectoryRows.Add(trajectoryRow); + } + catch (FileFormatException ex) + { + parseErrors.Add(ex.Message); + } + } + + if (parseErrors.Any()) + throw new FileFormatException(string.Join("\r\n", parseErrors)); + + return trajectoryRows; + } + } +} diff --git a/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedImportService.cs similarity index 60% rename from AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs rename to AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedImportService.cs index 296a4002..386a9b41 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedImportService.cs @@ -1,17 +1,16 @@ -using AsbCloudApp.Data; -using AsbCloudApp.Repositories; +using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Services; using ClosedXML.Excel; -namespace AsbCloudInfrastructure.Services.Trajectory +namespace AsbCloudInfrastructure.Services.Trajectory.Import { - public class PlannedTrajectoryImportService : TrajectoryImportService + public class TrajectoryPlannedImportService : TrajectoryImportService { /* * password for PlannedTrajectoryTemplate.xlsx is Drill2022 */ - public override string templateFileName { get; set; } = "PlannedTrajectoryTemplate.xlsx"; + public override string templateFileName { get; set; } = "TrajectoryPlannedTemplate.xlsx"; public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; public override string sheetNamePlannedTrajectory { get; set; } = "Плановая траектория"; public override int headerRowsCount { get; set; } = 2; @@ -20,13 +19,10 @@ namespace AsbCloudInfrastructure.Services.Trajectory public override int ColumnAzimuthGeo { get; set; } = 3; public override int ColumnAzimuthMagnetic { get; set; } = 4; public override int ColumnVerticalDepth { get; set; } = 5; - public override int ColumnRadius { get; set; } = 6; + public int ColumnRadius { get; set; } = 6; public override int ColumnComment { get; set; } = 7; - public PlannedTrajectoryImportService( - IWellService wellService, - ITrajectoryEditableRepository plannedTrajectoryService) - : base(plannedTrajectoryService, wellService) + public TrajectoryPlannedImportService() : base() { } @@ -45,17 +41,6 @@ namespace AsbCloudInfrastructure.Services.Trajectory return trajectoryRow; } - - protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoPlanDto trajectory) - { - row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; - row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; - row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; - row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; - row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; - row.Cell(ColumnRadius).Value = trajectory.Radius; - row.Cell(ColumnComment).Value = trajectory.Comment; - } } } diff --git a/AsbCloudInfrastructure/Services/Trajectory/Templates/FactTrajectoryTemplate.xlsx b/AsbCloudInfrastructure/Services/Trajectory/Templates/FactTrajectoryTemplate.xlsx deleted file mode 100644 index 219043d6cf2b5e7a3ed2a7da4b7060e78cb53691..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6885 zcmb7J1yohtwx&xsbW1nV4H6~a^d{cm?x7odcXqy!JfB`{0U0%031){FWx12#HSxg$Pp4Qpw5{)o z@)NL|CVQqZBF{n`UTL~=-I#`M1nKNW;@F#O<<0pbv<4|!gLrLZDIR->aznML6R2GJ z$rlFO?L;x{5#|uU56snDbeuAlnXsYYPq3zUE+~%eY2Rq{v zq>)yfAP#dUPemH<7YYYC_+;FMauK@OS3?`PD)PuE!Rb8d2X{sog@b`n`LAZeynDmV zirv-L0c31z3u1G#wu(}hw^`)CS~|mnJFBO?wIodr)Tobxx$aa-;H8UVnZaX%mD_gYn$=+1z>xUq7ty?DFQF)MJT!_oZS#Cy~}iuqVaw=P_H(=&O-N?-EDIJ1vwtz{2f0$IKs-JHLD44pxx_=8D5#gI*5ABE z_JsSa@@eu!c&swc2xI^<`4|$ljx*+KO=cb!aGgD$L^G;e?d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`aR&>dWjC3SWk-miz(0`$j{TSSbZ)5t4}t7Zs$a}~Rv z{NpfdkZ2bmN*C`QPYtv$%rDq%z(&`rU-}at5*@LhSt7?qk^bYQ+pQz6>6ULU(|#T zT$42Du?@;PEN)B}bFPhQ%6$tp(vr~uk4oSJP_(5FG*f&urB&y@1gSOI9X;(#Gsb-9 zw4~FvQtswD&iV$f*d1c;Nk^4tPeIYti||9&6=E@V?G!hI|Fg>H$ZS7=oZJ(6WTOd( zvizlG;`pkt9kHBW@souz4M$+~H;K<0SeHfoMZR0D*a$N$`PmV3mlPS#21NQdw~o?J zMMGa5(l~$UvpEyK>cj4am@hZ`u?L1swcKt@?|jO|J}(B`Ub14BkCF3#a(xvboWz<; zrR&YtUUz{?VOr*1$dGgIr?F+~cJsT~`-FJ!Cs;T9!n1BL&j2geJ4GCo8@ z?;-Zz#Bev&AAtLx%nt#Nd%*NJCEtOocg(-x(?3}sHaho+$Zz^~*Z%x#-v5P<{3+#O zk-l$=eiQdyV!L0!pDog#5*`+_`(pl^+U_dYorM2V+W(aEFx%djzTY&9^M4e=KiMDV zmiv_an|$u{`ga}uSAzbN`{5USpMQSS82$t9-`VI-0S`m#KLvmZU|{}_&t63y5$S#w Pw7bjiuD~e&^5OpgT_E7< diff --git a/AsbCloudInfrastructure/Services/Trajectory/Templates/NnbTrajectoryTemplate.xlsx b/AsbCloudInfrastructure/Services/Trajectory/Templates/NnbTrajectoryTemplate.xlsx deleted file mode 100644 index b6bc4bbf778127584baf9acdf27bfe3b6f93a6df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11600 zcmeHt1AATT*7k~R+iq;zcG9Sg?KHOS22Io0w%yohjK*x#Sl`+>r+a7b?-#shu4_$? z`<;+EkTRC zVF!o$(VNOtS-l#%n?l)oLWlB_54(JcQd>l5%bMX{Tao-7Tw!#%<2nD6)EDu9yfTgG z+PFyeENq0+Q^=WmD7mI3Lk3II7g7pL_BvSBz3vNz1Ci1&K~ai!+T9Y+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X=MKLe$co)VLxB+mg4J5n}l@zN$_K;-Axa@|_=S za$m_~n=R~}%|oa??6bWrXNm6CwKM_nNxYr)!R`Ie>(Ud4IKa#uV1^p*j^|pqaGUt#P<@I9)i7PN_t@6?o~2W>eiR|ogc$S=GY%epr@ePP!NZG zpRlDo7$fR;DqBP@?OWP^hi*%gl+-!nuTU<~eO~^q=ZdsOkF{6Ud3N>dCyu2-O}YIL zV=ZZ&yg_k7Y&31DUCl%( zG+W-r-Z=7|pAa4p0Dc`K+(*vujuHNo?j0)p&UhaKy#v;N5&f;I-(dFNnePJ}cQENM zO1OnoZ<&9AroXe^Z)@%lkY99i+wA`E3cimGD1m`|on@XWP5l_lx@R{+~+tJNy0Ia+i{S5$twd|1P9|C+Od~?|;E} u`R5mP5Z>edm5qKEa6h#EQ$X4y0O0@m>{aBEQSP*0++IGn1xE5uAO0Uh{oVcm literal 0 HcmV?d00001 diff --git a/AsbCloudInfrastructure/Services/Trajectory/Templates/TrajectoryFactNnbTemplate.xlsx b/AsbCloudInfrastructure/Services/Trajectory/Templates/TrajectoryFactNnbTemplate.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..54bd69aef6bb1865d6224c7092ec44dde59f15fd GIT binary patch literal 6881 zcmb7p1yo$ivi3kANYKH9I|O$LZo%E%28Y3e1cC+k;K7~XPH@-YZi59$fZ)O5!8!Nc zaPz-=*7|F&y=T^5Rn^^9wX3SXR+M=Lg9(6#hX)udz0&|Zp%)MT4IDu>PE3rC&(hcq z`7UOpzyr_FSLYndLhxDnO|p_rr0hiP6n6NvAvxXt$G^ldfJhNlU6Bsn@9&KBAhLG! z5N0YF{SY;+5a<>v6R(2qp*sh6CeGn(?_PB7H_BkqSB_B%(x+e7ga>myouj1@cTVJF z#-X-N_Dli%LP3stYHwNZOoO)qwD!V*4(96FbMIlA1LSP2Iqal}2|NVY)-}jJlDhUw z%jUc*;BE#Yg8~uVAt0|WLn{YyD0oQBl5*&Yq+37xu_x;zNpItZz9%JNG=AA~v^P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iEtIG_fg%q@msHWN^11Tg?=+*s%+Tkghs|9Pe-awt z@88}zN;wk<);l0~sp+#j=ey}c@9s2*H2N_42TeBJZ%zN0%0j;=M7h6WKrbC7;+lG^ z=f@Y%kU*;K#o1bWi9l>x;+{vH@#v>f2wAK7L+nk#KKcm?8WZsQFySeF{&<-1pY-Ht z;ZMP*5a=Vk{+p;DhWZ0+|5NxWzVV2X{-(4CMD;=VH)i^$=+n055dis3w-3$EzsCK4 z;E+GHJgw4?EzoZgen@PO6Zo?s`cuQxYW7&oe^bLl3474+UuyfGdY)$6$J+OsCV>A( zCHzzTX>NH;$-l|tVO{?&r2k6Le@Z|7f*ключ скважины /// /// - public async Task, IEnumerable, IEnumerable>> GetTrajectoryCartesianAsync(int idWell, CancellationToken token) + public async Task, IEnumerable>> GetTrajectoryCartesianAsync(int idWell, CancellationToken token) { - var result = new PlanFactBase, IEnumerable, IEnumerable>(); + var result = new TrajectoryPlanFactDto, IEnumerable>(); result.Plan = await trajectoryPlanService.GetAsync(idWell, token); - result.Fact = await trajectoryFactService.GetAsync(idWell, token); - result.Nnb = await trajectoryNnbService.GetAsync(idWell, token); + result.FactManual = await trajectoryFactService.GetAsync(idWell, token); + result.FactNnb = await trajectoryNnbService.GetAsync(idWell, token); return result; } diff --git a/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj b/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj index 4cf2783e..4cb7f7b1 100644 --- a/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj +++ b/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj @@ -8,6 +8,16 @@ enable + + + + + + + + + + diff --git a/AsbCloudWebApi.Tests/Services/Trajectory/Templates/TrajectoryFactManualTemplate.xlsx b/AsbCloudWebApi.Tests/Services/Trajectory/Templates/TrajectoryFactManualTemplate.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..bc7aef584e0010b6429c1cd2a336f61e12d96c4a GIT binary patch literal 6962 zcma)B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x~{e%ID7a+G@apn_|w%44b(kOMBHT(DQBUF!l6hu+9OM z!>4YmbN-udtd2I5r8@8DenI2)KQ||LCf;LRd_ezs#e!8bOv*jsq~pt-Lz>A}_X z`4XATsMsZsF6$vq!%LJ+Cil5F0sjyuXcz$0@6(CLg#5$l#J|gJe|g^*nDk#U F{2xi8>Bay6 literal 0 HcmV?d00001 diff --git a/AsbCloudWebApi.Tests/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx b/AsbCloudWebApi.Tests/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..42185e1ff573e375d8684c8457c1db7d0490488d GIT binary patch literal 7118 zcma)B1yoh-(xy|oLAtv`QW_4O(jgqeLm#@~Aky7PNUD?|DJ5_~I;A@#lm_Ye!SDXR zT)+Q*>&{;L#9A}6_n!CJGxI*9t^|*O4}*e&0%L69^9<&Jpx^yAbphIeIXUh>%M#jD zJGdT&?)gNpobt~&Vj5ZJRb@@DzdjRT-<9;qme zz;0M@Ci_@{A^t+Pxc~ zobOvK)P#!x3`O%=0QxobE$$^@l04#4P{B#1Uf=B|9IK0=zE0}fN=w80)UfX2^!ylU zpb0mG%i7gPh1O3&c{hiEoYxc(X^?%@w~nW-gpBesgD+$EE(n8gFfi)>F-%x@8lHBX z9*!=c=Z=mb4o`c#Xe}j&SuX7PQ+&A7TJf8&0&K|d>}X*xAXy9`0I7Z{vnJKnl&VH< zH=;|32{n^?uFc46$rcUy>Z~FgB4dRW-?R1R^pSl_EvF6ABrDAjsG~O&HoiM4TvlPh zSeZ<0#YS2d(14Gfz;5Hh<1JvMR1;NbB19^q96QOfk8(SBjd&L zcTHFoH%v3MU8L+uH}qbFY1&6$Z_T>dEKs9>RV+`_#KPcIF{&n?u=0~&@OCY`aCW}| zo@Wp$h~$Y6iC1TfL&oH-bkS_;#UkMS%;6VA_BxzJqPutBGX}c&Y$N z*F(yxSxsm&xQ&@Ck`+yim{%}o%3%b!P~hh4zIv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$l9F!k=P5AM!?elA04M+aA+ zgR7~wmlF_d{A+if)OW|rW6PdiM|2zFHv)sO0kep)^xAo)@s*6>wpVdGDJOgBbm}_v z)!NZ|`Um~Z)>h9&GRxhPOFtt62hyT8LO3z-Xtx=Q=i7aVB2^}?q>PROgV#@qGr?_b~GoV~@oyF8=?^W>R}u#n#`U;ZQv)+Qge<< zX<6!3$e44Fzo7-17VA6geMP)qCs;UqnBS9=hr@#V$;rRVgE`8dh7XzF`&q(oVZ6K4 zACrYYjUSRb_vG+zNxUPH?~H#_#ebSUY<2G0pWm{B{D0T|8yEDamxpEgzAgGKq<0nQ z{s#VRlK%AYu$diE-`VI-2M?k3?+)UKU|{~A*Ir!-5$XOaXm>~8U4aoIx&QY+ DiattY literal 0 HcmV?d00001 diff --git a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs b/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs new file mode 100644 index 00000000..ae8c1840 --- /dev/null +++ b/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs @@ -0,0 +1,128 @@ +using AsbCloudApp.Data.Trajectory; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using AsbCloudInfrastructure.Services.Trajectory.Export; +using NSubstitute; +using System; +using System.Threading; +using System.Threading.Tasks; +using Xunit; + +namespace AsbCloudWebApi.Tests.Services.Trajectory +{ + public class TrajectoryExportTest + { + private IWellService wellService; + private readonly ITrajectoryEditableRepository trajectoryPlannedRepository; + private readonly TrajectoryPlannedExportService trajectoryPlannedExportService; + + private readonly ITrajectoryEditableRepository trajectoryFactManualReposirory; + private readonly TrajectoryFactManualExportService trajectoryFactManualExportService; + + private readonly ITrajectoryNnbRepository trajectoryFactNnbRepository; + private readonly TrajectoryFactNnbExportService trajectoryFactNnbExportService; + + private readonly int idWell = 4; + + private readonly TrajectoryGeoPlanDto[] trajectoryPlannedRows = new TrajectoryGeoPlanDto[2] { + new TrajectoryGeoPlanDto() { + Id = 1, + AzimuthGeo = 1, + AzimuthMagnetic = 2, + Comment = "комментарий", + IdUser = 1, + IdWell = 4, + Radius = 3, + UpdateDate = DateTime.Now, + VerticalDepth = 100, + WellboreDepth = 100, + ZenithAngle = 10 + }, + new TrajectoryGeoPlanDto() { + Id = 2, + AzimuthGeo = 1, + AzimuthMagnetic = 2, + Comment = "комментарий", + IdUser = 1, + IdWell = 4, + Radius = 3, + UpdateDate = DateTime.Now, + VerticalDepth = 100, + WellboreDepth = 100, + ZenithAngle = 10 + }, + }; + + private readonly TrajectoryGeoFactDto[] trajectoryFactRows = new TrajectoryGeoFactDto[2] { + new TrajectoryGeoFactDto() { + Id = 1, + AzimuthGeo = 1, + AzimuthMagnetic = 2, + Comment = "комментарий", + IdUser = 1, + IdWell = 4, + UpdateDate = DateTime.Now, + VerticalDepth = 100, + WellboreDepth = 100, + ZenithAngle = 10 + }, + new TrajectoryGeoFactDto() { + Id = 2, + AzimuthGeo = 1, + AzimuthMagnetic = 2, + Comment = "комментарий", + IdUser = 1, + IdWell = 4, + UpdateDate = DateTime.Now, + VerticalDepth = 100, + WellboreDepth = 100, + ZenithAngle = 10 + }, + }; + + + public TrajectoryExportTest() + { + wellService = Substitute.For(); + trajectoryPlannedRepository = Substitute.For>(); + trajectoryPlannedExportService = new TrajectoryPlannedExportService(wellService, trajectoryPlannedRepository); + + trajectoryFactManualReposirory = Substitute.For>(); + trajectoryFactManualExportService = new TrajectoryFactManualExportService(wellService, trajectoryFactManualReposirory); + + trajectoryFactNnbRepository = Substitute.For(); + trajectoryFactNnbExportService = new TrajectoryFactNnbExportService(wellService, trajectoryFactNnbRepository); + } + + [Fact] + public async Task Export_trajectory_planned() + { + trajectoryPlannedRepository.GetAsync(idWell, CancellationToken.None) + .Returns(trajectoryPlannedRows); + + var stream = await trajectoryPlannedExportService.ExportAsync(idWell, CancellationToken.None); + Assert.True(stream.Length > 0); + + } + + [Fact] + public async Task Export_trajectory_fact_manual() + { + trajectoryFactManualReposirory.GetAsync(idWell, CancellationToken.None) + .Returns(trajectoryFactRows); + + var stream = await trajectoryFactManualExportService.ExportAsync(idWell, CancellationToken.None); + Assert.True(stream.Length > 0); + } + + [Fact] + public async Task Export_trajectory_fact_nnb() + { + trajectoryFactNnbRepository.GetAsync(idWell, CancellationToken.None) + .Returns(trajectoryFactRows); + + var stream = await trajectoryFactNnbExportService.ExportAsync(idWell, CancellationToken.None); + Assert.True(stream.Length > 0); + } + } +} diff --git a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryImportTest.cs b/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryImportTest.cs new file mode 100644 index 00000000..0250cefd --- /dev/null +++ b/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryImportTest.cs @@ -0,0 +1,53 @@ +using AsbCloudApp.Services; +using AsbCloudInfrastructure.Services.Trajectory; +using AsbCloudInfrastructure.Services.Trajectory.Import; +using NSubstitute; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Xunit; + +namespace AsbCloudWebApi.Tests.Services.Trajectory +{ + public class TrajectoryImportTest + { + private readonly TrajectoryPlannedImportService trajectoryPlannedImportService; + private readonly TrajectoryFactManualImportService trajectoryFactManualImportService; + + private string usingTemplateFile = "AsbCloudWebApi.Tests.Services.Trajectory.Templates"; + + public TrajectoryImportTest() + { + trajectoryPlannedImportService = new TrajectoryPlannedImportService(); + trajectoryFactManualImportService = new TrajectoryFactManualImportService(); + } + + [Fact] + public async Task Import_trajectory_planned() + { + var stream = System.Reflection.Assembly.GetExecutingAssembly() + .GetManifestResourceStream($"{usingTemplateFile}.TrajectoryPlannedTemplate.xlsx"); + + if (stream is null) + Assert.Fail("Файла для импорта не существует"); + + var trajectoryRows = await trajectoryPlannedImportService.ImportAsync(stream, CancellationToken.None); + + Assert.Equal(3, trajectoryRows.Count()); + } + + [Fact] + public async Task Import_trajectory_fact_manual() + { + var stream = System.Reflection.Assembly.GetExecutingAssembly() + .GetManifestResourceStream($"{usingTemplateFile}.TrajectoryFactManualTemplate.xlsx"); + + if (stream is null) + Assert.Fail("Файла для импорта не существует"); + + var trajectoryRows = await trajectoryFactManualImportService.ImportAsync(stream, CancellationToken.None); + + Assert.Equal(4, trajectoryRows.Count()); + } + } +} diff --git a/AsbCloudWebApi.Tests/Services/TrajectoryVisualizationServiceTest.cs b/AsbCloudWebApi.Tests/Services/TrajectoryVisualizationServiceTest.cs index c256e4ab..9a346a3d 100644 --- a/AsbCloudWebApi.Tests/Services/TrajectoryVisualizationServiceTest.cs +++ b/AsbCloudWebApi.Tests/Services/TrajectoryVisualizationServiceTest.cs @@ -1,4 +1,4 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Repositories; using AsbCloudInfrastructure.Services.Trajectory; using Moq; @@ -50,7 +50,7 @@ namespace AsbCloudWebApi.Tests.ServicesTests var service = new TrajectoryService(mockPlan.Object, mockFact.Object, mockNnb.Object); var result = await service.GetTrajectoryCartesianAsync(1, CancellationToken.None); Assert.Equal(plannedTrajectory.Length, result.Plan?.Count()); - Assert.Equal(actualTrajectory.Length, result.Fact?.Count()); + Assert.Equal(actualTrajectory.Length, result.FactManual?.Count()); } [Fact] @@ -82,7 +82,7 @@ namespace AsbCloudWebApi.Tests.ServicesTests var service = new TrajectoryService(mockPlan.Object, mockFact.Object, mockNnb.Object); var result = await service.GetTrajectoryCartesianAsync(1, CancellationToken.None); var lastPointPlan = result.Plan!.Last(); - var lastPointFact = result.Fact!.Last(); + var lastPointFact = result.FactManual!.Last(); Assert.Equal(0d, lastPointPlan.X, 0.1d); Assert.Equal(-50d, lastPointPlan.Y, 0.1d); @@ -116,7 +116,7 @@ namespace AsbCloudWebApi.Tests.ServicesTests var service = new TrajectoryService(mockPlanned.Object, mockFactual.Object, mockNnb.Object); var result = await service.GetTrajectoryCartesianAsync(1, CancellationToken.None); var lastPointPlan = result.Plan!.Last(); - var lastPointFact = result.Fact!.Last(); + var lastPointFact = result.FactManual!.Last(); var tolerancePlan = 0.001d; var toleranceFact = 0.001d; diff --git a/AsbCloudWebApi/Controllers/Trajectory/NnbTrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/NnbTrajectoryController.cs deleted file mode 100644 index 72dea0ef..00000000 --- a/AsbCloudWebApi/Controllers/Trajectory/NnbTrajectoryController.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using AsbCloudApp.Data; -using AsbCloudApp.Repositories; -using AsbCloudApp.Services; -using AsbCloudInfrastructure.Services; -using AsbCloudInfrastructure.Services.Trajectory; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace AsbCloudWebApi.Controllers.Trajectory; - -/// -/// Фактическая траектория из ННБ -/// -[Authorize] -[ApiController] -[Route("api/well/{idWell}/[controller]")] -public class NnbTrajectoryController : ControllerBase -{ - private readonly ITrajectoryNnbRepository trajectoryNnbRepository; - private readonly NnbTrajectoryImportService factNnbTrajectoryImportService; - private readonly IWellService wellService; - - public NnbTrajectoryController( - ITrajectoryNnbRepository trajectoryNnbRepository, - NnbTrajectoryImportService factNnbTrajectoryImportService, - IWellService wellService) - { - this.trajectoryNnbRepository = trajectoryNnbRepository; - this.factNnbTrajectoryImportService = factNnbTrajectoryImportService; - this.wellService = wellService; - this.wellService = wellService; - } - - /// - /// Метод получения всех строк фактических траекторий по id скважины из ННБ - /// - /// Id скважины - /// Токен отмены операции - /// - [HttpGet] - [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetRowsAsync([FromRoute] int idWell, - CancellationToken cancellationToken) - { - var nnbFactTrajectories = await trajectoryNnbRepository.GetAsync(idWell, - cancellationToken); - - return Ok(nnbFactTrajectories); - } - - /// - /// Формируем excel файл с текущими строками фактической ннб-траектории - /// - /// id скважины - /// Токен отмены задачи - /// Запрашиваемый файл - [HttpGet("export")] - [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public async Task ExportAsync([FromRoute] int idWell, CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, - token).ConfigureAwait(false)) - return Forbid(); - var stream = await factNnbTrajectoryImportService.ExportAsync(idWell, token); - var fileName = await factNnbTrajectoryImportService.GetFileNameAsync(idWell, token); - return File(stream, "application/octet-stream", fileName); - } - - private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) - { - int? idCompany = User.GetCompanyId(); - return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, - idWell, token).ConfigureAwait(false); - } -} \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs index 8bd2cca6..e37f02b2 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs @@ -1,12 +1,10 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Repositories; using AsbCloudApp.Services; -using AsbCloudInfrastructure.Services.Trajectory; +using AsbCloudInfrastructure.Services.Trajectory.Export; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using System.Collections.Generic; -using System.IO; using System.Threading; using System.Threading.Tasks; @@ -21,35 +19,21 @@ namespace AsbCloudWebApi.Controllers.Trajectory public abstract class TrajectoryController : ControllerBase where Tdto : TrajectoryGeoDto { - protected string fileName; + protected abstract string fileName { get; set; } private readonly IWellService wellService; - private readonly TrajectoryImportService trajectoryImportService; - private readonly ITrajectoryEditableRepository trajectoryRepository; + private readonly TrajectoryExportService trajectoryExportService; + private readonly ITrajectoryRepository trajectoryRepository; public TrajectoryController(IWellService wellService, - TrajectoryImportService trajectoryImportService, - ITrajectoryEditableRepository trajectoryRepository) + TrajectoryExportService trajectoryExportService, + ITrajectoryRepository trajectoryRepository) { - this.trajectoryImportService = trajectoryImportService; + this.trajectoryExportService = trajectoryExportService; this.wellService = wellService; this.trajectoryRepository = trajectoryRepository; } - /// - /// Возвращает excel шаблон для заполнения строк траектории - /// - /// Запрашиваемый файл - [HttpGet("template")] - [AllowAnonymous] - [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public IActionResult GetTemplate() - { - var stream = trajectoryImportService.GetTemplateFile(); - return File(stream, "application/octet-stream", fileName); - } - /// /// Формируем excel файл с текущими строками траектории /// @@ -64,57 +48,11 @@ namespace AsbCloudWebApi.Controllers.Trajectory if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); - var stream = await trajectoryImportService.ExportAsync(idWell, token); - var fileName = await trajectoryImportService.GetFileNameAsync(idWell, token); + var stream = await trajectoryExportService.ExportAsync(idWell, token); + var fileName = await trajectoryExportService.GetFileNameAsync(idWell, token); return File(stream, "application/octet-stream", fileName); } - /// - /// Импортирует координаты из excel (xlsx) файла - /// - /// id скважины - /// Коллекция из одного файла xlsx - /// Удалить операции перед импортом, если фал валидный - /// Токен отмены задачи - /// количество успешно записанных строк в БД - [HttpPost("import/{deleteBeforeImport}")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), (int)System.Net.HttpStatusCode.BadRequest)] - public async Task ImportAsync(int idWell, - [FromForm] IFormFileCollection files, - bool deleteBeforeImport, - CancellationToken token) - { - int? idUser = User.GetUserId(); - if (!idUser.HasValue) - return Forbid(); - if (!await CanUserAccessToWellAsync(idWell, - token).ConfigureAwait(false)) - return Forbid(); - if (files.Count < 1) - return this.ValidationBadRequest(nameof(files), "нет файла"); - var file = files[0]; - if (Path.GetExtension(file.FileName).ToLower() != ".xlsx") - return this.ValidationBadRequest(nameof(files), "Требуется xlsx файл."); - using Stream stream = file.OpenReadStream(); - - try - { - var trajectoryRows = await trajectoryImportService.ImportAsync(idWell, idUser.Value, stream, token); - - if (deleteBeforeImport) - await trajectoryRepository.DeleteByIdWellAsync(idWell, token); - - var rowsCount = await trajectoryRepository.AddRangeAsync(trajectoryRows, token); - - return Ok(rowsCount); - } - catch (FileFormatException ex) - { - return this.ValidationBadRequest(nameof(files), ex.Message); - } - } - /// /// Получаем список всех строк координат траектории (для клиента) /// @@ -123,7 +61,7 @@ namespace AsbCloudWebApi.Controllers.Trajectory /// Список добавленных координат траектории [HttpGet] //[ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public virtual async Task GetAsync([FromRoute] int idWell, CancellationToken token) + public async Task GetAsync([FromRoute] int idWell, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) @@ -132,100 +70,6 @@ namespace AsbCloudWebApi.Controllers.Trajectory return Ok(result); } - /// - /// Добавить одну новую строчку координат для плановой траектории - /// - /// - /// - /// - /// количество успешно записанных строк в БД - [HttpPost] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task AddAsync(int idWell, [FromBody] Tdto row, - CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) - return Forbid(); - var idUser = User.GetUserId(); - if (!idUser.HasValue) - return Forbid(); - row.IdUser = idUser.Value; - row.IdWell = idWell; - var result = await trajectoryRepository.AddAsync(row, token); - return Ok(result); - } - - /// - /// Добавить массив строчек координат для плановой траектории - /// - /// - /// - /// - /// количество успешно записанных строк в БД - [HttpPost("range")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task AddRangeAsync(int idWell, [FromBody] IEnumerable rows, - CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) - return Forbid(); - int? idUser = User.GetUserId(); - if (!idUser.HasValue) - return Forbid(); - foreach (var item in rows) - { - item.IdUser = idUser.Value; - item.IdWell = idWell; - } - var result = await trajectoryRepository.AddRangeAsync(rows, token); - return Ok(result); - } - - /// - /// Изменить выбранную строку с координатами - /// - /// - /// - /// - /// - /// количество успешно обновленных строк в БД - [HttpPut("{idRow}")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task UpdateAsync(int idWell, int idRow, - [FromBody] Tdto row, CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) - return Forbid(); - int? idUser = User.GetUserId(); - if (!idUser.HasValue) - return Forbid(); - row.Id = idRow; - row.IdUser = idUser.Value; - row.IdWell = idWell; - var result = await trajectoryRepository.UpdateAsync(row, token); - return Ok(result); - } - - /// - /// Удалить выбранную строку с координатами - /// - /// - /// - /// - /// количество успешно удаленных строк из БД - [HttpDelete("{idRow}")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task DeleteAsync(int idWell, int idRow, CancellationToken token) - { - if (!await CanUserAccessToWellAsync(idWell, - token).ConfigureAwait(false)) - return Forbid(); - - var result = await trajectoryRepository.DeleteRangeAsync(new int[] { idRow }, token); - - return Ok(result); - } - protected async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) { int? idCompany = User.GetCompanyId(); diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs new file mode 100644 index 00000000..a5e8660e --- /dev/null +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs @@ -0,0 +1,206 @@ +using AsbCloudApp.Data.Trajectory; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using AsbCloudInfrastructure.Services.Trajectory.Export; +using AsbCloudInfrastructure.Services.Trajectory.Import; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace AsbCloudWebApi.Controllers.Trajectory +{ + + /// + /// Плановые и фактические траектории (загрузка и хранение) + /// + [ApiController] + [Authorize] + public abstract class TrajectoryEditableController : TrajectoryController + where Tdto : TrajectoryGeoDto + { + protected override string fileName { get; set; } + + private readonly TrajectoryImportService trajectoryImportService; + private readonly TrajectoryExportService trajectoryExportService; + private readonly ITrajectoryEditableRepository trajectoryRepository; + + public TrajectoryEditableController(IWellService wellService, + TrajectoryImportService trajectoryImportService, + TrajectoryExportService trajectoryExportService, + ITrajectoryEditableRepository trajectoryRepository) + : base( + wellService, + trajectoryExportService, + trajectoryRepository) + { + this.trajectoryImportService = trajectoryImportService; + this.trajectoryExportService = trajectoryExportService; + this.trajectoryRepository = trajectoryRepository; + + } + + /// + /// Возвращает excel шаблон для заполнения строк траектории + /// + /// Запрашиваемый файл + [HttpGet("template")] + [AllowAnonymous] + [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + public IActionResult GetTemplate() + { + var stream = trajectoryExportService.GetTemplateFile(); + return File(stream, "application/octet-stream", fileName); + } + + /// + /// Импортирует координаты из excel (xlsx) файла + /// + /// id скважины + /// Коллекция из одного файла xlsx + /// Удалить операции перед импортом, если фал валидный + /// Токен отмены задачи + /// количество успешно записанных строк в БД + [HttpPost("import/{deleteBeforeImport}")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), (int)System.Net.HttpStatusCode.BadRequest)] + public async Task ImportAsync(int idWell, + [FromForm] IFormFileCollection files, + bool deleteBeforeImport, + CancellationToken token) + { + int? idUser = User.GetUserId(); + if (!idUser.HasValue) + return Forbid(); + if (!await CanUserAccessToWellAsync(idWell, + token).ConfigureAwait(false)) + return Forbid(); + if (files.Count < 1) + return this.ValidationBadRequest(nameof(files), "нет файла"); + var file = files[0]; + if (Path.GetExtension(file.FileName).ToLower() != ".xlsx") + return this.ValidationBadRequest(nameof(files), "Требуется xlsx файл."); + using Stream stream = file.OpenReadStream(); + + try + { + var trajectoryRows = await trajectoryImportService.ImportAsync(stream, token); + foreach (var row in trajectoryRows) + { + row.IdWell = idWell; + row.IdUser = idUser.Value; + } + + if (deleteBeforeImport) + await trajectoryRepository.DeleteByIdWellAsync(idWell, token); + + var rowsCount = await trajectoryRepository.AddRangeAsync(trajectoryRows, token); + + return Ok(rowsCount); + } + catch (FileFormatException ex) + { + return this.ValidationBadRequest(nameof(files), ex.Message); + } + } + + + /// + /// Добавить одну новую строчку координат для плановой траектории + /// + /// + /// + /// + /// количество успешно записанных строк в БД + [HttpPost] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + public async Task AddAsync(int idWell, [FromBody] Tdto row, + CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) + return Forbid(); + var idUser = User.GetUserId(); + if (!idUser.HasValue) + return Forbid(); + row.IdUser = idUser.Value; + row.IdWell = idWell; + var result = await trajectoryRepository.AddAsync(row, token); + return Ok(result); + } + + /// + /// Добавить массив строчек координат для плановой траектории + /// + /// + /// + /// + /// количество успешно записанных строк в БД + [HttpPost("range")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + public async Task AddRangeAsync(int idWell, [FromBody] IEnumerable rows, + CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) + return Forbid(); + int? idUser = User.GetUserId(); + if (!idUser.HasValue) + return Forbid(); + foreach (var item in rows) + { + item.IdUser = idUser.Value; + item.IdWell = idWell; + } + var result = await trajectoryRepository.AddRangeAsync(rows, token); + return Ok(result); + } + + /// + /// Изменить выбранную строку с координатами + /// + /// + /// + /// + /// + /// количество успешно обновленных строк в БД + [HttpPut("{idRow}")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + public async Task UpdateAsync(int idWell, int idRow, + [FromBody] Tdto row, CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) + return Forbid(); + int? idUser = User.GetUserId(); + if (!idUser.HasValue) + return Forbid(); + row.Id = idRow; + row.IdUser = idUser.Value; + row.IdWell = idWell; + var result = await trajectoryRepository.UpdateAsync(row, token); + return Ok(result); + } + + /// + /// Удалить выбранную строку с координатами + /// + /// + /// + /// + /// количество успешно удаленных строк из БД + [HttpDelete("{idRow}")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] + public async Task DeleteAsync(int idWell, int idRow, CancellationToken token) + { + if (!await CanUserAccessToWellAsync(idWell, + token).ConfigureAwait(false)) + return Forbid(); + + var result = await trajectoryRepository.DeleteRangeAsync(new int[] { idRow }, token); + + return Ok(result); + } + } +} diff --git a/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryFactManualController.cs similarity index 52% rename from AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs rename to AsbCloudWebApi/Controllers/Trajectory/TrajectoryFactManualController.cs index 6504da73..c9e408a2 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/FactTrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryFactManualController.cs @@ -1,7 +1,8 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Repositories; using AsbCloudApp.Services; -using AsbCloudInfrastructure.Services.Trajectory; +using AsbCloudInfrastructure.Services.Trajectory.Export; +using AsbCloudInfrastructure.Services.Trajectory.Import; using Microsoft.AspNetCore.Mvc; namespace AsbCloudWebApi.Controllers.Trajectory; @@ -11,14 +12,17 @@ namespace AsbCloudWebApi.Controllers.Trajectory; /// [ApiController] [Route("api/well/{idWell}/[controller]")] -public class FactTrajectoryController : TrajectoryController +public class TrajectoryFactManualController : TrajectoryEditableController { - public FactTrajectoryController(IWellService wellService, - FactTrajectoryImportService factTrajectoryImportService, + protected override string fileName { get; set; } + public TrajectoryFactManualController(IWellService wellService, + TrajectoryFactManualImportService factTrajectoryImportService, + TrajectoryFactManualExportService factTrajectoryExportService, ITrajectoryEditableRepository trajectoryFactRepository) : base( wellService, factTrajectoryImportService, + factTrajectoryExportService, trajectoryFactRepository) { fileName = "ЕЦП_шаблон_файла_фактическая_траектория.xlsx"; diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryFactNnbController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryFactNnbController.cs new file mode 100644 index 00000000..6bd1c658 --- /dev/null +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryFactNnbController.cs @@ -0,0 +1,30 @@ +using AsbCloudApp.Data.Trajectory; +using AsbCloudApp.Repositories; +using AsbCloudApp.Services; +using AsbCloudInfrastructure.Services.Trajectory.Export; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace AsbCloudWebApi.Controllers.Trajectory; + +/// +/// Фактическая траектория из ННБ +/// +[Authorize] +[ApiController] +[Route("api/well/{idWell}/[controller]")] +public class TrajectoryFactNnbController : TrajectoryController +{ + protected override string fileName { get; set; } + public TrajectoryFactNnbController( + ITrajectoryNnbRepository trajectoryNnbRepository, + TrajectoryFactNnbExportService trajectoryExportService, + IWellService wellService) + : base( + wellService, + trajectoryExportService, + trajectoryNnbRepository) + { + fileName = "ЕЦП_шаблон_файла_фактическая_ннб_траектория.xlsx"; + } +} \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/Trajectory/PlannedTrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlannedController.cs similarity index 70% rename from AsbCloudWebApi/Controllers/Trajectory/PlannedTrajectoryController.cs rename to AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlannedController.cs index 01b87365..669b1600 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/PlannedTrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlannedController.cs @@ -1,7 +1,9 @@ -using AsbCloudApp.Data; +using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Repositories; using AsbCloudApp.Services; using AsbCloudInfrastructure.Services.Trajectory; +using AsbCloudInfrastructure.Services.Trajectory.Import; +using AsbCloudInfrastructure.Services.Trajectory.Export; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Threading; @@ -15,17 +17,19 @@ namespace AsbCloudWebApi.Controllers.Trajectory /// [Route("api/well/{idWell}/plannedTrajectory")] [ApiController] - public class PlannedTrajectoryController : TrajectoryController + public class TrajectoryPlannedController : TrajectoryEditableController { private readonly TrajectoryService trajectoryVisualizationService; - public PlannedTrajectoryController(IWellService wellService, - PlannedTrajectoryImportService plannedTrajectoryImportService, + public TrajectoryPlannedController(IWellService wellService, + TrajectoryPlannedImportService plannedTrajectoryImportService, + TrajectoryPlannedExportService plannedTrajectoryExportService, ITrajectoryEditableRepository plannedTrajectoryRepository, TrajectoryService trajectoryVisualizationService) : base( wellService, plannedTrajectoryImportService, + plannedTrajectoryExportService, plannedTrajectoryRepository) { fileName = "ЕЦП_шаблон_файла_плановая_траектория.xlsx"; @@ -39,10 +43,10 @@ namespace AsbCloudWebApi.Controllers.Trajectory /// /// [HttpGet("trajectoryCartesianPlanFact")] - [ProducesResponseType(typeof(PlanFactBase, IEnumerable, IEnumerable>), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(TrajectoryPlanFactDto, IEnumerable>), (int)System.Net.HttpStatusCode.OK)] public async Task GetTrajectoryCartesianPlanFactAsync(int idWell, CancellationToken token) { - if (!await base.CanUserAccessToWellAsync(idWell, + if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); From 6387aeeb1729f39c9b070b04d7d8c1c07b1aa5a9 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 30 Nov 2023 09:40:51 +0500 Subject: [PATCH 12/19] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E?= =?UTF-8?q?-2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/PlanFactDto.cs | 1 - .../Repositories/ITrajectoryNnbRepository.cs | 11 + .../Repositories/ITrajectoryRepository.cs | 5 +- ...11522_Rename_t_trajectory_plan.Designer.cs | 9094 +++++++++++++++++ ...20231129111522_Rename_t_trajectory_plan.cs | 109 + .../AsbCloudDbContextModelSnapshot.cs | 19 +- AsbCloudDb/Model/AsbCloudDbContext.cs | 4 +- .../DefaultData/EntityFillerPermission.cs | 4 +- AsbCloudDb/Model/IAsbCloudDbContext.cs | 4 +- ...TrajectoryPlanned.cs => TrajectoryPlan.cs} | 4 +- AsbCloudInfrastructure/DependencyInjection.cs | 6 +- .../TrajectoryEditableRepository.cs | 22 +- .../Repository/TrajectoryNnbRepository.cs | 16 +- .../DailyReport/DailyReportService.cs | 8 +- .../Export/TrajectoryExportService.cs | 28 +- .../TrajectoryFactManualExportService.cs | 26 +- .../Export/TrajectoryFactNnbExportService.cs | 28 +- .../Export/TrajectoryPlannedExportService.cs | 29 +- .../TrajectoryFactManualImportService.cs | 43 - .../TrajectoryFactManualParserService.cs | 35 + ...tService.cs => TrajectoryParserService.cs} | 34 +- .../Import/TrajectoryPlannedImportService.cs | 47 - .../Import/TrajectoryPlannedParserService.cs | 40 + .../Services/Trajectory/TrajectoryService.cs | 6 +- .../Trajectory/TrajectoryExportTest.cs | 22 +- .../Trajectory/TrajectoryImportTest.cs | 27 +- .../Services/DailyReportServiceTest.cs | 6 +- .../TrajectoryVisualizationServiceTest.cs | 34 +- .../Trajectory/TrajectoryController.cs | 9 +- .../TrajectoryEditableController.cs | 6 +- .../TrajectoryFactManualController.cs | 2 +- .../Trajectory/TrajectoryPlannedController.cs | 2 +- 32 files changed, 9423 insertions(+), 308 deletions(-) create mode 100644 AsbCloudDb/Migrations/20231129111522_Rename_t_trajectory_plan.Designer.cs create mode 100644 AsbCloudDb/Migrations/20231129111522_Rename_t_trajectory_plan.cs rename AsbCloudDb/Model/Trajectory/{TrajectoryPlanned.cs => TrajectoryPlan.cs} (62%) delete mode 100644 AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualImportService.cs create mode 100644 AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualParserService.cs rename AsbCloudInfrastructure/Services/Trajectory/Import/{TrajectoryImportService.cs => TrajectoryParserService.cs} (68%) delete mode 100644 AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedImportService.cs create mode 100644 AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedParserService.cs diff --git a/AsbCloudApp/Data/PlanFactDto.cs b/AsbCloudApp/Data/PlanFactDto.cs index 74c0281b..669121d6 100644 --- a/AsbCloudApp/Data/PlanFactDto.cs +++ b/AsbCloudApp/Data/PlanFactDto.cs @@ -14,7 +14,6 @@ /// /// /// - /// public class PlanFactBase { /// diff --git a/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs b/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs index 6f383fea..cba8a707 100644 --- a/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs +++ b/AsbCloudApp/Repositories/ITrajectoryNnbRepository.cs @@ -1,4 +1,8 @@ using AsbCloudApp.Data.Trajectory; +using AsbCloudApp.Requests; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; namespace AsbCloudApp.Repositories { @@ -8,5 +12,12 @@ namespace AsbCloudApp.Repositories /// public interface ITrajectoryNnbRepository : ITrajectoryRepository { + /// + /// получение списка траекторий по параметрам запроса + /// + /// параметры запроса + /// + /// + Task> GetByRequestAsync(TrajectoryRequest trajectoryRequest, CancellationToken cancellationToken); } } diff --git a/AsbCloudApp/Repositories/ITrajectoryRepository.cs b/AsbCloudApp/Repositories/ITrajectoryRepository.cs index 46af205a..fb676d2d 100644 --- a/AsbCloudApp/Repositories/ITrajectoryRepository.cs +++ b/AsbCloudApp/Repositories/ITrajectoryRepository.cs @@ -1,5 +1,4 @@ using AsbCloudApp.Data.Trajectory; -using AsbCloudApp.Requests; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -15,9 +14,9 @@ namespace AsbCloudApp.Repositories /// /// Получить все добавленные по скважине координаты траектории /// - /// параметры запроса + /// ключ скважины /// /// - Task> GetAsync(TrajectoryRequest request, CancellationToken token); + Task> GetAsync(int idWell, CancellationToken token); } } diff --git a/AsbCloudDb/Migrations/20231129111522_Rename_t_trajectory_plan.Designer.cs b/AsbCloudDb/Migrations/20231129111522_Rename_t_trajectory_plan.Designer.cs new file mode 100644 index 00000000..cb769398 --- /dev/null +++ b/AsbCloudDb/Migrations/20231129111522_Rename_t_trajectory_plan.Designer.cs @@ -0,0 +1,9094 @@ +// +using System; +using System.Text.Json; +using AsbCloudDb.Model; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace AsbCloudDb.Migrations +{ + [DbContext(typeof(AsbCloudDbContext))] + [Migration("20231129111522_Rename_t_trajectory_plan")] + partial class Rename_t_trajectory_plan + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseCollation("Russian_Russia.1251") + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.Property("IdDeposit") + .HasColumnType("integer") + .HasColumnName("id_deposit"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex("IdDeposit"); + + b.ToTable("t_cluster"); + + b.HasComment("Кусты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.HasIndex("IdCompanyType"); + + b.ToTable("t_company"); + + b.HasData( + new + { + Id = 1, + Caption = "ООО \"АСБ\"", + IdCompanyType = 3 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("IsContact") + .HasColumnType("boolean") + .HasColumnName("is_contact"); + + b.Property("Order") + .HasColumnType("integer") + .HasColumnName("order"); + + b.HasKey("Id"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Contact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("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("IdWell") + .HasMaxLength(255) + .HasColumnType("integer") + .HasColumnName("id_well") + .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.HasKey("Id"); + + b.HasIndex("IdCompanyType"); + + b.HasIndex("IdWell"); + + b.ToTable("t_contact"); + + b.HasComment("Контакты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DailyReports.DailyReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Date") + .HasColumnType("timestamp with time zone") + .HasColumnName("date") + .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("SignBlock") + .HasColumnType("jsonb") + .HasColumnName("sign_block") + .HasComment("Подпись"); + + b.Property("SubsystemBlock") + .HasColumnType("jsonb") + .HasColumnName("subsystem_block") + .HasComment("Наработкой подсистем"); + + b.Property("TimeBalanceBlock") + .HasColumnType("jsonb") + .HasColumnName("time_balance_block") + .HasComment("Баланс времени"); + + b.HasKey("Id"); + + b.HasIndex("IdWell", "Date") + .IsUnique(); + + b.ToTable("t_daily_report"); + + b.HasComment("Ежедневные отчёты"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.ToTable("t_deposit"); + + b.HasComment("Месторождение"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина после завершения операции, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина на начало операции, м"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории операции"); + + b.Property("IdReasonOfEnd") + .HasColumnType("integer") + .HasColumnName("id_reason_of_end") + .HasComment("Код признака окончания операции"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdUsersAtStart") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя по телеметрии на момент начала операции"); + + b.Property("Value") + .HasColumnType("double precision") + .HasColumnName("value") + .HasComment("Ключевой показатель операции"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_detected_operation"); + + b.HasComment("автоматически определенные операции по телеметрии"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Driller", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Surname") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname") + .HasComment("Фамилия"); + + b.HasKey("Id"); + + b.ToTable("t_driller"); + + b.HasComment("Бурильщик"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdFileCategory") + .HasColumnType("integer") + .HasColumnName("id_file_category"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.HasKey("Id"); + + b.HasIndex("IdFileCategory"); + + b.HasIndex("IdWell", "IdFileCategory") + .IsUnique(); + + b.ToTable("t_drilling_program_part"); + + b.HasComment("части программ бурения"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .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("TimeStampStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("timestamp_start") + .HasComment("Время начала"); + + b.HasKey("Id", "IdTelemetry"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_drill_test"); + + b.HasComment("Drill_test"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Faq", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Answer") + .HasColumnType("text") + .HasColumnName("answer") + .HasComment("Текст ответа"); + + b.Property("CounterQuestion") + .HasColumnType("integer") + .HasColumnName("counter_question") + .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("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("IdAuthorQuestion") + .HasColumnType("integer") + .HasColumnName("id_author_question") + .HasComment("id автора вопроса"); + + b.Property("IdReplacementQuestion") + .HasColumnType("integer") + .HasColumnName("id_replacement_question") + .HasComment("Ключ заменяющего вопроса"); + + b.Property("IsFrequently") + .HasColumnType("boolean") + .HasColumnName("is_frequently") + .HasComment("Частый вопрос"); + + b.Property("Question") + .IsRequired() + .HasColumnType("text") + .HasColumnName("question") + .HasComment("Текст вопроса"); + + b.Property("State") + .HasColumnType("integer") + .HasColumnName("state") + .HasComment("Статус вопроса"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthorAnswer"); + + b.HasIndex("IdAuthorQuestion"); + + b.ToTable("t_faq"); + + b.HasComment("вопросы пользователей"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории"); + + b.Property("ShortName") + .HasColumnType("text") + .HasColumnName("short_name") + .HasComment("Короткое название категории"); + + b.HasKey("Id"); + + b.ToTable("t_file_category"); + + 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 = "Инструкции" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Id пользователя, загрузившего файл"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("id категории файла"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Удален ли файл"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название файла"); + + b.Property("Size") + .HasColumnType("bigint") + .HasColumnName("file_size") + .HasComment("Размер файла"); + + b.Property("UploadDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_file_info"); + + b.HasComment("Файлы всех категорий"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileMark", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("IdFile") + .HasColumnType("integer") + .HasColumnName("id_file") + .HasComment("id файла"); + + b.Property("IdMarkType") + .HasColumnType("integer") + .HasColumnName("id_mark_type") + .HasComment("0 - отклонен, 1 - согласован"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("id пользователя"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Помечен ли файл как удаленный"); + + b.HasKey("Id"); + + b.HasIndex("IdFile"); + + b.HasIndex("IdUser"); + + b.ToTable("t_file_mark"); + + b.HasComment("Действия с файлами."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .HasColumnType("real") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_float"); + + b.HasComment("таблица данных ГТИ с типом значения float"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .HasColumnType("integer") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_int"); + + b.HasComment("таблица данных ГТИ с типом значения int"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdRecord") + .HasColumnType("integer") + .HasColumnName("id_record"); + + b.Property("IdItem") + .HasColumnType("integer") + .HasColumnName("id_item"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text") + .HasColumnName("value"); + + b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); + + b.ToTable("t_wits_string"); + + b.HasComment("таблица данных ГТИ с типом значения string"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории файла"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название файла"); + + b.Property("Size") + .HasColumnType("bigint") + .HasColumnName("file_size") + .HasComment("Размер файла"); + + b.Property("UrlPage") + .IsRequired() + .HasColumnType("text") + .HasColumnName("url_page") + .HasComment("Url страницы"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.ToTable("t_help_page"); + + b.HasComment("Справки"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateEnd") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_end"); + + b.Property("DateStart") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_start"); + + b.Property("DepthEnd") + .HasColumnType("real") + .HasColumnName("depth_end"); + + b.Property("DepthStart") + .HasColumnType("real") + .HasColumnName("depth_start"); + + b.Property("IdFeedRegulator") + .HasColumnType("smallint") + .HasColumnName("id_feed_regulator"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.HasKey("Id"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_limiting_parameter"); + + b.HasComment("Ограничения по параметрам телеметрии"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.Manual", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateDownload") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_download") + .HasComment("Дата загрузки"); + + b.Property("IdAuthor") + .HasColumnType("integer") + .HasColumnName("id_author") + .HasComment("Id автора"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("Id категории файла"); + + b.Property("IdDirectory") + .HasColumnType("integer") + .HasColumnName("id_directory") + .HasComment("Id директории"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdDirectory"); + + b.ToTable("t_manual"); + + b.HasComment("Инструкции"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IdParent") + .HasColumnType("integer") + .HasColumnName("id_parent") + .HasComment("Id родительской директории"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название"); + + b.HasKey("Id"); + + b.HasIndex("IdParent"); + + b.ToTable("t_manual_directory"); + + b.HasComment("Директория для инструкций"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Measure", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Data") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("data") + .HasComment("Данные таблицы последних данных"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .HasComment("id категории"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("IsDeleted") + .HasColumnType("boolean") + .HasColumnName("is_deleted") + .HasComment("Пометка удаленным"); + + b.Property("Timestamp") + .HasColumnType("timestamp with time zone") + .HasColumnName("timestamp") + .HasComment("время добавления"); + + b.HasKey("Id"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_measure"); + + b.HasComment("Таблица c данными для вкладки 'Последние данные'"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории"); + + b.Property("ShortName") + .HasColumnType("text") + .HasColumnName("short_name") + .HasComment("Короткое название категории"); + + b.HasKey("Id"); + + b.ToTable("t_measure_category"); + + b.HasComment("Категория последних данных"); + + 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"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id получателя"); + + b.Property("Message") + .IsRequired() + .HasColumnType("text") + .HasColumnName("message") + .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("SentDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("sent_date") + .HasComment("Дата отправки уведомления"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasColumnName("title") + .HasComment("Заголовок уведомления"); + + b.HasKey("Id"); + + b.HasIndex("IdNotificationCategory"); + + b.HasIndex("IdUser"); + + b.ToTable("t_notification"); + + b.HasComment("Уведомления"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name"); + + b.HasKey("Id"); + + b.ToTable("t_notification_category"); + + b.HasComment("Категории уведомлений"); + + b.HasData( + new + { + Id = 1, + Name = "Системные уведомления" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.OperationValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Конечная глубина"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Старотовая глубина"); + + b.Property("IdOperationCategory") + .HasColumnType("integer") + .HasColumnName("id_operation_category") + .HasComment("Ид категории операции"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Ид скважины"); + + b.Property("StandardValue") + .HasColumnType("double precision") + .HasColumnName("standard_value") + .HasComment("Нормативный показатель"); + + b.Property("TargetValue") + .HasColumnType("double precision") + .HasColumnName("target_value") + .HasComment("Целевой показатель"); + + b.HasKey("Id"); + + b.HasIndex("IdOperationCategory"); + + b.HasIndex("IdWell"); + + b.ToTable("t_operationvalue"); + + b.HasComment("Целевые/нормативные показатели операции"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.ToTable("t_permission"); + + 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 = 529, + Description = "Разрешение редактировать фактические траектории", + Name = "FactTrajectory.edit" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарий"); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина по стволу до, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина по стволу от, м"); + + b.Property("FlowLimitMax") + .HasColumnType("double precision") + .HasColumnName("flow_limit_max") + .HasComment("Расход, допустимый максимум"); + + b.Property("FlowPlan") + .HasColumnType("double precision") + .HasColumnName("flow_plan") + .HasComment("Расход, план"); + + b.Property("IdMode") + .HasColumnType("integer") + .HasColumnName("id_mode") + .HasComment("Id режима (1- ротор, 2 слайд)"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_wellsection_type") + .HasComment("Тип секции"); + + b.Property("LastUpdate") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_update") + .HasComment("Дата последнего изменения"); + + b.Property("PressureLimitMax") + .HasColumnType("double precision") + .HasColumnName("pressure_limit_max") + .HasComment("Перепад давления, допустимый максимум"); + + b.Property("PressurePlan") + .HasColumnType("double precision") + .HasColumnName("pressure_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("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("TopDriveTorquePlan") + .HasColumnType("double precision") + .HasColumnName("top_drive_torque_plan") + .HasComment("Момент на ВСП, план"); + + b.Property("UsageSaub") + .HasColumnType("double precision") + .HasColumnName("usage_saub") + .HasComment("Плановый процент использования АКБ"); + + b.Property("UsageSpin") + .HasColumnType("double precision") + .HasColumnName("usage_spin") + .HasComment("Плановый процент использования spin master"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_process_map_well_drilling"); + + b.HasComment("РТК бурение скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellReam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарий"); + + b.Property("DepthEnd") + .HasColumnType("double precision") + .HasColumnName("depth_end") + .HasComment("Глубина по стволу до, м"); + + b.Property("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина по стволу от, м"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Id пользователя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_wellsection_type") + .HasComment("Тип секции"); + + b.Property("LastUpdate") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_update") + .HasComment("Дата последнего изменения"); + + b.Property("Pressure") + .HasColumnType("double precision") + .HasColumnName("pressure") + .HasComment("Давление, атм"); + + b.Property("Repeats") + .HasColumnType("double precision") + .HasColumnName("repeats") + .HasComment("Количество повторений"); + + b.Property("SetpointDrag") + .HasColumnType("double precision") + .HasColumnName("setpoint_drag") + .HasComment("Уставка зятяжки, т"); + + b.Property("SetpointTight") + .HasColumnType("double precision") + .HasColumnName("setpoint_tight") + .HasComment("Уставка посадки, т"); + + b.Property("SpeedDownward") + .HasColumnType("double precision") + .HasColumnName("speed_downward") + .HasComment("Скорость спуска, м/ч"); + + b.Property("SpeedUpward") + .HasColumnType("double precision") + .HasColumnName("speed_upward") + .HasComment("Скорость подъёма, м/ч"); + + b.Property("SpinDownward") + .HasColumnType("double precision") + .HasColumnName("spin_downward") + .HasComment("Вращение при движении вниз, об/мин"); + + b.Property("SpinUpward") + .HasColumnType("double precision") + .HasColumnName("spin_upward") + .HasComment("Вращение при движении вверх, об/мин"); + + b.Property("Torque") + .HasColumnType("double precision") + .HasColumnName("torque") + .HasComment("Момент, кН*м"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_process_map_well_ream"); + + b.HasComment("РТК проработка скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b => + { + b.Property("IdCompany") + .HasColumnType("integer") + .HasColumnName("id_company"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.HasKey("IdCompany", "IdWell"); + + b.HasIndex("IdWell"); + + b.ToTable("t_relation_company_well"); + + b.HasComment("отношение скважин и компаний"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationContactWell", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.HasKey("IdWell", "IdUser"); + + b.HasIndex("IdUser"); + + b.ToTable("t_relation_contact_well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserDrillingProgramPart", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdDrillingProgramPart") + .HasColumnType("integer") + .HasColumnName("id_drilling_program_part"); + + 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.HasIndex("IdDrillingProgramPart"); + + b.ToTable("t_relation_user_drilling_program_part"); + + b.HasComment("Отношение пользователей и частей ПБ"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserRolePermission", b => + { + b.Property("IdUserRole") + .HasColumnType("integer") + .HasColumnName("id_user_role"); + + b.Property("IdPermission") + .HasColumnType("integer") + .HasColumnName("id_permission"); + + b.HasKey("IdUserRole", "IdPermission"); + + b.HasIndex("IdPermission"); + + b.ToTable("t_relation_user_role_permission"); + + 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 = 529 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserRoleUserRole", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id_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.HasIndex("IdInclude"); + + b.ToTable("t_relation_user_role_user_role"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.RelationUserUserRole", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdUserRole") + .HasColumnType("integer") + .HasColumnName("id_user_role"); + + b.HasKey("IdUser", "IdUserRole"); + + b.HasIndex("IdUserRole"); + + b.ToTable("t_relation_user_user_role"); + + b.HasComment("Отношение пользователей и ролей"); + + b.HasData( + new + { + IdUser = 1, + IdUserRole = 1 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ReportProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Format") + .HasColumnType("integer") + .HasColumnName("format") + .HasComment("Формат отчета"); + + b.Property("IdFile") + .HasColumnType("integer") + .HasColumnName("id_file") + .HasComment("id файла-родителя"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("Step") + .HasColumnType("integer") + .HasColumnName("step") + .HasComment("размер шага в секундах"); + + b.HasKey("Id"); + + b.HasIndex("IdFile"); + + b.HasIndex("IdWell"); + + b.ToTable("t_report_property"); + + b.HasComment("Отчеты с данными по буровым"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Schedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("IdDriller") + .HasColumnType("integer") + .HasColumnName("id_driller") + .HasComment("Идентификатор бурильщика"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .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.HasKey("Id"); + + b.HasIndex("IdDriller"); + + b.HasIndex("IdWell"); + + b.ToTable("t_schedule"); + + b.HasComment("График работы бурильщика"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.SetpointsRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("комментарий для оператора"); + + 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("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("id скважины"); + + b.Property("ObsolescenceSec") + .HasColumnType("integer") + .HasColumnName("obsolescence") + .HasComment("сек. до устаревания"); + + b.Property("Setpoints") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("setpoint_set") + .HasComment("Набор уставок"); + + b.Property("UploadDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.HasKey("Id"); + + b.HasIndex("IdAuthor"); + + b.HasIndex("IdWell"); + + b.ToTable("t_setpoints_rquest"); + + b.HasComment("Запросы на изменение уставок панели оператора"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.Subsystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("description"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); + + b.HasKey("Id"); + + b.ToTable("t_subsystem"); + + b.HasComment("Описание подсистем"); + + b.HasData( + new + { + Id = 1, + Description = "Совместная работа режимов \"Бурение в роторе\" и \"Бурение в слайде\"", + Name = "АКБ" + }, + new + { + Id = 11, + Description = "Режим работы \"Бурение в роторе\"", + Name = "АПД ротор" + }, + new + { + Id = 12, + Description = "Режим работы \"Бурение в слайде\"", + Name = "АПД слайд" + }, + new + { + Id = 2, + Description = "Алгоритм поиска оптимальных параметров бурения САУБ", + Name = "MSE" + }, + new + { + Id = 65536, + Description = "Осцилляция", + Name = "Осцилляция" + }, + new + { + Id = 65537, + Description = "Демпфер", + Name = "Демпфер" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.SubsystemOperationTime", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("DepthEnd") + .HasColumnType("real") + .HasColumnName("depth_end") + .HasComment("глубина забоя на момент выключения подсистемы"); + + b.Property("DepthStart") + .HasColumnType("real") + .HasColumnName("depth_start") + .HasComment("глубина забоя на момент включения подсистемы"); + + b.Property("IdSubsystem") + .HasColumnType("integer") + .HasColumnName("id_subsystem"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .HasComment("ИД телеметрии по которой выдается информация"); + + b.HasKey("Id"); + + b.HasIndex("IdSubsystem"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_subsystem_operation_time"); + + b.HasComment("наработки подсистем"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Info") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("info") + .HasComment("Информация с панели о скважине"); + + b.Property("RemoteUid") + .IsRequired() + .HasColumnType("text") + .HasColumnName("remote_uid") + .HasComment("Идентификатор передающего устройства. Может повторяться в списке, так как комплекты оборудования переезжают от скв. к скв."); + + b.Property("TimeZone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "RemoteUid" }, "t_telemetry_remote_uid_index"); + + b.ToTable("t_telemetry"); + + b.HasComment("таблица привязки телеметрии от комплектов к конкретной скважине."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaub", b => + { + 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("AxialLoad") + .HasColumnType("real") + .HasColumnName("axial_load") + .HasComment("Осевая нагрузка"); + + b.Property("AxialLoadLimitMax") + .HasColumnType("real") + .HasColumnName("axial_load_limit_max") + .HasComment("Осевая нагрузка. Аварийная макс."); + + b.Property("AxialLoadSp") + .HasColumnType("real") + .HasColumnName("axial_load_sp") + .HasComment("Осевая нагрузка. Задание"); + + b.Property("BitDepth") + .HasColumnType("real") + .HasColumnName("bit_depth") + .HasComment("Положение инструмента"); + + b.Property("BlockPosition") + .HasColumnType("real") + .HasColumnName("block_position") + .HasComment("Высота талевого блока"); + + b.Property("BlockPositionMax") + .HasColumnType("real") + .HasColumnName("block_position_max") + .HasComment("Талевый блок. Макс положение"); + + b.Property("BlockPositionMin") + .HasColumnType("real") + .HasColumnName("block_position_min") + .HasComment("Талевый блок. Мин положение"); + + b.Property("BlockSpeed") + .HasColumnType("real") + .HasColumnName("block_speed") + .HasComment("Скорость талевого блока"); + + b.Property("BlockSpeedSp") + .HasColumnType("real") + .HasColumnName("block_speed_sp") + .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("BlockSpeedSpSlide") + .HasColumnType("real") + .HasColumnName("block_speed_sp_slide") + .HasComment("Талевый блок. Задание скорости для режима слайда"); + + b.Property("Flow") + .HasColumnType("real") + .HasColumnName("flow") + .HasComment("Расход"); + + b.Property("FlowDeltaLimitMax") + .HasColumnType("real") + .HasColumnName("flow_delta_limit_max") + .HasComment("Расход. Аварийный макс."); + + b.Property("FlowIdle") + .HasColumnType("real") + .HasColumnName("flow_idle") + .HasComment("Расход. Холостой ход"); + + b.Property("HookWeight") + .HasColumnType("real") + .HasColumnName("hook_weight") + .HasComment("Вес на крюке"); + + b.Property("HookWeightIdle") + .HasColumnType("real") + .HasColumnName("hook_weight_idle") + .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("IdFeedRegulator") + .HasColumnType("smallint") + .HasColumnName("id_feed_regulator") + .HasComment("Текущий критерий бурения"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("Пользователь САУБ"); + + b.Property("Mode") + .HasColumnType("smallint") + .HasColumnName("mode") + .HasComment("Режим САУБ"); + + b.Property("Mse") + .HasColumnType("real") + .HasColumnName("mse") + .HasComment("MSE"); + + b.Property("MseState") + .HasColumnType("smallint") + .HasColumnName("mse_state") + .HasComment("Текущее состояние работы MSE"); + + b.Property("Pressure") + .HasColumnType("real") + .HasColumnName("pressure") + .HasComment("Давление"); + + b.Property("PressureDeltaLimitMax") + .HasColumnType("real") + .HasColumnName("pressure_delta_limit_max") + .HasComment("Давление дифф. Аварийное макс."); + + b.Property("PressureIdle") + .HasColumnType("real") + .HasColumnName("pressure_idle") + .HasComment("Давление. Холостой ход"); + + b.Property("PressureSp") + .HasColumnType("real") + .HasColumnName("pressure_sp") + .HasComment("Давление. Задание"); + + b.Property("PressureSpDevelop") + .HasColumnType("real") + .HasColumnName("pressure_sp_develop") + .HasComment("Давление. Задание для проработки"); + + b.Property("PressureSpRotor") + .HasColumnType("real") + .HasColumnName("pressure_sp_rotor") + .HasComment("Давление. Задание для роторного бурения"); + + b.Property("PressureSpSlide") + .HasColumnType("real") + .HasColumnName("pressure_sp_slide") + .HasComment("Давление. Задание для режима слайда"); + + b.Property("Pump0Flow") + .HasColumnType("real") + .HasColumnName("pump0_flow") + .HasComment("Расход. Буровой насос 1"); + + b.Property("Pump1Flow") + .HasColumnType("real") + .HasColumnName("pump1_flow") + .HasComment("Расход. Буровой насос 2"); + + b.Property("Pump2Flow") + .HasColumnType("real") + .HasColumnName("pump2_flow") + .HasComment("Расход. Буровой насос 3"); + + b.Property("RotorSpeed") + .HasColumnType("real") + .HasColumnName("rotor_speed") + .HasComment("Обороты ротора"); + + b.Property("RotorTorque") + .HasColumnType("real") + .HasColumnName("rotor_torque") + .HasComment("Момент на роторе"); + + b.Property("RotorTorqueIdle") + .HasColumnType("real") + .HasColumnName("rotor_torque_idle") + .HasComment("Момент на роторе. Холостой ход"); + + b.Property("RotorTorqueLimitMax") + .HasColumnType("real") + .HasColumnName("rotor_torque_limit_max") + .HasComment("Момент на роторе. Аварийный макс."); + + b.Property("RotorTorqueSp") + .HasColumnType("real") + .HasColumnName("rotor_torque_sp") + .HasComment("Момент на роторе. Задание"); + + b.Property("WellDepth") + .HasColumnType("real") + .HasColumnName("well_depth") + .HasComment("Глубина забоя"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_data_saub"); + + b.HasComment("набор основных данных по SAUB"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaubStat", b => + { + b.Property("Count") + .HasColumnType("bigint") + .HasColumnName("count_items"); + + b.Property("DateMax") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_max"); + + b.Property("DateMin") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_min"); + + b.Property("DepthMax") + .HasColumnType("real") + .HasColumnName("depth_max"); + + b.Property("DepthMin") + .HasColumnType("real") + .HasColumnName("depth_min"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.ToView("mw_telemetry_datas_saub_stat"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSpin", b => + { + 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("Mode") + .HasColumnType("smallint") + .HasColumnName("mode") + .HasComment("Выбранный режим управления"); + + b.Property("PositionRight") + .HasColumnType("real") + .HasColumnName("position_right") + .HasComment("Крайний правый угол осцилляции"); + + b.Property("PositionZero") + .HasColumnType("real") + .HasColumnName("position_zero") + .HasComment("Нулевая позиция осцилляции"); + + b.Property("RevolsLeftLimit") + .HasColumnType("real") + .HasColumnName("revols_left_limit") + .HasComment("Ограничение числа оборотов влево"); + + b.Property("RevolsLeftTotal") + .HasColumnType("real") + .HasColumnName("revols_left_total") + .HasComment("Суммарное количество оборотов влево"); + + b.Property("RevolsRightLimit") + .HasColumnType("real") + .HasColumnName("revols_right_limit") + .HasComment("Ограничение числа оборотов вправо"); + + b.Property("RevolsRightTotal") + .HasColumnType("real") + .HasColumnName("revols_right_total") + .HasComment("Суммарное количество оборотов вправо"); + + b.Property("SpeedLeftSp") + .HasColumnType("real") + .HasColumnName("speed_left_sp") + .HasComment("Заданная скорость вращения влево"); + + b.Property("SpeedRightSp") + .HasColumnType("real") + .HasColumnName("speed_right_sp") + .HasComment("Заданная скорость вращения вправо"); + + b.Property("State") + .HasColumnType("smallint") + .HasColumnName("state") + .HasComment("Переменная этапа"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_data_spin"); + + b.HasComment("набор основных данных по SpinMaster"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryEvent", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdEvent") + .HasColumnType("integer") + .HasColumnName("id_event"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category"); + + b.Property("MessageTemplate") + .IsRequired() + .HasColumnType("text") + .HasColumnName("message_template"); + + b.HasKey("IdTelemetry", "IdEvent"); + + b.ToTable("t_telemetry_event"); + + b.HasComment("Справочник событий. События формируют сообщения. Разделено по версиям посылок от телеметрии."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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("Arg2") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg2"); + + b.Property("Arg3") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("arg3"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("IdEvent") + .HasColumnType("integer") + .HasColumnName("id_event"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdTelemetryUser") + .HasColumnType("integer") + .HasColumnName("id_telemetry_user") + .HasComment("Пользователь панели отправляющей телеметрию. не пользователь облака."); + + b.Property("WellDepth") + .HasColumnType("double precision") + .HasColumnName("well_depth"); + + b.HasKey("Id"); + + b.HasIndex("IdTelemetry"); + + b.ToTable("t_telemetry_message"); + + b.HasComment("Сообщения на буровых"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryUser", b => + { + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level"); + + b.Property("Name") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); + + b.Property("Patronymic") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("patronymic"); + + b.Property("Surname") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname"); + + b.HasKey("IdTelemetry", "IdUser"); + + b.ToTable("t_telemetry_user"); + + b.HasComment("Пользователи панели САУБ. Для сообщений."); + }); + + modelBuilder.Entity("AsbCloudDb.Model.TelemetryWirelineRunOut", b => + { + b.Property("IdTelemetry") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_telemetry") + .HasComment("Идентификатор телеметрии"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("IdTelemetry")); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_time") + .HasComment("Отметка времени"); + + b.Property("Hauling") + .HasColumnType("real") + .HasColumnName("hauling") + .HasComment("Наработка талевого каната с момента перетяжки каната, т*км"); + + b.Property("HaulingWarnSp") + .HasColumnType("real") + .HasColumnName("hauling_warn_sp") + .HasComment("Наработка талевого каната до сигнализации о необходимости перетяжки, т*км"); + + b.Property("Replace") + .HasColumnType("real") + .HasColumnName("replace") + .HasComment("Наработка талевого каната с момента замены каната, т*км"); + + b.Property("ReplaceWarnSp") + .HasColumnType("real") + .HasColumnName("replace_warn_sp") + .HasComment("Наработка талевого каната до сигнализации о необходимости замены, т*км"); + + b.HasKey("IdTelemetry"); + + b.ToTable("t_telemetry_wireline_run_out"); + + b.HasComment("Наработка талевого каната"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryFact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .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("VerticalDepth") + .HasColumnType("double precision") + .HasColumnName("vertical_depth") + .HasComment("Глубина вертикальная"); + + b.Property("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_trajectory_fact"); + + b.HasComment("Загрузка фактической траектории"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlanned", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AzimuthGeo") + .HasColumnType("double precision") + .HasColumnName("azimuth_geo") + .HasComment("Азимут Географ."); + + b.Property("AzimuthMagnetic") + .HasColumnType("double precision") + .HasColumnName("azimuth_magnetic") + .HasComment("Азимут Магнитный"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .HasComment("Комментарии"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user") + .HasComment("ID пользователя который внес/изменил запись"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("ID скважины"); + + b.Property("Radius") + .HasColumnType("double precision") + .HasColumnName("radius") + .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("WellboreDepth") + .HasColumnType("double precision") + .HasColumnName("wellbore_depth") + .HasComment("Глубина по стволу"); + + b.Property("ZenithAngle") + .HasColumnType("double precision") + .HasColumnName("zenith_angle") + .HasComment("Угол зенитный"); + + b.HasKey("Id"); + + b.HasIndex("IdUser"); + + b.HasIndex("IdWell"); + + b.ToTable("t_trajectory_plan"); + + b.HasComment("Загрузка плановой траектории"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Email") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("email") + .HasComment("должность"); + + b.Property("IdCompany") + .HasColumnType("integer") + .HasColumnName("id_company"); + + 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("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("Patronymic") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("patronymic") + .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("Surname") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("surname") + .HasComment("фамилия"); + + b.HasKey("Id"); + + b.HasIndex("IdCompany"); + + b.HasIndex("Login") + .IsUnique(); + + b.ToTable("t_user"); + + b.HasComment("Пользователи облака"); + + 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"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + 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.HasKey("Id"); + + b.ToTable("t_user_role"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => + { + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("Key") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("key") + .HasComment("Ключ настроек пользователя"); + + b.Property("Value") + .HasColumnType("jsonb") + .HasColumnName("setting_value") + .HasComment("Значение настроек пользователя"); + + b.HasKey("IdUser", "Key"); + + b.ToTable("t_user_settings"); + + b.HasComment("настройки интерфейса пользователя"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Well", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption"); + + b.Property("IdCluster") + .HasColumnType("integer") + .HasColumnName("id_cluster"); + + b.Property("IdState") + .HasColumnType("integer") + .HasColumnName("state") + .HasComment("0 - неизвестно, 1 - в работе, 2 - завершена"); + + b.Property("IdTelemetry") + .HasColumnType("integer") + .HasColumnName("id_telemetry"); + + b.Property("IdWellType") + .HasColumnType("integer") + .HasColumnName("id_well_type"); + + b.Property("Latitude") + .HasColumnType("double precision") + .HasColumnName("latitude"); + + b.Property("Longitude") + .HasColumnType("double precision") + .HasColumnName("longitude"); + + b.Property("Timezone") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("timezone") + .HasComment("Смещение часового пояса от UTC"); + + b.HasKey("Id"); + + b.HasIndex("IdCluster"); + + b.HasIndex("IdTelemetry") + .IsUnique(); + + b.HasIndex("IdWellType"); + + b.ToTable("t_well"); + + b.HasComment("скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellComposite", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .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.HasKey("IdWell", "IdWellSrc", "IdWellSectionType"); + + b.HasIndex("IdWellSectionType"); + + b.HasIndex("IdWellSrc"); + + b.ToTable("t_well_composite"); + + b.HasComment("Композитная скважина"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellFinalDocument", b => + { + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well"); + + b.Property("IdUser") + .HasColumnType("integer") + .HasColumnName("id_user"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category"); + + b.HasKey("IdWell", "IdUser", "IdCategory") + .HasName("t_well_final_documents_pk"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdUser"); + + b.ToTable("t_well_final_documents"); + + b.HasComment("Дело скважины"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CategoryInfo") + .HasColumnType("text") + .HasColumnName("category_info") + .HasComment("Доп. информация к выбраной категории"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment") + .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("DepthStart") + .HasColumnType("double precision") + .HasColumnName("depth_start") + .HasComment("Глубина на начало операции, м"); + + b.Property("DurationHours") + .HasColumnType("double precision") + .HasColumnName("duration_hours") + .HasComment("Продолжительность, часы"); + + b.Property("IdCategory") + .HasColumnType("integer") + .HasColumnName("id_category") + .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("IdUser") + .HasColumnType("integer"); + + b.Property("IdWell") + .HasColumnType("integer") + .HasColumnName("id_well") + .HasComment("Id скважины"); + + b.Property("IdWellSectionType") + .HasColumnType("integer") + .HasColumnName("id_well_section_type") + .HasComment("Id тип секции скважины"); + + b.Property("LastUpdateDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("DateStart"); + + b.HasIndex("DepthEnd"); + + b.HasIndex("IdCategory"); + + b.HasIndex("IdPlan"); + + b.HasIndex("IdWell"); + + b.HasIndex("IdWellSectionType"); + + b.ToTable("t_well_operation"); + + b.HasComment("Данные по операциям на скважине"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("KeyValueUnits") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("key_value_units") + .HasComment("Единицы измерения ключевого показателя операции"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name") + .HasComment("Название категории операции"); + + b.HasKey("Id"); + + b.HasIndex("IdParent"); + + b.ToTable("t_well_operation_category"); + + 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 = "Работа пакером в обсадной колонне" + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.Property("Order") + .HasColumnType("real") + .HasColumnName("order") + .HasComment("Порядок"); + + b.HasKey("Id"); + + b.ToTable("t_well_section_type"); + + 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 + }); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Caption") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("caption") + .HasComment("Название"); + + b.HasKey("Id"); + + b.ToTable("t_well_type"); + + b.HasComment("конструкция скважины"); + + 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("DateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("date"); + + b.Property("Actcod") + .HasColumnType("smallint") + .HasColumnName("ACTCOD"); + + b.Property("Date") + .HasColumnType("integer") + .HasColumnName("DATE"); + + b.Property("Recid") + .HasColumnType("smallint") + .HasColumnName("RECID"); + + b.Property("Seqid") + .HasColumnType("integer") + .HasColumnName("SEQID"); + + b.Property("Stknum") + .HasColumnType("smallint") + .HasColumnName("STKNUM"); + + b.Property("Time") + .HasColumnType("integer") + .HasColumnName("TIME"); + + b.Property("Wellid") + .HasColumnType("text") + .HasColumnName("WELLID"); + + b.HasKey("IdTelemetry", "DateTime"); + + b.ToTable("t_telemetry_wits_base"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Blkpos") + .HasColumnType("real") + .HasColumnName("BLKPOS"); + + b.Property("Chkp") + .HasColumnType("real") + .HasColumnName("CHKP"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptbitv") + .HasColumnType("real") + .HasColumnName("DEPTBITV"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptretm") + .HasColumnType("real") + .HasColumnName("DEPTRETM"); + + b.Property("Deptvert") + .HasColumnType("real") + .HasColumnName("DEPTVERT"); + + b.Property("Gasa") + .HasColumnType("real") + .HasColumnName("GASA"); + + b.Property("Hkla") + .HasColumnType("real") + .HasColumnName("HKLA"); + + b.Property("Hklx") + .HasColumnType("real") + .HasColumnName("HKLX"); + + b.Property("Lagstks") + .HasColumnType("smallint") + .HasColumnName("LAGSTKS"); + + b.Property("Mcia") + .HasColumnType("real") + .HasColumnName("MCIA"); + + b.Property("Mcoa") + .HasColumnType("real") + .HasColumnName("MCOA"); + + b.Property("Mdia") + .HasColumnType("real") + .HasColumnName("MDIA"); + + b.Property("Mdoa") + .HasColumnType("real") + .HasColumnName("MDOA"); + + b.Property("Mfia") + .HasColumnType("real") + .HasColumnName("MFIA"); + + b.Property("Mfoa") + .HasColumnType("real") + .HasColumnName("MFOA"); + + b.Property("Mfop") + .HasColumnType("smallint") + .HasColumnName("MFOP"); + + b.Property("Mtia") + .HasColumnType("real") + .HasColumnName("MTIA"); + + b.Property("Mtoa") + .HasColumnType("real") + .HasColumnName("MTOA"); + + b.Property("Ropa") + .HasColumnType("real") + .HasColumnName("ROPA"); + + b.Property("Rpma") + .HasColumnType("smallint") + .HasColumnName("RPMA"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Spm1") + .HasColumnType("smallint") + .HasColumnName("SPM1"); + + b.Property("Spm2") + .HasColumnType("smallint") + .HasColumnName("SPM2"); + + b.Property("Spm3") + .HasColumnType("smallint") + .HasColumnName("SPM3"); + + b.Property("Sppa") + .HasColumnType("real") + .HasColumnName("SPPA"); + + b.Property("Stkc") + .HasColumnType("integer") + .HasColumnName("STKC"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.Property("Torqa") + .HasColumnType("real") + .HasColumnName("TORQA"); + + b.Property("Torqx") + .HasColumnType("real") + .HasColumnName("TORQX"); + + b.Property("Tvolact") + .HasColumnType("real") + .HasColumnName("TVOLACT"); + + b.Property("Tvolcact") + .HasColumnType("real") + .HasColumnName("TVOLCACT"); + + b.Property("Woba") + .HasColumnType("real") + .HasColumnName("WOBA"); + + b.Property("Wobx") + .HasColumnType("real") + .HasColumnName("WOBX"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_1"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("DeptmeasGdpMc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_GDP_mc"); + + b.Property("DeptmeasMcrstat") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_MCRSTAT"); + + b.Property("DeptmeasRa33Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33_mc"); + + b.Property("DeptmeasRa33f2Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33F2_mc"); + + b.Property("DeptmeasRa33f4Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RA33F4_mc"); + + b.Property("DeptmeasRp33Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33_mc"); + + b.Property("DeptmeasRp33f2Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33F2_mc"); + + b.Property("DeptmeasRp33f4Mc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_RP33F4_mc"); + + b.Property("DeptmeasSlvlMc") + .HasColumnType("real") + .HasColumnName("DEPTMEAS_SLVL_mc"); + + b.Property("GdpMc") + .HasColumnType("real") + .HasColumnName("GDP_mc"); + + b.Property("Mcrstat") + .HasColumnType("real") + .HasColumnName("MCRSTAT"); + + b.Property("Ra33Mc") + .HasColumnType("real") + .HasColumnName("RA33_mc"); + + b.Property("Ra33f2Mc") + .HasColumnType("real") + .HasColumnName("RA33F2_mc"); + + b.Property("Ra33f4Mc") + .HasColumnType("real") + .HasColumnName("RA33F4_mc"); + + b.Property("Rp33Mc") + .HasColumnType("real") + .HasColumnName("RP33_mc"); + + b.Property("Rp33f2Mc") + .HasColumnType("real") + .HasColumnName("RP33F2_mc"); + + b.Property("Rp33f4Mc") + .HasColumnType("real") + .HasColumnName("RP33F4_mc"); + + b.Property("SlvlMc") + .HasColumnType("real") + .HasColumnName("SLVL_mc"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_50"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Btot") + .HasColumnType("real") + .HasColumnName("Btot"); + + b.Property("Bx") + .HasColumnType("real") + .HasColumnName("Bx"); + + b.Property("By") + .HasColumnType("real") + .HasColumnName("By"); + + b.Property("Bz") + .HasColumnType("real") + .HasColumnName("Bz"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Gtot") + .HasColumnType("real") + .HasColumnName("Gtot"); + + b.Property("Gx") + .HasColumnType("real") + .HasColumnName("Gx"); + + b.Property("Gy") + .HasColumnType("real") + .HasColumnName("Gy"); + + b.Property("Gz") + .HasColumnType("real") + .HasColumnName("Gz"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_60"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Att06h") + .HasColumnType("real") + .HasColumnName("ATT06H"); + + b.Property("Att06l") + .HasColumnType("real") + .HasColumnName("ATT06L"); + + b.Property("Att10h") + .HasColumnType("real") + .HasColumnName("ATT10H"); + + b.Property("Att10l") + .HasColumnType("real") + .HasColumnName("ATT10L"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Phl1f1") + .HasColumnType("real") + .HasColumnName("PHL1F1"); + + b.Property("Phl1f2") + .HasColumnType("real") + .HasColumnName("PHL1F2"); + + b.Property("Phl2f1") + .HasColumnType("real") + .HasColumnName("PHL2F1"); + + b.Property("Phl2f2") + .HasColumnType("real") + .HasColumnName("PHL2F2"); + + b.Property("Status") + .HasColumnType("real") + .HasColumnName("Status"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_61"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptsvym") + .HasColumnType("real") + .HasColumnName("DEPTSVYM"); + + b.Property("Deptsvyv") + .HasColumnType("real") + .HasColumnName("DEPTSVYV"); + + b.Property("Passnum") + .HasColumnType("smallint") + .HasColumnName("PASSNUM"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Svyazc") + .HasColumnType("real") + .HasColumnName("SVYAZC"); + + b.Property("Svyazu") + .HasColumnType("real") + .HasColumnName("SVYAZU"); + + b.Property("Svydls") + .HasColumnType("real") + .HasColumnName("SVYDLS"); + + b.Property("Svyew") + .HasColumnType("real") + .HasColumnName("SVYEW"); + + b.Property("Svygtf") + .HasColumnType("real") + .HasColumnName("SVYGTF"); + + b.Property("Svyinc") + .HasColumnType("real") + .HasColumnName("SVYINC"); + + b.Property("Svymtf") + .HasColumnType("real") + .HasColumnName("SVYMTF"); + + b.Property("Svyns") + .HasColumnType("real") + .HasColumnName("SVYNS"); + + b.Property("Svytype") + .HasColumnType("text") + .HasColumnName("SVYTYPE"); + + b.Property("Svywalk") + .HasColumnType("real") + .HasColumnName("SVYWALK"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + b.ToTable("t_telemetry_wits_7"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => + { + b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); + + b.Property("Deptbitm") + .HasColumnType("real") + .HasColumnName("DEPTBITM"); + + b.Property("Deptbitv") + .HasColumnType("real") + .HasColumnName("DEPTBITV"); + + b.Property("Deptcalm") + .HasColumnType("real") + .HasColumnName("DEPTCALM"); + + b.Property("Deptcalv") + .HasColumnType("real") + .HasColumnName("DEPTCALV"); + + b.Property("Deptfdm") + .HasColumnType("real") + .HasColumnName("DEPTFDM"); + + b.Property("Deptfdv") + .HasColumnType("real") + .HasColumnName("DEPTFDV"); + + b.Property("Deptgr1m") + .HasColumnType("real") + .HasColumnName("DEPTGR1M"); + + b.Property("Deptgr1v") + .HasColumnType("real") + .HasColumnName("DEPTGR1V"); + + b.Property("Deptgr2m") + .HasColumnType("real") + .HasColumnName("DEPTGR2M"); + + b.Property("Deptgr2v") + .HasColumnType("real") + .HasColumnName("DEPTGR2V"); + + b.Property("Deptmeas") + .HasColumnType("real") + .HasColumnName("DEPTMEAS"); + + b.Property("Deptp1m") + .HasColumnType("real") + .HasColumnName("DEPTP1M"); + + b.Property("Deptp1v") + .HasColumnType("real") + .HasColumnName("DEPTP1V"); + + b.Property("Deptp2m") + .HasColumnType("real") + .HasColumnName("DEPTP2M"); + + b.Property("Deptp2v") + .HasColumnType("real") + .HasColumnName("DEPTP2V"); + + b.Property("Deptrs1m") + .HasColumnType("real") + .HasColumnName("DEPTRS1M"); + + b.Property("Deptrs1v") + .HasColumnType("real") + .HasColumnName("DEPTRS1V"); + + b.Property("Deptrs2m") + .HasColumnType("real") + .HasColumnName("DEPTRS2M"); + + b.Property("Deptrs2v") + .HasColumnType("real") + .HasColumnName("DEPTRS2V"); + + b.Property("Deptvert") + .HasColumnType("real") + .HasColumnName("DEPTVERT"); + + b.Property("Mclp") + .HasColumnType("real") + .HasColumnName("MCLP"); + + b.Property("Mfd") + .HasColumnType("real") + .HasColumnName("MFD"); + + b.Property("Mffp") + .HasColumnType("real") + .HasColumnName("MFFP"); + + b.Property("Mfpp") + .HasColumnType("real") + .HasColumnName("MFPP"); + + b.Property("Mfrann") + .HasColumnType("real") + .HasColumnName("MFRANN"); + + b.Property("Mfrpipe") + .HasColumnType("real") + .HasColumnName("MFRPIPE"); + + b.Property("Mftann") + .HasColumnType("real") + .HasColumnName("MFTANN"); + + b.Property("Mftpipe") + .HasColumnType("real") + .HasColumnName("MFTPIPE"); + + b.Property("Mg1") + .HasColumnType("real") + .HasColumnName("MG1"); + + b.Property("Mg1c") + .HasColumnType("real") + .HasColumnName("MG1C"); + + b.Property("Mg2") + .HasColumnType("real") + .HasColumnName("MG2"); + + b.Property("Mg2c") + .HasColumnType("real") + .HasColumnName("MG2C"); + + b.Property("Mpo1") + .HasColumnType("real") + .HasColumnName("MPO1"); + + b.Property("Mpo2") + .HasColumnType("real") + .HasColumnName("MPO2"); + + b.Property("Mr1") + .HasColumnType("real") + .HasColumnName("MR1"); + + b.Property("Mr1c") + .HasColumnType("real") + .HasColumnName("MR1C"); + + b.Property("Mr2") + .HasColumnType("real") + .HasColumnName("MR2"); + + b.Property("Mr2c") + .HasColumnType("real") + .HasColumnName("MR2C"); + + b.Property("Passnum") + .HasColumnType("smallint") + .HasColumnName("PASSNUM"); + + b.Property("Spare1") + .HasColumnType("real") + .HasColumnName("SPARE1"); + + b.Property("Spare2") + .HasColumnType("real") + .HasColumnName("SPARE2"); + + b.Property("Spare3") + .HasColumnType("real") + .HasColumnName("SPARE3"); + + b.Property("Spare4") + .HasColumnType("real") + .HasColumnName("SPARE4"); + + b.Property("Spare5") + .HasColumnType("real") + .HasColumnName("SPARE5"); + + b.Property("Spare6") + .HasColumnType("real") + .HasColumnName("SPARE6"); + + b.Property("Spare7") + .HasColumnType("real") + .HasColumnName("SPARE7"); + + b.Property("Spare8") + .HasColumnType("real") + .HasColumnName("SPARE8"); + + b.Property("Spare9") + .HasColumnType("real") + .HasColumnName("SPARE9"); + + b.Property("TelemetryId") + .HasColumnType("integer"); + + b.HasIndex("TelemetryId"); + + 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.Navigation("Deposit"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.HasOne("AsbCloudDb.Model.CompanyType", "CompanyType") + .WithMany("Companies") + .HasForeignKey("IdCompanyType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.Well", "Well") + .WithMany("Contacts") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CompanyType"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DailyReports.DailyReport", b => + { + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => + { + 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.Navigation("OperationCategory"); + + 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.Well", "Well") + .WithMany("DrillingProgramParts") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FileCategory"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Faq", b => + { + b.HasOne("AsbCloudDb.Model.User", "AuthorAnswer") + .WithMany() + .HasForeignKey("IdAuthorAnswer"); + + b.HasOne("AsbCloudDb.Model.User", "AuthorQuestion") + .WithMany() + .HasForeignKey("IdAuthorQuestion") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AuthorAnswer"); + + b.Navigation("AuthorQuestion"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("FileCategory"); + + 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.User", "User") + .WithMany("FileMarks") + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_user_t_file_mark_fk"); + + b.Navigation("FileInfo"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => + { + b.HasOne("AsbCloudDb.Model.FileCategory", "FileCategory") + .WithMany() + .HasForeignKey("IdCategory") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FileCategory"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => + { + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.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.Navigation("Author"); + + b.Navigation("Category"); + + 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.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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NotificationCategory"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OperationCategory"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => + { + 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.WellSectionType", "WellSectionType") + .WithMany() + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Well"); + + b.Navigation("WellSectionType"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellReam", b => + { + 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.WellSectionType", "WellSectionType") + .WithMany() + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Well"); + + 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.Well", "Well") + .WithMany("RelationCompaniesWells") + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("t_relation_company_well_t_well_id_fk"); + + b.Navigation("Company"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DrillingProgramPart"); + + 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.UserRole", "UserRole") + .WithMany("RelationUserRolePermissions") + .HasForeignKey("IdUserRole") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + 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", "IncludeRole") + .WithMany() + .HasForeignKey("IdInclude") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("IncludeRole"); + + 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.UserRole", "UserRole") + .WithMany("RelationUsersUserRoles") + .HasForeignKey("IdUserRole") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("File"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Driller"); + + 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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Subsystems.SubsystemOperationTime", b => + { + b.HasOne("AsbCloudDb.Model.Subsystems.Subsystem", "Subsystem") + .WithMany() + .HasForeignKey("IdSubsystem") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") + .WithMany() + .HasForeignKey("IdTelemetry") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Subsystem"); + + b.Navigation("Telemetry"); + }); + + 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.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.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.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.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.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.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlanned", b => + { + 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.Navigation("User"); + + 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.Navigation("Company"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => + { + b.HasOne("AsbCloudDb.Model.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.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.Navigation("Cluster"); + + b.Navigation("Telemetry"); + + 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.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.Navigation("Well"); + + b.Navigation("WellSectionType"); + + 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.User", "User") + .WithMany() + .HasForeignKey("IdUser") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AsbCloudDb.Model.Well", "Well") + .WithMany() + .HasForeignKey("IdWell") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("User"); + + 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.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.WellSectionType", "WellSectionType") + .WithMany("WellOperations") + .HasForeignKey("IdWellSectionType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OperationCategory"); + + b.Navigation("OperationPlan"); + + b.Navigation("Well"); + + b.Navigation("WellSectionType"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => + { + b.HasOne("AsbCloudDb.Model.WellOperationCategory", "Parent") + .WithMany() + .HasForeignKey("IdParent"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => + { + 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.Navigation("Telemetry"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => + { + b.Navigation("Wells"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Company", b => + { + b.Navigation("RelationCompaniesWells"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => + { + b.Navigation("Companies"); + + b.Navigation("Contacts"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => + { + b.Navigation("Clusters"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Driller", b => + { + b.Navigation("Schedule"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => + { + b.Navigation("RelatedUsers"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => + { + b.Navigation("FileMarks"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => + { + b.Navigation("Children"); + + b.Navigation("Manuals"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => + { + b.Navigation("Measures"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => + { + b.Navigation("Notifications"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Permission", b => + { + b.Navigation("RelationUserRolePermissions"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => + { + b.Navigation("DataSaub"); + + b.Navigation("DataSpin"); + + b.Navigation("Events"); + + b.Navigation("Messages"); + + b.Navigation("Users"); + + b.Navigation("Well"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.User", b => + { + b.Navigation("FileMarks"); + + b.Navigation("Files"); + + b.Navigation("RelationContactsWells"); + + b.Navigation("RelationUsersUserRoles"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.UserRole", b => + { + b.Navigation("RelationUserRolePermissions"); + + b.Navigation("RelationUserRoleUserRoles"); + + b.Navigation("RelationUsersUserRoles"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.Well", b => + { + b.Navigation("Contacts"); + + b.Navigation("DrillingProgramParts"); + + b.Navigation("RelationCompaniesWells"); + + b.Navigation("WellCompositeSrcs"); + + b.Navigation("WellComposites"); + + b.Navigation("WellOperations"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => + { + b.Navigation("WellComposites"); + + b.Navigation("WellOperations"); + }); + + modelBuilder.Entity("AsbCloudDb.Model.WellType", b => + { + b.Navigation("Wells"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/AsbCloudDb/Migrations/20231129111522_Rename_t_trajectory_plan.cs b/AsbCloudDb/Migrations/20231129111522_Rename_t_trajectory_plan.cs new file mode 100644 index 00000000..b6644976 --- /dev/null +++ b/AsbCloudDb/Migrations/20231129111522_Rename_t_trajectory_plan.cs @@ -0,0 +1,109 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AsbCloudDb.Migrations +{ + public partial class Rename_t_trajectory_plan : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_t_trajectory_planned_t_user_id_user", + table: "t_trajectory_planned"); + + migrationBuilder.DropForeignKey( + name: "FK_t_trajectory_planned_t_well_id_well", + table: "t_trajectory_planned"); + + migrationBuilder.DropPrimaryKey( + name: "PK_t_trajectory_planned", + table: "t_trajectory_planned"); + + migrationBuilder.RenameTable( + name: "t_trajectory_planned", + newName: "t_trajectory_plan"); + + migrationBuilder.RenameIndex( + name: "IX_t_trajectory_planned_id_well", + table: "t_trajectory_plan", + newName: "IX_t_trajectory_plan_id_well"); + + migrationBuilder.RenameIndex( + name: "IX_t_trajectory_planned_id_user", + table: "t_trajectory_plan", + newName: "IX_t_trajectory_plan_id_user"); + + migrationBuilder.AddPrimaryKey( + name: "PK_t_trajectory_plan", + table: "t_trajectory_plan", + column: "id"); + + migrationBuilder.AddForeignKey( + name: "FK_t_trajectory_plan_t_user_id_user", + table: "t_trajectory_plan", + column: "id_user", + principalTable: "t_user", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_t_trajectory_plan_t_well_id_well", + table: "t_trajectory_plan", + column: "id_well", + principalTable: "t_well", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_t_trajectory_plan_t_user_id_user", + table: "t_trajectory_plan"); + + migrationBuilder.DropForeignKey( + name: "FK_t_trajectory_plan_t_well_id_well", + table: "t_trajectory_plan"); + + migrationBuilder.DropPrimaryKey( + name: "PK_t_trajectory_plan", + table: "t_trajectory_plan"); + + migrationBuilder.RenameTable( + name: "t_trajectory_plan", + newName: "t_trajectory_planned"); + + migrationBuilder.RenameIndex( + name: "IX_t_trajectory_plan_id_well", + table: "t_trajectory_planned", + newName: "IX_t_trajectory_planned_id_well"); + + migrationBuilder.RenameIndex( + name: "IX_t_trajectory_plan_id_user", + table: "t_trajectory_planned", + newName: "IX_t_trajectory_planned_id_user"); + + migrationBuilder.AddPrimaryKey( + name: "PK_t_trajectory_planned", + table: "t_trajectory_planned", + column: "id"); + + migrationBuilder.AddForeignKey( + name: "FK_t_trajectory_planned_t_user_id_user", + table: "t_trajectory_planned", + column: "id_user", + principalTable: "t_user", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_t_trajectory_planned_t_well_id_well", + table: "t_trajectory_planned", + column: "id_well", + principalTable: "t_well", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + } + } +} diff --git a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs index ff169691..91e84dfa 100644 --- a/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs +++ b/AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs @@ -262,7 +262,7 @@ namespace AsbCloudDb.Migrations b.HasComment("Контакты"); }); - modelBuilder.Entity("AsbCloudDb.Model.DailyReport.DailyReport", b => + modelBuilder.Entity("AsbCloudDb.Model.DailyReports.DailyReport", b => { b.Property("IdWell") .HasColumnType("integer") @@ -2413,12 +2413,6 @@ namespace AsbCloudDb.Migrations Id = 528, Description = "Разрешение на удаление контакта", Name = "WellContact.delete" - }, - new - { - Id = 529, - Description = "Разрешение редактировать фактические траектории", - Name = "FactTrajectory.edit" }); }); @@ -4015,11 +4009,6 @@ namespace AsbCloudDb.Migrations { IdUserRole = 1, IdPermission = 528 - }, - new - { - IdUserRole = 1, - IdPermission = 529 }); }); @@ -5191,7 +5180,7 @@ namespace AsbCloudDb.Migrations b.HasComment("Загрузка фактической траектории"); }); - modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlanned", b => + modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlan", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -5256,7 +5245,7 @@ namespace AsbCloudDb.Migrations b.HasIndex("IdWell"); - b.ToTable("t_trajectory_planned"); + b.ToTable("t_trajectory_plan"); b.HasComment("Загрузка плановой траектории"); }); @@ -8675,7 +8664,7 @@ namespace AsbCloudDb.Migrations b.Navigation("Well"); }); - modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlanned", b => + modelBuilder.Entity("AsbCloudDb.Model.Trajectory.TrajectoryPlan", b => { b.HasOne("AsbCloudDb.Model.User", "User") .WithMany() diff --git a/AsbCloudDb/Model/AsbCloudDbContext.cs b/AsbCloudDb/Model/AsbCloudDbContext.cs index ce728586..bd1e1690 100644 --- a/AsbCloudDb/Model/AsbCloudDbContext.cs +++ b/AsbCloudDb/Model/AsbCloudDbContext.cs @@ -18,7 +18,7 @@ namespace AsbCloudDb.Model public virtual DbSet DailyReports => Set (); public virtual DbSet Deposits => Set(); public virtual DbSet DetectedOperations => Set(); - public virtual DbSet PlannedTrajectories => Set(); + public virtual DbSet TrajectoriesPlan => Set(); public virtual DbSet ProcessMapWellDrillings => Set(); public virtual DbSet ProcessMapWellReams => Set(); public virtual DbSet DrillingProgramParts => Set(); @@ -61,7 +61,7 @@ namespace AsbCloudDb.Model public virtual DbSet LimitingParameter => Set(); public virtual DbSet TelemetryWirelineRunOut => Set(); - public virtual DbSet FactTrajectories => Set(); + public virtual DbSet TrajectoriesFact => Set(); // GTR WITS public DbSet WitsItemFloat => Set(); diff --git a/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs b/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs index 4b6bc2c8..b0476833 100644 --- a/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs +++ b/AsbCloudDb/Model/DefaultData/EntityFillerPermission.cs @@ -160,9 +160,7 @@ new (){ Id = 526, Name = "WellOperation.editCompletedWell", Description = "Разрешение на редактирование операций у завершенной скважины"}, new() { Id = 527, Name = "Manual.delete", Description = "Разрешение на удаление инструкций"}, - new (){ Id = 528, Name="WellContact.delete", Description="Разрешение на удаление контакта"}, - - new (){ Id = 529, Name="FactTrajectory.edit", Description="Разрешение редактировать фактические траектории"} + new (){ Id = 528, Name="WellContact.delete", Description="Разрешение на удаление контакта"} }; } } diff --git a/AsbCloudDb/Model/IAsbCloudDbContext.cs b/AsbCloudDb/Model/IAsbCloudDbContext.cs index bf1d0e8a..f19a1927 100644 --- a/AsbCloudDb/Model/IAsbCloudDbContext.cs +++ b/AsbCloudDb/Model/IAsbCloudDbContext.cs @@ -22,7 +22,7 @@ namespace AsbCloudDb.Model DbSet DailyReports { get; } DbSet Deposits { get; } DbSet DetectedOperations { get; } - DbSet PlannedTrajectories { get; } + DbSet TrajectoriesPlan { get; } DbSet ProcessMapWellDrillings { get; } DbSet ProcessMapWellReams { get; } DbSet DrillingProgramParts { get; } @@ -79,7 +79,7 @@ namespace AsbCloudDb.Model DbSet ManualDirectories { get; } DbSet Contacts { get; } DbSet DrillTests { get; } - DbSet FactTrajectories { get; } + DbSet TrajectoriesFact { get; } DatabaseFacade Database { get; } Task RefreshMaterializedViewAsync(string mwName, CancellationToken token); diff --git a/AsbCloudDb/Model/Trajectory/TrajectoryPlanned.cs b/AsbCloudDb/Model/Trajectory/TrajectoryPlan.cs similarity index 62% rename from AsbCloudDb/Model/Trajectory/TrajectoryPlanned.cs rename to AsbCloudDb/Model/Trajectory/TrajectoryPlan.cs index 20f54025..3f88e0d4 100644 --- a/AsbCloudDb/Model/Trajectory/TrajectoryPlanned.cs +++ b/AsbCloudDb/Model/Trajectory/TrajectoryPlan.cs @@ -3,8 +3,8 @@ using System.ComponentModel.DataAnnotations.Schema; namespace AsbCloudDb.Model.Trajectory { - [Table("t_trajectory_planned"), Comment("Загрузка плановой траектории")] - public class TrajectoryPlanned : Trajectory + [Table("t_trajectory_plan"), Comment("Загрузка плановой траектории")] + public class TrajectoryPlan : Trajectory { [Column("radius"), Comment("Радиус цели")] public double? Radius { get; set; } diff --git a/AsbCloudInfrastructure/DependencyInjection.cs b/AsbCloudInfrastructure/DependencyInjection.cs index ecfe3432..e0dbf411 100644 --- a/AsbCloudInfrastructure/DependencyInjection.cs +++ b/AsbCloudInfrastructure/DependencyInjection.cs @@ -204,8 +204,8 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -268,7 +268,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient, TrajectoryEditableRepository>(); + services.AddTransient, TrajectoryEditableRepository>(); services.AddTransient, TrajectoryEditableRepository>(); services.AddTransient(); services.AddTransient(); diff --git a/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs index db6917fd..4c8ab283 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryEditableRepository.cs @@ -1,7 +1,6 @@ using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Exceptions; using AsbCloudApp.Repositories; -using AsbCloudApp.Requests; using AsbCloudApp.Services; using AsbCloudDb.Model; using AsbCloudDb.Model.Trajectory; @@ -31,7 +30,7 @@ namespace AsbCloudInfrastructure.Repository this.db = db; this.wellService = wellService; } - /// + public async Task AddRangeAsync(IEnumerable trajectoryRows, CancellationToken token) { var idWell = trajectoryRows.First().IdWell; @@ -48,11 +47,9 @@ namespace AsbCloudInfrastructure.Repository }); db.Set().AddRange(entities); - return await db.SaveChangesAsync(token) - .ConfigureAwait(false); + return await db.SaveChangesAsync(token); } - /// public async Task AddAsync(Tdto trajectoryRow, CancellationToken token) { var offsetHours = wellService.GetTimezone(trajectoryRow.IdWell).Hours; @@ -63,7 +60,6 @@ namespace AsbCloudInfrastructure.Repository .ConfigureAwait(false); } - /// public async Task DeleteRangeAsync(IEnumerable ids, CancellationToken token) { var query = db.Set() @@ -73,7 +69,6 @@ namespace AsbCloudInfrastructure.Repository .ConfigureAwait(false); } - /// public async Task DeleteByIdWellAsync(int idWell, CancellationToken token) { var query = db.Set() @@ -83,11 +78,10 @@ namespace AsbCloudInfrastructure.Repository .ConfigureAwait(false); } - /// - public async Task> GetAsync(TrajectoryRequest request, CancellationToken token) + public async Task> GetAsync(int idWell, CancellationToken token) { - var well = wellService.GetOrDefault(request.IdWell) - ?? throw new ArgumentInvalidException(nameof(request.IdWell), "idWell doesn`t exist"); + var well = wellService.GetOrDefault(idWell) + ?? throw new ArgumentInvalidException(nameof(idWell), "idWell doesn`t exist"); var offsetHours = well.Timezone.Hours; var query = db.Set() @@ -96,12 +90,12 @@ namespace AsbCloudInfrastructure.Repository var entities = await query .OrderBy(e => e.WellboreDepth) .ToArrayAsync(token); + var result = entities .Select(r => Convert(r, offsetHours)); return result; } - /// public async Task UpdateAsync(Tdto row, CancellationToken token) { var offsetHours = wellService.GetTimezone(row.IdWell).Hours; @@ -111,14 +105,14 @@ namespace AsbCloudInfrastructure.Repository .ConfigureAwait(false); } - private Tdto Convert(TEntity entity, double offsetHours) + private static Tdto Convert(TEntity entity, double offsetHours) { var dto = entity.Adapt(); dto.UpdateDate = entity.UpdateDate.ToRemoteDateTime(offsetHours); return dto; } - private TEntity Convert(Tdto dto, double offsetHours) + private static TEntity Convert(Tdto dto, double offsetHours) { var entity = dto.Adapt(); entity.UpdateDate = DateTime.Now.ToUtcDateTimeOffset(offsetHours); diff --git a/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs index 64804b96..a2ee3f46 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs @@ -2,7 +2,6 @@ using AsbCloudApp.Exceptions; using AsbCloudApp.Repositories; using AsbCloudApp.Requests; -using AsbCloudApp.Services; using AsbCloudDb.Model; using AsbCloudDb.Model.WITS; using Microsoft.EntityFrameworkCore; @@ -16,11 +15,9 @@ namespace AsbCloudInfrastructure.Repository public class TrajectoryNnbRepository : ITrajectoryNnbRepository { private readonly IAsbCloudDbContext db; - private readonly IWellService wellService; - public TrajectoryNnbRepository(IAsbCloudDbContext db, IWellService wellService) + public TrajectoryNnbRepository(IAsbCloudDbContext db) { this.db = db; - this.wellService = wellService; } private IQueryable BuildQuery(TrajectoryRequest request) @@ -42,8 +39,12 @@ namespace AsbCloudInfrastructure.Repository return query.OrderBy(e => e.Deptsvym); } - public async Task> GetAsync(TrajectoryRequest request, CancellationToken token) + public async Task> GetAsync(int idWell, CancellationToken token) { + var request = new TrajectoryRequest() + { + IdWell = idWell, + }; var entities = (await BuildQuery(request) .Where(coord => coord.Deptsvym.HasValue && coord.Svyinc.HasValue && @@ -65,5 +66,10 @@ namespace AsbCloudInfrastructure.Repository return result; } + + public Task> GetByRequestAsync(TrajectoryRequest trajectoryRequest, CancellationToken cancellationToken) + { + throw new System.NotImplementedException(); + } } } diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs index 942446cd..ae4aa1a9 100644 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs +++ b/AsbCloudInfrastructure/Services/DailyReport/DailyReportService.cs @@ -26,7 +26,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport; public class DailyReportService : IDailyReportService { private readonly IWellService wellService; - private readonly ITrajectoryEditableRepository trajectoryFactRepository; + private readonly ITrajectoryNnbRepository trajectoryFactNnbRepository; private readonly IDailyReportRepository dailyReportRepository; private readonly IScheduleRepository scheduleRepository; private readonly IWellOperationRepository wellOperationRepository; @@ -35,7 +35,7 @@ public class DailyReportService : IDailyReportService private readonly IDetectedOperationService detectedOperationService; public DailyReportService(IWellService wellService, - ITrajectoryEditableRepository trajectoryFactRepository, + ITrajectoryNnbRepository trajectoryFactNnbRepository, IDailyReportRepository dailyReportRepository, IScheduleRepository scheduleRepository, IWellOperationRepository wellOperationRepository, @@ -44,7 +44,7 @@ public class DailyReportService : IDailyReportService IDetectedOperationService detectedOperationService) { this.wellService = wellService; - this.trajectoryFactRepository = trajectoryFactRepository; + this.trajectoryFactNnbRepository = trajectoryFactNnbRepository; this.dailyReportRepository = dailyReportRepository; this.scheduleRepository = scheduleRepository; this.wellOperationRepository = wellOperationRepository; @@ -260,7 +260,7 @@ public class DailyReportService : IDailyReportService private async Task AddTrajectoryBlockAsync(DailyReportDto dailyReport, CancellationToken cancellationToken) { - var trajectory = (await trajectoryFactRepository.GetAsync(new TrajectoryRequest + var trajectory = (await trajectoryFactNnbRepository.GetByRequestAsync(new TrajectoryRequest { IdWell = dailyReport.IdWell, GeDate = dailyReport.Date, diff --git a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryExportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryExportService.cs index 9ea76753..b2384d0e 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryExportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryExportService.cs @@ -1,6 +1,5 @@ using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Repositories; -using AsbCloudApp.Requests; using AsbCloudApp.Services; using ClosedXML.Excel; using System; @@ -17,31 +16,22 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export private readonly IWellService wellService; private readonly ITrajectoryRepository trajectoryRepository; - protected abstract void AddCoordinatesToRow(IXLRow row, T trajectory); - public abstract string templateFileName { get; set; } - public abstract string usingTemplateFile { get; set; } - public abstract string sheetTrajectory { get; set; } - public abstract int headerRowsCount { get; set; } - public abstract int ColumnWellboreDepth { get; set; } - public abstract int ColumnZenithAngle { get; set; } - public abstract int ColumnAzimuthGeo { get; set; } - public abstract int ColumnAzimuthMagnetic { get; set; } - public abstract int ColumnVerticalDepth { get; set; } - public abstract int ColumnComment { get; set; } + public abstract string templateFileName { get; } + public abstract string usingTemplateFile { get; } + public abstract string sheetTrajectory { get; } + public abstract int headerRowsCount { get; } - public TrajectoryExportService(IWellService wellService, ITrajectoryRepository trajectoryService) + public TrajectoryExportService(IWellService wellService, ITrajectoryRepository trajectoryRepository) { this.wellService = wellService; - this.trajectoryRepository = trajectoryService; + this.trajectoryRepository = trajectoryRepository; } + protected abstract void AddCoordinatesToRow(IXLRow row, T trajectory); + public async Task ExportAsync(int idWell, CancellationToken token) { - var request = new TrajectoryRequest() - { - IdWell = idWell, - }; - var trajectorys = await trajectoryRepository.GetAsync(request, token); + var trajectorys = await trajectoryRepository.GetAsync(idWell, token); return MakeExelFileStream(trajectorys); } diff --git a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs index 3a7ebf12..702b79f0 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs @@ -8,16 +8,10 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export public class TrajectoryFactManualExportService : TrajectoryExportService { - public override string templateFileName { get; set; } = "TrajectoryFactManualTemplate.xlsx"; - public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; - public override string sheetTrajectory { get; set; } = "Фактическая траектория"; - public override int headerRowsCount { get; set; } = 2; - public override int ColumnWellboreDepth { get; set; } = 1; - public override int ColumnZenithAngle { get; set; } = 2; - public override int ColumnAzimuthGeo { get; set; } = 3; - public override int ColumnAzimuthMagnetic { get; set; } = 4; - public override int ColumnVerticalDepth { get; set; } = 5; - public override int ColumnComment { get; set; } = 6; + public override string templateFileName { get; } = "TrajectoryFactManualTemplate.xlsx"; + public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; + public override string sheetTrajectory { get; } = "Фактическая траектория"; + public override int headerRowsCount { get; } = 2; public TrajectoryFactManualExportService( IWellService wellService, @@ -29,12 +23,12 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoFactDto trajectory) { - row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; - row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; - row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; - row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; - row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; - row.Cell(ColumnComment).Value = trajectory.Comment; + row.Cell(1).Value = trajectory.WellboreDepth; + row.Cell(2).Value = trajectory.ZenithAngle; + row.Cell(3).Value = trajectory.AzimuthGeo; + row.Cell(4).Value = trajectory.AzimuthMagnetic; + row.Cell(5).Value = trajectory.VerticalDepth; + row.Cell(6).Value = trajectory.Comment; } } } diff --git a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs index 5c34fc21..e787eb73 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs @@ -7,17 +7,11 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export { public class TrajectoryFactNnbExportService : TrajectoryExportService - { - public override string templateFileName { get; set; } = "TrajectoryFactNnbTemplate.xlsx"; - public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; - public override string sheetTrajectory { get; set; } = "Фактическая ннб-траектория"; - public override int headerRowsCount { get; set; } = 2; - public override int ColumnWellboreDepth { get; set; } = 1; - public override int ColumnZenithAngle { get; set; } = 2; - public override int ColumnAzimuthGeo { get; set; } = 3; - public override int ColumnAzimuthMagnetic { get; set; } = 4; - public override int ColumnVerticalDepth { get; set; } = 5; - public override int ColumnComment { get; set; } = 6; + { + public override string templateFileName { get; } = "TrajectoryFactNnbTemplate.xlsx"; + public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; + public override string sheetTrajectory { get; } = "Фактическая ннб-траектория"; + public override int headerRowsCount { get; } = 2; public TrajectoryFactNnbExportService( IWellService wellService, @@ -29,12 +23,12 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoFactDto trajectory) { - row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; - row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; - row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; - row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; - row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; - row.Cell(ColumnComment).Value = trajectory.Comment; + row.Cell(1).Value = trajectory.WellboreDepth; + row.Cell(2).Value = trajectory.ZenithAngle; + row.Cell(3).Value = trajectory.AzimuthGeo; + row.Cell(4).Value = trajectory.AzimuthMagnetic; + row.Cell(5).Value = trajectory.VerticalDepth; + row.Cell(6).Value = trajectory.Comment; } } } diff --git a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlannedExportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlannedExportService.cs index 26160885..fde6f246 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlannedExportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlannedExportService.cs @@ -10,17 +10,10 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export /* * password for PlannedTrajectoryTemplate.xlsx is Drill2022 */ - public override string templateFileName { get; set; } = "TrajectoryPlannedTemplate.xlsx"; - public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; - public override string sheetTrajectory { get; set; } = "Плановая траектория"; - public override int headerRowsCount { get; set; } = 2; - public override int ColumnWellboreDepth { get; set; } = 1; - public override int ColumnZenithAngle { get; set; } = 2; - public override int ColumnAzimuthGeo { get; set; } = 3; - public override int ColumnAzimuthMagnetic { get; set; } = 4; - public override int ColumnVerticalDepth { get; set; } = 5; - public int ColumnRadius { get; set; } = 6; - public override int ColumnComment { get; set; } = 7; + public override string templateFileName { get; } = "TrajectoryPlannedTemplate.xlsx"; + public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; + public override string sheetTrajectory { get; } = "Плановая траектория"; + public override int headerRowsCount { get; } = 2; public TrajectoryPlannedExportService( IWellService wellService, @@ -31,13 +24,13 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoPlanDto trajectory) { - row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; - row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; - row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; - row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; - row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; - row.Cell(ColumnRadius).Value = trajectory.Radius; - row.Cell(ColumnComment).Value = trajectory.Comment; + row.Cell(1).Value = trajectory.WellboreDepth; + row.Cell(2).Value = trajectory.ZenithAngle; + row.Cell(3).Value = trajectory.AzimuthGeo; + row.Cell(4).Value = trajectory.AzimuthMagnetic; + row.Cell(5).Value = trajectory.VerticalDepth; + row.Cell(6).Value = trajectory.Radius; + row.Cell(7).Value = trajectory.Comment; } } diff --git a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualImportService.cs deleted file mode 100644 index fb22794e..00000000 --- a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualImportService.cs +++ /dev/null @@ -1,43 +0,0 @@ -using AsbCloudApp.Data.Trajectory; -using AsbCloudApp.Repositories; -using AsbCloudApp.Services; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.Trajectory.Import -{ - - public class TrajectoryFactManualImportService : TrajectoryImportService - { - public override string templateFileName { get; set; } = "TrajectoryFactManualTemplate.xlsx"; - public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; - public override string sheetNamePlannedTrajectory { get; set; } = "Фактическая траектория"; - public override int headerRowsCount { get; set; } = 2; - public override int ColumnWellboreDepth { get; set; } = 1; - public override int ColumnZenithAngle { get; set; } = 2; - public override int ColumnAzimuthGeo { get; set; } = 3; - public override int ColumnAzimuthMagnetic { get; set; } = 4; - public override int ColumnVerticalDepth { get; set; } = 5; - public override int ColumnComment { get; set; } = 6; - - public TrajectoryFactManualImportService() : base() - { - - } - - protected override TrajectoryGeoFactDto ParseRow(IXLRow row) - { - var trajectoryRow = new TrajectoryGeoFactDto - { - WellboreDepth = row.Cell(ColumnWellboreDepth).GetCellValue(), - ZenithAngle = row.Cell(ColumnZenithAngle).GetCellValue(), - AzimuthGeo = row.Cell(ColumnAzimuthGeo).GetCellValue(), - AzimuthMagnetic = row.Cell(ColumnAzimuthMagnetic).GetCellValue(), - VerticalDepth = row.Cell(ColumnVerticalDepth).GetCellValue(), - Comment = row.Cell(ColumnComment).GetCellValue() - }; - - return trajectoryRow; - } - } -} - diff --git a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualParserService.cs b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualParserService.cs new file mode 100644 index 00000000..35f16a18 --- /dev/null +++ b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualParserService.cs @@ -0,0 +1,35 @@ +using AsbCloudApp.Data.Trajectory; +using ClosedXML.Excel; + +namespace AsbCloudInfrastructure.Services.Trajectory.Import +{ + + public class TrajectoryFactManualParserService : TrajectoryParserService + { + public override string templateFileName { get; } = "TrajectoryFactManualTemplate.xlsx"; + public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; + public override string sheetNameTrajectory { get; } = "Фактическая траектория"; + public override int headerRowsCount { get; } = 2; + + public TrajectoryFactManualParserService() : base() + { + + } + + protected override TrajectoryGeoFactDto ParseRow(IXLRow row) + { + var trajectoryRow = new TrajectoryGeoFactDto + { + WellboreDepth = row.Cell(1).GetCellValue(), + ZenithAngle = row.Cell(2).GetCellValue(), + AzimuthGeo = row.Cell(3).GetCellValue(), + AzimuthMagnetic = row.Cell(4).GetCellValue(), + VerticalDepth = row.Cell(5).GetCellValue(), + Comment = row.Cell(6).GetCellValue() + }; + //TODO: Добавить валидацию модели IValidatableObject + return trajectoryRow; + } + } +} + diff --git a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryParserService.cs similarity index 68% rename from AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryImportService.cs rename to AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryParserService.cs index 9c357dcb..c5b1c0b0 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryParserService.cs @@ -1,36 +1,26 @@ using AsbCloudApp.Data.Trajectory; -using AsbCloudApp.Repositories; -using AsbCloudApp.Services; using ClosedXML.Excel; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.IO; using System.Linq; -using System.Threading; -using System.Threading.Tasks; namespace AsbCloudInfrastructure.Services.Trajectory.Import { - public abstract class TrajectoryImportService where T : TrajectoryGeoDto + public abstract class TrajectoryParserService + where T : TrajectoryGeoDto { - private readonly IWellService wellService; + public abstract string templateFileName { get; } + public abstract string usingTemplateFile { get; } + public abstract string sheetNameTrajectory { get; } + public abstract int headerRowsCount { get; } - protected abstract T ParseRow(IXLRow row); - public abstract string templateFileName { get; set; } - public abstract string usingTemplateFile { get; set; } - public abstract string sheetNamePlannedTrajectory { get; set; } - public abstract int headerRowsCount { get; set; } - public abstract int ColumnWellboreDepth { get; set; } - public abstract int ColumnZenithAngle { get; set; } - public abstract int ColumnAzimuthGeo { get; set; } - public abstract int ColumnAzimuthMagnetic { get; set; } - public abstract int ColumnVerticalDepth { get; set; } - public abstract int ColumnComment { get; set; } - - public TrajectoryImportService() + public TrajectoryParserService() { } + protected abstract T ParseRow(IXLRow row); - public async Task> ImportAsync(Stream stream, CancellationToken token) + public IEnumerable ImportAsync(Stream stream) { using var workbook = new XLWorkbook(stream, XLEventTracking.Disabled); var trajectoryRows = ParseFileStream(stream); @@ -47,9 +37,9 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Import private IEnumerable ParseWorkbook(IXLWorkbook workbook) { - var sheetTrajectory = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetNamePlannedTrajectory); + var sheetTrajectory = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetNameTrajectory); if (sheetTrajectory is null) - throw new FileFormatException($"Книга excel не содержит листа {sheetNamePlannedTrajectory}."); + throw new FileFormatException($"Книга excel не содержит листа {sheetNameTrajectory}."); var trajectoryRows = ParseSheet(sheetTrajectory); return trajectoryRows; } diff --git a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedImportService.cs deleted file mode 100644 index 386a9b41..00000000 --- a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedImportService.cs +++ /dev/null @@ -1,47 +0,0 @@ -using AsbCloudApp.Data.Trajectory; -using AsbCloudApp.Services; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.Trajectory.Import -{ - - public class TrajectoryPlannedImportService : TrajectoryImportService - { - /* - * password for PlannedTrajectoryTemplate.xlsx is Drill2022 - */ - public override string templateFileName { get; set; } = "TrajectoryPlannedTemplate.xlsx"; - public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; - public override string sheetNamePlannedTrajectory { get; set; } = "Плановая траектория"; - public override int headerRowsCount { get; set; } = 2; - public override int ColumnWellboreDepth { get; set; } = 1; - public override int ColumnZenithAngle { get; set; } = 2; - public override int ColumnAzimuthGeo { get; set; } = 3; - public override int ColumnAzimuthMagnetic { get; set; } = 4; - public override int ColumnVerticalDepth { get; set; } = 5; - public int ColumnRadius { get; set; } = 6; - public override int ColumnComment { get; set; } = 7; - - public TrajectoryPlannedImportService() : base() - { - } - - protected override TrajectoryGeoPlanDto ParseRow(IXLRow row) - { - var trajectoryRow = new TrajectoryGeoPlanDto - { - WellboreDepth = row.Cell(ColumnWellboreDepth).GetCellValue(), - ZenithAngle = row.Cell(ColumnZenithAngle).GetCellValue(), - AzimuthGeo = row.Cell(ColumnAzimuthGeo).GetCellValue(), - AzimuthMagnetic = row.Cell(ColumnAzimuthMagnetic).GetCellValue(), - VerticalDepth = row.Cell(ColumnVerticalDepth).GetCellValue(), - Radius = row.Cell(ColumnRadius).GetCellValue(), - Comment = row.Cell(ColumnComment).GetCellValue() - }; - - return trajectoryRow; - } - } - -} - diff --git a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedParserService.cs b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedParserService.cs new file mode 100644 index 00000000..4328dc32 --- /dev/null +++ b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedParserService.cs @@ -0,0 +1,40 @@ +using AsbCloudApp.Data.Trajectory; +using ClosedXML.Excel; + +namespace AsbCloudInfrastructure.Services.Trajectory.Import +{ + + public class TrajectoryPlannedParserService : TrajectoryParserService + { + /* + * password for PlannedTrajectoryTemplate.xlsx is Drill2022 + */ + public override string templateFileName { get; } = "TrajectoryPlannedTemplate.xlsx"; + public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; + public override string sheetNameTrajectory { get; } = "Плановая траектория"; + public override int headerRowsCount { get; } = 2; + + public TrajectoryPlannedParserService() : base() + { + } + + protected override TrajectoryGeoPlanDto ParseRow(IXLRow row) + { + var trajectoryRow = new TrajectoryGeoPlanDto + { + WellboreDepth = row.Cell(1).GetCellValue(), + ZenithAngle = row.Cell(2).GetCellValue(), + AzimuthGeo = row.Cell(3).GetCellValue(), + AzimuthMagnetic = row.Cell(4).GetCellValue(), + VerticalDepth = row.Cell(5).GetCellValue(), + Radius = row.Cell(6).GetCellValue(), + Comment = row.Cell(7).GetCellValue() + }; + + //TODO: Добавить валидацию модели IValidatableObject + return trajectoryRow; + } + } + +} + diff --git a/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs b/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs index 427a23ee..216a2041 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs @@ -30,11 +30,7 @@ abstract class TrajectoryBaseService public async Task?> GetAsync(int idWell, CancellationToken token) { - var request = new TrajectoryRequest() - { - IdWell = idWell - }; - var geoCoords = await repository.GetAsync(request, token); + var geoCoords = await repository.GetAsync(idWell, token); var locs = GetTrajectoryVisualisation(geoCoords); var dtos = locs.Select(l => Convert(l)); return dtos; diff --git a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs b/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs index 68bad5eb..2bfb4136 100644 --- a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs +++ b/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs @@ -23,6 +23,8 @@ namespace AsbCloudWebApi.Tests.Services.Trajectory private readonly ITrajectoryNnbRepository trajectoryFactNnbRepository; private readonly TrajectoryFactNnbExportService trajectoryFactNnbExportService; + private readonly int idWell = 4; + private readonly TrajectoryGeoPlanDto[] trajectoryPlannedRows = new TrajectoryGeoPlanDto[2] { new TrajectoryGeoPlanDto() { Id = 1, @@ -79,14 +81,6 @@ namespace AsbCloudWebApi.Tests.Services.Trajectory }, }; - private readonly TrajectoryRequest request = new TrajectoryRequest() - { - IdWell = 4, - GeDate = DateTime.Now.AddDays(5), - LeDate = DateTime.Now.AddDays(-5), - }; - - public TrajectoryExportTest() { wellService = Substitute.For(); @@ -103,10 +97,10 @@ namespace AsbCloudWebApi.Tests.Services.Trajectory [Fact] public async Task Export_trajectory_planned() { - trajectoryPlannedRepository.GetAsync(request, CancellationToken.None) + trajectoryPlannedRepository.GetAsync(idWell, CancellationToken.None) .Returns(trajectoryPlannedRows); - var stream = await trajectoryPlannedExportService.ExportAsync(request.IdWell, CancellationToken.None); + var stream = await trajectoryPlannedExportService.ExportAsync(idWell, CancellationToken.None); Assert.True(stream.Length > 0); } @@ -114,20 +108,20 @@ namespace AsbCloudWebApi.Tests.Services.Trajectory [Fact] public async Task Export_trajectory_fact_manual() { - trajectoryFactManualReposirory.GetAsync(request, CancellationToken.None) + trajectoryFactManualReposirory.GetAsync(idWell, CancellationToken.None) .Returns(trajectoryFactRows); - var stream = await trajectoryFactManualExportService.ExportAsync(request.IdWell, CancellationToken.None); + var stream = await trajectoryFactManualExportService.ExportAsync(idWell, CancellationToken.None); Assert.True(stream.Length > 0); } [Fact] public async Task Export_trajectory_fact_nnb() { - trajectoryFactNnbRepository.GetAsync(request, CancellationToken.None) + trajectoryFactNnbRepository.GetAsync(idWell, CancellationToken.None) .Returns(trajectoryFactRows); - var stream = await trajectoryFactNnbExportService.ExportAsync(request.IdWell, CancellationToken.None); + var stream = await trajectoryFactNnbExportService.ExportAsync(idWell, CancellationToken.None); Assert.True(stream.Length > 0); } } diff --git a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryImportTest.cs b/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryImportTest.cs index 0250cefd..7357a3d7 100644 --- a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryImportTest.cs +++ b/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryImportTest.cs @@ -1,29 +1,24 @@ -using AsbCloudApp.Services; -using AsbCloudInfrastructure.Services.Trajectory; -using AsbCloudInfrastructure.Services.Trajectory.Import; -using NSubstitute; +using AsbCloudInfrastructure.Services.Trajectory.Import; using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Xunit; namespace AsbCloudWebApi.Tests.Services.Trajectory { public class TrajectoryImportTest { - private readonly TrajectoryPlannedImportService trajectoryPlannedImportService; - private readonly TrajectoryFactManualImportService trajectoryFactManualImportService; + private readonly TrajectoryPlannedParserService trajectoryPlannedImportService; + private readonly TrajectoryFactManualParserService trajectoryFactManualImportService; private string usingTemplateFile = "AsbCloudWebApi.Tests.Services.Trajectory.Templates"; public TrajectoryImportTest() { - trajectoryPlannedImportService = new TrajectoryPlannedImportService(); - trajectoryFactManualImportService = new TrajectoryFactManualImportService(); + trajectoryPlannedImportService = new TrajectoryPlannedParserService(); + trajectoryFactManualImportService = new TrajectoryFactManualParserService(); } [Fact] - public async Task Import_trajectory_planned() + public void Import_trajectory_planned() { var stream = System.Reflection.Assembly.GetExecutingAssembly() .GetManifestResourceStream($"{usingTemplateFile}.TrajectoryPlannedTemplate.xlsx"); @@ -31,13 +26,13 @@ namespace AsbCloudWebApi.Tests.Services.Trajectory if (stream is null) Assert.Fail("Файла для импорта не существует"); - var trajectoryRows = await trajectoryPlannedImportService.ImportAsync(stream, CancellationToken.None); - + var trajectoryRows = trajectoryPlannedImportService.ImportAsync(stream); + Assert.Equal(3, trajectoryRows.Count()); } [Fact] - public async Task Import_trajectory_fact_manual() + public void Import_trajectory_fact_manual() { var stream = System.Reflection.Assembly.GetExecutingAssembly() .GetManifestResourceStream($"{usingTemplateFile}.TrajectoryFactManualTemplate.xlsx"); @@ -45,8 +40,8 @@ namespace AsbCloudWebApi.Tests.Services.Trajectory if (stream is null) Assert.Fail("Файла для импорта не существует"); - var trajectoryRows = await trajectoryFactManualImportService.ImportAsync(stream, CancellationToken.None); - + var trajectoryRows = trajectoryFactManualImportService.ImportAsync(stream); + Assert.Equal(4, trajectoryRows.Count()); } } diff --git a/AsbCloudWebApi.Tests/UnitTests/Services/DailyReportServiceTest.cs b/AsbCloudWebApi.Tests/UnitTests/Services/DailyReportServiceTest.cs index e160d33d..8202a95f 100644 --- a/AsbCloudWebApi.Tests/UnitTests/Services/DailyReportServiceTest.cs +++ b/AsbCloudWebApi.Tests/UnitTests/Services/DailyReportServiceTest.cs @@ -200,7 +200,7 @@ public class DailyReportServiceTest }; private readonly IWellService wellServiceMock = Substitute.For(); - private readonly ITrajectoryEditableRepository trajectoryFactRepositoryMock = Substitute.For>(); + private readonly ITrajectoryNnbRepository trajectoryFactNnbRepositoryMock = Substitute.For(); private readonly IDailyReportRepository dailyReportRepositoryMock = Substitute.For(); private readonly IScheduleRepository scheduleRepositoryMock = Substitute.For(); private readonly IWellOperationRepository wellOperationRepositoryMock = Substitute.For(); @@ -234,7 +234,7 @@ public class DailyReportServiceTest }; dailyReportService = new DailyReportService(wellServiceMock, - trajectoryFactRepositoryMock, + trajectoryFactNnbRepositoryMock, dailyReportRepositoryMock, scheduleRepositoryMock, wellOperationRepositoryMock, @@ -254,7 +254,7 @@ public class DailyReportServiceTest wellServiceMock.GetOrDefaultAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(fakeWell); - trajectoryFactRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) + trajectoryFactNnbRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(new[] { fakeLastFactTrajectory }); wellOperationRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) diff --git a/AsbCloudWebApi.Tests/UnitTests/Services/TrajectoryVisualizationServiceTest.cs b/AsbCloudWebApi.Tests/UnitTests/Services/TrajectoryVisualizationServiceTest.cs index a12527fd..b029f983 100644 --- a/AsbCloudWebApi.Tests/UnitTests/Services/TrajectoryVisualizationServiceTest.cs +++ b/AsbCloudWebApi.Tests/UnitTests/Services/TrajectoryVisualizationServiceTest.cs @@ -53,18 +53,13 @@ public class TrajectoryVisualizationServiceTest new() { WellboreDepth = 0, ZenithAngle = 10, AzimuthGeo = 20 }, }; - var request = new TrajectoryRequest() - { - IdWell = Arg.Any() - }; - - trajectoryPlanRepositoryMock.GetAsync(request, Arg.Any()) + trajectoryPlanRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(plannedTrajectory); - trajectoryFactRepositoryMock.GetAsync(request, Arg.Any()) + trajectoryFactRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(actualTrajectory); - trajectoryNnbRepositoryMock.GetAsync(request, Arg.Any()) + trajectoryNnbRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(nnbTrajectory); //act @@ -110,18 +105,13 @@ public class TrajectoryVisualizationServiceTest new() { WellboreDepth = 50, ZenithAngle = 0, AzimuthGeo = 0 }, }; - var request = new TrajectoryRequest() - { - IdWell = Arg.Any() - }; - - trajectoryPlanRepositoryMock.GetAsync(request, Arg.Any()) + trajectoryPlanRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(plannedTrajectory); - trajectoryFactRepositoryMock.GetAsync(request, Arg.Any()) + trajectoryFactRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(actualTrajectory); - trajectoryNnbRepositoryMock.GetAsync(request, Arg.Any()) + trajectoryNnbRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(nnbTrajectory); //act @@ -173,18 +163,14 @@ public class TrajectoryVisualizationServiceTest new() { WellboreDepth = 20, ZenithAngle = 0, AzimuthGeo = 0 }, }; - var request = new TrajectoryRequest() - { - IdWell = Arg.Any() - }; - - trajectoryPlanRepositoryMock.GetAsync(request, Arg.Any()) + + trajectoryPlanRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(plannedTrajectory); - trajectoryFactRepositoryMock.GetAsync(request, Arg.Any()) + trajectoryFactRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(actualTrajectory); - trajectoryNnbRepositoryMock.GetAsync(request, Arg.Any()) + trajectoryNnbRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(nnbTrajectory); //act diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs index 836dea16..dc75b69a 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs @@ -57,17 +57,16 @@ namespace AsbCloudWebApi.Controllers.Trajectory /// /// Получаем список всех строк координат траектории (для клиента) /// - /// параметры запроса + /// ключ скважины /// Токен отмены задачи /// Список добавленных координат траектории - [HttpGet("/api/[controller]")] //[ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetAsync([FromQuery] TrajectoryRequest request, CancellationToken token) + public async Task GetAsync(int idWell, CancellationToken token) { - if (!await CanUserAccessToWellAsync(request.IdWell, + if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); - var result = await trajectoryRepository.GetAsync(request, token); + var result = await trajectoryRepository.GetAsync(idWell, token); return Ok(result); } diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs index a5e8660e..9afc825f 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs @@ -24,12 +24,12 @@ namespace AsbCloudWebApi.Controllers.Trajectory { protected override string fileName { get; set; } - private readonly TrajectoryImportService trajectoryImportService; + private readonly TrajectoryParserService trajectoryImportService; private readonly TrajectoryExportService trajectoryExportService; private readonly ITrajectoryEditableRepository trajectoryRepository; public TrajectoryEditableController(IWellService wellService, - TrajectoryImportService trajectoryImportService, + TrajectoryParserService trajectoryImportService, TrajectoryExportService trajectoryExportService, ITrajectoryEditableRepository trajectoryRepository) : base( @@ -88,7 +88,7 @@ namespace AsbCloudWebApi.Controllers.Trajectory try { - var trajectoryRows = await trajectoryImportService.ImportAsync(stream, token); + var trajectoryRows = trajectoryImportService.ImportAsync(stream); foreach (var row in trajectoryRows) { row.IdWell = idWell; diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryFactManualController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryFactManualController.cs index c9e408a2..f8823da5 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryFactManualController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryFactManualController.cs @@ -16,7 +16,7 @@ public class TrajectoryFactManualController : TrajectoryEditableController trajectoryFactRepository) : base( diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlannedController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlannedController.cs index 669b1600..33fd045a 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlannedController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlannedController.cs @@ -22,7 +22,7 @@ namespace AsbCloudWebApi.Controllers.Trajectory private readonly TrajectoryService trajectoryVisualizationService; public TrajectoryPlannedController(IWellService wellService, - TrajectoryPlannedImportService plannedTrajectoryImportService, + TrajectoryPlannedParserService plannedTrajectoryImportService, TrajectoryPlannedExportService plannedTrajectoryExportService, ITrajectoryEditableRepository plannedTrajectoryRepository, TrajectoryService trajectoryVisualizationService) From 5ed11d8b471c3e2c4dad11593ee646545b61fe0c Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 30 Nov 2023 10:27:38 +0500 Subject: [PATCH 13/19] =?UTF-8?q?=D0=9B=D0=BE=D0=BA=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2=20=D1=81=20=D1=82?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D0=B0=D0=BC=D0=B8=20=D0=B8=D0=B7=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj | 8 ++++---- .../Templates/TrajectoryFactManualTemplate.xlsx | Bin .../Templates/TrajectoryPlannedTemplate.xlsx | Bin .../Services/Trajectory/TrajectoryExportTest.cs | 2 +- .../Services/Trajectory/TrajectoryImportTest.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename AsbCloudWebApi.Tests/{ => UnitTests}/Services/Trajectory/Templates/TrajectoryFactManualTemplate.xlsx (100%) rename AsbCloudWebApi.Tests/{ => UnitTests}/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx (100%) rename AsbCloudWebApi.Tests/{ => UnitTests}/Services/Trajectory/TrajectoryExportTest.cs (98%) rename AsbCloudWebApi.Tests/{ => UnitTests}/Services/Trajectory/TrajectoryImportTest.cs (96%) diff --git a/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj b/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj index 046b0da3..8fd54d8c 100644 --- a/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj +++ b/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj @@ -9,13 +9,13 @@ - - + + - - + + diff --git a/AsbCloudWebApi.Tests/Services/Trajectory/Templates/TrajectoryFactManualTemplate.xlsx b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/Templates/TrajectoryFactManualTemplate.xlsx similarity index 100% rename from AsbCloudWebApi.Tests/Services/Trajectory/Templates/TrajectoryFactManualTemplate.xlsx rename to AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/Templates/TrajectoryFactManualTemplate.xlsx diff --git a/AsbCloudWebApi.Tests/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx similarity index 100% rename from AsbCloudWebApi.Tests/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx rename to AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx diff --git a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryExportTest.cs similarity index 98% rename from AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs rename to AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryExportTest.cs index 2bfb4136..08d83882 100644 --- a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryExportTest.cs +++ b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryExportTest.cs @@ -9,7 +9,7 @@ using System.Threading; using System.Threading.Tasks; using Xunit; -namespace AsbCloudWebApi.Tests.Services.Trajectory +namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory { public class TrajectoryExportTest { diff --git a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryImportTest.cs b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryImportTest.cs similarity index 96% rename from AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryImportTest.cs rename to AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryImportTest.cs index 7357a3d7..54444d9b 100644 --- a/AsbCloudWebApi.Tests/Services/Trajectory/TrajectoryImportTest.cs +++ b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryImportTest.cs @@ -2,7 +2,7 @@ using System.Linq; using Xunit; -namespace AsbCloudWebApi.Tests.Services.Trajectory +namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory { public class TrajectoryImportTest { From 8fd9961da7a2b292ca14ee3b7a6880c6d5090475 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 30 Nov 2023 11:11:45 +0500 Subject: [PATCH 14/19] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=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-3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ermissions_For_Trajectory_Fact.Designer.cs | 8916 ----------------- ...303_Add_Permissions_For_Trajectory_Fact.cs | 41 - .../Repository/TrajectoryNnbRepository.cs | 21 +- .../Trajectory/TrajectoryController.cs | 17 +- 4 files changed, 20 insertions(+), 8975 deletions(-) delete mode 100644 AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.Designer.cs delete mode 100644 AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs diff --git a/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.Designer.cs b/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.Designer.cs deleted file mode 100644 index 4fceca63..00000000 --- a/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.Designer.cs +++ /dev/null @@ -1,8916 +0,0 @@ -// -using System; -using System.Text.Json; -using AsbCloudDb.Model; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace AsbCloudDb.Migrations -{ - [DbContext(typeof(AsbCloudDbContext))] - [Migration("20231115102303_Add_Permissions_For_Trajectory_Fact")] - partial class Add_Permissions_For_Trajectory_Fact - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseCollation("Russian_Russia.1251") - .HasAnnotation("ProductVersion", "6.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption") - .HasComment("Название"); - - b.Property("IdDeposit") - .HasColumnType("integer") - .HasColumnName("id_deposit"); - - b.Property("Latitude") - .HasColumnType("double precision") - .HasColumnName("latitude"); - - b.Property("Longitude") - .HasColumnType("double precision") - .HasColumnName("longitude"); - - b.Property("Timezone") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("timezone") - .HasComment("Смещение часового пояса от UTC"); - - b.HasKey("Id"); - - b.HasIndex("IdDeposit"); - - b.ToTable("t_cluster"); - - b.HasComment("Кусты"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - 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.HasKey("Id"); - - b.HasIndex("IdCompanyType"); - - b.ToTable("t_company"); - - b.HasData( - new - { - Id = 1, - Caption = "ООО \"АСБ\"", - IdCompanyType = 3 - }); - }); - - modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption"); - - b.Property("IsContact") - .HasColumnType("boolean") - .HasColumnName("is_contact"); - - b.Property("Order") - .HasColumnType("integer") - .HasColumnName("order"); - - b.HasKey("Id"); - - 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 - }); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Contact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Company") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("company") - .HasComment("компания"); - - b.Property("Email") - .IsRequired() - .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("IdCompanyType") - .HasMaxLength(255) - .HasColumnType("integer") - .HasColumnName("id_company_type") - .HasComment("вид деятельности"); - - b.Property("IdWell") - .HasMaxLength(255) - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("ключ скважины"); - - b.Property("Phone") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("phone") - .HasComment("номер телефона"); - - b.Property("Position") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("position") - .HasComment("должность"); - - b.HasKey("Id"); - - b.HasIndex("IdCompanyType"); - - b.HasIndex("IdWell"); - - b.ToTable("t_contact"); - - b.HasComment("Контакты"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.DailyReport.DailyReport", b => - { - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("ID скважины"); - - b.Property("StartDate") - .HasColumnType("date") - .HasColumnName("start_date") - .HasComment("Дата отчёта"); - - b.Property("Info") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("info") - .HasComment("Список параметров для отчёта"); - - b.HasKey("IdWell", "StartDate") - .HasName("t_id_well_date_start_pk"); - - b.ToTable("t_daily_report"); - - b.HasComment("Ежедневные отчёты"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption"); - - b.Property("Latitude") - .HasColumnType("double precision") - .HasColumnName("latitude"); - - b.Property("Longitude") - .HasColumnType("double precision") - .HasColumnName("longitude"); - - b.Property("Timezone") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("timezone") - .HasComment("Смещение часового пояса от UTC"); - - b.HasKey("Id"); - - b.ToTable("t_deposit"); - - b.HasComment("Месторождение"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - 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("DepthEnd") - .HasColumnType("double precision") - .HasColumnName("depth_end") - .HasComment("Глубина после завершения операции, м"); - - b.Property("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Глубина на начало операции, м"); - - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("Id категории операции"); - - b.Property("IdReasonOfEnd") - .HasColumnType("integer") - .HasColumnName("id_reason_of_end") - .HasComment("Код признака окончания операции"); - - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); - - b.Property("IdUsersAtStart") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("Id пользователя по телеметрии на момент начала операции"); - - b.Property("Value") - .HasColumnType("double precision") - .HasColumnName("value") - .HasComment("Ключевой показатель операции"); - - b.HasKey("Id"); - - b.HasIndex("IdCategory"); - - b.HasIndex("IdTelemetry"); - - b.ToTable("t_detected_operation"); - - b.HasComment("автоматически определенные операции по телеметрии"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Driller", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - 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("Surname") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("surname") - .HasComment("Фамилия"); - - b.HasKey("Id"); - - b.ToTable("t_driller"); - - b.HasComment("Бурильщик"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("IdFileCategory") - .HasColumnType("integer") - .HasColumnName("id_file_category"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well"); - - b.HasKey("Id"); - - b.HasIndex("IdFileCategory"); - - b.HasIndex("IdWell", "IdFileCategory") - .IsUnique(); - - b.ToTable("t_drilling_program_part"); - - b.HasComment("части программ бурения"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => - { - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); - - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry") - .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("TimeStampStart") - .HasColumnType("timestamp with time zone") - .HasColumnName("timestamp_start") - .HasComment("Время начала"); - - b.HasKey("Id", "IdTelemetry"); - - b.HasIndex("IdTelemetry"); - - b.ToTable("t_drill_test"); - - b.HasComment("Drill_test"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Faq", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Answer") - .HasColumnType("text") - .HasColumnName("answer") - .HasComment("Текст ответа"); - - b.Property("CounterQuestion") - .HasColumnType("integer") - .HasColumnName("counter_question") - .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("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("IdAuthorQuestion") - .HasColumnType("integer") - .HasColumnName("id_author_question") - .HasComment("id автора вопроса"); - - b.Property("IdReplacementQuestion") - .HasColumnType("integer") - .HasColumnName("id_replacement_question") - .HasComment("Ключ заменяющего вопроса"); - - b.Property("IsFrequently") - .HasColumnType("boolean") - .HasColumnName("is_frequently") - .HasComment("Частый вопрос"); - - b.Property("Question") - .IsRequired() - .HasColumnType("text") - .HasColumnName("question") - .HasComment("Текст вопроса"); - - b.Property("State") - .HasColumnType("integer") - .HasColumnName("state") - .HasComment("Статус вопроса"); - - b.HasKey("Id"); - - b.HasIndex("IdAuthorAnswer"); - - b.HasIndex("IdAuthorQuestion"); - - b.ToTable("t_faq"); - - b.HasComment("вопросы пользователей"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.FileCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название категории"); - - b.Property("ShortName") - .HasColumnType("text") - .HasColumnName("short_name") - .HasComment("Короткое название категории"); - - b.HasKey("Id"); - - b.ToTable("t_file_category"); - - 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 = "Инструкции" - }); - }); - - modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("IdAuthor") - .HasColumnType("integer") - .HasColumnName("id_author") - .HasComment("Id пользователя, загрузившего файл"); - - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("id категории файла"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("id скважины"); - - b.Property("IsDeleted") - .HasColumnType("boolean") - .HasColumnName("is_deleted") - .HasComment("Удален ли файл"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название файла"); - - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("file_size") - .HasComment("Размер файла"); - - b.Property("UploadDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.HasKey("Id"); - - b.HasIndex("IdAuthor"); - - b.HasIndex("IdCategory"); - - b.HasIndex("IdWell"); - - b.ToTable("t_file_info"); - - b.HasComment("Файлы всех категорий"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.FileMark", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - 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("IdFile") - .HasColumnType("integer") - .HasColumnName("id_file") - .HasComment("id файла"); - - b.Property("IdMarkType") - .HasColumnType("integer") - .HasColumnName("id_mark_type") - .HasComment("0 - отклонен, 1 - согласован"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("id пользователя"); - - b.Property("IsDeleted") - .HasColumnType("boolean") - .HasColumnName("is_deleted") - .HasComment("Помечен ли файл как удаленный"); - - b.HasKey("Id"); - - b.HasIndex("IdFile"); - - b.HasIndex("IdUser"); - - b.ToTable("t_file_mark"); - - b.HasComment("Действия с файлами."); - }); - - modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); - - b.Property("IdRecord") - .HasColumnType("integer") - .HasColumnName("id_record"); - - b.Property("IdItem") - .HasColumnType("integer") - .HasColumnName("id_item"); - - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Value") - .HasColumnType("real") - .HasColumnName("value"); - - b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); - - b.ToTable("t_wits_float"); - - b.HasComment("таблица данных ГТИ с типом значения float"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); - - b.Property("IdRecord") - .HasColumnType("integer") - .HasColumnName("id_record"); - - b.Property("IdItem") - .HasColumnType("integer") - .HasColumnName("id_item"); - - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Value") - .HasColumnType("integer") - .HasColumnName("value"); - - b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); - - b.ToTable("t_wits_int"); - - b.HasComment("таблица данных ГТИ с типом значения int"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); - - b.Property("IdRecord") - .HasColumnType("integer") - .HasColumnName("id_record"); - - b.Property("IdItem") - .HasColumnType("integer") - .HasColumnName("id_item"); - - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .HasColumnName("value"); - - b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime"); - - b.ToTable("t_wits_string"); - - b.HasComment("таблица данных ГТИ с типом значения string"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("Id категории файла"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название файла"); - - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("file_size") - .HasComment("Размер файла"); - - b.Property("UrlPage") - .IsRequired() - .HasColumnType("text") - .HasColumnName("url_page") - .HasComment("Url страницы"); - - b.HasKey("Id"); - - b.HasIndex("IdCategory"); - - b.ToTable("t_help_page"); - - b.HasComment("Справки"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateEnd") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_end"); - - b.Property("DateStart") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_start"); - - b.Property("DepthEnd") - .HasColumnType("real") - .HasColumnName("depth_end"); - - b.Property("DepthStart") - .HasColumnType("real") - .HasColumnName("depth_start"); - - b.Property("IdFeedRegulator") - .HasColumnType("smallint") - .HasColumnName("id_feed_regulator"); - - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); - - b.HasKey("Id"); - - b.HasIndex("IdTelemetry"); - - b.ToTable("t_limiting_parameter"); - - b.HasComment("Ограничения по параметрам телеметрии"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Manuals.Manual", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateDownload") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_download") - .HasComment("Дата загрузки"); - - b.Property("IdAuthor") - .HasColumnType("integer") - .HasColumnName("id_author") - .HasComment("Id автора"); - - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("Id категории файла"); - - b.Property("IdDirectory") - .HasColumnType("integer") - .HasColumnName("id_directory") - .HasComment("Id директории"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название"); - - b.HasKey("Id"); - - b.HasIndex("IdAuthor"); - - b.HasIndex("IdCategory"); - - b.HasIndex("IdDirectory"); - - b.ToTable("t_manual"); - - b.HasComment("Инструкции"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("IdParent") - .HasColumnType("integer") - .HasColumnName("id_parent") - .HasComment("Id родительской директории"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название"); - - b.HasKey("Id"); - - b.HasIndex("IdParent"); - - b.ToTable("t_manual_directory"); - - b.HasComment("Директория для инструкций"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Measure", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Data") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("data") - .HasComment("Данные таблицы последних данных"); - - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .HasComment("id категории"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("id скважины"); - - b.Property("IsDeleted") - .HasColumnType("boolean") - .HasColumnName("is_deleted") - .HasComment("Пометка удаленным"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone") - .HasColumnName("timestamp") - .HasComment("время добавления"); - - b.HasKey("Id"); - - b.HasIndex("IdCategory"); - - b.HasIndex("IdWell"); - - b.ToTable("t_measure"); - - b.HasComment("Таблица c данными для вкладки 'Последние данные'"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название категории"); - - b.Property("ShortName") - .HasColumnType("text") - .HasColumnName("short_name") - .HasComment("Короткое название категории"); - - b.HasKey("Id"); - - b.ToTable("t_measure_category"); - - b.HasComment("Категория последних данных"); - - 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"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("Id получателя"); - - b.Property("Message") - .IsRequired() - .HasColumnType("text") - .HasColumnName("message") - .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("SentDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("sent_date") - .HasComment("Дата отправки уведомления"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title") - .HasComment("Заголовок уведомления"); - - b.HasKey("Id"); - - b.HasIndex("IdNotificationCategory"); - - b.HasIndex("IdUser"); - - b.ToTable("t_notification"); - - b.HasComment("Уведомления"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.ToTable("t_notification_category"); - - b.HasComment("Категории уведомлений"); - - b.HasData( - new - { - Id = 1, - Name = "Системные уведомления" - }); - }); - - modelBuilder.Entity("AsbCloudDb.Model.OperationValue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DepthEnd") - .HasColumnType("double precision") - .HasColumnName("depth_end") - .HasComment("Конечная глубина"); - - b.Property("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Старотовая глубина"); - - b.Property("IdOperationCategory") - .HasColumnType("integer") - .HasColumnName("id_operation_category") - .HasComment("Ид категории операции"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("Ид скважины"); - - b.Property("StandardValue") - .HasColumnType("double precision") - .HasColumnName("standard_value") - .HasComment("Нормативный показатель"); - - b.Property("TargetValue") - .HasColumnType("double precision") - .HasColumnName("target_value") - .HasComment("Целевой показатель"); - - b.HasKey("Id"); - - b.HasIndex("IdOperationCategory"); - - b.HasIndex("IdWell"); - - b.ToTable("t_operationvalue"); - - b.HasComment("Целевые/нормативные показатели операции"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Permission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - 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.HasKey("Id"); - - b.ToTable("t_permission"); - - 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 = 529, - Description = "Разрешение на получение отчетов drill test", - Name = "DrillTestReport.get" - }, - new - { - Id = 530, - Description = "Разрешение просматривать фактические траектории", - Name = "FactTrajectory.get" - }, - new - { - Id = 531, - Description = "Разрешение редактировать фактические траектории", - Name = "FactTrajectory.edit" - }); - }); - - modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AzimuthGeo") - .HasColumnType("double precision") - .HasColumnName("azimuth_geo") - .HasComment("Азимут Географ."); - - b.Property("AzimuthMagnetic") - .HasColumnType("double precision") - .HasColumnName("azimuth_magnetic") - .HasComment("Азимут Магнитный"); - - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("Комментарии"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("ID пользователя который внес/изменил запись"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("ID скважины"); - - b.Property("Radius") - .HasColumnType("double precision") - .HasColumnName("radius") - .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("WellboreDepth") - .HasColumnType("double precision") - .HasColumnName("wellbore_depth") - .HasComment("Глубина по стволу"); - - b.Property("ZenithAngle") - .HasColumnType("double precision") - .HasColumnName("zenith_angle") - .HasComment("Угол зенитный"); - - b.HasKey("Id"); - - b.HasIndex("IdUser"); - - b.HasIndex("IdWell"); - - b.ToTable("t_planned_trajectory"); - - b.HasComment("Загрузка плановой траектории"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - 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("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("Комментарий"); - - b.Property("DepthEnd") - .HasColumnType("double precision") - .HasColumnName("depth_end") - .HasComment("Глубина по стволу до, м"); - - b.Property("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Глубина по стволу от, м"); - - b.Property("FlowLimitMax") - .HasColumnType("double precision") - .HasColumnName("flow_limit_max") - .HasComment("Расход, допустимый максимум"); - - b.Property("FlowPlan") - .HasColumnType("double precision") - .HasColumnName("flow_plan") - .HasComment("Расход, план"); - - b.Property("IdMode") - .HasColumnType("integer") - .HasColumnName("id_mode") - .HasComment("Id режима (1- ротор, 2 слайд)"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("Id пользователя"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("Id скважины"); - - b.Property("IdWellSectionType") - .HasColumnType("integer") - .HasColumnName("id_wellsection_type") - .HasComment("Тип секции"); - - b.Property("LastUpdate") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_update") - .HasComment("Дата последнего изменения"); - - b.Property("PressureLimitMax") - .HasColumnType("double precision") - .HasColumnName("pressure_limit_max") - .HasComment("Перепад давления, допустимый максимум"); - - b.Property("PressurePlan") - .HasColumnType("double precision") - .HasColumnName("pressure_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("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("TopDriveTorquePlan") - .HasColumnType("double precision") - .HasColumnName("top_drive_torque_plan") - .HasComment("Момент на ВСП, план"); - - b.Property("UsageSaub") - .HasColumnType("double precision") - .HasColumnName("usage_saub") - .HasComment("Плановый процент использования АКБ"); - - b.Property("UsageSpin") - .HasColumnType("double precision") - .HasColumnName("usage_spin") - .HasComment("Плановый процент использования spin master"); - - b.HasKey("Id"); - - b.HasIndex("IdUser"); - - b.HasIndex("IdWell"); - - b.HasIndex("IdWellSectionType"); - - b.ToTable("t_process_map_well_drilling"); - - b.HasComment("РТК бурение скважины"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellReam", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("Комментарий"); - - b.Property("DepthEnd") - .HasColumnType("double precision") - .HasColumnName("depth_end") - .HasComment("Глубина по стволу до, м"); - - b.Property("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Глубина по стволу от, м"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("Id пользователя"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("Id скважины"); - - b.Property("IdWellSectionType") - .HasColumnType("integer") - .HasColumnName("id_wellsection_type") - .HasComment("Тип секции"); - - b.Property("LastUpdate") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_update") - .HasComment("Дата последнего изменения"); - - b.Property("Pressure") - .HasColumnType("double precision") - .HasColumnName("pressure") - .HasComment("Давление, атм"); - - b.Property("Repeats") - .HasColumnType("double precision") - .HasColumnName("repeats") - .HasComment("Количество повторений"); - - b.Property("SetpointDrag") - .HasColumnType("double precision") - .HasColumnName("setpoint_drag") - .HasComment("Уставка зятяжки, т"); - - b.Property("SetpointTight") - .HasColumnType("double precision") - .HasColumnName("setpoint_tight") - .HasComment("Уставка посадки, т"); - - b.Property("SpeedDownward") - .HasColumnType("double precision") - .HasColumnName("speed_downward") - .HasComment("Скорость спуска, м/ч"); - - b.Property("SpeedUpward") - .HasColumnType("double precision") - .HasColumnName("speed_upward") - .HasComment("Скорость подъёма, м/ч"); - - b.Property("SpinDownward") - .HasColumnType("double precision") - .HasColumnName("spin_downward") - .HasComment("Вращение при движении вниз, об/мин"); - - b.Property("SpinUpward") - .HasColumnType("double precision") - .HasColumnName("spin_upward") - .HasComment("Вращение при движении вверх, об/мин"); - - b.Property("Torque") - .HasColumnType("double precision") - .HasColumnName("torque") - .HasComment("Момент, кН*м"); - - b.HasKey("Id"); - - b.HasIndex("IdUser"); - - b.HasIndex("IdWell"); - - b.HasIndex("IdWellSectionType"); - - b.ToTable("t_process_map_well_ream"); - - b.HasComment("РТК проработка скважины"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b => - { - b.Property("IdCompany") - .HasColumnType("integer") - .HasColumnName("id_company"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well"); - - b.HasKey("IdCompany", "IdWell"); - - b.HasIndex("IdWell"); - - b.ToTable("t_relation_company_well"); - - b.HasComment("отношение скважин и компаний"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.RelationContactWell", b => - { - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); - - b.HasKey("IdWell", "IdUser"); - - b.HasIndex("IdUser"); - - b.ToTable("t_relation_contact_well"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.RelationUserDrillingProgramPart", b => - { - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); - - b.Property("IdDrillingProgramPart") - .HasColumnType("integer") - .HasColumnName("id_drilling_program_part"); - - 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.HasIndex("IdDrillingProgramPart"); - - b.ToTable("t_relation_user_drilling_program_part"); - - b.HasComment("Отношение пользователей и частей ПБ"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.RelationUserRolePermission", b => - { - b.Property("IdUserRole") - .HasColumnType("integer") - .HasColumnName("id_user_role"); - - b.Property("IdPermission") - .HasColumnType("integer") - .HasColumnName("id_permission"); - - b.HasKey("IdUserRole", "IdPermission"); - - b.HasIndex("IdPermission"); - - b.ToTable("t_relation_user_role_permission"); - - 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 = 529 - }, - 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("IdInclude") - .HasColumnType("integer") - .HasColumnName("id_include_user_role"); - - b.HasKey("Id", "IdInclude") - .HasName("t_relation_user_role_user_role_pk"); - - b.HasIndex("IdInclude"); - - b.ToTable("t_relation_user_role_user_role"); - - 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 - }); - }); - - modelBuilder.Entity("AsbCloudDb.Model.RelationUserUserRole", b => - { - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); - - b.Property("IdUserRole") - .HasColumnType("integer") - .HasColumnName("id_user_role"); - - b.HasKey("IdUser", "IdUserRole"); - - b.HasIndex("IdUserRole"); - - b.ToTable("t_relation_user_user_role"); - - b.HasComment("Отношение пользователей и ролей"); - - b.HasData( - new - { - IdUser = 1, - IdUserRole = 1 - }); - }); - - modelBuilder.Entity("AsbCloudDb.Model.ReportProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - 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("Format") - .HasColumnType("integer") - .HasColumnName("format") - .HasComment("Формат отчета"); - - b.Property("IdFile") - .HasColumnType("integer") - .HasColumnName("id_file") - .HasComment("id файла-родителя"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("id скважины"); - - b.Property("Step") - .HasColumnType("integer") - .HasColumnName("step") - .HasComment("размер шага в секундах"); - - b.HasKey("Id"); - - b.HasIndex("IdFile"); - - b.HasIndex("IdWell"); - - b.ToTable("t_report_property"); - - b.HasComment("Отчеты с данными по буровым"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Schedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id") - .HasComment("Идентификатор"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - 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("IdDriller") - .HasColumnType("integer") - .HasColumnName("id_driller") - .HasComment("Идентификатор бурильщика"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .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.HasKey("Id"); - - b.HasIndex("IdDriller"); - - b.HasIndex("IdWell"); - - b.ToTable("t_schedule"); - - b.HasComment("График работы бурильщика"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.SetpointsRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .HasComment("комментарий для оператора"); - - 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("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("id скважины"); - - b.Property("ObsolescenceSec") - .HasColumnType("integer") - .HasColumnName("obsolescence") - .HasComment("сек. до устаревания"); - - b.Property("Setpoints") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("setpoint_set") - .HasComment("Набор уставок"); - - b.Property("UploadDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.HasKey("Id"); - - b.HasIndex("IdAuthor"); - - b.HasIndex("IdWell"); - - b.ToTable("t_setpoints_rquest"); - - b.HasComment("Запросы на изменение уставок панели оператора"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Subsystems.Subsystem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.ToTable("t_subsystem"); - - b.HasComment("Описание подсистем"); - - b.HasData( - new - { - Id = 1, - Description = "Совместная работа режимов \"Бурение в роторе\" и \"Бурение в слайде\"", - Name = "АКБ" - }, - new - { - Id = 11, - Description = "Режим работы \"Бурение в роторе\"", - Name = "АПД ротор" - }, - new - { - Id = 12, - Description = "Режим работы \"Бурение в слайде\"", - Name = "АПД слайд" - }, - new - { - Id = 2, - Description = "Алгоритм поиска оптимальных параметров бурения САУБ", - Name = "MSE" - }, - new - { - Id = 65536, - Description = "Осцилляция", - Name = "Осцилляция" - }, - new - { - Id = 65537, - Description = "Демпфер", - Name = "Демпфер" - }); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Subsystems.SubsystemOperationTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - 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("DepthEnd") - .HasColumnType("real") - .HasColumnName("depth_end") - .HasComment("глубина забоя на момент выключения подсистемы"); - - b.Property("DepthStart") - .HasColumnType("real") - .HasColumnName("depth_start") - .HasComment("глубина забоя на момент включения подсистемы"); - - b.Property("IdSubsystem") - .HasColumnType("integer") - .HasColumnName("id_subsystem"); - - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry") - .HasComment("ИД телеметрии по которой выдается информация"); - - b.HasKey("Id"); - - b.HasIndex("IdSubsystem"); - - b.HasIndex("IdTelemetry"); - - b.ToTable("t_subsystem_operation_time"); - - b.HasComment("наработки подсистем"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Info") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("info") - .HasComment("Информация с панели о скважине"); - - b.Property("RemoteUid") - .IsRequired() - .HasColumnType("text") - .HasColumnName("remote_uid") - .HasComment("Идентификатор передающего устройства. Может повторяться в списке, так как комплекты оборудования переезжают от скв. к скв."); - - b.Property("TimeZone") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("timezone") - .HasComment("Смещение часового пояса от UTC"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "RemoteUid" }, "t_telemetry_remote_uid_index"); - - b.ToTable("t_telemetry"); - - b.HasComment("таблица привязки телеметрии от комплектов к конкретной скважине."); - }); - - modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaub", b => - { - 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("AxialLoad") - .HasColumnType("real") - .HasColumnName("axial_load") - .HasComment("Осевая нагрузка"); - - b.Property("AxialLoadLimitMax") - .HasColumnType("real") - .HasColumnName("axial_load_limit_max") - .HasComment("Осевая нагрузка. Аварийная макс."); - - b.Property("AxialLoadSp") - .HasColumnType("real") - .HasColumnName("axial_load_sp") - .HasComment("Осевая нагрузка. Задание"); - - b.Property("BitDepth") - .HasColumnType("real") - .HasColumnName("bit_depth") - .HasComment("Положение инструмента"); - - b.Property("BlockPosition") - .HasColumnType("real") - .HasColumnName("block_position") - .HasComment("Высота талевого блока"); - - b.Property("BlockPositionMax") - .HasColumnType("real") - .HasColumnName("block_position_max") - .HasComment("Талевый блок. Макс положение"); - - b.Property("BlockPositionMin") - .HasColumnType("real") - .HasColumnName("block_position_min") - .HasComment("Талевый блок. Мин положение"); - - b.Property("BlockSpeed") - .HasColumnType("real") - .HasColumnName("block_speed") - .HasComment("Скорость талевого блока"); - - b.Property("BlockSpeedSp") - .HasColumnType("real") - .HasColumnName("block_speed_sp") - .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("BlockSpeedSpSlide") - .HasColumnType("real") - .HasColumnName("block_speed_sp_slide") - .HasComment("Талевый блок. Задание скорости для режима слайда"); - - b.Property("Flow") - .HasColumnType("real") - .HasColumnName("flow") - .HasComment("Расход"); - - b.Property("FlowDeltaLimitMax") - .HasColumnType("real") - .HasColumnName("flow_delta_limit_max") - .HasComment("Расход. Аварийный макс."); - - b.Property("FlowIdle") - .HasColumnType("real") - .HasColumnName("flow_idle") - .HasComment("Расход. Холостой ход"); - - b.Property("HookWeight") - .HasColumnType("real") - .HasColumnName("hook_weight") - .HasComment("Вес на крюке"); - - b.Property("HookWeightIdle") - .HasColumnType("real") - .HasColumnName("hook_weight_idle") - .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("IdFeedRegulator") - .HasColumnType("smallint") - .HasColumnName("id_feed_regulator") - .HasComment("Текущий критерий бурения"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user") - .HasComment("Пользователь САУБ"); - - b.Property("Mode") - .HasColumnType("smallint") - .HasColumnName("mode") - .HasComment("Режим САУБ"); - - b.Property("Mse") - .HasColumnType("real") - .HasColumnName("mse") - .HasComment("MSE"); - - b.Property("MseState") - .HasColumnType("smallint") - .HasColumnName("mse_state") - .HasComment("Текущее состояние работы MSE"); - - b.Property("Pressure") - .HasColumnType("real") - .HasColumnName("pressure") - .HasComment("Давление"); - - b.Property("PressureDeltaLimitMax") - .HasColumnType("real") - .HasColumnName("pressure_delta_limit_max") - .HasComment("Давление дифф. Аварийное макс."); - - b.Property("PressureIdle") - .HasColumnType("real") - .HasColumnName("pressure_idle") - .HasComment("Давление. Холостой ход"); - - b.Property("PressureSp") - .HasColumnType("real") - .HasColumnName("pressure_sp") - .HasComment("Давление. Задание"); - - b.Property("PressureSpDevelop") - .HasColumnType("real") - .HasColumnName("pressure_sp_develop") - .HasComment("Давление. Задание для проработки"); - - b.Property("PressureSpRotor") - .HasColumnType("real") - .HasColumnName("pressure_sp_rotor") - .HasComment("Давление. Задание для роторного бурения"); - - b.Property("PressureSpSlide") - .HasColumnType("real") - .HasColumnName("pressure_sp_slide") - .HasComment("Давление. Задание для режима слайда"); - - b.Property("Pump0Flow") - .HasColumnType("real") - .HasColumnName("pump0_flow") - .HasComment("Расход. Буровой насос 1"); - - b.Property("Pump1Flow") - .HasColumnType("real") - .HasColumnName("pump1_flow") - .HasComment("Расход. Буровой насос 2"); - - b.Property("Pump2Flow") - .HasColumnType("real") - .HasColumnName("pump2_flow") - .HasComment("Расход. Буровой насос 3"); - - b.Property("RotorSpeed") - .HasColumnType("real") - .HasColumnName("rotor_speed") - .HasComment("Обороты ротора"); - - b.Property("RotorTorque") - .HasColumnType("real") - .HasColumnName("rotor_torque") - .HasComment("Момент на роторе"); - - b.Property("RotorTorqueIdle") - .HasColumnType("real") - .HasColumnName("rotor_torque_idle") - .HasComment("Момент на роторе. Холостой ход"); - - b.Property("RotorTorqueLimitMax") - .HasColumnType("real") - .HasColumnName("rotor_torque_limit_max") - .HasComment("Момент на роторе. Аварийный макс."); - - b.Property("RotorTorqueSp") - .HasColumnType("real") - .HasColumnName("rotor_torque_sp") - .HasComment("Момент на роторе. Задание"); - - b.Property("WellDepth") - .HasColumnType("real") - .HasColumnName("well_depth") - .HasComment("Глубина забоя"); - - b.HasKey("IdTelemetry", "DateTime"); - - b.ToTable("t_telemetry_data_saub"); - - b.HasComment("набор основных данных по SAUB"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSaubStat", b => - { - b.Property("Count") - .HasColumnType("bigint") - .HasColumnName("count_items"); - - b.Property("DateMax") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_max"); - - b.Property("DateMin") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_min"); - - b.Property("DepthMax") - .HasColumnType("real") - .HasColumnName("depth_max"); - - b.Property("DepthMin") - .HasColumnType("real") - .HasColumnName("depth_min"); - - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); - - b.ToView("mw_telemetry_datas_saub_stat"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.TelemetryDataSpin", b => - { - 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("Mode") - .HasColumnType("smallint") - .HasColumnName("mode") - .HasComment("Выбранный режим управления"); - - b.Property("PositionRight") - .HasColumnType("real") - .HasColumnName("position_right") - .HasComment("Крайний правый угол осцилляции"); - - b.Property("PositionZero") - .HasColumnType("real") - .HasColumnName("position_zero") - .HasComment("Нулевая позиция осцилляции"); - - b.Property("RevolsLeftLimit") - .HasColumnType("real") - .HasColumnName("revols_left_limit") - .HasComment("Ограничение числа оборотов влево"); - - b.Property("RevolsLeftTotal") - .HasColumnType("real") - .HasColumnName("revols_left_total") - .HasComment("Суммарное количество оборотов влево"); - - b.Property("RevolsRightLimit") - .HasColumnType("real") - .HasColumnName("revols_right_limit") - .HasComment("Ограничение числа оборотов вправо"); - - b.Property("RevolsRightTotal") - .HasColumnType("real") - .HasColumnName("revols_right_total") - .HasComment("Суммарное количество оборотов вправо"); - - b.Property("SpeedLeftSp") - .HasColumnType("real") - .HasColumnName("speed_left_sp") - .HasComment("Заданная скорость вращения влево"); - - b.Property("SpeedRightSp") - .HasColumnType("real") - .HasColumnName("speed_right_sp") - .HasComment("Заданная скорость вращения вправо"); - - b.Property("State") - .HasColumnType("smallint") - .HasColumnName("state") - .HasComment("Переменная этапа"); - - b.HasKey("IdTelemetry", "DateTime"); - - b.ToTable("t_telemetry_data_spin"); - - b.HasComment("набор основных данных по SpinMaster"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.TelemetryEvent", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); - - b.Property("IdEvent") - .HasColumnType("integer") - .HasColumnName("id_event"); - - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category"); - - b.Property("MessageTemplate") - .IsRequired() - .HasColumnType("text") - .HasColumnName("message_template"); - - b.HasKey("IdTelemetry", "IdEvent"); - - b.ToTable("t_telemetry_event"); - - b.HasComment("Справочник событий. События формируют сообщения. Разделено по версиям посылок от телеметрии."); - }); - - modelBuilder.Entity("AsbCloudDb.Model.TelemetryMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - 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("Arg2") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("arg2"); - - b.Property("Arg3") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("arg3"); - - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("IdEvent") - .HasColumnType("integer") - .HasColumnName("id_event"); - - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); - - b.Property("IdTelemetryUser") - .HasColumnType("integer") - .HasColumnName("id_telemetry_user") - .HasComment("Пользователь панели отправляющей телеметрию. не пользователь облака."); - - b.Property("WellDepth") - .HasColumnType("double precision") - .HasColumnName("well_depth"); - - b.HasKey("Id"); - - b.HasIndex("IdTelemetry"); - - b.ToTable("t_telemetry_message"); - - b.HasComment("Сообщения на буровых"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.TelemetryUser", b => - { - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Name") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("name"); - - b.Property("Patronymic") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("patronymic"); - - b.Property("Surname") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("surname"); - - b.HasKey("IdTelemetry", "IdUser"); - - b.ToTable("t_telemetry_user"); - - b.HasComment("Пользователи панели САУБ. Для сообщений."); - }); - - modelBuilder.Entity("AsbCloudDb.Model.TelemetryWirelineRunOut", b => - { - b.Property("IdTelemetry") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_telemetry") - .HasComment("Идентификатор телеметрии"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("IdTelemetry")); - - b.Property("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_time") - .HasComment("Отметка времени"); - - b.Property("Hauling") - .HasColumnType("real") - .HasColumnName("hauling") - .HasComment("Наработка талевого каната с момента перетяжки каната, т*км"); - - b.Property("HaulingWarnSp") - .HasColumnType("real") - .HasColumnName("hauling_warn_sp") - .HasComment("Наработка талевого каната до сигнализации о необходимости перетяжки, т*км"); - - b.Property("Replace") - .HasColumnType("real") - .HasColumnName("replace") - .HasComment("Наработка талевого каната с момента замены каната, т*км"); - - b.Property("ReplaceWarnSp") - .HasColumnType("real") - .HasColumnName("replace_warn_sp") - .HasComment("Наработка талевого каната до сигнализации о необходимости замены, т*км"); - - b.HasKey("IdTelemetry"); - - b.ToTable("t_telemetry_wireline_run_out"); - - b.HasComment("Наработка талевого каната"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("email") - .HasComment("должность"); - - b.Property("IdCompany") - .HasColumnType("integer") - .HasColumnName("id_company"); - - 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("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("Patronymic") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("patronymic") - .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("Surname") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("surname") - .HasComment("фамилия"); - - b.HasKey("Id"); - - b.HasIndex("IdCompany"); - - b.HasIndex("Login") - .IsUnique(); - - b.ToTable("t_user"); - - b.HasComment("Пользователи облака"); - - 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"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - 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.HasKey("Id"); - - b.ToTable("t_user_role"); - - 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 - }); - }); - - modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => - { - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); - - b.Property("Key") - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("key") - .HasComment("Ключ настроек пользователя"); - - b.Property("Value") - .HasColumnType("jsonb") - .HasColumnName("setting_value") - .HasComment("Значение настроек пользователя"); - - b.HasKey("IdUser", "Key"); - - b.ToTable("t_user_settings"); - - b.HasComment("настройки интерфейса пользователя"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Well", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption"); - - b.Property("IdCluster") - .HasColumnType("integer") - .HasColumnName("id_cluster"); - - b.Property("IdState") - .HasColumnType("integer") - .HasColumnName("state") - .HasComment("0 - неизвестно, 1 - в работе, 2 - завершена"); - - b.Property("IdTelemetry") - .HasColumnType("integer") - .HasColumnName("id_telemetry"); - - b.Property("IdWellType") - .HasColumnType("integer") - .HasColumnName("id_well_type"); - - b.Property("Latitude") - .HasColumnType("double precision") - .HasColumnName("latitude"); - - b.Property("Longitude") - .HasColumnType("double precision") - .HasColumnName("longitude"); - - b.Property("Timezone") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("timezone") - .HasComment("Смещение часового пояса от UTC"); - - b.HasKey("Id"); - - b.HasIndex("IdCluster"); - - b.HasIndex("IdTelemetry") - .IsUnique(); - - b.HasIndex("IdWellType"); - - b.ToTable("t_well"); - - b.HasComment("скважины"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WellComposite", b => - { - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .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.HasKey("IdWell", "IdWellSrc", "IdWellSectionType"); - - b.HasIndex("IdWellSectionType"); - - b.HasIndex("IdWellSrc"); - - b.ToTable("t_well_composite"); - - b.HasComment("Композитная скважина"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WellFinalDocument", b => - { - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well"); - - b.Property("IdUser") - .HasColumnType("integer") - .HasColumnName("id_user"); - - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category"); - - b.HasKey("IdWell", "IdUser", "IdCategory") - .HasName("t_well_final_documents_pk"); - - b.HasIndex("IdCategory"); - - b.HasIndex("IdUser"); - - b.ToTable("t_well_final_documents"); - - b.HasComment("Дело скважины"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WellOperation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CategoryInfo") - .HasColumnType("text") - .HasColumnName("category_info") - .HasComment("Доп. информация к выбраной категории"); - - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment") - .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("DepthStart") - .HasColumnType("double precision") - .HasColumnName("depth_start") - .HasComment("Глубина на начало операции, м"); - - b.Property("DurationHours") - .HasColumnType("double precision") - .HasColumnName("duration_hours") - .HasComment("Продолжительность, часы"); - - b.Property("IdCategory") - .HasColumnType("integer") - .HasColumnName("id_category") - .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("IdUser") - .HasColumnType("integer"); - - b.Property("IdWell") - .HasColumnType("integer") - .HasColumnName("id_well") - .HasComment("Id скважины"); - - b.Property("IdWellSectionType") - .HasColumnType("integer") - .HasColumnName("id_well_section_type") - .HasComment("Id тип секции скважины"); - - b.Property("LastUpdateDate") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("DateStart"); - - b.HasIndex("DepthEnd"); - - b.HasIndex("IdCategory"); - - b.HasIndex("IdPlan"); - - b.HasIndex("IdWell"); - - b.HasIndex("IdWellSectionType"); - - b.ToTable("t_well_operation"); - - b.HasComment("Данные по операциям на скважине"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("KeyValueUnits") - .HasMaxLength(16) - .HasColumnType("character varying(16)") - .HasColumnName("key_value_units") - .HasComment("Единицы измерения ключевого показателя операции"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name") - .HasComment("Название категории операции"); - - b.HasKey("Id"); - - b.HasIndex("IdParent"); - - b.ToTable("t_well_operation_category"); - - 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 = 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 = "Ремонт" - }); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption") - .HasComment("Название"); - - b.Property("Order") - .HasColumnType("real") - .HasColumnName("order") - .HasComment("Порядок"); - - b.HasKey("Id"); - - b.ToTable("t_well_section_type"); - - 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 - }); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WellType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Caption") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("caption") - .HasComment("Название"); - - b.HasKey("Id"); - - b.ToTable("t_well_type"); - - b.HasComment("конструкция скважины"); - - 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("DateTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Actcod") - .HasColumnType("smallint") - .HasColumnName("ACTCOD"); - - b.Property("Date") - .HasColumnType("integer") - .HasColumnName("DATE"); - - b.Property("Recid") - .HasColumnType("smallint") - .HasColumnName("RECID"); - - b.Property("Seqid") - .HasColumnType("integer") - .HasColumnName("SEQID"); - - b.Property("Stknum") - .HasColumnType("smallint") - .HasColumnName("STKNUM"); - - b.Property("Time") - .HasColumnType("integer") - .HasColumnName("TIME"); - - b.Property("Wellid") - .HasColumnType("text") - .HasColumnName("WELLID"); - - b.HasKey("IdTelemetry", "DateTime"); - - b.ToTable("t_telemetry_wits_base"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - - b.Property("Blkpos") - .HasColumnType("real") - .HasColumnName("BLKPOS"); - - b.Property("Chkp") - .HasColumnType("real") - .HasColumnName("CHKP"); - - b.Property("Deptbitm") - .HasColumnType("real") - .HasColumnName("DEPTBITM"); - - b.Property("Deptbitv") - .HasColumnType("real") - .HasColumnName("DEPTBITV"); - - b.Property("Deptmeas") - .HasColumnType("real") - .HasColumnName("DEPTMEAS"); - - b.Property("Deptretm") - .HasColumnType("real") - .HasColumnName("DEPTRETM"); - - b.Property("Deptvert") - .HasColumnType("real") - .HasColumnName("DEPTVERT"); - - b.Property("Gasa") - .HasColumnType("real") - .HasColumnName("GASA"); - - b.Property("Hkla") - .HasColumnType("real") - .HasColumnName("HKLA"); - - b.Property("Hklx") - .HasColumnType("real") - .HasColumnName("HKLX"); - - b.Property("Lagstks") - .HasColumnType("smallint") - .HasColumnName("LAGSTKS"); - - b.Property("Mcia") - .HasColumnType("real") - .HasColumnName("MCIA"); - - b.Property("Mcoa") - .HasColumnType("real") - .HasColumnName("MCOA"); - - b.Property("Mdia") - .HasColumnType("real") - .HasColumnName("MDIA"); - - b.Property("Mdoa") - .HasColumnType("real") - .HasColumnName("MDOA"); - - b.Property("Mfia") - .HasColumnType("real") - .HasColumnName("MFIA"); - - b.Property("Mfoa") - .HasColumnType("real") - .HasColumnName("MFOA"); - - b.Property("Mfop") - .HasColumnType("smallint") - .HasColumnName("MFOP"); - - b.Property("Mtia") - .HasColumnType("real") - .HasColumnName("MTIA"); - - b.Property("Mtoa") - .HasColumnType("real") - .HasColumnName("MTOA"); - - b.Property("Ropa") - .HasColumnType("real") - .HasColumnName("ROPA"); - - b.Property("Rpma") - .HasColumnType("smallint") - .HasColumnName("RPMA"); - - b.Property("Spare1") - .HasColumnType("real") - .HasColumnName("SPARE1"); - - b.Property("Spare2") - .HasColumnType("real") - .HasColumnName("SPARE2"); - - b.Property("Spare3") - .HasColumnType("real") - .HasColumnName("SPARE3"); - - b.Property("Spare4") - .HasColumnType("real") - .HasColumnName("SPARE4"); - - b.Property("Spare5") - .HasColumnType("real") - .HasColumnName("SPARE5"); - - b.Property("Spm1") - .HasColumnType("smallint") - .HasColumnName("SPM1"); - - b.Property("Spm2") - .HasColumnType("smallint") - .HasColumnName("SPM2"); - - b.Property("Spm3") - .HasColumnType("smallint") - .HasColumnName("SPM3"); - - b.Property("Sppa") - .HasColumnType("real") - .HasColumnName("SPPA"); - - b.Property("Stkc") - .HasColumnType("integer") - .HasColumnName("STKC"); - - b.Property("TelemetryId") - .HasColumnType("integer"); - - b.Property("Torqa") - .HasColumnType("real") - .HasColumnName("TORQA"); - - b.Property("Torqx") - .HasColumnType("real") - .HasColumnName("TORQX"); - - b.Property("Tvolact") - .HasColumnType("real") - .HasColumnName("TVOLACT"); - - b.Property("Tvolcact") - .HasColumnType("real") - .HasColumnName("TVOLCACT"); - - b.Property("Woba") - .HasColumnType("real") - .HasColumnName("WOBA"); - - b.Property("Wobx") - .HasColumnType("real") - .HasColumnName("WOBX"); - - b.HasIndex("TelemetryId"); - - b.ToTable("t_telemetry_wits_1"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - - b.Property("Deptbitm") - .HasColumnType("real") - .HasColumnName("DEPTBITM"); - - b.Property("DeptmeasGdpMc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_GDP_mc"); - - b.Property("DeptmeasMcrstat") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_MCRSTAT"); - - b.Property("DeptmeasRa33Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RA33_mc"); - - b.Property("DeptmeasRa33f2Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RA33F2_mc"); - - b.Property("DeptmeasRa33f4Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RA33F4_mc"); - - b.Property("DeptmeasRp33Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RP33_mc"); - - b.Property("DeptmeasRp33f2Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RP33F2_mc"); - - b.Property("DeptmeasRp33f4Mc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_RP33F4_mc"); - - b.Property("DeptmeasSlvlMc") - .HasColumnType("real") - .HasColumnName("DEPTMEAS_SLVL_mc"); - - b.Property("GdpMc") - .HasColumnType("real") - .HasColumnName("GDP_mc"); - - b.Property("Mcrstat") - .HasColumnType("real") - .HasColumnName("MCRSTAT"); - - b.Property("Ra33Mc") - .HasColumnType("real") - .HasColumnName("RA33_mc"); - - b.Property("Ra33f2Mc") - .HasColumnType("real") - .HasColumnName("RA33F2_mc"); - - b.Property("Ra33f4Mc") - .HasColumnType("real") - .HasColumnName("RA33F4_mc"); - - b.Property("Rp33Mc") - .HasColumnType("real") - .HasColumnName("RP33_mc"); - - b.Property("Rp33f2Mc") - .HasColumnType("real") - .HasColumnName("RP33F2_mc"); - - b.Property("Rp33f4Mc") - .HasColumnType("real") - .HasColumnName("RP33F4_mc"); - - b.Property("SlvlMc") - .HasColumnType("real") - .HasColumnName("SLVL_mc"); - - b.Property("TelemetryId") - .HasColumnType("integer"); - - b.HasIndex("TelemetryId"); - - b.ToTable("t_telemetry_wits_50"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - - b.Property("Btot") - .HasColumnType("real") - .HasColumnName("Btot"); - - b.Property("Bx") - .HasColumnType("real") - .HasColumnName("Bx"); - - b.Property("By") - .HasColumnType("real") - .HasColumnName("By"); - - b.Property("Bz") - .HasColumnType("real") - .HasColumnName("Bz"); - - b.Property("Deptbitm") - .HasColumnType("real") - .HasColumnName("DEPTBITM"); - - b.Property("Deptmeas") - .HasColumnType("real") - .HasColumnName("DEPTMEAS"); - - b.Property("Gtot") - .HasColumnType("real") - .HasColumnName("Gtot"); - - b.Property("Gx") - .HasColumnType("real") - .HasColumnName("Gx"); - - b.Property("Gy") - .HasColumnType("real") - .HasColumnName("Gy"); - - b.Property("Gz") - .HasColumnType("real") - .HasColumnName("Gz"); - - b.Property("TelemetryId") - .HasColumnType("integer"); - - b.HasIndex("TelemetryId"); - - b.ToTable("t_telemetry_wits_60"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - - b.Property("Att06h") - .HasColumnType("real") - .HasColumnName("ATT06H"); - - b.Property("Att06l") - .HasColumnType("real") - .HasColumnName("ATT06L"); - - b.Property("Att10h") - .HasColumnType("real") - .HasColumnName("ATT10H"); - - b.Property("Att10l") - .HasColumnType("real") - .HasColumnName("ATT10L"); - - b.Property("Deptbitm") - .HasColumnType("real") - .HasColumnName("DEPTBITM"); - - b.Property("Deptmeas") - .HasColumnType("real") - .HasColumnName("DEPTMEAS"); - - b.Property("Phl1f1") - .HasColumnType("real") - .HasColumnName("PHL1F1"); - - b.Property("Phl1f2") - .HasColumnType("real") - .HasColumnName("PHL1F2"); - - b.Property("Phl2f1") - .HasColumnType("real") - .HasColumnName("PHL2F1"); - - b.Property("Phl2f2") - .HasColumnType("real") - .HasColumnName("PHL2F2"); - - b.Property("Status") - .HasColumnType("real") - .HasColumnName("Status"); - - b.Property("TelemetryId") - .HasColumnType("integer"); - - b.HasIndex("TelemetryId"); - - b.ToTable("t_telemetry_wits_61"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - - b.Property("Deptmeas") - .HasColumnType("real") - .HasColumnName("DEPTMEAS"); - - b.Property("Deptsvym") - .HasColumnType("real") - .HasColumnName("DEPTSVYM"); - - b.Property("Deptsvyv") - .HasColumnType("real") - .HasColumnName("DEPTSVYV"); - - b.Property("Passnum") - .HasColumnType("smallint") - .HasColumnName("PASSNUM"); - - b.Property("Spare1") - .HasColumnType("real") - .HasColumnName("SPARE1"); - - b.Property("Spare2") - .HasColumnType("real") - .HasColumnName("SPARE2"); - - b.Property("Spare3") - .HasColumnType("real") - .HasColumnName("SPARE3"); - - b.Property("Spare4") - .HasColumnType("real") - .HasColumnName("SPARE4"); - - b.Property("Spare5") - .HasColumnType("real") - .HasColumnName("SPARE5"); - - b.Property("Svyazc") - .HasColumnType("real") - .HasColumnName("SVYAZC"); - - b.Property("Svyazu") - .HasColumnType("real") - .HasColumnName("SVYAZU"); - - b.Property("Svydls") - .HasColumnType("real") - .HasColumnName("SVYDLS"); - - b.Property("Svyew") - .HasColumnType("real") - .HasColumnName("SVYEW"); - - b.Property("Svygtf") - .HasColumnType("real") - .HasColumnName("SVYGTF"); - - b.Property("Svyinc") - .HasColumnType("real") - .HasColumnName("SVYINC"); - - b.Property("Svymtf") - .HasColumnType("real") - .HasColumnName("SVYMTF"); - - b.Property("Svyns") - .HasColumnType("real") - .HasColumnName("SVYNS"); - - b.Property("Svytype") - .HasColumnType("text") - .HasColumnName("SVYTYPE"); - - b.Property("Svywalk") - .HasColumnType("real") - .HasColumnName("SVYWALK"); - - b.Property("TelemetryId") - .HasColumnType("integer"); - - b.HasIndex("TelemetryId"); - - b.ToTable("t_telemetry_wits_7"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => - { - b.HasBaseType("AsbCloudDb.Model.WITS.RecordBase"); - - b.Property("Deptbitm") - .HasColumnType("real") - .HasColumnName("DEPTBITM"); - - b.Property("Deptbitv") - .HasColumnType("real") - .HasColumnName("DEPTBITV"); - - b.Property("Deptcalm") - .HasColumnType("real") - .HasColumnName("DEPTCALM"); - - b.Property("Deptcalv") - .HasColumnType("real") - .HasColumnName("DEPTCALV"); - - b.Property("Deptfdm") - .HasColumnType("real") - .HasColumnName("DEPTFDM"); - - b.Property("Deptfdv") - .HasColumnType("real") - .HasColumnName("DEPTFDV"); - - b.Property("Deptgr1m") - .HasColumnType("real") - .HasColumnName("DEPTGR1M"); - - b.Property("Deptgr1v") - .HasColumnType("real") - .HasColumnName("DEPTGR1V"); - - b.Property("Deptgr2m") - .HasColumnType("real") - .HasColumnName("DEPTGR2M"); - - b.Property("Deptgr2v") - .HasColumnType("real") - .HasColumnName("DEPTGR2V"); - - b.Property("Deptmeas") - .HasColumnType("real") - .HasColumnName("DEPTMEAS"); - - b.Property("Deptp1m") - .HasColumnType("real") - .HasColumnName("DEPTP1M"); - - b.Property("Deptp1v") - .HasColumnType("real") - .HasColumnName("DEPTP1V"); - - b.Property("Deptp2m") - .HasColumnType("real") - .HasColumnName("DEPTP2M"); - - b.Property("Deptp2v") - .HasColumnType("real") - .HasColumnName("DEPTP2V"); - - b.Property("Deptrs1m") - .HasColumnType("real") - .HasColumnName("DEPTRS1M"); - - b.Property("Deptrs1v") - .HasColumnType("real") - .HasColumnName("DEPTRS1V"); - - b.Property("Deptrs2m") - .HasColumnType("real") - .HasColumnName("DEPTRS2M"); - - b.Property("Deptrs2v") - .HasColumnType("real") - .HasColumnName("DEPTRS2V"); - - b.Property("Deptvert") - .HasColumnType("real") - .HasColumnName("DEPTVERT"); - - b.Property("Mclp") - .HasColumnType("real") - .HasColumnName("MCLP"); - - b.Property("Mfd") - .HasColumnType("real") - .HasColumnName("MFD"); - - b.Property("Mffp") - .HasColumnType("real") - .HasColumnName("MFFP"); - - b.Property("Mfpp") - .HasColumnType("real") - .HasColumnName("MFPP"); - - b.Property("Mfrann") - .HasColumnType("real") - .HasColumnName("MFRANN"); - - b.Property("Mfrpipe") - .HasColumnType("real") - .HasColumnName("MFRPIPE"); - - b.Property("Mftann") - .HasColumnType("real") - .HasColumnName("MFTANN"); - - b.Property("Mftpipe") - .HasColumnType("real") - .HasColumnName("MFTPIPE"); - - b.Property("Mg1") - .HasColumnType("real") - .HasColumnName("MG1"); - - b.Property("Mg1c") - .HasColumnType("real") - .HasColumnName("MG1C"); - - b.Property("Mg2") - .HasColumnType("real") - .HasColumnName("MG2"); - - b.Property("Mg2c") - .HasColumnType("real") - .HasColumnName("MG2C"); - - b.Property("Mpo1") - .HasColumnType("real") - .HasColumnName("MPO1"); - - b.Property("Mpo2") - .HasColumnType("real") - .HasColumnName("MPO2"); - - b.Property("Mr1") - .HasColumnType("real") - .HasColumnName("MR1"); - - b.Property("Mr1c") - .HasColumnType("real") - .HasColumnName("MR1C"); - - b.Property("Mr2") - .HasColumnType("real") - .HasColumnName("MR2"); - - b.Property("Mr2c") - .HasColumnType("real") - .HasColumnName("MR2C"); - - b.Property("Passnum") - .HasColumnType("smallint") - .HasColumnName("PASSNUM"); - - b.Property("Spare1") - .HasColumnType("real") - .HasColumnName("SPARE1"); - - b.Property("Spare2") - .HasColumnType("real") - .HasColumnName("SPARE2"); - - b.Property("Spare3") - .HasColumnType("real") - .HasColumnName("SPARE3"); - - b.Property("Spare4") - .HasColumnType("real") - .HasColumnName("SPARE4"); - - b.Property("Spare5") - .HasColumnType("real") - .HasColumnName("SPARE5"); - - b.Property("Spare6") - .HasColumnType("real") - .HasColumnName("SPARE6"); - - b.Property("Spare7") - .HasColumnType("real") - .HasColumnName("SPARE7"); - - b.Property("Spare8") - .HasColumnType("real") - .HasColumnName("SPARE8"); - - b.Property("Spare9") - .HasColumnType("real") - .HasColumnName("SPARE9"); - - b.Property("TelemetryId") - .HasColumnType("integer"); - - b.HasIndex("TelemetryId"); - - 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.Navigation("Deposit"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Company", b => - { - b.HasOne("AsbCloudDb.Model.CompanyType", "CompanyType") - .WithMany("Companies") - .HasForeignKey("IdCompanyType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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.Well", "Well") - .WithMany("Contacts") - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CompanyType"); - - b.Navigation("Well"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.DailyReport.DailyReport", b => - { - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Well"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b => - { - 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.Navigation("OperationCategory"); - - 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.Well", "Well") - .WithMany("DrillingProgramParts") - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("FileCategory"); - - b.Navigation("Well"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.DrillTest", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Telemetry"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Faq", b => - { - b.HasOne("AsbCloudDb.Model.User", "AuthorAnswer") - .WithMany() - .HasForeignKey("IdAuthorAnswer"); - - b.HasOne("AsbCloudDb.Model.User", "AuthorQuestion") - .WithMany() - .HasForeignKey("IdAuthorQuestion") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("AuthorAnswer"); - - b.Navigation("AuthorQuestion"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => - { - 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.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Author"); - - b.Navigation("FileCategory"); - - 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.User", "User") - .WithMany("FileMarks") - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_user_t_file_mark_fk"); - - b.Navigation("FileInfo"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Telemetry"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemInt", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Telemetry"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemString", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Telemetry"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.HelpPage", b => - { - b.HasOne("AsbCloudDb.Model.FileCategory", "FileCategory") - .WithMany() - .HasForeignKey("IdCategory") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("FileCategory"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b => - { - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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.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.Navigation("Author"); - - b.Navigation("Category"); - - 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.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.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Category"); - - 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.User", "User") - .WithMany() - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NotificationCategory"); - - 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.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("OperationCategory"); - - b.Navigation("Well"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.PlannedTrajectory", b => - { - 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.Navigation("User"); - - b.Navigation("Well"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellDrilling", b => - { - 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.WellSectionType", "WellSectionType") - .WithMany() - .HasForeignKey("IdWellSectionType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - - b.Navigation("Well"); - - b.Navigation("WellSectionType"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapWellReam", b => - { - 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.WellSectionType", "WellSectionType") - .WithMany() - .HasForeignKey("IdWellSectionType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - - b.Navigation("Well"); - - 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.Well", "Well") - .WithMany("RelationCompaniesWells") - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("t_relation_company_well_t_well_id_fk"); - - b.Navigation("Company"); - - 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.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - - 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.User", "User") - .WithMany() - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DrillingProgramPart"); - - 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.UserRole", "UserRole") - .WithMany("RelationUserRolePermissions") - .HasForeignKey("IdUserRole") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Permission"); - - 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", "IncludeRole") - .WithMany() - .HasForeignKey("IdInclude") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("IncludeRole"); - - 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.UserRole", "UserRole") - .WithMany("RelationUsersUserRoles") - .HasForeignKey("IdUserRole") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - - 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.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("File"); - - 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.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Driller"); - - 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.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Author"); - - b.Navigation("Well"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Subsystems.SubsystemOperationTime", b => - { - b.HasOne("AsbCloudDb.Model.Subsystems.Subsystem", "Subsystem") - .WithMany() - .HasForeignKey("IdSubsystem") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry") - .WithMany() - .HasForeignKey("IdTelemetry") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subsystem"); - - b.Navigation("Telemetry"); - }); - - 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.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.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.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.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.Navigation("Telemetry"); - }); - - 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.Navigation("Company"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.UserSetting", b => - { - b.HasOne("AsbCloudDb.Model.User", "User") - .WithMany() - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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.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.Navigation("Cluster"); - - b.Navigation("Telemetry"); - - 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.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.Navigation("Well"); - - b.Navigation("WellSectionType"); - - 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.User", "User") - .WithMany() - .HasForeignKey("IdUser") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("AsbCloudDb.Model.Well", "Well") - .WithMany() - .HasForeignKey("IdWell") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Category"); - - b.Navigation("User"); - - 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.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.WellSectionType", "WellSectionType") - .WithMany("WellOperations") - .HasForeignKey("IdWellSectionType") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("OperationCategory"); - - b.Navigation("OperationPlan"); - - b.Navigation("Well"); - - b.Navigation("WellSectionType"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WellOperationCategory", b => - { - b.HasOne("AsbCloudDb.Model.WellOperationCategory", "Parent") - .WithMany() - .HasForeignKey("IdParent"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b => - { - 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.Navigation("Telemetry"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b => - { - 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.Navigation("Telemetry"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b => - { - 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.Navigation("Telemetry"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b => - { - 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.Navigation("Telemetry"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b => - { - 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.Navigation("Telemetry"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b => - { - 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.Navigation("Telemetry"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Cluster", b => - { - b.Navigation("Wells"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Company", b => - { - b.Navigation("RelationCompaniesWells"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.CompanyType", b => - { - b.Navigation("Companies"); - - b.Navigation("Contacts"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Deposit", b => - { - b.Navigation("Clusters"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Driller", b => - { - b.Navigation("Schedule"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.DrillingProgramPart", b => - { - b.Navigation("RelatedUsers"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.FileInfo", b => - { - b.Navigation("FileMarks"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Manuals.ManualDirectory", b => - { - b.Navigation("Children"); - - b.Navigation("Manuals"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.MeasureCategory", b => - { - b.Navigation("Measures"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.NotificationCategory", b => - { - b.Navigation("Notifications"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Permission", b => - { - b.Navigation("RelationUserRolePermissions"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Telemetry", b => - { - b.Navigation("DataSaub"); - - b.Navigation("DataSpin"); - - b.Navigation("Events"); - - b.Navigation("Messages"); - - b.Navigation("Users"); - - b.Navigation("Well"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.User", b => - { - b.Navigation("FileMarks"); - - b.Navigation("Files"); - - b.Navigation("RelationContactsWells"); - - b.Navigation("RelationUsersUserRoles"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.UserRole", b => - { - b.Navigation("RelationUserRolePermissions"); - - b.Navigation("RelationUserRoleUserRoles"); - - b.Navigation("RelationUsersUserRoles"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.Well", b => - { - b.Navigation("Contacts"); - - b.Navigation("DrillingProgramParts"); - - b.Navigation("RelationCompaniesWells"); - - b.Navigation("WellCompositeSrcs"); - - b.Navigation("WellComposites"); - - b.Navigation("WellOperations"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WellSectionType", b => - { - b.Navigation("WellComposites"); - - b.Navigation("WellOperations"); - }); - - modelBuilder.Entity("AsbCloudDb.Model.WellType", b => - { - b.Navigation("Wells"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs b/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs deleted file mode 100644 index c3e87ce6..00000000 --- a/AsbCloudDb/Migrations/20231115102303_Add_Permissions_For_Trajectory_Fact.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace AsbCloudDb.Migrations -{ - public partial class Add_Permissions_For_Trajectory_Fact : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "t_permission", - columns: new[] { "id", "description", "name" }, - values: new object[,] - { - { 529, "Разрешение просматривать фактические траектории", "FactTrajectory.edit" }, - }); - - migrationBuilder.InsertData( - table: "t_relation_user_role_permission", - columns: new[] { "id_permission", "id_user_role" }, - values: new object[,] - { - { 529, 1 }, - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "t_relation_user_role_permission", - keyColumns: new[] { "id_permission", "id_user_role" }, - keyValues: new object[] { 529, 1 }); - - migrationBuilder.DeleteData( - table: "t_permission", - keyColumn: "id", - keyValue: 529); - } - } -} diff --git a/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs b/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs index a2ee3f46..3a3692d9 100644 --- a/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs +++ b/AsbCloudInfrastructure/Repository/TrajectoryNnbRepository.cs @@ -45,12 +45,18 @@ namespace AsbCloudInfrastructure.Repository { IdWell = idWell, }; + var result = await GetByRequestAsync(request, token); + return result; + } + + public async Task> GetByRequestAsync(TrajectoryRequest request, CancellationToken token) + { var entities = (await BuildQuery(request) - .Where(coord => coord.Deptsvym.HasValue && - coord.Svyinc.HasValue && - coord.Svyazc.HasValue) - .AsNoTracking() - .ToArrayAsync(token)); + .Where(coord => coord.Deptsvym.HasValue && + coord.Svyinc.HasValue && + coord.Svyazc.HasValue) + .AsNoTracking() + .ToArrayAsync(token)); var result = entities .Select(coord => new TrajectoryGeoFactDto @@ -66,10 +72,5 @@ namespace AsbCloudInfrastructure.Repository return result; } - - public Task> GetByRequestAsync(TrajectoryRequest trajectoryRequest, CancellationToken cancellationToken) - { - throw new System.NotImplementedException(); - } } } diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs index dc75b69a..0b9b6421 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryController.cs @@ -6,6 +6,7 @@ using AsbCloudInfrastructure.Services.Trajectory.Export; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -17,18 +18,18 @@ namespace AsbCloudWebApi.Controllers.Trajectory /// [ApiController] [Authorize] - public abstract class TrajectoryController : ControllerBase - where Tdto : TrajectoryGeoDto + public abstract class TrajectoryController : ControllerBase + where TDto : TrajectoryGeoDto { protected abstract string fileName { get; set; } private readonly IWellService wellService; - private readonly TrajectoryExportService trajectoryExportService; - private readonly ITrajectoryRepository trajectoryRepository; + private readonly TrajectoryExportService trajectoryExportService; + private readonly ITrajectoryRepository trajectoryRepository; public TrajectoryController(IWellService wellService, - TrajectoryExportService trajectoryExportService, - ITrajectoryRepository trajectoryRepository) + TrajectoryExportService trajectoryExportService, + ITrajectoryRepository trajectoryRepository) { this.trajectoryExportService = trajectoryExportService; this.wellService = wellService; @@ -60,8 +61,8 @@ namespace AsbCloudWebApi.Controllers.Trajectory /// ключ скважины /// Токен отмены задачи /// Список добавленных координат траектории - //[ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetAsync(int idWell, CancellationToken token) + [HttpGet] + public async Task>> GetAsync(int idWell, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) From 1acc94fad85676223f0fd4a3051dfd2a0950253a Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 30 Nov 2023 15:08:58 +0500 Subject: [PATCH 15/19] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E-3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IPlannedTrajectoryImportService.cs | 40 ------------------ .../AsbCloudInfrastructure.csproj | 2 +- AsbCloudInfrastructure/DependencyInjection.cs | 8 ++-- .../Export/TrajectoryExportService.cs | 6 +-- .../TrajectoryFactManualExportService.cs | 2 +- .../Export/TrajectoryFactNnbExportService.cs | 2 +- ...vice.cs => TrajectoryPlanExportService.cs} | 8 ++-- .../TrajectoryFactManualParserService.cs | 7 +-- .../Import/TrajectoryParserService.cs | 12 ++---- ...vice.cs => TrajectoryPlanParserService.cs} | 13 ++---- ...plate.xlsx => TrajectoryPlanTemplate.xlsx} | Bin .../Services/Trajectory/Templates/password.md | 1 + .../Trajectory/TrajectoryExportTest.cs | 17 ++++---- .../Trajectory/TrajectoryImportTest.cs | 10 ++--- .../TrajectoryEditableController.cs | 2 +- ...troller.cs => TrajectoryPlanController.cs} | 10 ++--- 16 files changed, 42 insertions(+), 98 deletions(-) delete mode 100644 AsbCloudApp/Services/IPlannedTrajectoryImportService.cs rename AsbCloudInfrastructure/Services/Trajectory/Export/{TrajectoryPlannedExportService.cs => TrajectoryPlanExportService.cs} (82%) rename AsbCloudInfrastructure/Services/Trajectory/Import/{TrajectoryPlannedParserService.cs => TrajectoryPlanParserService.cs} (74%) rename AsbCloudInfrastructure/Services/Trajectory/Templates/{TrajectoryPlannedTemplate.xlsx => TrajectoryPlanTemplate.xlsx} (100%) create mode 100644 AsbCloudInfrastructure/Services/Trajectory/Templates/password.md rename AsbCloudWebApi/Controllers/Trajectory/{TrajectoryPlannedController.cs => TrajectoryPlanController.cs} (85%) diff --git a/AsbCloudApp/Services/IPlannedTrajectoryImportService.cs b/AsbCloudApp/Services/IPlannedTrajectoryImportService.cs deleted file mode 100644 index 9d00caf0..00000000 --- a/AsbCloudApp/Services/IPlannedTrajectoryImportService.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace AsbCloudApp.Services -{ - /// - /// Сервис загрузки и обработки плановой траектории из файла - /// - public interface IPlannedTrajectoryImportService - { - /// - /// скачать шаблон для заполнения плановой траектории - /// - /// - Stream GetTemplateFile(); - /// - /// Получить имя файла (исходя из названия скважины) - /// - /// - Task GetFileNameAsync(int idWell, CancellationToken token); - - /// - /// загрузить текущую плановую траекторию в .xlsx - /// - /// - /// - /// - Task ExportAsync(int idWell, CancellationToken token); - /// - /// импортировать из excel плановую траекторию - /// - /// - /// - /// - /// - /// Очистить старые координаты перед импортом (если файл проходит валидацию) - Task ImportAsync(int idWell, int idUser, Stream stream, bool deleteBeforeImport, CancellationToken token); - } -} diff --git a/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj b/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj index 25bea191..f2edc76d 100644 --- a/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj +++ b/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj @@ -38,7 +38,7 @@ - + diff --git a/AsbCloudInfrastructure/DependencyInjection.cs b/AsbCloudInfrastructure/DependencyInjection.cs index 7aafcb27..4e7c8ee6 100644 --- a/AsbCloudInfrastructure/DependencyInjection.cs +++ b/AsbCloudInfrastructure/DependencyInjection.cs @@ -201,10 +201,10 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -276,9 +276,9 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient, CrudCacheRepositoryBase>(); - + services.AddTransient, CrudCacheRepositoryBase>(); - + services.AddTransient, CrudCacheRepositoryBase>(); // TelemetryData services diff --git a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryExportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryExportService.cs index b2384d0e..fc075d12 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryExportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryExportService.cs @@ -18,7 +18,7 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export private readonly ITrajectoryRepository trajectoryRepository; public abstract string templateFileName { get; } public abstract string usingTemplateFile { get; } - public abstract string sheetTrajectory { get; } + public abstract string sheetName { get; } public abstract int headerRowsCount { get; } public TrajectoryExportService(IWellService wellService, ITrajectoryRepository trajectoryRepository) @@ -65,9 +65,9 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export { if (trajectories.Any()) { - var sheet = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetTrajectory); + var sheet = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetName); if (sheet is null) - throw new FileFormatException($"Лист с именем {sheetTrajectory} отсутствует, либо имеет некорректное название"); + throw new FileFormatException($"Лист с именем {sheetName} отсутствует, либо имеет некорректное название"); AddTrajecoryToSheet(sheet, trajectories); } } diff --git a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs index 702b79f0..8484fd3f 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactManualExportService.cs @@ -10,7 +10,7 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export { public override string templateFileName { get; } = "TrajectoryFactManualTemplate.xlsx"; public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; - public override string sheetTrajectory { get; } = "Фактическая траектория"; + public override string sheetName { get; } = "Фактическая траектория"; public override int headerRowsCount { get; } = 2; public TrajectoryFactManualExportService( diff --git a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs index e787eb73..e4548599 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryFactNnbExportService.cs @@ -10,7 +10,7 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export { public override string templateFileName { get; } = "TrajectoryFactNnbTemplate.xlsx"; public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; - public override string sheetTrajectory { get; } = "Фактическая ннб-траектория"; + public override string sheetName { get; } = "Фактическая ннб-траектория"; public override int headerRowsCount { get; } = 2; public TrajectoryFactNnbExportService( diff --git a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlannedExportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlanExportService.cs similarity index 82% rename from AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlannedExportService.cs rename to AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlanExportService.cs index fde6f246..e5e6cc35 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlannedExportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlanExportService.cs @@ -5,17 +5,17 @@ using ClosedXML.Excel; namespace AsbCloudInfrastructure.Services.Trajectory.Export { - public class TrajectoryPlannedExportService : TrajectoryExportService + public class TrajectoryPlanExportService : TrajectoryExportService { /* * password for PlannedTrajectoryTemplate.xlsx is Drill2022 */ - public override string templateFileName { get; } = "TrajectoryPlannedTemplate.xlsx"; + public override string templateFileName { get; } = "TrajectoryPlanTemplate.xlsx"; public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; - public override string sheetTrajectory { get; } = "Плановая траектория"; + public override string sheetName { get; } = "Плановая траектория"; public override int headerRowsCount { get; } = 2; - public TrajectoryPlannedExportService( + public TrajectoryPlanExportService( IWellService wellService, ITrajectoryEditableRepository plannedTrajectoryService) : base(wellService, plannedTrajectoryService) diff --git a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualParserService.cs b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualParserService.cs index 35f16a18..be08e12e 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualParserService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryFactManualParserService.cs @@ -8,14 +8,9 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Import { public override string templateFileName { get; } = "TrajectoryFactManualTemplate.xlsx"; public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; - public override string sheetNameTrajectory { get; } = "Фактическая траектория"; + public override string sheetName { get; } = "Фактическая траектория"; public override int headerRowsCount { get; } = 2; - public TrajectoryFactManualParserService() : base() - { - - } - protected override TrajectoryGeoFactDto ParseRow(IXLRow row) { var trajectoryRow = new TrajectoryGeoFactDto diff --git a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryParserService.cs b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryParserService.cs index c5b1c0b0..c67bc409 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryParserService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryParserService.cs @@ -1,7 +1,6 @@ using AsbCloudApp.Data.Trajectory; using ClosedXML.Excel; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.IO; using System.Linq; @@ -12,15 +11,12 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Import { public abstract string templateFileName { get; } public abstract string usingTemplateFile { get; } - public abstract string sheetNameTrajectory { get; } + public abstract string sheetName { get; } public abstract int headerRowsCount { get; } - public TrajectoryParserService() - { - } protected abstract T ParseRow(IXLRow row); - public IEnumerable ImportAsync(Stream stream) + public IEnumerable Import(Stream stream) { using var workbook = new XLWorkbook(stream, XLEventTracking.Disabled); var trajectoryRows = ParseFileStream(stream); @@ -37,9 +33,9 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Import private IEnumerable ParseWorkbook(IXLWorkbook workbook) { - var sheetTrajectory = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetNameTrajectory); + var sheetTrajectory = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetName); if (sheetTrajectory is null) - throw new FileFormatException($"Книга excel не содержит листа {sheetNameTrajectory}."); + throw new FileFormatException($"Книга excel не содержит листа {sheetName}."); var trajectoryRows = ParseSheet(sheetTrajectory); return trajectoryRows; } diff --git a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedParserService.cs b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlanParserService.cs similarity index 74% rename from AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedParserService.cs rename to AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlanParserService.cs index 4328dc32..00f3f197 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlannedParserService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlanParserService.cs @@ -4,20 +4,13 @@ using ClosedXML.Excel; namespace AsbCloudInfrastructure.Services.Trajectory.Import { - public class TrajectoryPlannedParserService : TrajectoryParserService + public class TrajectoryPlanParserService : TrajectoryParserService { - /* - * password for PlannedTrajectoryTemplate.xlsx is Drill2022 - */ - public override string templateFileName { get; } = "TrajectoryPlannedTemplate.xlsx"; + public override string templateFileName { get; } = "TrajectoryPlanTemplate.xlsx"; public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; - public override string sheetNameTrajectory { get; } = "Плановая траектория"; + public override string sheetName { get; } = "Плановая траектория"; public override int headerRowsCount { get; } = 2; - public TrajectoryPlannedParserService() : base() - { - } - protected override TrajectoryGeoPlanDto ParseRow(IXLRow row) { var trajectoryRow = new TrajectoryGeoPlanDto diff --git a/AsbCloudInfrastructure/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx b/AsbCloudInfrastructure/Services/Trajectory/Templates/TrajectoryPlanTemplate.xlsx similarity index 100% rename from AsbCloudInfrastructure/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx rename to AsbCloudInfrastructure/Services/Trajectory/Templates/TrajectoryPlanTemplate.xlsx diff --git a/AsbCloudInfrastructure/Services/Trajectory/Templates/password.md b/AsbCloudInfrastructure/Services/Trajectory/Templates/password.md new file mode 100644 index 00000000..74caf50b --- /dev/null +++ b/AsbCloudInfrastructure/Services/Trajectory/Templates/password.md @@ -0,0 +1 @@ +password for PlannedTrajectoryTemplate.xlsx is Drill2022 \ No newline at end of file diff --git a/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryExportTest.cs b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryExportTest.cs index 08d83882..280b7392 100644 --- a/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryExportTest.cs +++ b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryExportTest.cs @@ -1,6 +1,5 @@ using AsbCloudApp.Data.Trajectory; using AsbCloudApp.Repositories; -using AsbCloudApp.Requests; using AsbCloudApp.Services; using AsbCloudInfrastructure.Services.Trajectory.Export; using NSubstitute; @@ -14,8 +13,8 @@ namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory public class TrajectoryExportTest { private IWellService wellService; - private readonly ITrajectoryEditableRepository trajectoryPlannedRepository; - private readonly TrajectoryPlannedExportService trajectoryPlannedExportService; + private readonly ITrajectoryEditableRepository trajectoryPlanRepository; + private readonly TrajectoryPlanExportService trajectoryPlanExportService; private readonly ITrajectoryEditableRepository trajectoryFactManualReposirory; private readonly TrajectoryFactManualExportService trajectoryFactManualExportService; @@ -25,7 +24,7 @@ namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory private readonly int idWell = 4; - private readonly TrajectoryGeoPlanDto[] trajectoryPlannedRows = new TrajectoryGeoPlanDto[2] { + private readonly TrajectoryGeoPlanDto[] trajectoryPlanRows = new TrajectoryGeoPlanDto[2] { new TrajectoryGeoPlanDto() { Id = 1, AzimuthGeo = 1, @@ -84,8 +83,8 @@ namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory public TrajectoryExportTest() { wellService = Substitute.For(); - trajectoryPlannedRepository = Substitute.For>(); - trajectoryPlannedExportService = new TrajectoryPlannedExportService(wellService, trajectoryPlannedRepository); + trajectoryPlanRepository = Substitute.For>(); + trajectoryPlanExportService = new TrajectoryPlanExportService(wellService, trajectoryPlanRepository); trajectoryFactManualReposirory = Substitute.For>(); trajectoryFactManualExportService = new TrajectoryFactManualExportService(wellService, trajectoryFactManualReposirory); @@ -97,10 +96,10 @@ namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory [Fact] public async Task Export_trajectory_planned() { - trajectoryPlannedRepository.GetAsync(idWell, CancellationToken.None) - .Returns(trajectoryPlannedRows); + trajectoryPlanRepository.GetAsync(idWell, CancellationToken.None) + .Returns(trajectoryPlanRows); - var stream = await trajectoryPlannedExportService.ExportAsync(idWell, CancellationToken.None); + var stream = await trajectoryPlanExportService.ExportAsync(idWell, CancellationToken.None); Assert.True(stream.Length > 0); } diff --git a/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryImportTest.cs b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryImportTest.cs index 54444d9b..00063ada 100644 --- a/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryImportTest.cs +++ b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryImportTest.cs @@ -6,14 +6,14 @@ namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory { public class TrajectoryImportTest { - private readonly TrajectoryPlannedParserService trajectoryPlannedImportService; + private readonly TrajectoryPlanParserService trajectoryPlanImportService; private readonly TrajectoryFactManualParserService trajectoryFactManualImportService; private string usingTemplateFile = "AsbCloudWebApi.Tests.Services.Trajectory.Templates"; public TrajectoryImportTest() { - trajectoryPlannedImportService = new TrajectoryPlannedParserService(); + trajectoryPlanImportService = new TrajectoryPlanParserService(); trajectoryFactManualImportService = new TrajectoryFactManualParserService(); } @@ -21,12 +21,12 @@ namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory public void Import_trajectory_planned() { var stream = System.Reflection.Assembly.GetExecutingAssembly() - .GetManifestResourceStream($"{usingTemplateFile}.TrajectoryPlannedTemplate.xlsx"); + .GetManifestResourceStream($"{usingTemplateFile}.TrajectoryPlanTemplate.xlsx"); if (stream is null) Assert.Fail("Файла для импорта не существует"); - var trajectoryRows = trajectoryPlannedImportService.ImportAsync(stream); + var trajectoryRows = trajectoryPlanImportService.Import(stream); Assert.Equal(3, trajectoryRows.Count()); } @@ -40,7 +40,7 @@ namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory if (stream is null) Assert.Fail("Файла для импорта не существует"); - var trajectoryRows = trajectoryFactManualImportService.ImportAsync(stream); + var trajectoryRows = trajectoryFactManualImportService.Import(stream); Assert.Equal(4, trajectoryRows.Count()); } diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs index 9afc825f..05764835 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryEditableController.cs @@ -88,7 +88,7 @@ namespace AsbCloudWebApi.Controllers.Trajectory try { - var trajectoryRows = trajectoryImportService.ImportAsync(stream); + var trajectoryRows = trajectoryImportService.Import(stream); foreach (var row in trajectoryRows) { row.IdWell = idWell; diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlannedController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlanController.cs similarity index 85% rename from AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlannedController.cs rename to AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlanController.cs index 33fd045a..3ca300ee 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlannedController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlanController.cs @@ -15,15 +15,15 @@ namespace AsbCloudWebApi.Controllers.Trajectory /// /// Плановая траектория (загрузка и хранение) /// - [Route("api/well/{idWell}/plannedTrajectory")] + [Route("api/well/{idWell}/[controller]")] [ApiController] - public class TrajectoryPlannedController : TrajectoryEditableController + public class TrajectoryPlanController : TrajectoryEditableController { private readonly TrajectoryService trajectoryVisualizationService; - public TrajectoryPlannedController(IWellService wellService, - TrajectoryPlannedParserService plannedTrajectoryImportService, - TrajectoryPlannedExportService plannedTrajectoryExportService, + public TrajectoryPlanController(IWellService wellService, + TrajectoryPlanParserService plannedTrajectoryImportService, + TrajectoryPlanExportService plannedTrajectoryExportService, ITrajectoryEditableRepository plannedTrajectoryRepository, TrajectoryService trajectoryVisualizationService) : base( From 6046b61ba1a340f9234880fd9509f4986896a425 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 30 Nov 2023 15:20:22 +0500 Subject: [PATCH 16/19] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E?= =?UTF-8?q?=20-=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Export/TrajectoryPlanExportService.cs | 4 ++-- .../Services/Trajectory/TrajectoryService.cs | 4 ++-- AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj | 2 +- ...nedTemplate.xlsx => TrajectoryPlanTemplate.xlsx} | Bin .../Services/Trajectory/TrajectoryExportTest.cs | 2 +- .../Services/Trajectory/TrajectoryImportTest.cs | 4 ++-- .../Trajectory/TrajectoryPlanController.cs | 12 ++++++------ 7 files changed, 14 insertions(+), 14 deletions(-) rename AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/Templates/{TrajectoryPlannedTemplate.xlsx => TrajectoryPlanTemplate.xlsx} (100%) diff --git a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlanExportService.cs b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlanExportService.cs index e5e6cc35..2d1c1689 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlanExportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/Export/TrajectoryPlanExportService.cs @@ -17,8 +17,8 @@ namespace AsbCloudInfrastructure.Services.Trajectory.Export public TrajectoryPlanExportService( IWellService wellService, - ITrajectoryEditableRepository plannedTrajectoryService) - : base(wellService, plannedTrajectoryService) + ITrajectoryEditableRepository trajectoryPlanService) + : base(wellService, trajectoryPlanService) { } diff --git a/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs b/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs index 216a2041..730d0445 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/TrajectoryService.cs @@ -130,11 +130,11 @@ public class TrajectoryService private TrajectoryNnbService trajectoryNnbService; public TrajectoryService( - ITrajectoryEditableRepository plannedRepository, + ITrajectoryEditableRepository planRepository, ITrajectoryEditableRepository factRepository, ITrajectoryNnbRepository nnbRepository) { - trajectoryPlanService = new TrajectoryPlanService(plannedRepository); + trajectoryPlanService = new TrajectoryPlanService(planRepository); trajectoryFactService = new TrajectoryFactService(factRepository); trajectoryNnbService = new TrajectoryNnbService(nnbRepository); } diff --git a/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj b/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj index 8fd54d8c..03c795e6 100644 --- a/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj +++ b/AsbCloudWebApi.Tests/AsbCloudWebApi.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/Templates/TrajectoryPlanTemplate.xlsx similarity index 100% rename from AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/Templates/TrajectoryPlannedTemplate.xlsx rename to AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/Templates/TrajectoryPlanTemplate.xlsx diff --git a/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryExportTest.cs b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryExportTest.cs index 280b7392..0bc9c2d4 100644 --- a/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryExportTest.cs +++ b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryExportTest.cs @@ -94,7 +94,7 @@ namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory } [Fact] - public async Task Export_trajectory_planned() + public async Task Export_trajectory_plan() { trajectoryPlanRepository.GetAsync(idWell, CancellationToken.None) .Returns(trajectoryPlanRows); diff --git a/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryImportTest.cs b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryImportTest.cs index 00063ada..cb151ce5 100644 --- a/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryImportTest.cs +++ b/AsbCloudWebApi.Tests/UnitTests/Services/Trajectory/TrajectoryImportTest.cs @@ -9,7 +9,7 @@ namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory private readonly TrajectoryPlanParserService trajectoryPlanImportService; private readonly TrajectoryFactManualParserService trajectoryFactManualImportService; - private string usingTemplateFile = "AsbCloudWebApi.Tests.Services.Trajectory.Templates"; + private string usingTemplateFile = "AsbCloudWebApi.Tests.UnitTests.Services.Trajectory.Templates"; public TrajectoryImportTest() { @@ -18,7 +18,7 @@ namespace AsbCloudWebApi.Tests.UnitTests.Services.Trajectory } [Fact] - public void Import_trajectory_planned() + public void Import_trajectory_plan() { var stream = System.Reflection.Assembly.GetExecutingAssembly() .GetManifestResourceStream($"{usingTemplateFile}.TrajectoryPlanTemplate.xlsx"); diff --git a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlanController.cs b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlanController.cs index 3ca300ee..eb8559b6 100644 --- a/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlanController.cs +++ b/AsbCloudWebApi/Controllers/Trajectory/TrajectoryPlanController.cs @@ -22,15 +22,15 @@ namespace AsbCloudWebApi.Controllers.Trajectory private readonly TrajectoryService trajectoryVisualizationService; public TrajectoryPlanController(IWellService wellService, - TrajectoryPlanParserService plannedTrajectoryImportService, - TrajectoryPlanExportService plannedTrajectoryExportService, - ITrajectoryEditableRepository plannedTrajectoryRepository, + TrajectoryPlanParserService trajectoryPlanImportService, + TrajectoryPlanExportService trajectoryPlanExportService, + ITrajectoryEditableRepository trajectoryPlanRepository, TrajectoryService trajectoryVisualizationService) : base( wellService, - plannedTrajectoryImportService, - plannedTrajectoryExportService, - plannedTrajectoryRepository) + trajectoryPlanImportService, + trajectoryPlanExportService, + trajectoryPlanRepository) { fileName = "ЕЦП_шаблон_файла_плановая_траектория.xlsx"; this.trajectoryVisualizationService = trajectoryVisualizationService; From 05181998b7a75ae7642e1d50372dd1ec80b8ee19 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Fri, 1 Dec 2023 11:25:52 +0500 Subject: [PATCH 17/19] fix test --- .../UnitTests/Services/DailyReportServiceTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsbCloudWebApi.Tests/UnitTests/Services/DailyReportServiceTest.cs b/AsbCloudWebApi.Tests/UnitTests/Services/DailyReportServiceTest.cs index 8202a95f..95008c7a 100644 --- a/AsbCloudWebApi.Tests/UnitTests/Services/DailyReportServiceTest.cs +++ b/AsbCloudWebApi.Tests/UnitTests/Services/DailyReportServiceTest.cs @@ -254,7 +254,7 @@ public class DailyReportServiceTest wellServiceMock.GetOrDefaultAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(fakeWell); - trajectoryFactNnbRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) + trajectoryFactNnbRepositoryMock.GetByRequestAsync(Arg.Any(), Arg.Any()) .ReturnsForAnyArgs(new[] { fakeLastFactTrajectory }); wellOperationRepositoryMock.GetAsync(Arg.Any(), Arg.Any()) From 7436cfd11a57d8fba2ef518fda1d21f6cce0f0f6 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Fri, 1 Dec 2023 16:26:18 +0500 Subject: [PATCH 18/19] MockController Add method testing sirnalR --- AsbCloudWebApi/Controllers/MockController.cs | 159 ++++++++++++------- 1 file changed, 103 insertions(+), 56 deletions(-) diff --git a/AsbCloudWebApi/Controllers/MockController.cs b/AsbCloudWebApi/Controllers/MockController.cs index 0c95725e..4cec7ce2 100644 --- a/AsbCloudWebApi/Controllers/MockController.cs +++ b/AsbCloudWebApi/Controllers/MockController.cs @@ -1,72 +1,119 @@ -using Microsoft.AspNetCore.Mvc; +using AsbCloudApp.Exceptions; +using AsbCloudWebApi.SignalR; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.SignalR; +using Microsoft.Extensions.DependencyInjection; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Threading; +using System.Threading.Tasks; -namespace AsbCloudWebApi.Controllers +namespace AsbCloudWebApi.Controllers; + +/// +/// Имитирует разные типы ответа сервера +/// +[Route("api/[controller]")] +[ApiController] +public class MockController : ControllerBase { - /// - /// Имитирует разные типы ответа сервера - /// - [Route("api/[controller]")] - [ApiController] - public class MockController : ControllerBase + private readonly IServiceProvider provider; + + public MockController(IServiceProvider provider) { - /// - /// имитирует http-400 - /// - [HttpGet("400")] - [ProducesResponseType(typeof(ValidationProblemDetails), (int)System.Net.HttpStatusCode.BadRequest)] - public IActionResult Get400([FromQuery, Required]IDictionary args) + this.provider = provider; + } + + /// + /// имитирует http-400 + /// + [HttpGet("400")] + [ProducesResponseType(typeof(ValidationProblemDetails), (int)System.Net.HttpStatusCode.BadRequest)] + public IActionResult Get400([FromQuery, Required]IDictionary args) + { + var errors = new Dictionary(); + + foreach (var arg in args) { - var errors = new Dictionary(); - - foreach (var arg in args) - { - var countOfErrors = ((arg.Key + arg.Value).Length % 3) + 1; - var errorsText = Enumerable.Range(0, countOfErrors) - .Select(i => $"{arg.Value} не соответствует критериям проверки № {i}"); + var countOfErrors = ((arg.Key + arg.Value).Length % 3) + 1; + var errorsText = Enumerable.Range(0, countOfErrors) + .Select(i => $"{arg.Value} не соответствует критериям проверки № {i}"); - errors.Add(arg.Key, errorsText.ToArray()); - } - - if (errors.Any()) - { - var problem = new ValidationProblemDetails(errors); - return BadRequest(problem); - } - else - { - var problem = new ValidationProblemDetails { Detail = "at least one argument must be provided" }; - return BadRequest(problem); - } + errors.Add(arg.Key, errorsText.ToArray()); } - /// - /// имитирует http-403 - /// - [HttpGet("403")] - public IActionResult Get403() + if (errors.Any()) { - return Forbid(); + var problem = new ValidationProblemDetails(errors); + return BadRequest(problem); } - - /// - /// имитирует http-401 - /// - [HttpGet("401")] - public IActionResult Get401() + else { - return Unauthorized(); - } - - /// - /// имитирует http-500 - /// - [HttpGet("500")] - public IActionResult Get500() - { - throw new System.Exception("Это тестовое исключение"); + var problem = new ValidationProblemDetails { Detail = "at least one argument must be provided" }; + return BadRequest(problem); } } + + /// + /// имитирует http-403 + /// + [HttpGet("403")] + public IActionResult Get403() + { + return Forbid(); + } + + /// + /// имитирует http-401 + /// + [HttpGet("401")] + public IActionResult Get401() + { + return Unauthorized(); + } + + /// + /// имитирует http-500 + /// + [HttpGet("500")] + public IActionResult Get500() + { + throw new System.Exception("Это тестовое исключение"); + } + + /// + /// имитация отправки SignalR данных + /// + /// + /// + /// + /// Поддерживаемые hubЫ: wellInfo, notifications, telemetry, reports + /// + /// Название вызываемого на клиенте метода. Прим.:"ReceiveDataSaub". Список методов см. в swagger definition signalr + /// Группа пользователей. Прим.: "well_1". Если не задана - все пользователи. Шаблон формирования групп см. описание методов в swagger definition signalr + /// передаваемая нагрузка. (json) + /// + /// + [HttpPost("signalr/hubs/{hubName}/{methodName}/{groupName}")] + [Authorize] + public async Task PostAsync(string hubName, string methodName, string? groupName, object body, CancellationToken token) + { + IHubClients clients = hubName.ToLower() switch { + "wellinfo" => provider.GetRequiredService>().Clients, + "notifications" => provider.GetRequiredService>().Clients, + "telemetry" => provider.GetRequiredService>().Clients, + "reports" => provider.GetRequiredService>().Clients, + _ => throw new ArgumentInvalidException(nameof(hubName), "hubName does not listed"), + }; + + IClientProxy selectedClients = string.IsNullOrEmpty(groupName) + ? clients.All + : clients.Group(groupName); + + await selectedClients.SendAsync(methodName, body, token); + return Ok(); + } } From e8bbff2d3c9c0f9b493ebcceaa8b3074e44c3f54 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Fri, 1 Dec 2023 17:41:39 +0500 Subject: [PATCH 19/19] fix doc --- AsbCloudDb/Setup db replication.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/AsbCloudDb/Setup db replication.md b/AsbCloudDb/Setup db replication.md index 91c64792..4c5fe184 100644 --- a/AsbCloudDb/Setup db replication.md +++ b/AsbCloudDb/Setup db replication.md @@ -113,17 +113,12 @@ sudo -u postgres psql SELECT * FROM pg_stat_replication; ``` - 7. Для включения синхронного режима необходимо выполнить следующую команду - ``` - ALTER SYSTEM SET synchronous_standby_names TO '*'; - ``` + 7. Сделать рестарт primary-сервера. - 8. Сделать рестарт primary-сервера. - - 9. Внести запись в любую таблицу базы данных primary-сервера - 10. Убедиться, что соответствующая запись появилась в таблице базы данных standby-сервера - 11. Попытаться внести запись в таблицу базы данных standby-сервера. - 12. Убедиться, что операция завершилась с ошибкой + 8. Внести запись в любую таблицу базы данных primary-сервера + 9. Убедиться, что соответствующая запись появилась в таблице базы данных standby-сервера + 10. Попытаться внести запись в таблицу базы данных standby-сервера. + 11. Убедиться, что операция завершилась с ошибкой > cannot execute OPERATION in a read-only transaction