forked from ddrilling/AsbCloudServer
nit improvements
This commit is contained in:
parent
e634094738
commit
91dd386ffc
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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()
|
||||
|
@ -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")]
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user