forked from ddrilling/AsbCloudServer
Добавлено заполнение блока с фактическими операциями при формировании фиктивного списка суточных отчётов
This commit is contained in:
parent
b5985b0fd8
commit
71c9be6a73
@ -152,6 +152,7 @@ public class DailyReportService : IDailyReportService
|
||||
var dailyReports = new List<DailyReportDto>();
|
||||
|
||||
var existingDailyReports = await dailyReportRepository.GetAsync(idWell, request, cancellationToken);
|
||||
var factWellOperations = await GetFactWellOperationsAsync(idWell, null, cancellationToken);
|
||||
|
||||
if (request.GeDate.HasValue)
|
||||
{
|
||||
@ -201,19 +202,16 @@ public class DailyReportService : IDailyReportService
|
||||
|
||||
void AddDailyReport(DateTime date)
|
||||
{
|
||||
var existingDailyReport = existingDailyReports.FirstOrDefault(d => d.IdWell == idWell && d.Date == date);
|
||||
var dailyReport = existingDailyReports.FirstOrDefault(d => d.IdWell == idWell && d.Date == date)
|
||||
?? new DailyReportDto
|
||||
{
|
||||
Date = date,
|
||||
IdWell = idWell
|
||||
};
|
||||
|
||||
if (existingDailyReport is not null)
|
||||
{
|
||||
dailyReports.Add(existingDailyReport);
|
||||
return;
|
||||
}
|
||||
AddFactWellOperationBlock(dailyReport, factWellOperations.Where(o => o.DateStart >= date && o.DateStart <= date.AddDays(1)));
|
||||
|
||||
dailyReports.Add(new DailyReportDto
|
||||
{
|
||||
Date = date,
|
||||
IdWell = idWell
|
||||
});
|
||||
dailyReports.Add(dailyReport);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user