Merge branch 'dev' into feature/faq

This commit is contained in:
Olga Nemt 2023-04-20 15:09:34 +05:00
commit 49611d45f3
123 changed files with 8916 additions and 224 deletions

View File

@ -0,0 +1,14 @@
namespace AsbCloudApp.Data.GTR
{
/// <summary>
/// Класс позволяющий хранить значение неопределенного типа.
/// Все возможные типы должны быть описаны в JsonValueJsonConverter.
/// </summary>
/// <param name="Value"></param>
public record JsonValue(object Value)
{
/// <inheritdoc/>
public override string ToString()
=> Value.ToString() ?? string.Empty;
}
}

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
namespace AsbCloudApp.Data.GTR
{
/// <summary>
/// Запись WITS
/// </summary>
public class WitsRecordDto
{
/// <summary>
/// Id записи
/// </summary>
public int Id { get; set; }
/// <summary>
/// Дата создания записи
/// </summary>
public DateTime Date { get; set; }
/// <summary>
/// Параметры. Ключ - id_item. ValueContainer содержит значение.
/// </summary>
public Dictionary<int, JsonValue> Items { get; set; } = new();
}
}

View File

@ -0,0 +1,39 @@
using AsbCloudApp.Data.GTR;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudApp.Repositories
{
#nullable enable
/// <summary>
/// данные ГТИ
/// </summary>
public interface IGtrRepository
{
/// <summary>
/// добавить данные (для панели бурильщика)
/// </summary>
/// <param name="idTelemetry"></param>
/// <param name="dto"></param>
/// <param name="token"></param>
/// <returns></returns>
Task SaveDataAsync(int idTelemetry, WitsRecordDto dto, CancellationToken token);
/// <summary>
/// получить данные для клиента
/// </summary>
/// <param name="idWell"></param>
/// <param name="dateBegin"></param>
/// <param name="intervalSec"></param>
/// <param name="approxPointsCount">кол-во элементов до которых эти данные прореживаются</param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<WitsRecordDto>> GetAsync(int idWell,
DateTime? dateBegin, double intervalSec = 600d,
int approxPointsCount = 1024, CancellationToken token = default);
}
#nullable disable
}

View File

@ -15,7 +15,7 @@ namespace AsbCloudApp.Services
/// <param name="latitude"></param>
/// <param name="longitude"></param>
/// <returns></returns>
SimpleTimezoneDto GetByCoordinates(double latitude, double longitude);
SimpleTimezoneDto? GetOrDefaultByCoordinates(double latitude, double longitude);
/// <summary>
/// по координатам
@ -24,6 +24,6 @@ namespace AsbCloudApp.Services
/// <param name="longitude"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<Data.SimpleTimezoneDto> GetByCoordinatesAsync(double latitude, double longitude, CancellationToken token);
Task<Data.SimpleTimezoneDto?> GetOrDefaultByCoordinatesAsync(double latitude, double longitude, CancellationToken token);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,97 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class Add_GTR : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "t_wits_float",
columns: table => new
{
id_telemetry = table.Column<int>(type: "integer", nullable: false),
id_record = table.Column<int>(type: "integer", nullable: false),
id_item = table.Column<int>(type: "integer", nullable: false),
date = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
value = table.Column<float>(type: "real", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_t_wits_float", x => new { x.id_telemetry, x.id_record, x.id_item, x.date });
table.ForeignKey(
name: "FK_t_wits_float_t_telemetry_id_telemetry",
column: x => x.id_telemetry,
principalTable: "t_telemetry",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
},
comment: "таблица данных ГТИ с типом значения float");
migrationBuilder.CreateTable(
name: "t_wits_int",
columns: table => new
{
id_telemetry = table.Column<int>(type: "integer", nullable: false),
id_record = table.Column<int>(type: "integer", nullable: false),
id_item = table.Column<int>(type: "integer", nullable: false),
date = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
value = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_t_wits_int", x => new { x.id_telemetry, x.id_record, x.id_item, x.date });
table.ForeignKey(
name: "FK_t_wits_int_t_telemetry_id_telemetry",
column: x => x.id_telemetry,
principalTable: "t_telemetry",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
},
comment: "таблица данных ГТИ с типом значения int");
migrationBuilder.CreateTable(
name: "t_wits_string",
columns: table => new
{
id_telemetry = table.Column<int>(type: "integer", nullable: false),
id_record = table.Column<int>(type: "integer", nullable: false),
id_item = table.Column<int>(type: "integer", nullable: false),
date = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
value = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_t_wits_string", x => new { x.id_telemetry, x.id_record, x.id_item, x.date });
table.ForeignKey(
name: "FK_t_wits_string_t_telemetry_id_telemetry",
column: x => x.id_telemetry,
principalTable: "t_telemetry",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
},
comment: "таблица данных ГТИ с типом значения string");
migrationBuilder.Sql
("SELECT create_hypertable('t_wits_string','date','id_telemetry',2,chunk_time_interval => INTERVAL '5 day'); " +
"SELECT create_hypertable('t_wits_float','date','id_telemetry',2,chunk_time_interval => INTERVAL '5 day'); " +
"SELECT create_hypertable('t_wits_int','date','id_telemetry',2,chunk_time_interval => INTERVAL '5 day'); ");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "t_wits_float");
migrationBuilder.DropTable(
name: "t_wits_int");
migrationBuilder.DropTable(
name: "t_wits_string");
}
}
}

View File

@ -885,6 +885,94 @@ namespace AsbCloudDb.Migrations
b.HasComment("Действия с файлами.");
});
modelBuilder.Entity("AsbCloudDb.Model.GTR.WitsItemFloat", b =>
{
b.Property<int>("IdTelemetry")
.HasColumnType("integer")
.HasColumnName("id_telemetry");
b.Property<int>("IdRecord")
.HasColumnType("integer")
.HasColumnName("id_record");
b.Property<int>("IdItem")
.HasColumnType("integer")
.HasColumnName("id_item");
b.Property<DateTimeOffset>("DateTime")
.HasColumnType("timestamp with time zone")
.HasColumnName("date");
b.Property<float>("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<int>("IdTelemetry")
.HasColumnType("integer")
.HasColumnName("id_telemetry");
b.Property<int>("IdRecord")
.HasColumnType("integer")
.HasColumnName("id_record");
b.Property<int>("IdItem")
.HasColumnType("integer")
.HasColumnName("id_item");
b.Property<DateTimeOffset>("DateTime")
.HasColumnType("timestamp with time zone")
.HasColumnName("date");
b.Property<int>("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<int>("IdTelemetry")
.HasColumnType("integer")
.HasColumnName("id_telemetry");
b.Property<int>("IdRecord")
.HasColumnType("integer")
.HasColumnName("id_record");
b.Property<int>("IdItem")
.HasColumnType("integer")
.HasColumnName("id_item");
b.Property<DateTimeOffset>("DateTime")
.HasColumnType("timestamp with time zone")
.HasColumnName("date");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("text")
.HasColumnName("value");
b.HasKey("IdTelemetry", "IdRecord", "IdItem", "DateTime");
b.ToTable("t_wits_string");
b.HasComment("таблица данных ГТИ с типом значения string");
});
modelBuilder.Entity("AsbCloudDb.Model.LimitingParameter", b =>
{
b.Property<int>("Id")
@ -7273,6 +7361,39 @@ namespace AsbCloudDb.Migrations
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.LimitingParameter", b =>
{
b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry")

View File

@ -1,4 +1,5 @@
using AsbCloudDb.Model.Subsystems;
using AsbCloudDb.Model.GTR;
using AsbCloudDb.Model.Subsystems;
using Microsoft.EntityFrameworkCore;
using System.Threading;
using System.Threading.Tasks;
@ -55,6 +56,11 @@ namespace AsbCloudDb.Model
public virtual DbSet<TelemetryWirelineRunOut> TelemetryWirelineRunOut => Set<TelemetryWirelineRunOut>();
// GTR WITS
public DbSet<WitsItemFloat> WitsItemFloat => Set<WitsItemFloat>();
public DbSet<WitsItemInt> WitsItemInt => Set<WitsItemInt>();
public DbSet<WitsItemString> WitsItemString => Set<WitsItemString>();
// WITS
public DbSet<WITS.Record1> Record1 => Set<WITS.Record1>();
public DbSet<WITS.Record7> Record7 => Set<WITS.Record7>();
@ -336,6 +342,31 @@ namespace AsbCloudDb.Model
.HasJsonConversion();
});
modelBuilder.Entity<WitsItemFloat>(entity =>
{
entity.HasKey(
nameof(ITelemetryData.IdTelemetry),
nameof(WitsItemBase<float>.IdRecord),
nameof(WitsItemBase<float>.IdItem),
nameof(WitsItemBase<float>.DateTime));
});
modelBuilder.Entity<WitsItemInt>(entity =>
{
entity.HasKey(
nameof(ITelemetryData.IdTelemetry),
nameof(WitsItemBase<int>.IdRecord),
nameof(WitsItemBase<int>.IdItem),
nameof(WitsItemBase<int>.DateTime));
});
modelBuilder.Entity<WitsItemString>(entity =>
{
entity.HasKey(
nameof(ITelemetryData.IdTelemetry),
nameof(WitsItemBase<string>.IdRecord),
nameof(WitsItemBase<string>.IdItem),
nameof(WitsItemBase<string>.DateTime));
});
modelBuilder.Entity<UserSetting>(entity =>
{

View File

@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudDb.Model.GTR
{
public class WitsItemBase<T> : ITelemetryData
where T: notnull
{
[Column("id_telemetry")]
public int IdTelemetry { get; set; }
[Column("id_record")]
public int IdRecord { get; set; }
[Column("id_item")]
public int IdItem { get; set; }
[Column("date", TypeName = "timestamp with time zone")]
public DateTimeOffset DateTime { get; set; }
[Column("value")]
public T Value { get; set; } = default!;
[ForeignKey(nameof(IdTelemetry))]
public virtual Telemetry? Telemetry { get; set; }
}
[Table("t_wits_string"), Comment("таблица данных ГТИ с типом значения string")]
public class WitsItemString : WitsItemBase<string> { }
[Table("t_wits_float"), Comment("таблица данных ГТИ с типом значения float")]
public class WitsItemFloat : WitsItemBase<float> { }
[Table("t_wits_int"), Comment("таблица данных ГТИ с типом значения int")]
public class WitsItemInt : WitsItemBase<int> { }
}

View File

@ -1,4 +1,5 @@
using AsbCloudDb.Model.Subsystems;
using AsbCloudDb.Model.GTR;
using AsbCloudDb.Model.Subsystems;
using AsbCloudDb.Model.WITS;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
@ -47,6 +48,9 @@ namespace AsbCloudDb.Model
DbSet<WellOperationCategory> WellOperationCategories { get; }
DbSet<WellSectionType> WellSectionTypes { get; }
DbSet<WellType> WellTypes { get; }
DbSet<WitsItemFloat> WitsItemFloat { get; }
DbSet<WitsItemInt> WitsItemInt { get; }
DbSet<WitsItemString> WitsItemString { get; }
DbSet<Driller> Drillers { get; }
DbSet<Schedule> Schedule { get; }
DbSet<OperationValue> OperationValues { get; }

View File

@ -17,10 +17,9 @@ dotnet ef migrations add <MigrationName> --project AsbCloudDb
```
## Откатить миграцию
```
dotnet ef migrations remove <MigrationName> --project AsbCloudDb
dotnet ef migrations remove --project AsbCloudDb
```
\<MigrationName> - Name of migration class.
После создания миграции обязательно прочитать генерированный код.
Удаляется последняя созданная миграция.
## Применить миграции
При старте проекта применяются автоматически

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@ -94,5 +94,5 @@ namespace AsbCloudInfrastructure.Background
}
}
}
#nullable disable
}

View File

@ -4,7 +4,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Background
{
#nullable enable
/// <summary>
/// Класс разовой работы.
/// Разовая работа приоритетнее периодической.
@ -65,5 +65,5 @@ namespace AsbCloudInfrastructure.Background
ActionAsync = actionAsync;
}
}
#nullable disable
}

View File

@ -4,7 +4,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Background
{
#nullable enable
/// <summary>
/// Класс периодической работы.
/// </summary>
@ -32,5 +32,5 @@ namespace AsbCloudInfrastructure.Background
Period = period;
}
}
#nullable disable
}

View File

@ -4,7 +4,7 @@ using System.Linq;
namespace AsbCloudInfrastructure.Background
{
#nullable enable
/// <summary>
/// <para>
/// Очередь работ
@ -103,5 +103,5 @@ namespace AsbCloudInfrastructure.Background
return work;
}
}
#nullable disable
}

View File

@ -2,7 +2,7 @@
namespace AsbCloudInfrastructure
{
#nullable enable
public static class DateTimeExtentions
{
/// <summary>
@ -78,5 +78,5 @@ namespace AsbCloudInfrastructure
return indexOfMiddle;
}
}
#nullable disable
}

View File

@ -1,10 +1,12 @@
using AsbCloudApp.Data;
using AsbCloudApp.Data.GTR;
using AsbCloudApp.Data.SAUB;
using AsbCloudApp.Data.Subsystems;
using AsbCloudApp.Repositories;
using AsbCloudApp.Services;
using AsbCloudApp.Services.Subsystems;
using AsbCloudDb.Model;
using AsbCloudDb.Model.GTR;
using AsbCloudDb.Model.Subsystems;
using AsbCloudInfrastructure.Background;
using AsbCloudInfrastructure.Repository;
@ -26,7 +28,7 @@ using System;
namespace AsbCloudInfrastructure
{
#nullable enable
public static class DependencyInjection
{
public static IAsbCloudDbContext MakeContext(string connectionString)
@ -139,6 +141,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IProcessMapReportMakerService, ProcessMapReportMakerService>();
services.AddTransient<IProcessMapReportService, ProcessMapReportService>();
services.AddTransient<ITrajectoryVisualizationService, TrajectoryVisualizationService>();
services.AddTransient<IGtrRepository, GtrWitsRepository>();
// admin crud services:
services.AddTransient<ICrudRepository<TelemetryDto>, CrudCacheRepositoryBase<TelemetryDto, Telemetry>>(s =>
@ -213,5 +216,5 @@ namespace AsbCloudInfrastructure
.AddTransient(provider => new Lazy<TService>(() => implementationFactory(provider)));
}
#nullable disable
}

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure
{
#nullable enable
public static class MemoryCacheExtentions
{
private static readonly TimeSpan CacheOlescence = TimeSpan.FromMinutes(5);

View File

@ -5,7 +5,7 @@ using System.Linq.Expressions;
namespace AsbCloudInfrastructure
{
#nullable enable
/// <summary>
/// stolen from https://github.com/lotosbin/BinbinPredicateBuilder
/// </summary>
@ -77,4 +77,3 @@ namespace AsbCloudInfrastructure
}
}
}
#nullable disable

View File

@ -8,7 +8,7 @@ using System.Linq;
namespace AsbCloudInfrastructure
{
#nullable enable
public class ReportDataSourcePgCloud : IReportDataSource
{
private readonly IAsbCloudDbContext context;
@ -159,5 +159,5 @@ namespace AsbCloudInfrastructure
public WellInfoReport GetWellInfo()
=> info;
}
#nullable disable
}

View File

@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class CacheBase<TEntity> : QueryContainer<TEntity>
where TEntity : class, AsbCloudDb.Model.IId
{
@ -58,5 +58,5 @@ namespace AsbCloudInfrastructure.Repository
return cache;
}
}
#nullable disable
}

View File

@ -11,7 +11,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
/// <summary>
/// CRUD ñåðâèñ ñ êåøåì â îïåðàòèâêå
/// </summary>
@ -110,5 +110,5 @@ namespace AsbCloudInfrastructure.Repository
protected virtual TEntity Convert(TDto src) => src.Adapt<TEntity>();
}
#nullable disable
}

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
/// <summary>
/// CRUD сервис для работы с БД
/// </summary>
@ -133,5 +133,5 @@ namespace AsbCloudInfrastructure.Repository
protected virtual TEntity Convert(TDto src) => src.Adapt<TEntity>();
}
#nullable disable
}

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class CrudWellRelatedCacheRepositoryBase<TDto, TEntity> : CrudCacheRepositoryBase<TDto, TEntity>, IRepositoryWellRelated<TDto>
where TDto : AsbCloudApp.Data.IId, AsbCloudApp.Data.IWellRelated
where TEntity : class, IId, IWellRelated
@ -46,5 +46,5 @@ namespace AsbCloudInfrastructure.Repository
return dtos;
}
}
#nullable disable
}

View File

@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class CrudWellRelatedRepositoryBase<TDto, TEntity> : CrudRepositoryBase<TDto, TEntity>, IRepositoryWellRelated<TDto>
where TDto : AsbCloudApp.Data.IId, AsbCloudApp.Data.IWellRelated
where TEntity : class, IId, IWellRelated
@ -41,5 +41,5 @@ namespace AsbCloudInfrastructure.Repository
return dtos;
}
}
#nullable disable
}

View File

@ -11,7 +11,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class DepositRepository : IDepositRepository
{
private readonly IAsbCloudDbContext db;
@ -121,5 +121,5 @@ namespace AsbCloudInfrastructure.Repository
return dtos;
}
}
#nullable disable
}

View File

@ -13,7 +13,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class FileRepository : IFileRepository
{
private readonly IQueryable<FileInfo> dbSetConfigured;
@ -288,5 +288,5 @@ namespace AsbCloudInfrastructure.Repository
return dto;
}
}
#nullable disable
}

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class FileStorageRepository : IFileStorageRepository
{
/// <summary>
@ -117,5 +117,5 @@ namespace AsbCloudInfrastructure.Repository
Directory.CreateDirectory(directoryName);
}
}
#nullable disable
}

View File

@ -0,0 +1,160 @@
using AsbCloudApp.Data.GTR;
using AsbCloudApp.Repositories;
using AsbCloudApp.Services;
using AsbCloudDb.Model;
using AsbCloudDb.Model.GTR;
using Mapster;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
public class GtrWitsRepository : IGtrRepository
{
private readonly IAsbCloudDbContext db;
private readonly ITelemetryService telemetryService;
public GtrWitsRepository(
IAsbCloudDbContext db,
ITelemetryService telemetryService)
{
this.db = db;
this.telemetryService = telemetryService;
}
public async Task<IEnumerable<WitsRecordDto>> GetAsync(int idWell, DateTime? dateBegin, double intervalSec = 600, int approxPointsCount = 1024, CancellationToken token = default)
{
var telemetry = telemetryService.GetOrDefaultTelemetryByIdWell(idWell);
if (telemetry is null)
return Enumerable.Empty<WitsRecordDto>();
var timezone = telemetryService.GetTimezone(telemetry.Id);
DateTimeOffset? dateBeginUtc = dateBegin?.ToUtcDateTimeOffset(timezone.Hours);
var dateEnd = dateBeginUtc?.AddSeconds(intervalSec);
var recordAllInt = await GetItemsOrDefaultAsync<WitsItemInt, int>(telemetry.Id, dateBeginUtc, dateEnd, approxPointsCount, timezone.Hours, token);
var recordAllFloat = await GetItemsOrDefaultAsync<WitsItemFloat, float>(telemetry.Id, dateBeginUtc, dateEnd, approxPointsCount,timezone.Hours, token);
var recordAllString = await GetItemsOrDefaultAsync<WitsItemString, string>(telemetry.Id, dateBeginUtc, dateEnd, approxPointsCount, timezone.Hours, token);
var dtos = (recordAllFloat.Union(recordAllInt)).Union(recordAllString)
.GroupBy(g => new
{
g.IdRecord,
g.Date
})
.Select(g => new WitsRecordDto
{
Id = g.Key.IdRecord,
Date = g.Key.Date,
Items = g.Select(r => new {
Key = r.IdItem,
Value = r.Item
}).ToDictionary(x => x.Key, x => x.Value)
});
return dtos;
}
private async Task<IEnumerable<ItemRecord>> GetItemsOrDefaultAsync<TEntity, TValue>(
int idTelemetry,
DateTimeOffset? dateBegin,
DateTimeOffset? dateEnd,
int approxPointsCount,
double timezoneHours,
CancellationToken token)
where TEntity: WitsItemBase<TValue>
where TValue: notnull
{
var query = db.Set<TEntity>()
.Where(i => i.IdTelemetry == idTelemetry);
if (dateBegin is not null)
query = query
.Where(d => d.DateTime >= dateBegin);
if (dateEnd is not null)
query = query
.Where(d => d.DateTime <= dateEnd);
var fullDataCount = await query.CountAsync(token);
if (fullDataCount == 0)
return Enumerable.Empty<ItemRecord>();
if (fullDataCount > 1.75 * approxPointsCount)
{
var m = (int)Math.Round(1d * fullDataCount / approxPointsCount);
if (m > 1)
query = query.Where((d) => (((d.DateTime.DayOfYear * 24 + d.DateTime.Hour) * 60 + d.DateTime.Minute) * 60 + d.DateTime.Second) % m == 0);
}
var entities = await query
.OrderBy(d => d.DateTime)
.AsNoTracking()
.ToListAsync(token)
.ConfigureAwait(false);
var items = entities.Select(e => new ItemRecord
{
IdRecord = e.IdRecord,
IdTelemetry = e.IdTelemetry,
Date = e.DateTime.ToRemoteDateTime(timezoneHours),
IdItem = e.IdItem,
Item = new JsonValue(e.Value)
});
return items;
}
public async Task SaveDataAsync(int idTelemetry, WitsRecordDto dto, CancellationToken token)
{
var timezoneHours = telemetryService.GetTimezone(idTelemetry).Hours;
foreach (var item in dto.Items)
{
var dateTime = dto.Date.ToUtcDateTimeOffset(timezoneHours);
if (item.Value.Value is string valueString)
{
var entity = MakeEntity<WitsItemString, string>( dto.Id, item.Key, idTelemetry, dateTime, valueString);
db.WitsItemString.Add(entity);
}
if (item.Value.Value is float valueFloat)
{
var entity = MakeEntity<WitsItemFloat, float>(dto.Id, item.Key, idTelemetry, dateTime, valueFloat);
db.WitsItemFloat.Add(entity);
}
if (item.Value.Value is int valueInt)
{
var entity = MakeEntity<WitsItemInt, int>(dto.Id, item.Key, idTelemetry, dateTime, valueInt);
db.WitsItemInt.Add(entity);
}
}
await db.SaveChangesAsync(token);
}
private static TEntity MakeEntity<TEntity, TValue>(int idRecord, int idItem, int idTelemetry, DateTimeOffset dateTime, TValue value)
where TEntity : WitsItemBase<TValue>, new()
where TValue: notnull
=> new TEntity() {
IdRecord = idRecord,
IdItem = idItem,
IdTelemetry = idTelemetry,
DateTime = dateTime,
Value = value,
};
internal class ItemRecord
{
public int IdRecord { get; set; }
public int IdTelemetry { get; set; }
public DateTime Date { get; set; }
public int IdItem { get; set; }
public JsonValue Item { get; set; } = default!;
}
}
}

View File

@ -11,7 +11,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class LimitingParameterRepository : ILimitingParameterRepository
{
private readonly IAsbCloudDbContext context;
@ -75,5 +75,5 @@ namespace AsbCloudInfrastructure.Repository
return query;
}
}
#nullable disable
}

View File

@ -13,7 +13,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class PlannedTrajectoryRepository : IPlannedTrajectoryRepository
{
private readonly IAsbCloudDbContext db;
@ -116,5 +116,5 @@ namespace AsbCloudInfrastructure.Repository
return entity;
}
}
#nullable disable
}

View File

@ -15,7 +15,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class ProcessMapRepository : CrudWellRelatedRepositoryBase<ProcessMapPlanDto, ProcessMap>,
IProcessMapPlanRepository
{
@ -156,5 +156,5 @@ namespace AsbCloudInfrastructure.Repository
return entity;
}
}
#nullable disable
}

View File

@ -5,7 +5,7 @@ using System.Linq;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class QueryContainer<TEntity> where TEntity : class, IId
{
protected readonly IAsbCloudDbContext dbContext;
@ -26,5 +26,5 @@ namespace AsbCloudInfrastructure.Repository
GetQuery = () => makeQuery(dbSet);
}
}
#nullable disable
}

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class ScheduleRepository : CrudWellRelatedRepositoryBase<ScheduleDto, Schedule>, IScheduleRepository
{
private readonly IWellService wellService;
@ -64,5 +64,5 @@ namespace AsbCloudInfrastructure.Repository
return dto;
}
}
#nullable disable
}

View File

@ -11,7 +11,7 @@ using System.Linq;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class SetpointsRequestRepository : CrudWellRelatedCacheRepositoryBase<SetpointsRequestDto, SetpointsRequest>
{
private readonly IWellService wellService;
@ -62,5 +62,5 @@ namespace AsbCloudInfrastructure.Repository
return result;
}
}
#nullable disable
}

View File

@ -12,7 +12,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class TelemetryWirelineRunOutRepository : ITelemetryWirelineRunOutRepository
{
private readonly IAsbCloudDbContext context;
@ -105,5 +105,5 @@ namespace AsbCloudInfrastructure.Repository
return dto;
}
}
#nullable disable
}

View File

@ -13,7 +13,7 @@ using Microsoft.Extensions.Caching.Memory;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class UserRepository : IUserRepository
{
private readonly IAsbCloudDbContext dbContext;
@ -284,5 +284,5 @@ namespace AsbCloudInfrastructure.Repository
return dto;
}
}
#nullable disable
}

View File

@ -15,7 +15,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class UserRoleRepository : IUserRoleRepository
{
private readonly IAsbCloudDbContext dbContext;
@ -295,5 +295,5 @@ namespace AsbCloudInfrastructure.Repository
return entity;
}
}
#nullable disable
}

View File

@ -13,7 +13,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class WellCompositeRepository : IWellCompositeRepository
{
private readonly IAsbCloudDbContext db;
@ -75,5 +75,5 @@ namespace AsbCloudInfrastructure.Repository
return dto;
}
}
#nullable disable
}

View File

@ -14,7 +14,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class WellFinalDocumentsRepository : IWellFinalDocumentsRepository
{
private readonly IAsbCloudDbContext context;
@ -139,5 +139,5 @@ namespace AsbCloudInfrastructure.Repository
private static WellFinalDocumentDBDto Convert(WellFinalDocument entity)
=> entity.Adapt<WellFinalDocumentDBDto>();
}
#nullable disable
}

View File

@ -15,7 +15,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
/// <summary>
/// репозиторий операций по скважине
/// </summary>
@ -399,5 +399,5 @@ namespace AsbCloudInfrastructure.Repository
return result;
}
}
#nullable disable
}

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Repository
{
#nullable enable
public class WitsRecordRepository<TDto, TEntity> : IWitsRecordRepository<TDto>
where TEntity : AsbCloudDb.Model.WITS.RecordBase, ITelemetryData
where TDto : AsbCloudApp.Data.ITelemetryData
@ -146,5 +146,5 @@ namespace AsbCloudInfrastructure.Repository
}
}
#nullable disable
}

View File

@ -15,7 +15,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
#nullable enable
namespace AsbCloudInfrastructure.Services
{
/// <inheritdoc/>
@ -256,4 +256,3 @@ namespace AsbCloudInfrastructure.Services
}
}
}
#nullable disable

View File

@ -2,12 +2,12 @@
namespace AsbCloudInfrastructure.Services.DailyReport
{
#nullable enable
abstract class BlockAbstract
{
public abstract CellAddress AddressBlockBegin { get; }
public abstract CellAddress AddressBlockEnd { get; }
public abstract void Draw(IXLWorksheet sheet);
}
#nullable disable
}

View File

@ -5,7 +5,7 @@ using System.Text;
namespace AsbCloudInfrastructure.Services.DailyReport
{
#nullable enable
internal class CellAddress: IXLAddress
{
const int excelLettersCount = 'Z' - 'A' + 1;
@ -170,5 +170,5 @@ namespace AsbCloudInfrastructure.Services.DailyReport
return false;
}
}
#nullable disable
}

View File

@ -3,7 +3,7 @@ using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
{
#nullable enable
class BhaBlock : BlockAbstract
{
private readonly BhaDto blockDto;
@ -111,7 +111,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
.SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[4], AddressDurationDataFinish[4])}").Style.SetAllBorders();
}
}
#nullable disable
}

View File

@ -3,7 +3,7 @@ using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
{
#nullable enable
internal class DimensionlessBlock : BlockAbstract
{
private readonly NoDrillingDto blockDto;
@ -114,6 +114,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue("Наращивание");
}
}
#nullable disable
}

View File

@ -3,7 +3,7 @@ using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
{
#nullable enable
class HeadBlock : BlockAbstract
{
private readonly HeadDto blockDto;
@ -175,7 +175,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue($"{blockDto.CountLaunchesMSE}");
}
}
#nullable disable
}

View File

@ -3,7 +3,7 @@ using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
{
#nullable enable
internal class SaubBlock : BlockAbstract
{
private readonly SaubDto blockDto;
@ -225,6 +225,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue($"Примечание: {blockDto.DeclinesReasonsROP}");
}
}
#nullable disable
}

View File

@ -3,7 +3,7 @@ using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
{
#nullable enable
internal class SignBlock : BlockAbstract
{
private readonly SignDto blockDto;
@ -45,7 +45,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
.SetValue($"{blockDto.Supervisor}");
}
}
#nullable disable
}

View File

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
#nullable enable
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
{
/// <summary>
@ -90,4 +90,4 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
}
}
}
#nullable disable

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.IO;
namespace AsbCloudInfrastructure.Services.DailyReport
{
#nullable enable
public class DailyReportMakerExcel
{
private IEnumerable<WellOperationCategoryDto> OperationCategories = null!;
@ -56,6 +56,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport
sheet.Rows().AdjustToContents();
}
}
#nullable disable
}

View File

@ -17,7 +17,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.DailyReport
{
#nullable enable
public class DailyReportService : IDailyReportService
{
private readonly IAsbCloudDbContext db;
@ -244,5 +244,5 @@ namespace AsbCloudInfrastructure.Services.DailyReport
};
}
}
#nullable disable
}

View File

@ -3,7 +3,7 @@ using System;
namespace AsbCloudInfrastructure.Services.DailyReport
{
#nullable enable
internal static class XLExtentions
{
public static IXLRange _SetValue(this IXLRange range, object value)
@ -157,5 +157,5 @@ namespace AsbCloudInfrastructure.Services.DailyReport
=> sheet.Range(begin.RowNumber, begin.ColumnNumber, end.RowNumber, end.ColumnNumber);
}
#nullable disable
}

View File

@ -2,7 +2,7 @@
namespace AsbCloudInfrastructure.Services.DetectOperations
{
#nullable enable
public class DetectableTelemetry
{
public DateTimeOffset DateTime { get; set; }
@ -14,5 +14,5 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
public float BitDepth { get; set; }
public float RotorSpeed { get; set; }
}
#nullable disable
}

View File

@ -12,7 +12,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.DetectOperations
{
#nullable enable
internal class DetectedOperationExportService
{
private readonly IAsbCloudDbContext db;
@ -116,5 +116,5 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
sheet.Cell(rowNumber, 6).Value = operation.Value;
}
}
#nullable enable
}

View File

@ -15,7 +15,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.DetectOperations
{
#nullable enable
public class DetectedOperationService : IDetectedOperationService
{
private readonly IAsbCloudDbContext db;
@ -310,5 +310,5 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
}
}
#nullable disable
}

View File

@ -4,7 +4,7 @@ using System.Linq;
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
internal abstract class DetectorAbstract
{
private readonly int idOperation;
@ -343,6 +343,6 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
}
}
#nullable disable
}

View File

@ -2,7 +2,7 @@
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
/// <summary>
/// Проработка перед наращиванием
/// </summary>
@ -62,6 +62,6 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
=> IsValidByWellDepthDoesNotChange(telemetry, begin, end);
}
#nullable disable
}

View File

@ -2,7 +2,7 @@
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
/// <summary>
/// Промывка
/// </summary>
@ -54,6 +54,6 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
=> IsValidByWellDepthDoesNotChange(telemetry, begin, end);
}
#nullable disable
}

View File

@ -2,7 +2,7 @@
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
/// <summary>
/// Промывка перед наращиванием
/// </summary>
@ -50,6 +50,6 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
=> IsValidByWellDepthDoesNotChange(telemetry, begin, end);
}
#nullable disable
}

View File

@ -3,7 +3,7 @@ using System.Linq;
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
internal class DetectorRotor : DetectorAbstract
{
public DetectorRotor()
@ -57,6 +57,6 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
=> CalcRop(telemetry, begin, end);
}
#nullable disable
}

View File

@ -2,7 +2,7 @@
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
internal class DetectorSlide : DetectorAbstract
{
public DetectorSlide()
@ -56,6 +56,6 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
=> CalcRop(telemetry, begin, end);
}
#nullable disable
}

View File

@ -2,7 +2,7 @@
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
internal class DetectorSlipsTime : DetectorAbstract
{
public DetectorSlipsTime()
@ -35,6 +35,6 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
=> IsValidByWellDepthDoesNotChange(telemetry, begin, end);
}
#nullable disable
}

View File

@ -4,7 +4,7 @@ using System;
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
/// <summary>
/// Статический замер телесистемы
@ -64,6 +64,6 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
=> CalcDeltaMinutes(telemetry, begin, end);
}
#nullable disable
}

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
internal class DetectorTemplating : DetectorAbstract
{
public DetectorTemplating()
@ -60,6 +60,6 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
=> IsValidByWellDepthDoesNotChange(telemetry, begin, end);
}
#nullable disable
}

View File

@ -2,7 +2,7 @@
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
/// <summary>
/// Шаблонировка при бурении
/// </summary>
@ -56,6 +56,6 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
=> IsValidByWellDepthDoesNotChange(telemetry, begin, end);
}
#nullable disable
}

View File

@ -2,12 +2,12 @@
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
class OperationDetectorResult
{
public int TelemetryBegin { get; set; }
public int TelemetryEnd { get; set; }
public DetectedOperation Operation { get; set; } = null!;
}
#nullable enable
}

View File

@ -2,7 +2,7 @@
namespace AsbCloudInfrastructure.Services.DetectOperations
{
#nullable enable
public class InterpolationLine
{
private readonly double xSum;
@ -53,5 +53,5 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
public bool IsAverageYGreaterThan(double bound) =>
(ySum / count) >= bound;
}
#nullable disable
}

View File

@ -12,7 +12,7 @@ using Microsoft.Extensions.DependencyInjection;
namespace AsbCloudInfrastructure.Services.DetectOperations
{
#nullable enable
public static class OperationDetectionWorkFactory
{
private const string workId = "Operation detection";
@ -159,5 +159,5 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
return detectedOperations;
}
}
#nullable disable
}

View File

@ -6,7 +6,7 @@ using System.Linq;
namespace AsbCloudInfrastructure.Services.DrillingProgram
{
#nullable enable
public class ContentListSheet
{
private readonly List<DrillingProgramPartDto> parts;
@ -37,5 +37,5 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
}
}
}
#nullable disable
}

View File

@ -10,7 +10,7 @@ using iText.Kernel.Utils;
namespace AsbCloudInfrastructure.Services.DrillingProgram.Convert
{
#nullable enable
sealed internal class ConvertToPdf
{
internal static readonly string[] filesExtensions = { ".xlsx", ".xls", ".ods", ".odt", ".doc", ".docx", ".pdf" };
@ -85,5 +85,5 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram.Convert
Directory.Delete(Path.Combine(convertedFilesDir, "pdf"), true);
}
}
#nullable disable
}

View File

@ -6,7 +6,7 @@ using System.Linq;
namespace AsbCloudInfrastructure.Services.DrillingProgram
{
#nullable enable
internal class DrillingProgramMaker
{
private const int maxAllowedColumns = 256;
@ -129,5 +129,5 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
return rngData;
}
}
#nullable disable
}

View File

@ -552,5 +552,5 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
private static string MakeWorkId(int idWell)
=> $"Make drilling program for wellId {idWell}";
}
#nullable disable
}

View File

@ -2,7 +2,7 @@
namespace AsbCloudInfrastructure.Services.DrillingProgram
{
#nullable enable
class ImageInfo
{
public int Id { get; set; }
@ -13,5 +13,5 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
public int Left { get; set; }
public int Top { get; set; }
}
#nullable disable
}

View File

@ -6,7 +6,7 @@ using System.Linq;
namespace AsbCloudInfrastructure.Services.DrillingProgram
{
#nullable enable
public class TitleListSheet
{
private const string directionDirectorPositionName = "Руководитель направления по ТСБ";
@ -160,5 +160,5 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
private static string FormatDate(DateTime dateTime)
=> $"{dateTime.Day:00}.{dateTime.Month:00}.{dateTime.Year:00}";
}
#nullable disable
}

View File

@ -6,7 +6,7 @@ using System.IO;
namespace AsbCloudInfrastructure.Services.Email
{
#nullable enable
public class BaseFactory
{
private readonly string platformName;
@ -61,5 +61,5 @@ namespace AsbCloudInfrastructure.Services.Email
public virtual string MakeSubject(WellDto well, string action)
=> $"{well.Deposit}, {well.Cluster}, {well.Caption}. {action}";
}
#nullable disable
}

View File

@ -6,7 +6,7 @@ using System.IO;
namespace AsbCloudInfrastructure
{
#nullable enable
class DrillingMailBodyFactory : BaseFactory
{
private readonly string platformName;
@ -85,5 +85,5 @@ namespace AsbCloudInfrastructure
return drillingProgramHref;
}
}
#nullable disable
}

View File

@ -12,7 +12,7 @@ using AsbCloudInfrastructure.Background;
namespace AsbCloudInfrastructure.Services
{
#nullable enable
public class EmailService : IEmailService
{
private readonly BackgroundWorker backgroundWorker;
@ -117,5 +117,5 @@ namespace AsbCloudInfrastructure.Services
return hash;
}
}
#nullable disable
}

View File

@ -6,7 +6,7 @@ using System.IO;
namespace AsbCloudInfrastructure
{
#nullable enable
class WellFinalDocumentMailBodyFactory : BaseFactory
{
private readonly string platformName;
@ -30,5 +30,5 @@ namespace AsbCloudInfrastructure
return body;
}
}
#nullable disable
}

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services
{
#nullable enable
public class FileCategoryService : CrudCacheRepositoryBase<FileCategoryDto, FileCategory>, IFileCategoryService
{
public FileCategoryService(IAsbCloudDbContext context, IMemoryCache memoryCache)
@ -29,5 +29,5 @@ namespace AsbCloudInfrastructure.Services
return dtos;
}
}
#nullable disable
}

View File

@ -12,7 +12,7 @@ using Microsoft.Extensions.DependencyInjection;
namespace AsbCloudInfrastructure.Services
{
#nullable enable
internal static class LimitingParameterCalcWorkFactory
{
private const string workId = "Limiting parameter calc";
@ -147,5 +147,5 @@ namespace AsbCloudInfrastructure.Services
return result;
}
}
#nullable disable
}

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services
{
#nullable enable
public class LimitingParameterService : ILimitingParameterService
{
private readonly ILimitingParameterRepository limitingParameterRepository;
@ -115,5 +115,5 @@ namespace AsbCloudInfrastructure.Services
return result;
}
}
#nullable disable
}

View File

@ -13,7 +13,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services
{
#nullable enable
public class MeasureService : IMeasureService
{
private readonly IAsbCloudDbContext db;
@ -158,5 +158,5 @@ namespace AsbCloudInfrastructure.Services
return entity;
}
}
#nullable disable
}

View File

@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMap
{
#nullable enable
public class ProcessMapReportMakerService : IProcessMapReportMakerService
{
const int firstColumn = 2;
@ -205,5 +205,5 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
return style;
}
}
#nullable disable
}

View File

@ -11,7 +11,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMap
{
#nullable enable
public partial class ProcessMapReportService : IProcessMapReportService
{
private readonly IWellService wellService;
@ -389,5 +389,5 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
_ => "Ручной",
};
}
#nullable disable
}

View File

@ -5,7 +5,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMap;
internal static class XLExtentions
{
#nullable enable
public static IXLCell SetVal(this IXLCell cell, string value, bool adaptRowHeight = false)
{
cell.Value = value;
@ -48,5 +48,5 @@ internal static class XLExtentions
cell.Style.NumberFormat.Format = format;
return cell;
}
#nullable disable
}

View File

@ -13,7 +13,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services
{
#nullable enable
class JobHandle
{
public int Id => Job.Id;
@ -331,5 +331,5 @@ namespace AsbCloudInfrastructure.Services
return new AsbCloudDbContext(options);
}
}
#nullable disable
}

View File

@ -15,7 +15,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services
{
#nullable enable
public class ReportService : IReportService
{
private readonly IAsbCloudDbContext db;
@ -177,5 +177,5 @@ namespace AsbCloudInfrastructure.Services
return generator;
}
}
#nullable disable
}

View File

@ -7,7 +7,7 @@ using System.Linq;
namespace AsbCloudInfrastructure.Services
{
#nullable enable
public class RequestTrackerService : IRequerstTrackerService
{
const int fastRequestsCount = 1000;
@ -128,5 +128,5 @@ namespace AsbCloudInfrastructure.Services
}
}
}
#nullable disable
}

View File

@ -6,7 +6,7 @@ using System.Text.RegularExpressions;
namespace System.Text.Csv
{
#nullable enable
public class CsvSerializer<T>
{
private readonly PropertyInfo[] props;
@ -80,5 +80,5 @@ namespace System.Text.Csv
return $"\"{inString}\"";
}
}
#nullable disable
}

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.SAUB
{
#nullable enable
public class EventService : IEventService
{
private readonly IAsbCloudDbContext db;
@ -43,5 +43,5 @@ namespace AsbCloudInfrastructure.Services.SAUB
memoryCache.DropBasic<TelemetryEvent>();
}
}
#nullable disable
}

View File

@ -13,7 +13,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
#nullable enable
namespace AsbCloudInfrastructure.Services.SAUB
{
public class MessageService : IMessageService
@ -155,4 +155,4 @@ namespace AsbCloudInfrastructure.Services.SAUB
}
}
}
#nullable disable

View File

@ -12,7 +12,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.SAUB
{
#nullable enable
public class SetpointsService : ISetpointsService
{
// ## Инфо от АПГ от 26.11.2021, дополнения ШОВ от 26.11.2021
@ -113,5 +113,5 @@ namespace AsbCloudInfrastructure.Services.SAUB
public IEnumerable<SetpointInfoDto> GetSetpointsNames()
=> SetpointInfos.Values;
}
#nullable disable
}

View File

@ -9,7 +9,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
#nullable enable
namespace AsbCloudInfrastructure.Services.SAUB
{
public abstract class TelemetryDataBaseService<TDto, TEntity> : ITelemetryDataService<TDto>
@ -158,4 +158,3 @@ namespace AsbCloudInfrastructure.Services.SAUB
}
}
#nullable disable

View File

@ -8,7 +8,7 @@ using Mapster;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
#nullable enable
namespace AsbCloudInfrastructure.Services.SAUB
{
public class TelemetryDataCache<TDto>
@ -182,4 +182,3 @@ namespace AsbCloudInfrastructure.Services.SAUB
}
}
}
#nullable disable

View File

@ -17,7 +17,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.SAUB
{
#nullable enable
public class TelemetryDataSaubService : TelemetryDataBaseService<TelemetryDataSaubDto, TelemetryDataSaub>, ITelemetryDataSaubService
{
private readonly ITelemetryUserService telemetryUserService;
@ -145,5 +145,5 @@ namespace AsbCloudInfrastructure.Services.SAUB
return outStream;
}
}
#nullable disable
}

View File

@ -5,7 +5,7 @@ using Mapster;
namespace AsbCloudInfrastructure.Services.SAUB
{
#nullable enable
public class TelemetryDataSpinService : TelemetryDataBaseService<TelemetryDataSpinDto, TelemetryDataSpin>
{
public TelemetryDataSpinService(
@ -29,5 +29,5 @@ namespace AsbCloudInfrastructure.Services.SAUB
return dto;
}
}
#nullable disable
}

View File

@ -14,7 +14,7 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.SAUB
{
#nullable enable
public class TelemetryService : ITelemetryService
{
private readonly IAsbCloudDbContext db;
@ -343,5 +343,5 @@ namespace AsbCloudInfrastructure.Services.SAUB
return affected;
}
}
#nullable disable
}

Some files were not shown because too many files have changed in this diff Show More