|
|
@@ -1,5 +1,6 @@
|
|
|
package com.ufo.project.forecast.shortterm.weather.controller;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import com.ufo.base.framework.aspectj.lang.annotation.Log;
|
|
|
import com.ufo.base.framework.aspectj.lang.enums.BusinessType;
|
|
|
import com.ufo.project.forecast.shortterm.weather.domain.DataShortTermWeatherForecastRaw;
|
|
|
+import com.ufo.project.forecast.shortterm.weather.domain.vo.ChartDataPair;
|
|
|
import com.ufo.project.forecast.shortterm.weather.domain.vo.PsfcChartResult;
|
|
|
import com.ufo.project.forecast.shortterm.weather.domain.vo.PsfcChartStat;
|
|
|
import com.ufo.project.forecast.shortterm.weather.domain.vo.RhsfcChartResult;
|
|
|
@@ -29,6 +31,7 @@ import com.ufo.project.forecast.shortterm.weather.domain.vo.TsfcChartStat;
|
|
|
import com.ufo.project.forecast.shortterm.weather.domain.vo.WsChartResult;
|
|
|
import com.ufo.project.forecast.shortterm.weather.domain.vo.WsChartStat;
|
|
|
import com.ufo.project.forecast.shortterm.weather.service.IDataShortTermWeatherForecastRawService;
|
|
|
+import com.ufo.project.weather.service.IDataWeatherLocalService;
|
|
|
import com.ufo.base.framework.web.controller.BaseController;
|
|
|
import com.ufo.base.framework.web.domain.AjaxResult;
|
|
|
import com.ufo.base.common.utils.poi.ExcelUtil;
|
|
|
@@ -47,6 +50,9 @@ public class DataShortTermWeatherForecastRawController extends BaseController
|
|
|
@Autowired
|
|
|
private IDataShortTermWeatherForecastRawService dataShortTermWeatherForecastRawService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IDataWeatherLocalService dataWeatherLocalService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询短期气象原始数据列表
|
|
|
*/
|
|
|
@@ -85,18 +91,20 @@ public class DataShortTermWeatherForecastRawController extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 统计风速曲线数据
|
|
|
+ * 统计风速曲线数据(短期预报 + 本地实测)
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('weather:weatherRaw:wschart')")
|
|
|
@GetMapping("/wschart")
|
|
|
public AjaxResult wschart(@RequestParam("stationId") Long stationId,
|
|
|
@RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime)
|
|
|
{
|
|
|
- return success(dataShortTermWeatherForecastRawService.getWsChart(stationId, startTime, endTime));
|
|
|
+ WsChartResult forecast = dataShortTermWeatherForecastRawService.getWsChart(stationId, startTime, endTime);
|
|
|
+ WsChartResult local = dataWeatherLocalService.getWsChart(stationId, startTime, endTime);
|
|
|
+ return success(new ChartDataPair<WsChartResult>(forecast, local));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 导出风速曲线数据
|
|
|
+ * 导出风速曲线数据(短期预报 + 本地实测,合并导出)
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('weather:weatherRaw:wschart')")
|
|
|
@Log(title = "风速曲线", businessType = BusinessType.EXPORT)
|
|
|
@@ -104,24 +112,36 @@ public class DataShortTermWeatherForecastRawController extends BaseController
|
|
|
public void wschartExport(HttpServletResponse response, @RequestParam("stationId") Long stationId,
|
|
|
@RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime)
|
|
|
{
|
|
|
- WsChartResult result = dataShortTermWeatherForecastRawService.getWsChart(stationId, startTime, endTime);
|
|
|
+ WsChartResult forecast = dataShortTermWeatherForecastRawService.getWsChart(stationId, startTime, endTime);
|
|
|
+ WsChartResult local = dataWeatherLocalService.getWsChart(stationId, startTime, endTime);
|
|
|
+ List<WsChartStat> stats = new ArrayList<WsChartStat>();
|
|
|
+ if (forecast.getStats() != null)
|
|
|
+ {
|
|
|
+ stats.addAll(forecast.getStats());
|
|
|
+ }
|
|
|
+ if (local.getStats() != null)
|
|
|
+ {
|
|
|
+ stats.addAll(local.getStats());
|
|
|
+ }
|
|
|
ExcelUtil<WsChartStat> util = new ExcelUtil<WsChartStat>(WsChartStat.class);
|
|
|
- util.exportExcel(response, result.getStats(), "风速曲线数据");
|
|
|
+ util.exportExcel(response, stats, "风速曲线数据");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 统计温度曲线数据
|
|
|
+ * 统计温度曲线数据(短期预报 + 本地实测)
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('weather:weatherRaw:tsfcchart')")
|
|
|
@GetMapping("/tsfcchart")
|
|
|
public AjaxResult tsfcchart(@RequestParam("stationId") Long stationId,
|
|
|
@RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime)
|
|
|
{
|
|
|
- return success(dataShortTermWeatherForecastRawService.getTsfcChart(stationId, startTime, endTime));
|
|
|
+ TsfcChartResult forecast = dataShortTermWeatherForecastRawService.getTsfcChart(stationId, startTime, endTime);
|
|
|
+ TsfcChartResult local = dataWeatherLocalService.getTsfcChart(stationId, startTime, endTime);
|
|
|
+ return success(new ChartDataPair<TsfcChartResult>(forecast, local));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 导出温度曲线数据
|
|
|
+ * 导出温度曲线数据(短期预报 + 本地实测,合并导出)
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('weather:weatherRaw:tsfcchart')")
|
|
|
@Log(title = "温度曲线", businessType = BusinessType.EXPORT)
|
|
|
@@ -129,24 +149,36 @@ public class DataShortTermWeatherForecastRawController extends BaseController
|
|
|
public void tsfcchartExport(HttpServletResponse response, @RequestParam("stationId") Long stationId,
|
|
|
@RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime)
|
|
|
{
|
|
|
- TsfcChartResult result = dataShortTermWeatherForecastRawService.getTsfcChart(stationId, startTime, endTime);
|
|
|
+ TsfcChartResult forecast = dataShortTermWeatherForecastRawService.getTsfcChart(stationId, startTime, endTime);
|
|
|
+ TsfcChartResult local = dataWeatherLocalService.getTsfcChart(stationId, startTime, endTime);
|
|
|
+ List<TsfcChartStat> stats = new ArrayList<TsfcChartStat>();
|
|
|
+ if (forecast.getStats() != null)
|
|
|
+ {
|
|
|
+ stats.addAll(forecast.getStats());
|
|
|
+ }
|
|
|
+ if (local.getStats() != null)
|
|
|
+ {
|
|
|
+ stats.addAll(local.getStats());
|
|
|
+ }
|
|
|
ExcelUtil<TsfcChartStat> util = new ExcelUtil<TsfcChartStat>(TsfcChartStat.class);
|
|
|
- util.exportExcel(response, result.getStats(), "温度曲线数据");
|
|
|
+ util.exportExcel(response, stats, "温度曲线数据");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 统计湿度曲线数据
|
|
|
+ * 统计湿度曲线数据(短期预报 + 本地实测)
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('weather:weatherRaw:rhsfcchart')")
|
|
|
@GetMapping("/rhsfcchart")
|
|
|
public AjaxResult rhsfcchart(@RequestParam("stationId") Long stationId,
|
|
|
@RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime)
|
|
|
{
|
|
|
- return success(dataShortTermWeatherForecastRawService.getRhsfcChart(stationId, startTime, endTime));
|
|
|
+ RhsfcChartResult forecast = dataShortTermWeatherForecastRawService.getRhsfcChart(stationId, startTime, endTime);
|
|
|
+ RhsfcChartResult local = dataWeatherLocalService.getRhsfcChart(stationId, startTime, endTime);
|
|
|
+ return success(new ChartDataPair<RhsfcChartResult>(forecast, local));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 导出湿度曲线数据
|
|
|
+ * 导出湿度曲线数据(短期预报 + 本地实测,合并导出)
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('weather:weatherRaw:rhsfcchart')")
|
|
|
@Log(title = "湿度曲线", businessType = BusinessType.EXPORT)
|
|
|
@@ -154,24 +186,36 @@ public class DataShortTermWeatherForecastRawController extends BaseController
|
|
|
public void rhsfcchartExport(HttpServletResponse response, @RequestParam("stationId") Long stationId,
|
|
|
@RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime)
|
|
|
{
|
|
|
- RhsfcChartResult result = dataShortTermWeatherForecastRawService.getRhsfcChart(stationId, startTime, endTime);
|
|
|
+ RhsfcChartResult forecast = dataShortTermWeatherForecastRawService.getRhsfcChart(stationId, startTime, endTime);
|
|
|
+ RhsfcChartResult local = dataWeatherLocalService.getRhsfcChart(stationId, startTime, endTime);
|
|
|
+ List<RhsfcChartStat> stats = new ArrayList<RhsfcChartStat>();
|
|
|
+ if (forecast.getStats() != null)
|
|
|
+ {
|
|
|
+ stats.addAll(forecast.getStats());
|
|
|
+ }
|
|
|
+ if (local.getStats() != null)
|
|
|
+ {
|
|
|
+ stats.addAll(local.getStats());
|
|
|
+ }
|
|
|
ExcelUtil<RhsfcChartStat> util = new ExcelUtil<RhsfcChartStat>(RhsfcChartStat.class);
|
|
|
- util.exportExcel(response, result.getStats(), "湿度曲线数据");
|
|
|
+ util.exportExcel(response, stats, "湿度曲线数据");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 统计气压曲线数据
|
|
|
+ * 统计气压曲线数据(短期预报 + 本地实测)
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('weather:weatherRaw:psfcchart')")
|
|
|
@GetMapping("/psfcchart")
|
|
|
public AjaxResult psfcchart(@RequestParam("stationId") Long stationId,
|
|
|
@RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime)
|
|
|
{
|
|
|
- return success(dataShortTermWeatherForecastRawService.getPsfcChart(stationId, startTime, endTime));
|
|
|
+ PsfcChartResult forecast = dataShortTermWeatherForecastRawService.getPsfcChart(stationId, startTime, endTime);
|
|
|
+ PsfcChartResult local = dataWeatherLocalService.getPsfcChart(stationId, startTime, endTime);
|
|
|
+ return success(new ChartDataPair<PsfcChartResult>(forecast, local));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 导出气压曲线数据
|
|
|
+ * 导出气压曲线数据(短期预报 + 本地实测,合并导出)
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('weather:weatherRaw:psfcchart')")
|
|
|
@Log(title = "气压曲线", businessType = BusinessType.EXPORT)
|
|
|
@@ -179,24 +223,36 @@ public class DataShortTermWeatherForecastRawController extends BaseController
|
|
|
public void psfcchartExport(HttpServletResponse response, @RequestParam("stationId") Long stationId,
|
|
|
@RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime)
|
|
|
{
|
|
|
- PsfcChartResult result = dataShortTermWeatherForecastRawService.getPsfcChart(stationId, startTime, endTime);
|
|
|
+ PsfcChartResult forecast = dataShortTermWeatherForecastRawService.getPsfcChart(stationId, startTime, endTime);
|
|
|
+ PsfcChartResult local = dataWeatherLocalService.getPsfcChart(stationId, startTime, endTime);
|
|
|
+ List<PsfcChartStat> stats = new ArrayList<PsfcChartStat>();
|
|
|
+ if (forecast.getStats() != null)
|
|
|
+ {
|
|
|
+ stats.addAll(forecast.getStats());
|
|
|
+ }
|
|
|
+ if (local.getStats() != null)
|
|
|
+ {
|
|
|
+ stats.addAll(local.getStats());
|
|
|
+ }
|
|
|
ExcelUtil<PsfcChartStat> util = new ExcelUtil<PsfcChartStat>(PsfcChartStat.class);
|
|
|
- util.exportExcel(response, result.getStats(), "气压曲线数据");
|
|
|
+ util.exportExcel(response, stats, "气压曲线数据");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 统计辐照曲线数据
|
|
|
+ * 统计辐照曲线数据(短期预报 + 本地实测)
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('weather:weatherRaw:tirrchart')")
|
|
|
@GetMapping("/tirrchart")
|
|
|
public AjaxResult tirrchart(@RequestParam("stationId") Long stationId,
|
|
|
@RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime)
|
|
|
{
|
|
|
- return success(dataShortTermWeatherForecastRawService.getTirrChart(stationId, startTime, endTime));
|
|
|
+ TirrChartResult forecast = dataShortTermWeatherForecastRawService.getTirrChart(stationId, startTime, endTime);
|
|
|
+ TirrChartResult local = dataWeatherLocalService.getTirrChart(stationId, startTime, endTime);
|
|
|
+ return success(new ChartDataPair<TirrChartResult>(forecast, local));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 导出辐照曲线数据
|
|
|
+ * 导出辐照曲线数据(短期预报 + 本地实测,合并导出)
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('weather:weatherRaw:tirrchart')")
|
|
|
@Log(title = "辐照曲线", businessType = BusinessType.EXPORT)
|
|
|
@@ -204,9 +260,19 @@ public class DataShortTermWeatherForecastRawController extends BaseController
|
|
|
public void tirrchartExport(HttpServletResponse response, @RequestParam("stationId") Long stationId,
|
|
|
@RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime)
|
|
|
{
|
|
|
- TirrChartResult result = dataShortTermWeatherForecastRawService.getTirrChart(stationId, startTime, endTime);
|
|
|
+ TirrChartResult forecast = dataShortTermWeatherForecastRawService.getTirrChart(stationId, startTime, endTime);
|
|
|
+ TirrChartResult local = dataWeatherLocalService.getTirrChart(stationId, startTime, endTime);
|
|
|
+ List<TirrChartStat> stats = new ArrayList<TirrChartStat>();
|
|
|
+ if (forecast.getStats() != null)
|
|
|
+ {
|
|
|
+ stats.addAll(forecast.getStats());
|
|
|
+ }
|
|
|
+ if (local.getStats() != null)
|
|
|
+ {
|
|
|
+ stats.addAll(local.getStats());
|
|
|
+ }
|
|
|
ExcelUtil<TirrChartStat> util = new ExcelUtil<TirrChartStat>(TirrChartStat.class);
|
|
|
- util.exportExcel(response, result.getStats(), "辐照曲线数据");
|
|
|
+ util.exportExcel(response, stats, "辐照曲线数据");
|
|
|
}
|
|
|
|
|
|
/**
|