RealTimeDisplayController.java 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. package com.jiayue.biz.controller;
  2. import com.jiayue.biz.service.*;
  3. import com.jiayue.common.annotation.Log;
  4. import com.jiayue.common.core.controller.BaseController;
  5. import com.jiayue.common.core.domain.AjaxResult;
  6. import com.jiayue.common.core.page.TableDataInfo;
  7. import com.jiayue.common.enums.BusinessType;
  8. import lombok.RequiredArgsConstructor;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.web.bind.annotation.*;
  11. import javax.servlet.http.HttpServletRequest;
  12. import javax.servlet.http.HttpServletResponse;
  13. import java.util.Date;
  14. import java.util.List;
  15. import java.util.Map;
  16. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  17. @RestController
  18. @RequestMapping("/dataQuery/RealTimeDisplay")
  19. public class RealTimeDisplayController extends BaseController {
  20. @Autowired
  21. RealTimeDisplayService realTimeDisplayService;
  22. @Autowired
  23. WindTowerDataParentTableService windTowerDataParentTableService;
  24. //湍流
  25. @RequestMapping("/turbulence")
  26. public TableDataInfo realDisplayTur(Long startTime, Long endTime, String equipmentId, String height) {
  27. List turbulence = realTimeDisplayService.turbulence(startTime, endTime, equipmentId, height);
  28. return getDataTable(turbulence);
  29. }
  30. //威布尔
  31. @RequestMapping("/weibull")
  32. public TableDataInfo realDisplayWeibull(Long startTime, Long endTime, String equipmentId, String height) {
  33. List<Object> weibull = realTimeDisplayService.weibull(startTime, endTime, equipmentId, height);
  34. return getDataTable(weibull);
  35. }
  36. /*12个月的测风塔数据完整性*/
  37. @GetMapping(value = "/dataIntegrity")
  38. public AjaxResult getDataIntegrity(String equipmentId) {
  39. return AjaxResult.success(realTimeDisplayService.dataIntegrity(equipmentId));
  40. }
  41. /**
  42. * 风速风向折线图
  43. *
  44. * @param startTime 开始时间
  45. * @param endTime 结束时间
  46. * @param equipmentId 测风塔编号
  47. * @param height 层高
  48. * @return 风速风向
  49. */
  50. @GetMapping("/wsAndWd")
  51. @ResponseBody
  52. public AjaxResult selectAll(Long startTime, Long endTime, String equipmentId, String height) {
  53. Map<String, Object> allWs = realTimeDisplayService.selectWsAndWd(startTime, endTime, equipmentId, height);
  54. return AjaxResult.success(allWs);
  55. }
  56. //获取测风塔数据最后一条数据时间到前一周数据 时间段内所有时间点
  57. @GetMapping("/getStartTimeAndEndTime")
  58. public AjaxResult getStartTimeAndEndTime() {
  59. return AjaxResult.success(realTimeDisplayService.getStartTimeAndEndTime());
  60. }
  61. //风功率密度(风向玫瑰图)
  62. @GetMapping(value = "/getWindEnergyDensity")
  63. public AjaxResult getTPAndAirDensity(Long startTime, Long endTime, String equipmentId, String height) throws Exception {
  64. return AjaxResult.success(realTimeDisplayService.getWindEnergyDensity(startTime, endTime, equipmentId, height));
  65. }
  66. //获取风切变指数(风向玫瑰图)
  67. @GetMapping(value = "/getWindShear")
  68. public AjaxResult getWindShear(Long startTime, Long endTime, String equipmentId, String height,String heightMin) {
  69. return AjaxResult.success(realTimeDisplayService.getWindShear(startTime, endTime, equipmentId, height,heightMin));
  70. }
  71. //获取湍流(风向玫瑰图)
  72. @GetMapping(value = "/getTurbulenceIntensity")
  73. public AjaxResult getTurbulenceIntensity(Long startTime, Long endTime, String equipmentId, String height) {
  74. return AjaxResult.success(realTimeDisplayService.getTurbulenceIntensity(startTime, endTime, equipmentId, height));
  75. }
  76. //风况对比
  77. @GetMapping(value = "/getWindPowerDensityAndAverageWindSpeed")
  78. public AjaxResult getWindPowerDensityAndAverageWindSpeed(Long startTime, Long endTime, String height, String eqId) {
  79. return AjaxResult.success(realTimeDisplayService.getWindPowerDensityAndAverageWindSpeed(startTime, endTime, height, eqId));
  80. }
  81. /*
  82. * 风向玫瑰图
  83. * */
  84. @GetMapping(value = "/getWindRose")
  85. public AjaxResult getWindRose(Long startTime, Long endTime, String equipmentId, String height) {
  86. return AjaxResult.success(realTimeDisplayService.queryCharts(startTime, endTime, equipmentId, height));
  87. }
  88. //空气密度
  89. @GetMapping(value = "/getTPAndAirDensity")
  90. public AjaxResult getTPAndAirDensity(Long startTime, Long endTime, String equipmentId) {
  91. return AjaxResult.success(realTimeDisplayService.queryTPAndAirDensity(startTime, endTime, equipmentId));
  92. }
  93. /**
  94. * 根据时间分页查询测风塔数据
  95. */
  96. @PostMapping("/time")
  97. public AjaxResult selectTime(Integer current, Integer size, Long startTime, Long endTime, String equipmentId) {
  98. return AjaxResult.success(windTowerDataParentTableService.selectDataPageByBetweenTimeAndEquipmetId(new Date(startTime), new Date(endTime), equipmentId, current, size));
  99. }
  100. /**
  101. * 导出测风塔数据
  102. */
  103. @Log(title = "测风塔数据", businessType = BusinessType.EXPORT)
  104. @GetMapping("/export")
  105. public void export(HttpServletResponse response, Long startTime, Long endTime, String equipmentId) {
  106. windTowerDataParentTableService.export(response, startTime, endTime, equipmentId);
  107. }
  108. @Log(title = "测风塔数据文件", businessType = BusinessType.EXPORT)
  109. @GetMapping("/exportAll")
  110. public void exportAll(HttpServletRequest request, HttpServletResponse response, String equipmentId,Long startTime,Long endTime) {
  111. windTowerDataParentTableService.exportAll(request, response, equipmentId,startTime,endTime);
  112. }
  113. }