From 0d1664c88eba639b5809582f47e0b5942e52ddec Mon Sep 17 00:00:00 2001 From: xjs <1294405880@qq.com> Date: Wed, 26 Jan 2022 14:35:29 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A4=A9=E6=B0=94=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=9C=AA=E6=9D=A5=E5=A4=A9=E6=B0=94=E7=BB=9F=E8=AE=A1=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xjs/business/api/RemoteWeatherFeign.java | 3 + .../api/factory/RemoteWeatherFactory.java | 7 +- .../business/statistics/weatherstatistics.js | 8 ++ .../statistics/apistatistics/index.vue | 6 +- .../statistics/weatherstatistics/index.vue | 121 ++++++++++++++++-- .../weather/controller/WeatherController.java | 8 ++ .../xjs/weather/service/WeatherService.java | 6 + .../service/impl/WeatherServiceImpl.java | 51 +++++++- .../WeatherStatisticsController.java | 8 ++ .../xjs/service/WeatherStatisticsService.java | 6 + .../impl/WeatherStatisticsServiceImpl.java | 30 +++++ 11 files changed, 233 insertions(+), 21 deletions(-) diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/xjs/business/api/RemoteWeatherFeign.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/xjs/business/api/RemoteWeatherFeign.java index ac0baa28..cb4aedf3 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/xjs/business/api/RemoteWeatherFeign.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/xjs/business/api/RemoteWeatherFeign.java @@ -26,4 +26,7 @@ public interface RemoteWeatherFeign { @GetMapping("/weather/getHistoryWeatherForRPC") R> getHistoryWeatherForRPC(@RequestParam("startDate")String startDate, @RequestParam("endDate")String endDate); + + @GetMapping("/weather/getFutureWeatherForRPC") + R>> getFutureWeatherForRPC(); } diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/xjs/business/api/factory/RemoteWeatherFactory.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/xjs/business/api/factory/RemoteWeatherFactory.java index e3038175..f9ab5c7c 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/xjs/business/api/factory/RemoteWeatherFactory.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/xjs/business/api/factory/RemoteWeatherFactory.java @@ -31,7 +31,12 @@ public class RemoteWeatherFactory implements FallbackFactory @Override public R> getHistoryWeatherForRPC(String startDate, String endDate) { - return R.fail("获取统计天气服务调用失败" + cause.getMessage()); + return R.fail("获取统计历史天气服务调用失败" + cause.getMessage()); + } + + @Override + public R>> getFutureWeatherForRPC() { + return R.fail("获取统计未来天气服务调用失败" + cause.getMessage()); } }; diff --git a/ruoyi-ui/src/api/business/statistics/weatherstatistics.js b/ruoyi-ui/src/api/business/statistics/weatherstatistics.js index 562f166a..b2fd20a2 100644 --- a/ruoyi-ui/src/api/business/statistics/weatherstatistics.js +++ b/ruoyi-ui/src/api/business/statistics/weatherstatistics.js @@ -8,3 +8,11 @@ export function getHistoryWeather(params) { params: params, }) } + +//查询未来天气统计 +export function getFutureWeather() { + return request({ + url: '/statistics/weatherstatistics/future', + method: 'get', + }) +} diff --git a/ruoyi-ui/src/views/business/statistics/apistatistics/index.vue b/ruoyi-ui/src/views/business/statistics/apistatistics/index.vue index a86b0113..f15fb267 100644 --- a/ruoyi-ui/src/views/business/statistics/apistatistics/index.vue +++ b/ruoyi-ui/src/views/business/statistics/apistatistics/index.vue @@ -112,9 +112,7 @@ export default { //查询API历史记录统计 getStatisticsHistoryApi() { - this.loading=true getStatisticsHistoryApi().then(res => { - this.loading=false this.historyApiData = res.data this.initHistory() }) @@ -122,9 +120,13 @@ export default { //查询API当天记录统计 getStatisticsTodayApi() { + this.loading=true getStatisticsTodayApi().then(res => { + this.loading=false this.todayApiData = res.data this.initToday() + }).catch(err =>{ + this.loading=false }) }, diff --git a/ruoyi-ui/src/views/business/statistics/weatherstatistics/index.vue b/ruoyi-ui/src/views/business/statistics/weatherstatistics/index.vue index eed8ec79..3f9f2798 100644 --- a/ruoyi-ui/src/views/business/statistics/weatherstatistics/index.vue +++ b/ruoyi-ui/src/views/business/statistics/weatherstatistics/index.vue @@ -28,16 +28,16 @@ 重置 -
+
-
+