ExamPaperAppService.cs 4.3 KB

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