forked from ddrilling/AsbCloudServer
#8103063 fix
This commit is contained in:
parent
7be6173f73
commit
9410508213
@ -35,7 +35,7 @@ namespace AsbCloudApp.Repositories
|
|||||||
/// <param name="idWell"></param>
|
/// <param name="idWell"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<ProcessMapDto>> GetCompositeProcessMap(int idWell, CancellationToken token);
|
Task<IEnumerable<ProcessMapDto>?> GetCompositeProcessMap(int idWell, CancellationToken token);
|
||||||
}
|
}
|
||||||
#nullable disable
|
#nullable disable
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
namespace AsbCloudApp.Requests
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace AsbCloudApp.Requests
|
||||||
{
|
{
|
||||||
#nullable enable
|
#nullable enable
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -9,12 +11,12 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Идентификатор скважины
|
/// Идентификатор скважины
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int IdWell { get; set; }
|
public IEnumerable<int> IdWells { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Тип секции
|
/// Тип секции
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? IdWellSectionType { get; set; }
|
public IEnumerable<int>? IdWellSectionTypes { get; set; } = null!;
|
||||||
}
|
}
|
||||||
#nullable disable
|
#nullable disable
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
using AsbCloudApp.Data;
|
using AsbCloudApp.Data.ProcessMap;
|
||||||
using AsbCloudApp.Data.ProcessMap;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
@ -43,10 +43,10 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
|
|
||||||
public async Task<IEnumerable<ProcessMapDto>?> GetByRequesProcessMaplAsync(WellCompositeRequest request, CancellationToken token)
|
public async Task<IEnumerable<ProcessMapDto>?> GetByRequesProcessMaplAsync(WellCompositeRequest request, CancellationToken token)
|
||||||
{
|
{
|
||||||
var query = GetQuery().Where(e => e.IdWell == request.IdWell);
|
var query = GetQuery().Where(e => request.IdWells.Contains(e.IdWell));
|
||||||
if (request.IdWellSectionType is not null)
|
if (request.IdWellSectionTypes is not null)
|
||||||
{
|
{
|
||||||
query.Where(e => e.IdWellSectionType == request.IdWellSectionType);
|
query.Where(e => request.IdWellSectionTypes.Contains(e.IdWellSectionType));
|
||||||
}
|
}
|
||||||
|
|
||||||
var entities = await query
|
var entities = await query
|
||||||
|
@ -51,53 +51,49 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public async Task<IEnumerable<ProcessMapDto>> GetCompositeProcessMap(int idWell, CancellationToken token)
|
public async Task<IEnumerable<ProcessMapDto>?> GetCompositeProcessMap(int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
var result = new List<ProcessMapDto>();
|
|
||||||
|
|
||||||
var dtos = await GetAsync(idWell, token);
|
var dtos = await GetAsync(idWell, token);
|
||||||
foreach (var dto in dtos)
|
var idWells = dtos.Select(c => c.IdWellSrc);
|
||||||
{
|
var idWellSectionTypes = dtos.Select(c => c.IdWellSectionType);
|
||||||
var processMaps = (await processMapRepository.GetByRequesProcessMaplAsync(new WellCompositeRequest
|
|
||||||
{
|
|
||||||
IdWell = dto.IdWellSrc,
|
|
||||||
IdWellSectionType = dto.IdWellSectionType
|
|
||||||
}
|
|
||||||
, token))?
|
|
||||||
.Where(x => x.IdWellSectionType == dto.IdWellSectionType)
|
|
||||||
.Select(x => new ProcessMapDto
|
|
||||||
{
|
|
||||||
IdWell = dto.IdWell,
|
|
||||||
IdWellSectionType = dto.IdWellSectionType,
|
|
||||||
RopPlan = x.RopPlan,
|
|
||||||
DepthStart = x.DepthStart,
|
|
||||||
DepthEnd = x.DepthEnd,
|
|
||||||
AxialLoad = new PlanFactDto
|
|
||||||
{
|
|
||||||
Plan = x.AxialLoad.Fact ?? 0
|
|
||||||
},
|
|
||||||
Flow = new PlanFactDto
|
|
||||||
{
|
|
||||||
Plan = x.Flow.Fact ?? x.Flow.Plan
|
|
||||||
},
|
|
||||||
Pressure = new PlanFactDto
|
|
||||||
{
|
|
||||||
Plan = x.Pressure.Fact ?? x.Pressure.Plan
|
|
||||||
},
|
|
||||||
TopDriveSpeed = new PlanFactDto
|
|
||||||
{
|
|
||||||
Plan = x.TopDriveSpeed.Fact ?? x.TopDriveSpeed.Plan
|
|
||||||
},
|
|
||||||
TopDriveTorque = new PlanFactDto
|
|
||||||
{
|
|
||||||
Plan = x.TopDriveTorque.Fact ?? x.TopDriveTorque.Plan
|
|
||||||
},
|
|
||||||
LastUpdate = DateTime.UtcNow
|
|
||||||
});
|
|
||||||
|
|
||||||
if (processMaps is not null)
|
var processMap = (await processMapRepository.GetByRequesProcessMaplAsync(new WellCompositeRequest
|
||||||
result.AddRange(processMaps);
|
{
|
||||||
}
|
IdWells = idWells,
|
||||||
|
IdWellSectionTypes = idWellSectionTypes
|
||||||
|
},
|
||||||
|
token));
|
||||||
|
|
||||||
|
var result = processMap?.Select(x => new ProcessMapDto
|
||||||
|
{
|
||||||
|
IdWell = x.IdWell,
|
||||||
|
IdWellSectionType = x.IdWellSectionType,
|
||||||
|
RopPlan = x.RopPlan,
|
||||||
|
DepthStart = x.DepthStart,
|
||||||
|
DepthEnd = x.DepthEnd,
|
||||||
|
AxialLoad = new PlanFactDto
|
||||||
|
{
|
||||||
|
Plan = x.AxialLoad.Fact ?? x.AxialLoad.Plan,
|
||||||
|
},
|
||||||
|
Flow = new PlanFactDto
|
||||||
|
{
|
||||||
|
Plan = x.Flow.Fact ?? x.Flow.Plan
|
||||||
|
},
|
||||||
|
Pressure = new PlanFactDto
|
||||||
|
{
|
||||||
|
Plan = x.Pressure.Fact ?? x.Pressure.Plan
|
||||||
|
},
|
||||||
|
TopDriveSpeed = new PlanFactDto
|
||||||
|
{
|
||||||
|
Plan = x.TopDriveSpeed.Fact ?? x.TopDriveSpeed.Plan
|
||||||
|
},
|
||||||
|
TopDriveTorque = new PlanFactDto
|
||||||
|
{
|
||||||
|
Plan = x.TopDriveTorque.Fact ?? x.TopDriveTorque.Plan
|
||||||
|
},
|
||||||
|
LastUpdate = DateTime.UtcNow
|
||||||
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
|
|||||||
private readonly ITelemetryDataSaubService telemetryDataSaubService;
|
private readonly ITelemetryDataSaubService telemetryDataSaubService;
|
||||||
private readonly ILimitingParameterRepository limitingParameterRepository;
|
private readonly ILimitingParameterRepository limitingParameterRepository;
|
||||||
private readonly ISubsystemOperationTimeService subsystemOperationTimeService;
|
private readonly ISubsystemOperationTimeService subsystemOperationTimeService;
|
||||||
private readonly IWellCompositeRepository wellCompositeRepository;
|
|
||||||
|
|
||||||
public ProcessMapService(
|
public ProcessMapService(
|
||||||
IWellService wellService,
|
IWellService wellService,
|
||||||
@ -34,8 +33,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
|
|||||||
IProcessMapRepository processMapRepository,
|
IProcessMapRepository processMapRepository,
|
||||||
ITelemetryDataSaubService telemetryDataSaubService,
|
ITelemetryDataSaubService telemetryDataSaubService,
|
||||||
ILimitingParameterRepository limitingParameterRepository,
|
ILimitingParameterRepository limitingParameterRepository,
|
||||||
ISubsystemOperationTimeService subsystemOperationTimeService,
|
ISubsystemOperationTimeService subsystemOperationTimeService)
|
||||||
IWellCompositeRepository wellCompositeRepository)
|
|
||||||
{
|
{
|
||||||
this.wellService = wellService;
|
this.wellService = wellService;
|
||||||
this.wellOperationRepository = wellOperationService;
|
this.wellOperationRepository = wellOperationService;
|
||||||
@ -43,7 +41,6 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
|
|||||||
this.telemetryDataSaubService = telemetryDataSaubService;
|
this.telemetryDataSaubService = telemetryDataSaubService;
|
||||||
this.limitingParameterRepository = limitingParameterRepository;
|
this.limitingParameterRepository = limitingParameterRepository;
|
||||||
this.subsystemOperationTimeService = subsystemOperationTimeService;
|
this.subsystemOperationTimeService = subsystemOperationTimeService;
|
||||||
this.wellCompositeRepository = wellCompositeRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
Loading…
Reference in New Issue
Block a user