ExamOrgScoreReportAppService.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. namespace YBEE.EQM.Application;
  2. /// <summary>
  3. /// 校考成绩上报管理服务
  4. /// </summary>
  5. [ApiDescriptionSettings(Name = "exam-org-score-report")]
  6. [Route("exam/org/score/report")]
  7. public class ExamOrgScoreReportAppService(IExamOrgScoreReportService examOrgScoreReportService) : IDynamicApiController
  8. {
  9. private readonly IExamOrgScoreReportService _examOrgScoreReportService = examOrgScoreReportService;
  10. /// <summary>
  11. /// 上传校考成绩
  12. /// </summary>
  13. /// <param name="input"></param>
  14. /// <returns></returns>
  15. [RequestSizeLimit(1024 * 1024 * 20)]
  16. [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)]
  17. public async Task<UploadExamOrgScoreReportOutput> Upload([FromForm] UploadExamOrgScoreReportInput input)
  18. {
  19. return await _examOrgScoreReportService.Upload(input);
  20. }
  21. /// <summary>
  22. /// 查询某科目校考成绩上报数据
  23. /// </summary>
  24. /// <param name="input"></param>
  25. /// <returns></returns>
  26. public async Task<ExamOrgScoreReportOutput> QueryOne(QueryExamOrgScoreReportInput input)
  27. {
  28. return await _examOrgScoreReportService.QueryOne(input);
  29. }
  30. /// <summary>
  31. /// 获取机构校考上报明细列表
  32. /// </summary>
  33. /// <param name="examPlanId"></param>
  34. /// <returns></returns>
  35. public async Task<List<ExamOrgScoreReportItem>> GetListByExamPlanId(int examPlanId)
  36. {
  37. return await _examOrgScoreReportService.GetListByExamPlanId(examPlanId);
  38. }
  39. ///// <summary>
  40. ///// 删除
  41. ///// </summary>
  42. ///// <param name="input"></param>
  43. ///// <returns></returns>
  44. //public async Task Del(DeleteAttachmentInput input)
  45. //{
  46. // await _examOrgScoreReportService.Del(input);
  47. //}
  48. /// <summary>
  49. /// 合并学校上报小题分
  50. /// </summary>
  51. /// <param name="examPlanId"></param>
  52. /// <returns></returns>
  53. public async Task<IActionResult> MergeMinorScore(int examPlanId)
  54. {
  55. var (fileName, fileBytes) = await _examOrgScoreReportService.MergeMinorScore(examPlanId);
  56. return new FileContentResult(fileBytes, "application/octet-stream")
  57. {
  58. FileDownloadName = fileName,
  59. };
  60. }
  61. }