ExamResultService.cs 931 B

12345678910111213141516171819202122232425262728293031
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application;
  3. /// <summary>
  4. /// 反馈结果管理服务(各机构均适用)
  5. /// </summary>
  6. public class ExamResultService(IRepository<ExamResult> rep) : IExamResultService, ITransient
  7. {
  8. /// <summary>
  9. /// 添加监测结果文件
  10. /// </summary>
  11. /// <param name="input"></param>
  12. /// <returns></returns>
  13. public async Task Add(AddExamResultInput input)
  14. {
  15. var item = input.Adapt<ExamResult>();
  16. await rep.InsertNowAsync(item);
  17. }
  18. /// <summary>
  19. /// 根据发布内容ID获取文件列表
  20. /// </summary>
  21. /// <param name="publishId"></param>
  22. /// <returns></returns>
  23. public async Task<List<ExamResultOutput>> GetListByPublishId(int publishId)
  24. {
  25. var items = await rep.DetachedEntities.Where(t => t.ExamDataPublishId == publishId).ProjectToType<ExamResultOutput>().ToListAsync();
  26. return items;
  27. }
  28. }