From c1ba562d638ae75bef24012db614c6819a9c71de Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 29 八月 2025 09:11:16 +0800
Subject: [PATCH] 使一个站的气象、墒情历史数据查询支持一天的时间范围内查询

---
 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/weather/WeatherCtrl.java |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/weather/WeatherCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/weather/WeatherCtrl.java
index 410677e..4ad2bac 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/weather/WeatherCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/weather/WeatherCtrl.java
@@ -43,6 +43,9 @@
     @SsoAop()
     public BaseResponse<VoWeather> oneLast(Long weatherId){
         try {
+            if(weatherId == null){
+                return BaseResponseUtils.buildFail("姘旇薄绔檌d涓嶈兘涓虹┖") ;
+            }
             return BaseResponseUtils.buildSuccess(sv.oneLast(weatherId));
         } catch (Exception e) {
             return BaseResponseUtils.buildException(e.getMessage()) ;
@@ -51,15 +54,23 @@
 
     /**
      * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍
-     * @param weatherId
+     * @param qo
      * @return
      */
     @GetMapping(path = "oneHistory")
     @SsoAop()
-    public BaseResponse<QueryResultVo<List<VoWeather>>> oneHistory(Long weatherId){
+    public BaseResponse<QueryResultVo<List<VoWeather>>> oneHistory(WeatherQo qo){
         try {
-
-            return BaseResponseUtils.buildSuccess(sv.oneHistory(weatherId));
+            if(qo.weatherId == null){
+                return BaseResponseUtils.buildFail("姘旇薄绔檌d涓嶈兘涓虹┖") ;
+            }
+            qo.completionTime();
+            if(qo.timeStop == null || qo.timeStop.trim().equals("")){
+                if(qo.timeStart != null && !qo.timeStart.trim().equals("")){
+                    qo.timeStop = qo.timeStart + " 23:59:59";
+                }
+            }
+           return BaseResponseUtils.buildSuccess(sv.oneHistory(qo));
         } catch (Exception e) {
             return BaseResponseUtils.buildException(e.getMessage()) ;
         }
@@ -74,6 +85,7 @@
     @SsoAop()
     public BaseResponse<QueryResultVo<List<VoWeather>>> someLast(WeatherQo qo){
         try {
+            qo.completionTime();
             return BaseResponseUtils.buildSuccess(sv.someLast(qo));
         } catch (Exception e) {
             return BaseResponseUtils.buildException(e.getMessage()) ;
@@ -89,6 +101,7 @@
     @SsoAop()
     public BaseResponse<QueryResultVo<List<VoWeather>>> someHistory(WeatherQo qo){
         try {
+            qo.completionTime();
             return BaseResponseUtils.buildSuccess(sv.someHistory(qo));
         } catch (Exception e) {
             return BaseResponseUtils.buildException(e.getMessage()) ;

--
Gitblit v1.8.0