DailyReport. Незначительные исправления

This commit is contained in:
ngfrolov 2023-03-29 16:05:57 +05:00
parent 921b5f75c0
commit 9066ff9b04
Signed by: ng.frolov
GPG Key ID: E99907A0357B29A7
5 changed files with 187 additions and 188 deletions

View File

@ -1,152 +1,16 @@
using System.Linq;
using System;
using System.Linq;
namespace AsbCloudDb.Model.DefaultData
{
public class EntityFillerWellOperationCategory : EntityFiller<WellOperationCategory>
internal class EntityFillerWellOperationCategory : EntityFiller<WellOperationCategory>
{
/// <summary>
/// Этапы работ
/// </summary>
public static WellOperationCategory[] WorkStages { get; } = new WellOperationCategory[]{
new() { Id = WellOperationCategory.IdDrilling, Name = "БУРЕНИЕ", KeyValueName = "dT", KeyValueUnits = "м/ч" },
new() { Id = WellOperationCategory.IdSPOStage, Name = "СПО", KeyValueName = "dT", KeyValueUnits = "мин" },
new() { Id = WellOperationCategory.IdFastening, Name = "КРЕПЛЕНИЕ", KeyValueName = "dT", KeyValueUnits = "мин" },
new() { Id = WellOperationCategory.IdGFR, Name = "ГФР", KeyValueName = "dT", KeyValueUnits = "мин" },
new() { Id = WellOperationCategory.IdAuxiliaryOperations, Name = "Вспомогательные операции", KeyValueName = "dT", KeyValueUnits = "мин" },
new() { Id = WellOperationCategory.IdNonProductiveTime, Name = "Непроизводительное время (НПВ)", KeyValueName = "dT", KeyValueUnits = "мин" },
};
/// <summary>
/// Виды работ
/// </summary>
public static WellOperationCategory[] WorkTypes { get; } = new WellOperationCategory[]{
new () {Id = WellOperationCategory.IdKnbk, IdParent = 3000, Name = "КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdMechanicalDrilling, IdParent = 3000, Name = "Механическое. бурение", KeyValueName = "dT", KeyValueUnits = "м/ч" },
new () {Id = WellOperationCategory.IdMeasurementStat, IdParent = 3000, Name = "Статический замер", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdNormalizedWellDiameter, IdParent = 3000, Name = "Нормализация диаметра скважины", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdBuilding, IdParent = 3000, Name = "Наращивание", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdSPO , IdParent = 3001, Name = "СПО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdCasingRunning, IdParent = 3002, Name = "Спуск обсадной колонны", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdCementing, IdParent = 3002, Name = "Цементирование", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdAuxiliaryWorkFastening, IdParent = 3002, Name = "Вспомогательные работы при креплении", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdAssemblyOrDisassemblyGIS, IdParent = 3003, Name = "Сборка/разборка приборов ГИС", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdSPO2, IdParent = 3003, Name = "СПО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdGIS, IdParent = 3003, Name = "ГИС", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdFlushingOBR, IdParent = 3004, Name = "Промывка, ОБР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdAuxiliaryWork, IdParent = 3004, Name = "Вспомогательные работы", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdEquipmentRepair, IdParent = 3005, Name = "Ремонт оборудования", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdEmergencyWork, IdParent = 3005, Name = "Аварийные работы", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdComplication, IdParent = 3005, Name = "Осложнение", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdOperationsNotIncludedGGD, IdParent = 3005, Name = "Незаложенные в ГГД операции", KeyValueName = "dT", KeyValueUnits = "мин" },
};
/// <summary>
/// Категории работ
/// </summary>
public static WellOperationCategory[] WorkCategories { get; } = new WellOperationCategory[]{
new () {Id = WellOperationCategory.IdBhaDisassembly, IdParent = 4000, Name = "Разборка КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdBhaAssembly, IdParent = 4000, Name = "Сборка КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdSlide, IdParent = 4001, Name = "Бурение слайдом", KeyValueName = "МСП", KeyValueUnits = "м/ч" },
new () {Id = WellOperationCategory.IdRotor, IdParent = 4001, Name = "Бурение ротором", KeyValueName = "МСП", KeyValueUnits = "м/ч" },
new () {Id = WellOperationCategory.IdStaticSurveying, IdParent = 4002, Name = "Замер ЗТС (запись MWD)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdFlashingBeforeConnection, IdParent = 4003, Name = "Промывка перед наращиванием", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5006, IdParent = 4003, Name = "Проработка во время бурения", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdDevelopment, IdParent = 4003, Name = "Проработка перед наращиванием", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdTemplatingWhileDrilling, IdParent = 4003, Name = "Шаблонировка во время бурения", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdTemplating, IdParent = 4003, Name = "Шаблонировка перед наращиванием", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5010, IdParent = 4004, Name = "Наращивание", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdSlipsTime, IdParent = 4004, Name = "Удержание в клиньях", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5012, IdParent = 4005, Name = "Подъем инструмента", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdBhaUp, IdParent = 4005, Name = "Подъем КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5014, IdParent = 4005, Name = "Спуск инструмента", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdBhaDown, IdParent = 4005, Name = "Спуск КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5016, IdParent = 4006, Name = "Промывка при спуске ОК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdCasingDown, IdParent = 4006, Name = "Спуск ОК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5018, IdParent = 4007, Name = "ОЗЦ", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5019, IdParent = 4007, Name = "Цементирование", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5020, IdParent = 4008, Name = "Опрессовка БИ", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5021, IdParent = 4008, Name = "Опрессовка ОК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5022, IdParent = 4008, Name = "ПЗР при спуске ОК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5023, IdParent = 4008, Name = "ПЗР при цементировании", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5024, IdParent = 4009, Name = "Разборка комплекса приборов ГИС", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5025, IdParent = 4009, Name = "Сборка комплекса приборов ГИС", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5026, IdParent = 4010, Name = "Подъем приборов ГИС (на трубах)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5027, IdParent = 4010, Name = "Спуск приборов ГИС (на трубах)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5028, IdParent = 4011, Name = "Комплекс ГИС на жестком кабеле", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5029, IdParent = 4011, Name = "Комплекс ГИС на кабеле", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5030, IdParent = 4011, Name = "Комплекс ГИС на трубах", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5031, IdParent = 4012, Name = "Закачка/прокачка пачки", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5032, IdParent = 4012, Name = "Обработка БР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5033, IdParent = 4012, Name = "Ориентирование ТС при бурении", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5034, IdParent = 4012, Name = "Перезапись гаммы-каротажа", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5035, IdParent = 4012, Name = "Приготовление БР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdFlashing, IdParent = 4012, Name = "Промывка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5037, IdParent = 4012, Name = "Разбуривание тех.оснастки", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5038, IdParent = 4012, Name = "Спуск инструмента с проработкой", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5039, IdParent = 4013, Name = "ВМР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5040, IdParent = 4013, Name = "Демонтаж ПВО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5041, IdParent = 4013, Name = "Долив затруба при подъёме", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5042, IdParent = 4013, Name = "Монтаж ПВО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5043, IdParent = 4013, Name = "Наработка жёлоба", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5044, IdParent = 4013, Name = "Обвязка устья с циркуляционной системой", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5045, IdParent = 4013, Name = "Оборудование устья", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5046, IdParent = 4013, Name = "Опрессовка ПВО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5047, IdParent = 4013, Name = "Перемонтаж ПВО ", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5048, IdParent = 4013, Name = "Перетяжка талевого каната", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5049, IdParent = 4013, Name = "ПЗР при сборке КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5050, IdParent = 4013, Name = "Полная замена талевого каната", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5051, IdParent = 4013, Name = "ПР перед забуркой направления", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5052, IdParent = 4013, Name = "Продувка манифольда", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5053, IdParent = 4013, Name = "Срезка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5054, IdParent = 4013, Name = "Тайм-дриллинг", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5055, IdParent = 4013, Name = "Тех.отстой", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5056, IdParent = 4013, Name = "Учебная тревога \"Выброс\"", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5057, IdParent = 4013, Name = "Чистка ЦСГО/емкостного блока", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = WellOperationCategory.IdEquipmentDrillingRepair, IdParent = 4014, Name = "Ремонт бурового оборудования", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5059, IdParent = 4015, Name = "Ловильные работы", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5060, IdParent = 4015, Name = "Ожидание", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5061, IdParent = 4015, Name = "Определение места прихвата и ЛМ", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5062, IdParent = 4015, Name = "Работа яссом", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5063, IdParent = 4015, Name = "Расхаживание", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5064, IdParent = 4015, Name = "СПО - колокол", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5065, IdParent = 4015, Name = "СПО - метчик", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5066, IdParent = 4015, Name = "СПО - овершот", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5067, IdParent = 4015, Name = "СПО - труболовка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5068, IdParent = 4015, Name = "Торпедирование (встряхивание)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5069, IdParent = 4015, Name = "Торпедирование (отстрел)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5070, IdParent = 4015, Name = "Установка ванн", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5071, IdParent = 4015, Name = "Фрезеровка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5072, IdParent = 4016, Name = "Контролируемое ГНВП", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5073, IdParent = 4016, Name = "Поглощение", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5074, IdParent = 4016, Name = "Сальникообразование", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5075, IdParent = 4016, Name = "Утяжеление БР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5076, IdParent = 4017, Name = "НПВ / прочее", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5077, IdParent = 4017, Name = "Обработка раствора (несоответствие параметров)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5078, IdParent = 4017, Name = "подъем ОК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5079, IdParent = 4017, Name = "Ревизия КНБК/инструмента/ЗТС", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5082, IdParent = 4000, Name = "Сборка устройства ориентирования КО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5083, IdParent = 4003, Name = "Проработка принудительная", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5084, IdParent = 4005, Name = "Шаблонировка подъем БИ, продувка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5085, IdParent = 4005, Name = "Спуск бурильного инструмента со сборкой с мостков", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5086, IdParent = 4005, Name = "Подъем БИ с выбросом на мостки", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5087, IdParent = 4005, Name = "Спуск БИ со сборкой с мостков", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5088, IdParent = 4005, Name = "Сборка и спуск ТБТ", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5089, IdParent = 4005, Name = "Спуск КО на транспотрной колонне", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5090, IdParent = 4008, Name = "Отворот допускной трубы", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5091, IdParent = 4008, Name = "Активация подвески, опрессовка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5092, IdParent = 4008, Name = "Монтаж, опрессовка ФА", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5093, IdParent = 4008, Name = "Сборка хвостовика 114мм (согласно схеме)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5094, IdParent = 4008, Name = "ПЗР к спуску УЭЦН", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5095, IdParent = 4008, Name = "Активация подвески (потайной колонны, хвостовика)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5096, IdParent = 4008, Name = "Шаблонирование перед спуском", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5097, IdParent = 4012, Name = "Промывка - перевод скважины на новый раствор", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5098, IdParent = 4013, Name = "Сборка БИ с мостков на подсвечник", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5099, IdParent = 4013, Name = "Подготовка ствола скважины. Перезапись ГК в интервале установки КО.", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5100, IdParent = 4013, Name = "Смена рабочего переводника ВСП", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5101, IdParent = 4014, Name = "Ремонт", KeyValueName = "dT", KeyValueUnits = "мин" },
};
public override WellOperationCategory[] GetData()
=> WorkStages.Concat(WorkTypes).Concat(WorkCategories).ToArray();
=> WellOperationCategory.WorkStages
.Concat(WellOperationCategory.WorkTypes)
.Concat(WellOperationCategory.WorkCategories)
.ToArray();
}
}

View File

@ -229,6 +229,150 @@ namespace AsbCloudDb.Model
public static readonly int[] MechanicalDrillingSubIds = { IdRotor, IdSlide, IdMechanicalDrilling, };
#endregion
#region Списки категорий операций по группам
/// <summary>
/// Этапы работ
/// </summary>
public static WellOperationCategory[] WorkStages { get; } = new WellOperationCategory[]{
new() { Id = IdDrilling, Name = "БУРЕНИЕ", KeyValueName = "dT", KeyValueUnits = "м/ч" },
new() { Id = IdSPOStage, Name = "СПО", KeyValueName = "dT", KeyValueUnits = "мин" },
new() { Id = IdFastening, Name = "КРЕПЛЕНИЕ", KeyValueName = "dT", KeyValueUnits = "мин" },
new() { Id = IdGFR, Name = "ГФР", KeyValueName = "dT", KeyValueUnits = "мин" },
new() { Id = IdAuxiliaryOperations, Name = "Вспомогательные операции", KeyValueName = "dT", KeyValueUnits = "мин" },
new() { Id = IdNonProductiveTime, Name = "Непроизводительное время (НПВ)", KeyValueName = "dT", KeyValueUnits = "мин" },
};
/// <summary>
/// Виды работ
/// </summary>
public static WellOperationCategory[] WorkTypes { get; } = new WellOperationCategory[]{
new () {Id = IdKnbk, IdParent = 3000, Name = "КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdMechanicalDrilling, IdParent = 3000, Name = "Механическое. бурение", KeyValueName = "dT", KeyValueUnits = "м/ч" },
new () {Id = IdMeasurementStat, IdParent = 3000, Name = "Статический замер", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdNormalizedWellDiameter, IdParent = 3000, Name = "Нормализация диаметра скважины", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdBuilding, IdParent = 3000, Name = "Наращивание", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdSPO , IdParent = 3001, Name = "СПО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdCasingRunning, IdParent = 3002, Name = "Спуск обсадной колонны", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdCementing, IdParent = 3002, Name = "Цементирование", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdAuxiliaryWorkFastening, IdParent = 3002, Name = "Вспомогательные работы при креплении", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdAssemblyOrDisassemblyGIS, IdParent = 3003, Name = "Сборка/разборка приборов ГИС", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdSPO2, IdParent = 3003, Name = "СПО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdGIS, IdParent = 3003, Name = "ГИС", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdFlushingOBR, IdParent = 3004, Name = "Промывка, ОБР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdAuxiliaryWork, IdParent = 3004, Name = "Вспомогательные работы", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdEquipmentRepair, IdParent = 3005, Name = "Ремонт оборудования", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdEmergencyWork, IdParent = 3005, Name = "Аварийные работы", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdComplication, IdParent = 3005, Name = "Осложнение", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdOperationsNotIncludedGGD, IdParent = 3005, Name = "Незаложенные в ГГД операции", KeyValueName = "dT", KeyValueUnits = "мин" },
};
/// <summary>
/// Категории работ
/// </summary>
public static WellOperationCategory[] WorkCategories { get; } = new WellOperationCategory[]{
new () {Id = IdBhaDisassembly, IdParent = 4000, Name = "Разборка КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdBhaAssembly, IdParent = 4000, Name = "Сборка КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdSlide, IdParent = 4001, Name = "Бурение слайдом", KeyValueName = "МСП", KeyValueUnits = "м/ч" },
new () {Id = IdRotor, IdParent = 4001, Name = "Бурение ротором", KeyValueName = "МСП", KeyValueUnits = "м/ч" },
new () {Id = IdStaticSurveying, IdParent = 4002, Name = "Замер ЗТС (запись MWD)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdFlashingBeforeConnection, IdParent = 4003, Name = "Промывка перед наращиванием", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5006, IdParent = 4003, Name = "Проработка во время бурения", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdDevelopment, IdParent = 4003, Name = "Проработка перед наращиванием", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdTemplatingWhileDrilling, IdParent = 4003, Name = "Шаблонировка во время бурения", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdTemplating, IdParent = 4003, Name = "Шаблонировка перед наращиванием", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5010, IdParent = 4004, Name = "Наращивание", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdSlipsTime, IdParent = 4004, Name = "Удержание в клиньях", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5012, IdParent = 4005, Name = "Подъем инструмента", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdBhaUp, IdParent = 4005, Name = "Подъем КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5014, IdParent = 4005, Name = "Спуск инструмента", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdBhaDown, IdParent = 4005, Name = "Спуск КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5016, IdParent = 4006, Name = "Промывка при спуске ОК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdCasingDown, IdParent = 4006, Name = "Спуск ОК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5018, IdParent = 4007, Name = "ОЗЦ", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5019, IdParent = 4007, Name = "Цементирование", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5020, IdParent = 4008, Name = "Опрессовка БИ", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5021, IdParent = 4008, Name = "Опрессовка ОК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5022, IdParent = 4008, Name = "ПЗР при спуске ОК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5023, IdParent = 4008, Name = "ПЗР при цементировании", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5024, IdParent = 4009, Name = "Разборка комплекса приборов ГИС", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5025, IdParent = 4009, Name = "Сборка комплекса приборов ГИС", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5026, IdParent = 4010, Name = "Подъем приборов ГИС (на трубах)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5027, IdParent = 4010, Name = "Спуск приборов ГИС (на трубах)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5028, IdParent = 4011, Name = "Комплекс ГИС на жестком кабеле", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5029, IdParent = 4011, Name = "Комплекс ГИС на кабеле", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5030, IdParent = 4011, Name = "Комплекс ГИС на трубах", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5031, IdParent = 4012, Name = "Закачка/прокачка пачки", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5032, IdParent = 4012, Name = "Обработка БР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5033, IdParent = 4012, Name = "Ориентирование ТС при бурении", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5034, IdParent = 4012, Name = "Перезапись гаммы-каротажа", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5035, IdParent = 4012, Name = "Приготовление БР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdFlashing, IdParent = 4012, Name = "Промывка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5037, IdParent = 4012, Name = "Разбуривание тех.оснастки", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5038, IdParent = 4012, Name = "Спуск инструмента с проработкой", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5039, IdParent = 4013, Name = "ВМР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5040, IdParent = 4013, Name = "Демонтаж ПВО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5041, IdParent = 4013, Name = "Долив затруба при подъёме", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5042, IdParent = 4013, Name = "Монтаж ПВО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5043, IdParent = 4013, Name = "Наработка жёлоба", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5044, IdParent = 4013, Name = "Обвязка устья с циркуляционной системой", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5045, IdParent = 4013, Name = "Оборудование устья", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5046, IdParent = 4013, Name = "Опрессовка ПВО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5047, IdParent = 4013, Name = "Перемонтаж ПВО ", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5048, IdParent = 4013, Name = "Перетяжка талевого каната", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5049, IdParent = 4013, Name = "ПЗР при сборке КНБК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5050, IdParent = 4013, Name = "Полная замена талевого каната", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5051, IdParent = 4013, Name = "ПР перед забуркой направления", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5052, IdParent = 4013, Name = "Продувка манифольда", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5053, IdParent = 4013, Name = "Срезка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5054, IdParent = 4013, Name = "Тайм-дриллинг", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5055, IdParent = 4013, Name = "Тех.отстой", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5056, IdParent = 4013, Name = "Учебная тревога \"Выброс\"", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5057, IdParent = 4013, Name = "Чистка ЦСГО/емкостного блока", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = IdEquipmentDrillingRepair, IdParent = 4014, Name = "Ремонт бурового оборудования", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5059, IdParent = 4015, Name = "Ловильные работы", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5060, IdParent = 4015, Name = "Ожидание", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5061, IdParent = 4015, Name = "Определение места прихвата и ЛМ", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5062, IdParent = 4015, Name = "Работа яссом", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5063, IdParent = 4015, Name = "Расхаживание", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5064, IdParent = 4015, Name = "СПО - колокол", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5065, IdParent = 4015, Name = "СПО - метчик", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5066, IdParent = 4015, Name = "СПО - овершот", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5067, IdParent = 4015, Name = "СПО - труболовка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5068, IdParent = 4015, Name = "Торпедирование (встряхивание)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5069, IdParent = 4015, Name = "Торпедирование (отстрел)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5070, IdParent = 4015, Name = "Установка ванн", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5071, IdParent = 4015, Name = "Фрезеровка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5072, IdParent = 4016, Name = "Контролируемое ГНВП", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5073, IdParent = 4016, Name = "Поглощение", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5074, IdParent = 4016, Name = "Сальникообразование", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5075, IdParent = 4016, Name = "Утяжеление БР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5076, IdParent = 4017, Name = "НПВ / прочее", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5077, IdParent = 4017, Name = "Обработка раствора (несоответствие параметров)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5078, IdParent = 4017, Name = "подъем ОК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5079, IdParent = 4017, Name = "Ревизия КНБК/инструмента/ЗТС", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5082, IdParent = 4000, Name = "Сборка устройства ориентирования КО", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5083, IdParent = 4003, Name = "Проработка принудительная", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5084, IdParent = 4005, Name = "Шаблонировка подъем БИ, продувка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5085, IdParent = 4005, Name = "Спуск бурильного инструмента со сборкой с мостков", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5086, IdParent = 4005, Name = "Подъем БИ с выбросом на мостки", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5087, IdParent = 4005, Name = "Спуск БИ со сборкой с мостков", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5088, IdParent = 4005, Name = "Сборка и спуск ТБТ", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5089, IdParent = 4005, Name = "Спуск КО на транспотрной колонне", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5090, IdParent = 4008, Name = "Отворот допускной трубы", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5091, IdParent = 4008, Name = "Активация подвески, опрессовка", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5092, IdParent = 4008, Name = "Монтаж, опрессовка ФА", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5093, IdParent = 4008, Name = "Сборка хвостовика 114мм (согласно схеме)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5094, IdParent = 4008, Name = "ПЗР к спуску УЭЦН", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5095, IdParent = 4008, Name = "Активация подвески (потайной колонны, хвостовика)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5096, IdParent = 4008, Name = "Шаблонирование перед спуском", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5097, IdParent = 4012, Name = "Промывка - перевод скважины на новый раствор", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5098, IdParent = 4013, Name = "Сборка БИ с мостков на подсвечник", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5099, IdParent = 4013, Name = "Подготовка ствола скважины. Перезапись ГК в интервале установки КО.", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5100, IdParent = 4013, Name = "Смена рабочего переводника ВСП", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 5101, IdParent = 4014, Name = "Ремонт", KeyValueName = "dT", KeyValueUnits = "мин" },
};
#endregion
[Key]
[Column("id")]
public int Id { get; set; }

View File

@ -1,14 +1,15 @@
using AsbCloudApp.Data;
using AsbCloudApp.Data.DailyReport;
using AsbCloudDb.Model;
using ClosedXML.Excel;
using System;
using System.Collections.Generic;
using System.Linq;
#nullable enable
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
{
/// <summary>
/// Пострение баланса времени
/// Построение баланса времени
/// </summary>
class TimeBalanceBlock : BlockAbstract
{
@ -38,9 +39,9 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
private IEnumerable<WellOperationCategoryDto> OperationCategories { get; }
/// <summary>
/// количество стобцов в таблице
/// количество столбцов в таблице
/// </summary>
private readonly int CountColumns = 3;
private const int countColumns = 3;
/// <summary>
/// количество категорий операций
@ -55,38 +56,29 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
OperationsStatistics = blockDto.OperationsStat;
OperationCategories = operationCategories;
var rowColumn = (CountColumns * 2) + (OperationCategoriesCount % CountColumns == 0 ? 0 : 2);
var cellColumn = OperationCategoriesCount % CountColumns;
AddressBlockEnd = AddressBlockBegin + (rowColumn, cellColumn);
var rowsCount = (int)Math.Ceiling( 1d * OperationCategoriesCount / countColumns);
var colsCount = (1 + 1) * countColumns;
AddressBlockEnd = Title + (rowsCount, colsCount);
}
public override void Draw(IXLWorksheet sheet)
{
sheet.Range(Title.RowNumber, Title.ColumnNumber, Title.RowNumber, Title.ColumnNumber + 1)
.Merge()
.SetValue("БАЛАНС ВРЕМЕНИ");
var rowColumn = 2;
var cellColumn = 1;
var rowsCountInColumn = OperationCategoriesCount / CountColumns;
if (OperationCategoriesCount % CountColumns != 0)
rowsCountInColumn++;
var i = 0;
foreach (var operationCategory in OperationCategories)
{
sheet.Cell(AddressBlockBegin + (rowColumn, cellColumn))
._SetValue(GetCaption(operationCategory.Id), true);
sheet.Cell(AddressBlockBegin + (rowColumn, cellColumn + 1))
._SetValue(GetValue(operationCategory.Id), true);
var row = 2 + (int)Math.Floor(1d * i / countColumns);
var col = 1 + 2 *(i % countColumns);
i++;
if (rowColumn <= rowsCountInColumn)
rowColumn++;
else
{
rowColumn = 2;
cellColumn = cellColumn + 2;
}
sheet.Cell(AddressBlockBegin + (row, col))
._SetValue(operationCategory.Name, true);
sheet.Cell(AddressBlockBegin + (row, col + 1))
._SetValue(GetValue(operationCategory.Id), true);
}
}
@ -96,12 +88,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
return $"{duration}";
return "0";
}
private string GetCaption(int categoryId)
{
var caption = OperationCategories.FirstOrDefault(o => o.Id == categoryId)?.Name ?? string.Empty;
return caption;
}
}
}
#nullable disable

View File

@ -6,7 +6,6 @@ using AsbCloudApp.Requests;
using AsbCloudApp.Services;
using AsbCloudDb.Model;
using AsbCloudDb.Model.DailyReport;
using AsbCloudDb.Model.DefaultData;
using Mapster;
using Microsoft.EntityFrameworkCore;
using System;
@ -148,7 +147,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport
public async Task<Stream?> MakeReportAsync(int idWell, DateTime date, CancellationToken token)
{
var stageIds = EntityFillerWellOperationCategory.WorkStages.Select(w => w.Id).ToArray();
var stageIds = WellOperationCategory.WorkStages.Select(w => w.Id).ToArray();
var wellOperationCategories = wellOperationRepository.GetCategories(true)
.Where(o => o.IdParent is not null)
.Where(o => stageIds.Contains(o.IdParent!.Value));
@ -207,7 +206,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport
dto.Head,
dto.Bha,
dto.NoDrilling,
dto.TimeBalance,
dto.Saub,
dto.Sign
};
@ -216,8 +214,8 @@ namespace AsbCloudInfrastructure.Services.DailyReport
{
if (block.IdUser is not null)
{
var user = users.FirstOrDefault(u => u.Id == block.IdUser.Value);
block.UserName = user is not null ? user.MakeDisplayName() : $"userId:{block.IdUser.Value}";
block.UserName = users.FirstOrDefault(u => u.Id == block.IdUser.Value)?.MakeDisplayName()
?? $"userId:{block.IdUser.Value}";
}
}

View File

@ -1,4 +1,5 @@
using AsbCloudApp.Data.DailyReport;
using AsbCloudApp.Exceptions;
using AsbCloudApp.Repositories;
using AsbCloudApp.Services;
using Microsoft.AspNetCore.Authorization;
@ -11,6 +12,7 @@ using System.Threading.Tasks;
namespace AsbCloudWebApi.Controllers
{
#nullable enable
/// <summary>
/// Суточный рапорт
/// </summary>
@ -42,7 +44,6 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token"></param>
/// <returns></returns>
[HttpGet]
//[Permission]
[ProducesResponseType(typeof(IEnumerable<DailyReportDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetListAsync(int idWell, DateTime? begin, DateTime? end, CancellationToken token)
{
@ -58,15 +59,15 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token"></param>
/// <returns></returns>
[HttpPost]
//[Permission]
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> AddAsync(int idWell, [Required] DateTime startDate, CancellationToken token)
{
var idUser = User.GetUserId();
if (idUser is null)
if (!await UserHasAccesToWellAsync(idWell, token))
return Forbid();
var result = await dailyReportService.AddAsync(idWell, startDate, (int)idUser, token);
var idUser = User.GetUserId()!.Value;
var result = await dailyReportService.AddAsync(idWell, startDate, idUser, token);
return Ok(result);
}
@ -149,6 +150,7 @@ namespace AsbCloudWebApi.Controllers
return Forbid();
dto.IdUser = User.GetUserId();
dto.LastUpdateDate = DateTimeOffset.Now;
var result = await dailyReportService.UpdateBlockAsync(idWell, date, dto, token);
return Ok(result);
@ -162,13 +164,17 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token"></param>
/// <returns></returns>
[HttpGet("{date}/excel")]
//[Permission]
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> DownloadAsync(int idWell, DateTime date, CancellationToken token)
{
var well = await wellService.GetOrDefaultAsync(idWell, token);
if (!await UserHasAccesToWellAsync(idWell, token))
return Forbid();
var well = await wellService.GetOrDefaultAsync(idWell, token)
?? throw new ArgumentInvalidException($"Скважина c id:{idWell} не найдена", nameof(idWell));
var stream = await dailyReportService.MakeReportAsync(idWell, date, token);
if (stream != null)
if (stream is not null)
{
var fileName = $"Суточный рапорт по скважине {well.Caption} куст {well.Cluster}.xlsx";
return File(stream, "application/octet-stream", fileName);
@ -187,4 +193,5 @@ namespace AsbCloudWebApi.Controllers
return false;
}
}
#nullable disable
}