TDashboardelecdataController.java 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. package com.ruoyi.project.aspen.controller;
  2. import java.util.List;
  3. import com.ruoyi.project.aspen.domain.TDashboardelecdata;
  4. import com.ruoyi.project.aspen.service.ITDashboardelecdataService;
  5. import org.springframework.security.access.prepost.PreAuthorize;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.PostMapping;
  9. import org.springframework.web.bind.annotation.PutMapping;
  10. import org.springframework.web.bind.annotation.DeleteMapping;
  11. import org.springframework.web.bind.annotation.PathVariable;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RestController;
  15. import com.ruoyi.framework.aspectj.lang.annotation.Log;
  16. import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
  17. import com.ruoyi.project.aspen.domain.TDashboardelecdata;
  18. import com.ruoyi.project.aspen.service.ITDashboardelecdataService;
  19. import com.ruoyi.framework.web.controller.BaseController;
  20. import com.ruoyi.framework.web.domain.AjaxResult;
  21. import com.ruoyi.common.utils.poi.ExcelUtil;
  22. import com.ruoyi.framework.web.page.TableDataInfo;
  23. /**
  24. * 电厂大屏DASHBOARDELEC抓取数据Controller
  25. *
  26. * @author ruoyi
  27. * @date 2022-03-11
  28. */
  29. @RestController
  30. @RequestMapping("/aspen/dashboardelecdata")
  31. public class TDashboardelecdataController extends BaseController
  32. {
  33. @Autowired
  34. private ITDashboardelecdataService tDashboardelecdataService;
  35. /**
  36. * 查询电厂大屏DASHBOARDELEC抓取数据列表
  37. */
  38. @PreAuthorize("@ss.hasPermi('aspen:dashboardelecdata:list')")
  39. @GetMapping("/list")
  40. public TableDataInfo list(TDashboardelecdata tDashboardelecdata)
  41. {
  42. startPage();
  43. List<TDashboardelecdata> list = tDashboardelecdataService.selectTDashboardelecdataList(tDashboardelecdata);
  44. return getDataTable(list);
  45. }
  46. /**
  47. * 导出电厂大屏DASHBOARDELEC抓取数据列表
  48. */
  49. @PreAuthorize("@ss.hasPermi('aspen:dashboardelecdata:export')")
  50. @Log(title = "电厂大屏DASHBOARDELEC抓取数据", businessType = BusinessType.EXPORT)
  51. @GetMapping("/export")
  52. public AjaxResult export(TDashboardelecdata tDashboardelecdata)
  53. {
  54. List<TDashboardelecdata> list = tDashboardelecdataService.selectTDashboardelecdataList(tDashboardelecdata);
  55. ExcelUtil<TDashboardelecdata> util = new ExcelUtil<TDashboardelecdata>(TDashboardelecdata.class);
  56. return util.exportExcel(list, "dashboardelecdata");
  57. }
  58. /**
  59. * 获取电厂大屏DASHBOARDELEC抓取数据详细信息
  60. */
  61. @PreAuthorize("@ss.hasPermi('aspen:dashboardelecdata:query')")
  62. @GetMapping(value = "/{id}")
  63. public AjaxResult getInfo(@PathVariable("id") Long id)
  64. {
  65. return AjaxResult.success(tDashboardelecdataService.selectTDashboardelecdataById(id));
  66. }
  67. /**
  68. * 新增电厂大屏DASHBOARDELEC抓取数据
  69. */
  70. @PreAuthorize("@ss.hasPermi('aspen:dashboardelecdata:add')")
  71. @Log(title = "电厂大屏DASHBOARDELEC抓取数据", businessType = BusinessType.INSERT)
  72. @PostMapping
  73. public AjaxResult add(@RequestBody TDashboardelecdata tDashboardelecdata)
  74. {
  75. return toAjax(tDashboardelecdataService.insertTDashboardelecdata(tDashboardelecdata));
  76. }
  77. /**
  78. * 修改电厂大屏DASHBOARDELEC抓取数据
  79. */
  80. @PreAuthorize("@ss.hasPermi('aspen:dashboardelecdata:edit')")
  81. @Log(title = "电厂大屏DASHBOARDELEC抓取数据", businessType = BusinessType.UPDATE)
  82. @PutMapping
  83. public AjaxResult edit(@RequestBody TDashboardelecdata tDashboardelecdata)
  84. {
  85. return toAjax(tDashboardelecdataService.updateTDashboardelecdata(tDashboardelecdata));
  86. }
  87. /**
  88. * 删除电厂大屏DASHBOARDELEC抓取数据
  89. */
  90. @PreAuthorize("@ss.hasPermi('aspen:dashboardelecdata:remove')")
  91. @Log(title = "电厂大屏DASHBOARDELEC抓取数据", businessType = BusinessType.DELETE)
  92. @DeleteMapping("/{ids}")
  93. public AjaxResult remove(@PathVariable Long[] ids)
  94. {
  95. return toAjax(tDashboardelecdataService.deleteTDashboardelecdataByIds(ids));
  96. }
  97. /**
  98. * 查询最后一条dashboard抓取数据
  99. */
  100. @PreAuthorize("@ss.hasPermi('aspen:dashboardelecdata:query')")
  101. @GetMapping("/selectLast")
  102. public AjaxResult selectLast(TDashboardelecdata tDashboardelecdata)
  103. {
  104. TDashboardelecdata tDashboardelecdata1 = tDashboardelecdataService.selectLast(tDashboardelecdata);
  105. return AjaxResult.success(tDashboardelecdata1);
  106. }
  107. /**
  108. * 查询最近31条DASHBOARD每日抓取数据列表
  109. */
  110. @PreAuthorize("@ss.hasPermi('aspen:dashboardday:list')")
  111. @GetMapping("/month")
  112. public AjaxResult selectMonth(TDashboardelecdata tDashboardelecdata)
  113. {
  114. TDashboardelecdata tDashboardelecdata1 = tDashboardelecdataService.selectLast(tDashboardelecdata);
  115. return AjaxResult.success(tDashboardelecdata1);
  116. }
  117. }