ExamDataReportAppService.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application;
  3. /// <summary>
  4. /// 监测数据上报类型管理服务
  5. /// </summary>
  6. [ApiDescriptionSettings(Name = "exam-data-report")]
  7. [Route("exam/data/report")]
  8. public class ExamDataReportAppService : IDynamicApiController
  9. {
  10. private readonly IExamDataReportService _examDataReportService;
  11. public ExamDataReportAppService(IExamDataReportService examDataReportService)
  12. {
  13. _examDataReportService = examDataReportService;
  14. }
  15. #region 创建更新
  16. /// <summary>
  17. /// 添加上报类型
  18. /// </summary>
  19. /// <param name="input"></param>
  20. /// <returns></returns>
  21. public async Task Add(AddExamDataReportInput input)
  22. {
  23. await _examDataReportService.Add(input);
  24. }
  25. /// <summary>
  26. /// 更新上报类型
  27. /// </summary>
  28. /// <param name="input"></param>
  29. /// <returns></returns>
  30. public async Task Update(UpdateExamDataReportInput input)
  31. {
  32. await _examDataReportService.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 _examDataReportService.Del(input);
  42. }
  43. #endregion
  44. #region 状态处理
  45. /// <summary>
  46. /// 开始
  47. /// </summary>
  48. /// <param name="input"></param>
  49. /// <returns></returns>
  50. public async Task Start(BaseId input)
  51. {
  52. await _examDataReportService.Start(input);
  53. }
  54. /// <summary>
  55. /// 结束
  56. /// </summary>
  57. /// <param name="input"></param>
  58. /// <returns></returns>
  59. public async Task Stop(BaseId input)
  60. {
  61. await _examDataReportService.Stop(input);
  62. }
  63. /// <summary>
  64. /// 取消
  65. /// </summary>
  66. /// <param name="input"></param>
  67. /// <returns></returns>
  68. public async Task Cancel(BaseId input)
  69. {
  70. await _examDataReportService.Cancel(input);
  71. }
  72. #endregion
  73. #region 查询
  74. /// <summary>
  75. /// 根据ID获取监测数据上报类型
  76. /// </summary>
  77. /// <param name="id"></param>
  78. /// <returns></returns>
  79. public async Task<ExamDataReportOutput> GetById([FromQuery][Required] int id)
  80. {
  81. return await _examDataReportService.GetById(id);
  82. }
  83. /// <summary>
  84. /// 根据监测计划ID获取数据上报类型列表
  85. /// </summary>
  86. /// <param name="examPlanId"></param>
  87. /// <returns></returns>
  88. public async Task<List<ExamDataReportOutput>> GetListByExamPlanId([FromQuery][Required] int examPlanId)
  89. {
  90. return await _examDataReportService.GetListByExamPlanId(examPlanId);
  91. }
  92. #endregion
  93. }