forked from ddrilling/AsbCloudServer
#20402628 Fix report.
- Атрибут валидации даты - Даты по умолчанию - мин и макс дата по телеметрии САУБ.
This commit is contained in:
parent
cef609fbdb
commit
d88ea454a8
@ -1,3 +1,4 @@
|
||||
using AsbCloudApp.ValidationAttributes;
|
||||
using System;
|
||||
|
||||
namespace AsbCloudApp.Requests;
|
||||
@ -20,10 +21,12 @@ public class ReportParametersRequest
|
||||
/// <summary>
|
||||
/// Дата начала интервала
|
||||
/// </summary>
|
||||
[DateValidation(GtDate ="2000-01-01")]
|
||||
public DateTime Begin { get; set; } = default;
|
||||
|
||||
/// <summary>
|
||||
/// Дата окончания интервала
|
||||
/// </summary>
|
||||
public DateTime End { get; set; } = default;
|
||||
/// <summary>
|
||||
/// Дата окончания интервала
|
||||
/// </summary>
|
||||
[DateValidation(GtDate ="2000-01-01")]
|
||||
public DateTime End { get; set; } = default;
|
||||
}
|
@ -40,6 +40,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AsbSaubReport" Version="3.2.1" />
|
||||
<PackageReference Include="AsbSaubReportLas" Version="3.2.1" />
|
||||
<PackageReference Include="AsbSaubReportPdf" Version="3.2.1" />
|
||||
<PackageReference Include="CliWrap" Version="3.6.0" />
|
||||
<PackageReference Include="ClosedXML" Version="0.96.0" />
|
||||
<PackageReference Include="itext7" Version="7.2.3" />
|
||||
@ -59,15 +62,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="AsbSaubReport">
|
||||
<HintPath>CommonLibs\AsbSaubReport.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AsbSaubReportLas">
|
||||
<HintPath>CommonLibs\AsbSaubReportLas.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AsbSaubReportPdf">
|
||||
<HintPath>CommonLibs\AsbSaubReportPdf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AsbWitsInfo">
|
||||
<HintPath>CommonLibs\AsbWitsInfo.dll</HintPath>
|
||||
</Reference>
|
||||
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1,7 +1,6 @@
|
||||
using AsbCloudApp.Exceptions;
|
||||
using AsbCloudDb.Model;
|
||||
using AsbSaubReport.Model;
|
||||
using iText.Forms.Xfdf;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -168,6 +168,14 @@ namespace AsbCloudInfrastructure.Services
|
||||
//PDF
|
||||
_ => new AsbSaubReportPdf.ReprotGeneratorPdf(dataSource),
|
||||
};
|
||||
|
||||
if(begin == default || end == default)
|
||||
{
|
||||
var analyzeResult = dataSource.Analyze();
|
||||
begin = begin == default ? analyzeResult.MinDate : begin;
|
||||
end = end == default ? begin.AddDays(1) : end;
|
||||
}
|
||||
|
||||
generator.Begin = begin;
|
||||
generator.End = end;
|
||||
generator.Step = TimeSpan.FromSeconds(stepSeconds);
|
||||
|
@ -1 +1 @@
|
||||
<!doctype html><html lang="ru"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="white"/><meta name="theme-color" media="(prefers-color-scheme: light)" content="white"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="black"/><meta name="description" content="Онлайн мониторинг процесса бурения в реальном времени в офисе заказчика"/><title>DDrilling</title><script defer="defer" src="/runtime~main.af5f343a.js"></script><script defer="defer" src="/vendors.a8e3bd9c.js"></script><script defer="defer" src="/main.8a0ba951.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="ru"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="white"/><meta name="theme-color" media="(prefers-color-scheme: light)" content="white"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="black"/><meta name="description" content="Онлайн мониторинг процесса бурения в реальном времени в офисе заказчика"/><title>DDrill</title><script defer="defer" src="/runtime~main.5f05be65.js"></script><script defer="defer" src="/vendors.408d069b.js"></script><script defer="defer" src="/main.c3c166db.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
Loading…
Reference in New Issue
Block a user