ExamPaperAppService.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application;
  3. /// <summary>
  4. /// 试卷管理服务
  5. /// </summary>
  6. [ApiDescriptionSettings(Name = "exam-paper")]
  7. [Route("exam/paper")]
  8. public class ExamPaperAppService(IExamPaperService examPaperService) : IDynamicApiController
  9. {
  10. private readonly IExamPaperService _examPaperService = examPaperService;
  11. /// <summary>
  12. /// 按监测计划初始化试卷
  13. /// </summary>
  14. /// <param name="input"></param>
  15. /// <returns></returns>
  16. [UnitOfWork]
  17. public async Task BatchInit(ExamPaperBatchInitInput input)
  18. {
  19. await _examPaperService.BatchInit(input);
  20. }
  21. /// <summary>
  22. /// 分配双向细目表编制人
  23. /// </summary>
  24. /// <param name="input"></param>
  25. /// <returns></returns>
  26. public async Task AssignTwclWriter(AssignExamPaperWriterInput input)
  27. {
  28. await _examPaperService.AssignTwclWriter(input);
  29. }
  30. /// <summary>
  31. /// 分配问题建议撰写人
  32. /// </summary>
  33. /// <param name="input"></param>
  34. /// <returns></returns>
  35. public async Task AssignSuggestionWriter(AssignExamPaperWriterInput input)
  36. {
  37. await _examPaperService.AssignSuggestionWriter(input);
  38. }
  39. /// <summary>
  40. /// 根据ID获取试卷详情
  41. /// </summary>
  42. /// <param name="id"></param>
  43. /// <returns></returns>
  44. public async Task<ExamPaperOutput> GetById(int id)
  45. {
  46. return await _examPaperService.GetById(id);
  47. }
  48. /// <summary>
  49. /// 根据监测计划ID获取试卷列表(管理端)
  50. /// </summary>
  51. /// <param name="examPlanId"></param>
  52. /// <returns></returns>
  53. public async Task<List<ExamPaperLiteOutput>> GetListByExamPlanId(int examPlanId)
  54. {
  55. return await _examPaperService.GetListByExamPlanId(examPlanId);
  56. }
  57. /// <summary>
  58. /// 获取双向细目表监测计划列表(管理端)
  59. /// </summary>
  60. /// <param name="input"></param>
  61. /// <returns></returns>
  62. public async Task<PageResult<ExamPaperTodoPlanOutput>> QueryExamPlanPageList(ExamPlanPageInput input)
  63. {
  64. return await _examPaperService.QueryExamPlanPageList(input);
  65. }
  66. /// <summary>
  67. /// 导出TQES导入文件格式文件包
  68. /// </summary>
  69. /// <param name="examPlanId"></param>
  70. /// <returns></returns>
  71. /// <exception cref="Exception"></exception>
  72. public async Task<IActionResult> ExportTqesFile([Required] int examPlanId)
  73. {
  74. var (fileName, fileBytes) = await _examPaperService.ExportTqesFile(examPlanId);
  75. return new FileContentResult(fileBytes, "application/octet-stream")
  76. {
  77. FileDownloadName = fileName,
  78. };
  79. }
  80. #region 编撰者
  81. /// <summary>
  82. /// 分页查询编撰人监测计划列表
  83. /// </summary>
  84. /// <param name="input"></param>
  85. /// <returns></returns>
  86. public async Task<PageResult<ExamPaperTodoPlanOutput>> QueryWriterExamPlanPageList(ExamPaperExamPlanPageInput input)
  87. {
  88. return await _examPaperService.QueryWriterExamPlanPageList(input);
  89. }
  90. /// <summary>
  91. /// 根据监测计划ID获取待处理试卷列表
  92. /// </summary>
  93. /// <param name="examPlanId"></param>
  94. /// <param name="writerType"></param>
  95. /// <returns></returns>
  96. public async Task<List<ExamPaperLiteOutput>> GetWriterListByExamPlanId([Required] int examPlanId, [Required] ExamPaperWriterType writerType)
  97. {
  98. return await _examPaperService.GetWriterListByExamPlanId(examPlanId, writerType);
  99. }
  100. /// <summary>
  101. /// 保存问题建议
  102. /// </summary>
  103. /// <param name="input"></param>
  104. /// <returns></returns>
  105. public async Task SaveSuggestion(SaveExamPaperSuggestion input)
  106. {
  107. await _examPaperService.SaveSuggestion(input);
  108. }
  109. /// <summary>
  110. /// 提交双向细目表
  111. /// </summary>
  112. /// <param name="input"></param>
  113. /// <returns></returns>
  114. public async Task SubmitTwcl(BaseId input)
  115. {
  116. await _examPaperService.SubmitTwcl(input);
  117. }
  118. /// <summary>
  119. /// 提交问题建议
  120. /// </summary>
  121. /// <param name="input"></param>
  122. /// <returns></returns>
  123. public async Task SubmitSuggestion(BaseId input)
  124. {
  125. await _examPaperService.SubmitSuggestion(input);
  126. }
  127. #endregion
  128. }