ExamOrgScoreReportAppService.cs 2.3 KB

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