ExamPlanAppService.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application;
  3. /// <summary>
  4. /// 监测计划管理服务
  5. /// </summary>
  6. [ApiDescriptionSettings(Name = "exam-plan")]
  7. [Route("exam/plan")]
  8. public class ExamPlanAppService(IExamPlanService examPlanService) : IDynamicApiController
  9. {
  10. /// <summary>
  11. /// 添加监测计划
  12. /// </summary>
  13. /// <param name="input"></param>
  14. /// <returns></returns>
  15. public async Task Add(AddExamPlanInput input)
  16. {
  17. await examPlanService.Add(input);
  18. }
  19. /// <summary>
  20. /// 更新监测计划
  21. /// </summary>
  22. /// <param name="input"></param>
  23. /// <returns></returns>
  24. public async Task Update(UpdateExamPlanInput input)
  25. {
  26. await examPlanService.Update(input);
  27. }
  28. /// <summary>
  29. /// 删除监测计划
  30. /// </summary>
  31. /// <param name="input"></param>
  32. /// <returns></returns>
  33. public async Task Del(BaseId input)
  34. {
  35. await examPlanService.Del(input);
  36. }
  37. /// <summary>
  38. /// 开始监测
  39. /// </summary>
  40. /// <param name="input"></param>
  41. /// <returns></returns>
  42. public async Task Start(BaseId input)
  43. {
  44. await examPlanService.Start(input);
  45. }
  46. /// <summary>
  47. /// 结束监测
  48. /// </summary>
  49. /// <param name="input"></param>
  50. /// <returns></returns>
  51. public async Task Stop(BaseId input)
  52. {
  53. await examPlanService.Stop(input);
  54. }
  55. /// <summary>
  56. /// 取消监测
  57. /// </summary>
  58. /// <param name="input"></param>
  59. /// <returns></returns>
  60. public async Task Cancel(BaseId input)
  61. {
  62. await examPlanService.Cancel(input);
  63. }
  64. /// <summary>
  65. /// 根据ID获取监测计划
  66. /// </summary>
  67. /// <param name="id"></param>
  68. /// <returns></returns>
  69. public async Task<ExamPlanOutput> GetById([FromQuery][Required] int id)
  70. {
  71. return await examPlanService.GetById(id);
  72. }
  73. /// <summary>
  74. /// 分页查询监测计划列表
  75. /// </summary>
  76. /// <param name="input"></param>
  77. /// <returns></returns>
  78. public async Task<PageResult<ExamPlanOutput>> QueryPageList(ExamPlanPageInput input)
  79. {
  80. return await examPlanService.QueryPageList(input);
  81. }
  82. /// <summary>
  83. /// 获取我的单据状态数量
  84. /// </summary>
  85. /// <returns></returns>
  86. public async Task<List<StatusCount>> QueryStatusCount(ExamPlanPageInput input)
  87. {
  88. return await examPlanService.QueryStatusCount(input);
  89. }
  90. /// <summary>
  91. /// 获取最近5个抽测参照成绩监测计划
  92. /// </summary>
  93. /// <param name="id"></param>
  94. /// <returns></returns>
  95. public async Task<List<ExamPlanOutput>> GetSampleRefPlanList(int id)
  96. {
  97. return await examPlanService.GetSampleRefPlanList(id);
  98. }
  99. }