ExamPlanAppService.cs 2.6 KB

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