forked from ddrilling/AsbCloudServer
Фикс получения статуса скважины
This commit is contained in:
parent
33ac04b304
commit
4f4556b62b
@ -105,18 +105,17 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
|
|
||||||
public async Task<WellMapInfoWithTelemetryStat?> GetOrDefaultStatAsync(int idWell, CancellationToken token)
|
public async Task<WellMapInfoWithTelemetryStat?> GetOrDefaultStatAsync(int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
var dto = wellInfoService.FirstOrDefault(well => well.Id == idWell);
|
var entity = await GetOrDefaultAsync(idWell, token);
|
||||||
if (dto is not null)
|
|
||||||
return dto;
|
|
||||||
|
|
||||||
var request = new WellRequest{Ids = new[] { idWell }};
|
|
||||||
var entities = await GetEntitiesAsync(request, token);
|
|
||||||
var entity = entities.FirstOrDefault();
|
|
||||||
if (entity is null)
|
if (entity is null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
var dto = wellInfoService.FirstOrDefault(well => well.Id == idWell);
|
||||||
|
|
||||||
dto = entity.Adapt<WellMapInfoWithTelemetryStat>();
|
if (dto is null)
|
||||||
|
return entity.Adapt<WellMapInfoWithTelemetryStat>();
|
||||||
|
|
||||||
|
dto.IdState = entity.IdState;
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user