ExamReportingAvgRangeAppService.cs 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. namespace YBEE.EQM.Application;
  2. /// <summary>
  3. /// 统计报表之分数段报表服务
  4. /// </summary>
  5. [ApiDescriptionSettings(Name = "exam-reporting-avg-range")]
  6. [Route("exam/reporting/avg/range")]
  7. public class ExamReportingAvgRangeAppService : IDynamicApiController
  8. {
  9. private readonly IExamReportingAvgRangeService _examReportingAvgRangeService;
  10. public ExamReportingAvgRangeAppService(IExamReportingAvgRangeService examReportingAvgRangeService)
  11. {
  12. _examReportingAvgRangeService = examReportingAvgRangeService;
  13. }
  14. /// <summary>
  15. /// 导出表格
  16. /// </summary>
  17. /// <param name="examPlanId">监测计划ID</param>
  18. /// <returns></returns>
  19. [AllowAnonymous]
  20. public async Task<IActionResult> Export([FromQuery][Required] int examPlanId)
  21. {
  22. var (fileName, fileBytes) = await _examReportingAvgRangeService.Export(examPlanId);
  23. return new FileContentResult(fileBytes, "application/octet-stream")
  24. {
  25. FileDownloadName = fileName,
  26. };
  27. }
  28. }