From 4f97850c9cc2098f460124a66266bdf6157319dd Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期四, 26 六月 2025 15:46:29 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
---
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 159 insertions(+), 0 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
new file mode 100644
index 0000000..90468c2
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java
@@ -0,0 +1,159 @@
+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;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/26 09:31
+ * @Description
+ */
+@Slf4j
+@Tag(name = "澧掓儏鏁版嵁鏌ヨ", description = "澧掓儏鏁版嵁鏌ヨ")
+@RestController("rmSoilCtrl")
+@RequestMapping(path = "soil")
+@RequiredArgsConstructor
+public class SoilCtrl {
+
+ private SoilSv sv;
+
+ @Autowired
+ public void setSv(SoilSv sv){
+ this.sv = sv ;
+ }
+
+ /**
+ * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏌愭皵璞$珯鏌愪竴鏃ヨ褰�
+ * @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 qo
+ * @return
+ */
+ @GetMapping(path = "oneSomeDay")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoSoilDay>>> oneSomeDay(SoilQo qo){
+ try {
+ if(qo.soilId == null){
+ return BaseResponseUtils.buildFail("澧掓儏绔檌d涓嶈兘涓虹┖") ;
+ }
+ 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
+ */
+ @GetMapping(path = "oneLast")
+ @SsoAop()
+ public BaseResponse<VoSoil> oneLast(Long soilId){
+ try {
+ return BaseResponseUtils.buildSuccess(sv.oneLast(soilId));
+ } catch (Exception e) {
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
+
+ /**
+ * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍
+ * @param soilId
+ * @return
+ */
+ @GetMapping(path = "oneHistory")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoSoil>>> oneHistory(Long soilId){
+ try {
+
+ return BaseResponseUtils.buildSuccess(sv.oneHistory(soilId));
+ } catch (Exception e) {
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
+
+
+ /**
+ * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏈�鏂拌褰�
+ * @param qo
+ * @return
+ */
+ @GetMapping(path = "someLast")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoSoil>>> someLast(SoilQo qo){
+ try {
+ return BaseResponseUtils.buildSuccess(sv.someLast(qo));
+ } catch (Exception e) {
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
+
+ /**
+ * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍
+ * @param qo
+ * @return
+ */
+ @GetMapping(path = "someHistory")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoSoil>>> someHistory(SoilQo qo){
+ try {
+ return BaseResponseUtils.buildSuccess(sv.someHistory(qo));
+ } catch (Exception e) {
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
+}
--
Gitblit v1.8.0