using YBEE.EQM.Core; namespace YBEE.EQM.Application; /// /// 试卷管理服务 /// [ApiDescriptionSettings(Name = "exam-paper")] [Route("exam/paper")] public class ExamPaperAppService : IDynamicApiController { private readonly IExamPaperService _examPaperService; public ExamPaperAppService(IExamPaperService examPaperService) { _examPaperService = examPaperService; } /// /// 按监测计划初始化试卷 /// /// /// [UnitOfWork] public async Task BatchInit(ExamPaperBatchInitInput input) { await _examPaperService.BatchInit(input); } /// /// 分配双向细目表编制人 /// /// /// public async Task AssignTwclWriter(AssignExamPaperWriterInput input) { await _examPaperService.AssignTwclWriter(input); } /// /// 分配问题建议撰写人 /// /// /// public async Task AssignSuggestionWriter(AssignExamPaperWriterInput input) { await _examPaperService.AssignSuggestionWriter(input); } /// /// 根据ID获取试卷详情 /// /// /// public async Task GetById(int id) { return await _examPaperService.GetById(id); } /// /// 根据监测计划ID获取试卷列表(管理端) /// /// /// public async Task> GetListByExamPlanId(int examPlanId) { return await _examPaperService.GetListByExamPlanId(examPlanId); } /// /// 获取双向细目表监测计划列表(管理端) /// /// /// public async Task> QueryExamPlanPageList(ExamPlanPageInput input) { return await _examPaperService.QueryExamPlanPageList(input); } /// /// 导出TQES导入文件格式文件包 /// /// /// /// [AllowAnonymous] public async Task ExportTqesFile([Required] int examPlanId) { var (fileName, fileBytes) = await _examPaperService.ExportTqesFile(examPlanId); return new FileContentResult(fileBytes, "application/octet-stream") { FileDownloadName = fileName, }; } #region 编撰者 /// /// 分页查询编撰人监测计划列表 /// /// /// public async Task> QueryWriterExamPlanPageList(ExamPaperExamPlanPageInput input) { return await _examPaperService.QueryWriterExamPlanPageList(input); } /// /// 根据监测计划ID获取待处理试卷列表 /// /// /// /// public async Task> GetWriterListByExamPlanId([Required] int examPlanId, [Required] ExamPaperWriterType writerType) { return await _examPaperService.GetWriterListByExamPlanId(examPlanId, writerType); } /// /// 保存问题建议 /// /// /// public async Task SaveSuggestion(SaveExamPaperSuggestion input) { await _examPaperService.SaveSuggestion(input); } /// /// 提交双向细目表 /// /// /// public async Task SubmitTwcl(BaseId input) { await _examPaperService.SubmitTwcl(input); } /// /// 提交问题建议 /// /// /// public async Task SubmitSuggestion(BaseId input) { await _examPaperService.SubmitSuggestion(input); } #endregion }