From aec4636e4fb430055feb66751da0e6c05bb864df Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期三, 30 四月 2025 16:25:30 +0800
Subject: [PATCH] fix(irrigatePlan): 修复终止灌溉计划时长设置错误- 将终止计划的默认时长从 9999 修改为 0 - 此修改确保在终止灌溉计划时,不会出现时长设置过长的问题

---
 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuControllerCtrl.java |  146 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 146 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuControllerCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuControllerCtrl.java
new file mode 100644
index 0000000..1b13aef
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuControllerCtrl.java
@@ -0,0 +1,146 @@
+package com.dy.pipIrrBase.rtuUpgrade.task;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/11/7 14:48
+ * @Description
+ */
+
+import com.dy.common.aop.SsoAop;
+import com.dy.common.webUtil.BaseResponse;
+import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.common.webUtil.QueryResultVo;
+import com.dy.common.webUtil.ResultCodeMsg;
+import com.dy.pipIrrGlobal.pojoUg.UgRtuTask;
+import com.dy.pipIrrGlobal.voPr.VoController;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+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: 2024/11/7 11:33
+ * @Description
+ */
+@Slf4j
+@Tag(name = "RTU鍗囩骇浠诲姟瀵瑰簲鐨勬帶鍒跺櫒", description = "RTU鍗囩骇浠诲姟瀵瑰簲鐨勬帶鍒跺櫒澧炲垹鏀规煡绛夋搷浣�")
+@RestController
+@RequestMapping(path = "ugRtuController")
+@SuppressWarnings("unchecked")
+//java鐗堟湰瓒婇珮锛屽娉涘瀷绾︽潫瓒婁弗锛屾墍浠ラ厤缃甋uppressWarnings("unchecked")
+public class UgRtuControllerCtrl {
+
+    private UgRtuControllerSv sv;
+
+    @Autowired
+    private void setAddSv(UgRtuControllerSv sv) { this.sv = sv; }
+
+    /**
+     * 瀹㈡埛绔垎椤垫煡璇竴涓崌绾т换鍔$殑鎵�鏈夋帶鍒跺櫒
+     * @return 涓�浜汻TU鍗囩骇浠诲姟鏁版嵁
+     */
+    @Operation(summary = "鍒嗛〉鏌ヨ涓�涓崌绾т换鍔$殑鎵�鏈夋帶鍒跺櫒", description = "瀹㈡埛绔垎椤垫煡璇竴涓崌绾т换鍔$殑鎵�鏈夋帶鍒跺櫒")
+    @ApiResponses(value = {
+            @ApiResponse(
+                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+                    description = "杩斿洖涓�浜汻TU鍗囩骇浠诲姟鎺у埗鍣ㄦ暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�",
+                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+                            schema = @Schema(implementation = UgRtuTask.class))}
+            )
+    })
+    @GetMapping(path = "/some")
+    @SsoAop()
+    public BaseResponse<QueryResultVo<List<VoController>>> some(QueryControllerVo vo){
+        if(vo.taskId == null){
+            return BaseResponseUtils.buildErrorMsg("鍗囩骇浠诲姟id涓嶈兘涓虹┖") ;
+        }
+        try {
+            QueryResultVo<List<VoController>> res = this.sv.selectSome(vo) ;
+            return BaseResponseUtils.buildSuccess(res);
+        } catch (Exception e) {
+            log.error("鏌ヨRTU鍗囩骇浠诲姟寮傚父", e);
+            return BaseResponseUtils.buildErrorMsg(e.getMessage()) ;
+        }
+    }
+
+    /**
+     * 鍒犻櫎鍗囩骇浠诲姟鎵�鏈夋帶鍒跺櫒
+     * @param taskId 浠诲姟id
+     * @return 鏄惁鎴愬姛
+     */
+    @Operation(summary = "鍒犻櫎鍗囩骇浠诲姟鎵�鏈夋帶鍒跺櫒", description = "鍒犻櫎鍗囩骇浠诲姟鎵�鏈夋帶鍒跺櫒")
+    @ApiResponses(value = {
+            @ApiResponse(
+                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+                    description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�",
+                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+                            schema = @Schema(implementation = Boolean.class))}
+            )
+    })
+    @GetMapping(path = "deleteAll")
+    @SsoAop()
+    public BaseResponse<Boolean> deleteAll(Long taskId){
+        if(taskId == null){
+            return BaseResponseUtils.buildErrorMsg("浠诲姟id涓嶈兘涓虹┖") ;
+        }
+        int count;
+        try {
+            count = this.sv.deleteAll(taskId);
+        } catch (Exception e) {
+            log.error("鍒犻櫎鍗囩骇鎵�鏈夊璞℃帶鍒跺櫒寮傚父", e);
+            return BaseResponseUtils.buildErrorMsg(e.getMessage()) ;
+        }
+        if(count <= 0){
+            return BaseResponseUtils.buildErrorMsg("鏁版嵁搴撴搷浣滃け璐�") ;
+        }else{
+            return BaseResponseUtils.buildSuccess(true) ;
+        }
+    }
+
+
+    /**
+     * 鍗囩骇浠诲姟鎺у埗鍣ㄩ泦鍚堜腑鍒犻櫎涓�涓帶鍒跺櫒
+     * @param id 鏁版嵁璁板綍id
+     * @return 鏄惁鎴愬姛
+     */
+    @Operation(summary = "鍗囩骇浠诲姟鎺у埗鍣ㄩ泦鍚堜腑鍒犻櫎涓�涓帶鍒跺櫒", description = "鍗囩骇浠诲姟鎺у埗鍣ㄩ泦鍚堜腑鍒犻櫎涓�涓帶鍒跺櫒")
+    @ApiResponses(value = {
+            @ApiResponse(
+                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+                    description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�",
+                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+                            schema = @Schema(implementation = Boolean.class))}
+            )
+    })
+    @GetMapping(path = "deleteOne")
+    @SsoAop()
+    public BaseResponse<Boolean> deleteOne(Long id){
+        if(id == null){
+            return BaseResponseUtils.buildErrorMsg("id涓嶈兘涓虹┖") ;
+        }
+        int count;
+        try {
+            count = this.sv.deleteOne(id);
+        } catch (Exception e) {
+            log.error("鍒犻櫎鍗囩骇瀵硅薄鎺у埗鍣ㄥ紓甯�", e);
+            return BaseResponseUtils.buildErrorMsg(e.getMessage()) ;
+        }
+        if(count <= 0){
+            return BaseResponseUtils.buildErrorMsg("鏁版嵁搴撴搷浣滃け璐�") ;
+        }else{
+            return BaseResponseUtils.buildSuccess(true) ;
+        }
+    }
+
+}

--
Gitblit v1.8.0