forked from ddrilling/AsbCloudServer
Фикс получения фиктивных суточных отчётов
This commit is contained in:
parent
f2867794d1
commit
139a66a2c9
@ -177,8 +177,7 @@ public class DailyReportService : IDailyReportService
|
|||||||
datesRange.To = finishDate;
|
datesRange.To = finishDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.Count = (int)(Math.Ceiling((datesRange.To - DateTimeOffset.UnixEpoch).TotalDays)
|
result.Count = (datesRange.To.Day - DateTimeOffset.UnixEpoch.Day) - (datesRange.From.Day - DateTimeOffset.UnixEpoch.Day);
|
||||||
- Math.Floor((datesRange.From - DateTimeOffset.UnixEpoch).TotalDays));
|
|
||||||
|
|
||||||
var existingDailyReports = await dailyReportRepository.GetAsync(idWell, request, cancellationToken);
|
var existingDailyReports = await dailyReportRepository.GetAsync(idWell, request, cancellationToken);
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ public class DailyReportServiceTest
|
|||||||
IdParentCategory = 4001,
|
IdParentCategory = 4001,
|
||||||
IdWellSectionType = 1,
|
IdWellSectionType = 1,
|
||||||
OperationCategoryName = "Механическое. бурение",
|
OperationCategoryName = "Механическое. бурение",
|
||||||
DateStart = new DateTime(2023, 10, 26),
|
DateStart = new DateTime(2023, 10, 26, 0, 0, 0),
|
||||||
DepthStart = 80,
|
DepthStart = 80,
|
||||||
DepthEnd = 150,
|
DepthEnd = 150,
|
||||||
DurationHours = 8,
|
DurationHours = 8,
|
||||||
@ -169,7 +169,7 @@ public class DailyReportServiceTest
|
|||||||
OperationCategoryName = "Механическое. бурение",
|
OperationCategoryName = "Механическое. бурение",
|
||||||
IdWellSectionType = 1,
|
IdWellSectionType = 1,
|
||||||
IdParentCategory = 4001,
|
IdParentCategory = 4001,
|
||||||
DateStart = new DateTime(2023, 10, 26),
|
DateStart = new DateTime(2023, 10, 26, 23, 59, 59),
|
||||||
DepthStart = 150,
|
DepthStart = 150,
|
||||||
DepthEnd = 200,
|
DepthEnd = 200,
|
||||||
DurationHours = 8,
|
DurationHours = 8,
|
||||||
@ -507,7 +507,7 @@ public class DailyReportServiceTest
|
|||||||
public async Task GetAsync_ShouldReturn_FictiveDailyReport()
|
public async Task GetAsync_ShouldReturn_FictiveDailyReport()
|
||||||
{
|
{
|
||||||
//arrange
|
//arrange
|
||||||
var expectedCount = (fakeLastFactWellOperation.DateStart - fakeFirstFactWellOperation.DateStart).TotalDays + 1;
|
var expectedCount = fakeLastFactWellOperation.DateStart.Day - fakeFirstFactWellOperation.DateStart.Day;
|
||||||
|
|
||||||
//act
|
//act
|
||||||
var result = await dailyReportService.GetAsync(idWell, new FileReportRequest(), CancellationToken.None);
|
var result = await dailyReportService.GetAsync(idWell, new FileReportRequest(), CancellationToken.None);
|
||||||
|
Loading…
Reference in New Issue
Block a user