uncomment

This commit is contained in:
eugeniy_ivanov 2023-04-17 20:59:27 +05:00
parent f81f092c64
commit 8b9dee1609
2 changed files with 20 additions and 20 deletions

View File

@ -116,21 +116,21 @@ namespace AsbCloudInfrastructure.Repository
, CancellationToken token) , CancellationToken token)
where T: notnull where T: notnull
{ {
//if (filterByDateEnd) if (filterByDateEnd)
// query = query.Where(d => d.DateTime <= dateEnd); query = query.Where(d => d.DateTime <= dateEnd);
//var fullDataCount = await query.CountAsync(token) var fullDataCount = await query.CountAsync(token)
// .ConfigureAwait(false); .ConfigureAwait(false);
//if (fullDataCount == 0) if (fullDataCount == 0)
// return Enumerable.Empty<ItemRecord>(); return Enumerable.Empty<ItemRecord>();
//if (fullDataCount > 1.75 * approxPointsCount) if (fullDataCount > 1.75 * approxPointsCount)
//{ {
// var m = (int)Math.Round(1d * fullDataCount / approxPointsCount); var m = (int)Math.Round(1d * fullDataCount / approxPointsCount);
// if (m > 1) if (m > 1)
// query = query.Where((d) => (((d.DateTime.DayOfYear * 24 + d.DateTime.Hour) * 60 + d.DateTime.Minute) * 60 + d.DateTime.Second) % m == 0); query = query.Where((d) => (((d.DateTime.DayOfYear * 24 + d.DateTime.Hour) * 60 + d.DateTime.Minute) * 60 + d.DateTime.Second) % m == 0);
//} }
var entities = await query var entities = await query
.Where(d => d.DateTime >= dateBeginUtc) .Where(d => d.DateTime >= dateBeginUtc)

View File

@ -46,20 +46,20 @@ namespace AsbCloudWebApi.Controllers.SAUB
/// <param name = "token" > Токен завершения задачи</param> /// <param name = "token" > Токен завершения задачи</param>
/// <returns></returns> /// <returns></returns>
[HttpGet("{idWell}")] [HttpGet("{idWell}")]
// [Permission] [Permission]
public async Task<ActionResult<IEnumerable<WitsRecordDto>>> GetDataAsync(int idWell, DateTime begin = default, public async Task<ActionResult<IEnumerable<WitsRecordDto>>> GetDataAsync(int idWell, DateTime begin = default,
int intervalSec = 600, int approxPointsCount = 1024, CancellationToken token = default) int intervalSec = 600, int approxPointsCount = 1024, CancellationToken token = default)
{ {
//int? idCompany = User.GetCompanyId(); int? idCompany = User.GetCompanyId();
//if (idCompany is null) if (idCompany is null)
// return Forbid(); return Forbid();
//bool isCompanyOwnsWell = await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, bool isCompanyOwnsWell = await wellService.IsCompanyInvolvedInWellAsync((int)idCompany,
// idWell, token).ConfigureAwait(false); idWell, token).ConfigureAwait(false);
//if (!isCompanyOwnsWell) if (!isCompanyOwnsWell)
// return Forbid(); return Forbid();
var content = await gtrRepository.GetAsync(idWell, begin, var content = await gtrRepository.GetAsync(idWell, begin,
intervalSec, approxPointsCount, token).ConfigureAwait(false); intervalSec, approxPointsCount, token).ConfigureAwait(false);