forked from ddrilling/AsbCloudServer
Fix filter
This commit is contained in:
parent
93156ef6f8
commit
3c67d22bbd
@ -67,13 +67,13 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
|
||||
query = query.Where(o => o.DateStart >= request.GtDate.Value.ToUtcDateTimeOffset(well.Timezone.Hours));
|
||||
|
||||
if (request.LtDate is not null)
|
||||
query = query.Where(o => o.DateStart <= request.LtDate.Value.ToUtcDateTimeOffset(well.Timezone.Hours));
|
||||
query = query.Where(o => o.DateEnd <= request.LtDate.Value.ToUtcDateTimeOffset(well.Timezone.Hours));
|
||||
|
||||
if (request.GtDepth is not null)
|
||||
query = query.Where(o => o.DepthStart >= request.GtDepth);
|
||||
|
||||
if (request.LtDepth is not null)
|
||||
query = query.Where(o => o.DepthStart <= request.LtDepth);
|
||||
query = query.Where(o => o.DepthEnd <= request.LtDepth);
|
||||
|
||||
if (request.EqIdTelemetryUser is not null)
|
||||
query = query.Where(o => o.IdUsersAtStart == request.EqIdTelemetryUser);
|
||||
|
@ -1,9 +1,4 @@
|
||||
using AsbCloudDb.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AsbCloudInfrastructure.Services.DetectOperations
|
||||
{
|
||||
@ -39,12 +34,18 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
|
||||
{
|
||||
if (DetectEnd(telemetry, skip))
|
||||
{
|
||||
var dateStart = telemetry[position].DateTime;
|
||||
var dateEnd = telemetry[skip].DateTime;
|
||||
var durationSec = (dateEnd - dateStart).TotalSeconds;
|
||||
if (durationSec < MinDurationSeconds || durationSec > MaxDurationSeconds)
|
||||
return null;
|
||||
|
||||
var result = new DetectedOperation
|
||||
{
|
||||
IdCategory = IdCategory,
|
||||
IdUsersAtStart = telemetry[position].IdUser ?? -1,
|
||||
DateStart = telemetry[position].DateTime,
|
||||
DateEnd = telemetry[skip].DateTime,
|
||||
DateStart = dateStart,
|
||||
DateEnd = dateEnd,
|
||||
DepthStart = telemetry[position].WellDepth ?? -1d,
|
||||
DepthEnd = telemetry[skip].WellDepth ?? -1d,
|
||||
};
|
@ -0,0 +1,5 @@
|
||||
# Сервис определения операций по данным телеметрии
|
||||
|
||||
Классы:
|
||||
|
||||
**DetectableTelemetry** - обертка над классами телеметрий, которые можно проанализировать.
|
@ -1 +0,0 @@
|
||||
|
Loading…
Reference in New Issue
Block a user