nit improvements

This commit is contained in:
Фролов 2022-07-04 17:50:16 +05:00
parent e634094738
commit 91dd386ffc
5 changed files with 6 additions and 7 deletions

View File

@ -12,7 +12,7 @@ namespace AsbCloudDb
{
public static class EFExtentions
{
private static System.Text.Json.JsonSerializerOptions jsonSerializerOptions = new()
private static readonly System.Text.Json.JsonSerializerOptions jsonSerializerOptions = new()
{
AllowTrailingCommas = true,
WriteIndented = true,

View File

@ -122,7 +122,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport
private async Task<DailyReportDto> MakeDefaultDailyReportAsync(int idWell, DateTime date, CancellationToken token)
{
var well = await wellService.GetOrDefaultAsync(idWell, token);
var offsetHours = wellService.GetTimezone(idWell).Hours;
var dto = new DailyReportDto()
{
ReportDate = date,

View File

@ -68,7 +68,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
await base.StopAsync(token).ConfigureAwait(false);
}
private async Task<int> DetectedAllTelemetriesAsync(IAsbCloudDbContext db, CancellationToken token)
private static async Task<int> DetectedAllTelemetriesAsync(IAsbCloudDbContext db, CancellationToken token)
{
var lastDetectedDates = await db.DetectedOperations
.GroupBy(o => o.IdTelemetry)
@ -91,7 +91,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
(outer, inner) => new
{
IdTelemetry = outer,
LastDate = inner.SingleOrDefault()?.LastDate,
inner.SingleOrDefault()?.LastDate,
});
var affected = 0;
foreach (var item in JounedlastDetectedDates)
@ -108,7 +108,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
return affected;
}
private async Task<IEnumerable<DetectedOperation>> DetectOperationsAsync(int idTelemetry, DateTimeOffset begin, IAsbCloudDbContext db, CancellationToken token)
private static async Task<IEnumerable<DetectedOperation>> DetectOperationsAsync(int idTelemetry, DateTimeOffset begin, IAsbCloudDbContext db, CancellationToken token)
{
var query = db.TelemetryDataSaub
.AsNoTracking()

View File

@ -97,6 +97,7 @@ namespace AsbCloudWebApi.Controllers
/// Сформировать и скачать рапорт в формате excel
/// </summary>
/// <param name="idWell"></param>
/// <param name="date"></param>
/// <param name="token"></param>
/// <returns></returns>
[HttpGet("{date}/excel")]

View File

@ -18,14 +18,12 @@ namespace AsbCloudWebApi.Controllers
public class DrillFlowChartController : CrudWellRelatedController<DrillFlowChartDto, IDrillFlowChartService>
{
private readonly ITelemetryService telemetryService;
private readonly IWellService wellService;
public DrillFlowChartController(IWellService wellService, IDrillFlowChartService service,
ITelemetryService telemetryService)
: base(wellService, service)
{
this.telemetryService = telemetryService;
this.wellService = wellService;
}
/// <summary>