From 7d55b601b8ec846e9d48ce31de1c5c6930d6dee0 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 19 八月 2025 17:24:35 +0800
Subject: [PATCH] 1、修改等待中间件返回结果超时时间为10秒; 2、修改向水肥机下发命令相关逻辑; 3、修改水肥机回复命令结果处理逻辑; 4、去除前端webSocket关闭产生异常日志记录。
---
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 102 insertions(+), 4 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java
index 122a62b..e3e2cb6 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java
@@ -1,10 +1,12 @@
package com.dy.pipIrrRemote.mqttSd1.soil;
import com.dy.common.aop.SsoAop;
+import com.dy.common.util.NumUtil;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.voRm.VoSoil;
+import com.dy.pipIrrGlobal.voRm.VoSoilDay;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -35,6 +37,96 @@
}
/**
+ * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏌愭皵璞$珯鏌愪竴鏃ヨ褰�
+ * @param soilId
+ * @param yyyy_MM_dd
+ * @return
+ */
+ @GetMapping(path = "oneDay")
+ @SsoAop()
+ public BaseResponse<VoSoilDay> oneDay(Long soilId, String yyyy_MM_dd){
+ try {
+ if(soilId == null){
+ return BaseResponseUtils.buildFail("澧掓儏绔檌d涓嶈兘涓虹┖") ;
+ }
+ if(yyyy_MM_dd == null || yyyy_MM_dd.trim().equals("")){
+ return BaseResponseUtils.buildFail("鏌ヨ鏃ユ湡涓嶈兘涓虹┖") ;
+ }
+ String ymdStr = yyyy_MM_dd.replaceAll("-", "") ;
+ if(!NumUtil.isPlusIntNumber(ymdStr)){
+ return BaseResponseUtils.buildFail("鏌ヨ鏃ユ湡鏍煎紡涓嶆纭紝鏍煎紡瑙勫畾涓簓yyy-MM-dd") ;
+ }
+ return BaseResponseUtils.buildSuccess(sv.oneDay(soilId, Integer.parseInt(ymdStr)));
+ } catch (Exception e) {
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
+
+ /**
+ * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏌愭皵璞$珯鏌愪竴鏃ヨ褰�
+ * @param soilId
+ * @param yyyy_MM
+ * @return
+ */
+ @GetMapping(path = "oneDayByMonth")
+ @SsoAop()
+ public BaseResponse<List<VoSoilDay>> oneDayByMonth(Long soilId, String yyyy_MM){
+ try {
+ if(soilId == null){
+ return BaseResponseUtils.buildFail("澧掓儏绔檌d涓嶈兘涓虹┖") ;
+ }
+ if(yyyy_MM == null || yyyy_MM.trim().equals("")){
+ return BaseResponseUtils.buildFail("鏌ヨ鏈堜唤涓嶈兘涓虹┖") ;
+ }
+ String ymdStr = yyyy_MM.replaceAll("-", "") ;
+ if(!NumUtil.isPlusIntNumber(ymdStr)){
+ return BaseResponseUtils.buildFail("鏌ヨ鏃ユ湡鏍煎紡涓嶆纭紝鏍煎紡瑙勫畾涓簓yyy-MM-dd") ;
+ }
+ Integer ymStart = Integer.parseInt(ymdStr) * 100;
+ Integer ymEnd = Integer.parseInt(ymdStr) * 100 + 31;
+ return BaseResponseUtils.buildSuccess(sv.oneDayByMonth(soilId, ymStart, ymEnd));
+ } catch (Exception e) {
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
+
+
+
+ /**
+ * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏌愭皵璞$珯涓�浜涙棩璁板綍
+ * @param qo
+ * @return
+ */
+ @GetMapping(path = "oneSomeDay")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoSoilDay>>> oneSomeDay(SoilQo qo){
+ try {
+ if(qo.soilId == null){
+ return BaseResponseUtils.buildFail("澧掓儏绔檌d涓嶈兘涓虹┖") ;
+ }
+ qo.completionTime();
+ return BaseResponseUtils.buildSuccess(sv.someDay(qo));
+ } catch (Exception e) {
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
+
+ /**
+ * 鏍规嵁鎸囧畾鏉′欢鏌ヨ涓�浜涙皵璞$珯鏃ヨ褰�
+ * @param qo
+ * @return
+ */
+ @GetMapping(path = "someDay")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoSoilDay>>> someDay(SoilQo qo){
+ try {
+ return BaseResponseUtils.buildSuccess(sv.someDay(qo));
+ } catch (Exception e) {
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
+
+ /**
* 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏈�鏂拌褰�
* @param soilId
* @return
@@ -51,19 +143,23 @@
/**
* 鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍
- * @param soilId
+ * @param qo
* @return
*/
@GetMapping(path = "oneHistory")
@SsoAop()
- public BaseResponse<QueryResultVo<List<VoSoil>>> oneHistory(Long soilId){
+ public BaseResponse<QueryResultVo<List<VoSoil>>> oneHistory(SoilQo qo){
try {
-
- return BaseResponseUtils.buildSuccess(sv.oneHistory(soilId));
+ if(qo.soilId == null){
+ return BaseResponseUtils.buildFail("澧掓儏绔檌d涓嶈兘涓虹┖") ;
+ }
+ qo.completionTime();
+ return BaseResponseUtils.buildSuccess(sv.oneHistory(qo));
} catch (Exception e) {
return BaseResponseUtils.buildException(e.getMessage()) ;
}
}
+
/**
* 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏈�鏂拌褰�
@@ -74,6 +170,7 @@
@SsoAop()
public BaseResponse<QueryResultVo<List<VoSoil>>> someLast(SoilQo qo){
try {
+ qo.completionTime();
return BaseResponseUtils.buildSuccess(sv.someLast(qo));
} catch (Exception e) {
return BaseResponseUtils.buildException(e.getMessage()) ;
@@ -89,6 +186,7 @@
@SsoAop()
public BaseResponse<QueryResultVo<List<VoSoil>>> someHistory(SoilQo qo){
try {
+ qo.completionTime();
return BaseResponseUtils.buildSuccess(sv.someHistory(qo));
} catch (Exception e) {
return BaseResponseUtils.buildException(e.getMessage()) ;
--
Gitblit v1.8.0