fix: отчеты за период
This commit is contained in:
parent
c9852a5384
commit
e97902084f
@ -4,5 +4,5 @@ namespace Contracts.Services;
|
||||
|
||||
public interface IReportPeriodService
|
||||
{
|
||||
Task<IEnumerable<ChangeRecordViewModel>> GetReportData(DateTime from, DateTime to);
|
||||
Task<IEnumerable<ChangeRecordViewModel>> GetReportData(DateTime from, DateTime to, Guid userId);
|
||||
}
|
@ -19,13 +19,13 @@ public class ReportController : ControllerBase
|
||||
_reportOffsetFromPlanService = reportOffsetFromPlanService;
|
||||
}
|
||||
|
||||
[HttpGet("period")]
|
||||
[HttpGet("period/{id}")]
|
||||
public async Task<ActionResult<IEnumerable<ChangeRecordViewModel>>> GetReportData(
|
||||
[FromQuery] DateTime from, [FromQuery] DateTime to)
|
||||
[FromQuery] DateTime from, [FromQuery] DateTime to, Guid id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var periodData = await _reportPeriodService.GetReportData(from, to);
|
||||
var periodData = await _reportPeriodService.GetReportData(from, to, id);
|
||||
return Ok(periodData);
|
||||
}
|
||||
catch (ReportDataNotFoundException ex)
|
||||
|
@ -16,9 +16,9 @@ public class ReportPeriodService : IReportPeriodService
|
||||
_changeRecordRepo = changeRecordRepo;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<ChangeRecordViewModel>> GetReportData(DateTime from, DateTime to)
|
||||
public async Task<IEnumerable<ChangeRecordViewModel>> GetReportData(DateTime from, DateTime to, Guid userId)
|
||||
{
|
||||
var records = await _changeRecordRepo.GetList(new ChangeRecordSearch() { From = from, To = to });
|
||||
var records = await _changeRecordRepo.GetList(new ChangeRecordSearch() { From = from, To = to, UserId = userId });
|
||||
|
||||
if (!records.Any())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user