forked from ddrilling/AsbCloudServer
Merge branch 'dev' of https://bitbucket.org/autodrilling/asbcloudserver into dev
This commit is contained in:
commit
f7fedb16e8
@ -9,5 +9,8 @@ namespace AsbCloudApp.Services
|
||||
{
|
||||
Task<DrillParamsDto> GetDefaultDrillParamsAsync(int idWell, double startDepth,
|
||||
double endDepth, CancellationToken token = default);
|
||||
|
||||
Task<IEnumerable<DrillParamsDto>> GetAllAsync(int idWell,
|
||||
CancellationToken token = default);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AsbCloudApp.Data;
|
||||
using AsbCloudApp.Services;
|
||||
using AsbCloudDb.Model;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Mapster;
|
||||
|
||||
namespace AsbCloudInfrastructure.Services
|
||||
{
|
||||
@ -19,6 +21,7 @@ namespace AsbCloudInfrastructure.Services
|
||||
this.db = context;
|
||||
this.telemetryService = telemetryService;
|
||||
}
|
||||
|
||||
public async Task<DrillParamsDto> GetDefaultDrillParamsAsync(int idWell,
|
||||
double startDepth, double endDepth, CancellationToken token = default)
|
||||
{
|
||||
@ -110,6 +113,20 @@ namespace AsbCloudInfrastructure.Services
|
||||
FlowMax = flows.Max ?? 0,
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<DrillParamsDto>> GetAllAsync(int idWell,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
var entities = await (from p in db.DrillParams
|
||||
where p.IdWell == idWell
|
||||
orderby p.Id
|
||||
select p)
|
||||
.ToListAsync(token)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
var dto = entities.Select(entity => entity.Adapt<DrillParamsDto>());
|
||||
return dto;
|
||||
}
|
||||
|
||||
private IQueryable<IGrouping<int, TelemetryDataSaub>> GetTelemetryGroupQuery(int idTelemetry,
|
||||
double startDepth, double endDepth)
|
||||
|
@ -66,7 +66,7 @@ namespace AsbCloudWebApi.Controllers
|
||||
idWell, token).ConfigureAwait(false))
|
||||
return Forbid();
|
||||
|
||||
var dto = await drillParamsService.GetAsync(idWell, token);
|
||||
var dto = await drillParamsService.GetAllAsync(idWell, token);
|
||||
|
||||
return Ok(dto);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user