ExamReportingAvgRangeAppService.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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(IExamReportingAvgRangeService examReportingAvgRangeService) : IDynamicApiController
  8. {
  9. /// <summary>
  10. /// 导出全区表格
  11. /// </summary>
  12. /// <param name="examPlanId">监测计划ID</param>
  13. /// <returns></returns>
  14. public async Task<IActionResult> ExportTotal([FromQuery][Required] int examPlanId)
  15. {
  16. var (fileName, fileBytes) = await examReportingAvgRangeService.ExportTotal(examPlanId);
  17. return new FileContentResult(fileBytes, "application/octet-stream")
  18. {
  19. FileDownloadName = fileName,
  20. };
  21. }
  22. /// <summary>
  23. /// 导出各校分数段统计表
  24. /// </summary>
  25. /// <param name="examPlanId">监测计划ID</param>
  26. /// <returns></returns>
  27. /// <exception cref="Exception"></exception>
  28. public async Task<IActionResult> ExportOrg([FromQuery][Required] int examPlanId)
  29. {
  30. var (fileName, fileBytes) = await examReportingAvgRangeService.ExportOrg(examPlanId);
  31. return new FileContentResult(fileBytes, "application/octet-stream")
  32. {
  33. FileDownloadName = fileName,
  34. };
  35. }
  36. }