ExamPlanAppService.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 : IDynamicApiController
  9. {
  10. private readonly IExamPlanService _examPlanService;
  11. public ExamPlanAppService(IExamPlanService examPlanService)
  12. {
  13. _examPlanService = examPlanService;
  14. }
  15. /// <summary>
  16. /// 添加监测计划
  17. /// </summary>
  18. /// <param name="input"></param>
  19. /// <returns></returns>
  20. public async Task Add(AddExamPlanInput input)
  21. {
  22. await _examPlanService.Add(input);
  23. }
  24. /// <summary>
  25. /// 更新监测计划
  26. /// </summary>
  27. /// <param name="input"></param>
  28. /// <returns></returns>
  29. public async Task Update(UpdateExamPlanInput input)
  30. {
  31. await _examPlanService.Update(input);
  32. }
  33. /// <summary>
  34. /// 删除监测计划
  35. /// </summary>
  36. /// <param name="input"></param>
  37. /// <returns></returns>
  38. public async Task Del(BaseId input)
  39. {
  40. await _examPlanService.Del(input);
  41. }
  42. /// <summary>
  43. /// 开始监测
  44. /// </summary>
  45. /// <param name="input"></param>
  46. /// <returns></returns>
  47. public async Task Start(BaseId input)
  48. {
  49. await _examPlanService.Start(input);
  50. }
  51. /// <summary>
  52. /// 结束监测
  53. /// </summary>
  54. /// <param name="input"></param>
  55. /// <returns></returns>
  56. public async Task Stop(BaseId input)
  57. {
  58. await _examPlanService.Stop(input);
  59. }
  60. /// <summary>
  61. /// 取消监测
  62. /// </summary>
  63. /// <param name="input"></param>
  64. /// <returns></returns>
  65. public async Task Cancel(BaseId input)
  66. {
  67. await _examPlanService.Cancel(input);
  68. }
  69. /// <summary>
  70. /// 根据ID获取监测计划
  71. /// </summary>
  72. /// <param name="id"></param>
  73. /// <returns></returns>
  74. public async Task<ExamPlanOutput> GetById([FromQuery][Required] int id)
  75. {
  76. return await _examPlanService.GetById(id);
  77. }
  78. /// <summary>
  79. /// 分页查询监测计划列表
  80. /// </summary>
  81. /// <param name="input"></param>
  82. /// <returns></returns>
  83. public async Task<PageResult<ExamPlanOutput>> QueryPageList(ExamPlanPageInput input)
  84. {
  85. return await _examPlanService.QueryPageList(input);
  86. }
  87. /// <summary>
  88. /// 获取我的单据状态数量
  89. /// </summary>
  90. /// <returns></returns>
  91. public async Task<List<StatusCount>> QueryStatusCount(ExamPlanPageInput input)
  92. {
  93. return await _examPlanService.QueryStatusCount(input);
  94. }
  95. }