From bf1b78168478f802a7413d438b16ab64b27b7f4a Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期三, 02 四月 2025 14:32:38 +0800
Subject: [PATCH] 代码优化

---
 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java                           |    2 +-
 pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java             |    2 +-
 pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java |   29 +++++++++++++++++++----------
 pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java   |    9 +++++++++
 4 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java
index e9e1581..646d9be 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java
@@ -401,7 +401,7 @@
                 rmCommandHistory.setResult((byte) 1);
                 rmCommandHistoryMapper.updateByPrimaryKeySelective(rmCommandHistory);
 
-                if(openType == 1) {
+                if(openType != null && openType == 1) {
                     irIntakeOperateMapper.updateByCommandId(comId, (byte)1, null);
                 }
 
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java
index eb887a1..714a413 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java
@@ -259,7 +259,7 @@
         Byte openType = automaticClose.getOpenType();
         Long comId = new IDLongGenerator().generate();
 
-        if(openType == 1) {
+        if(openType != null && openType == 1) {
             IrIntakeOperate irIntakeOperate = new IrIntakeOperate();
             irIntakeOperate.setPlanId(planId);
             irIntakeOperate.setOperateType((byte)1);
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java
index 2d11845..b89610f 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java
@@ -281,18 +281,27 @@
     }
 
     /**
-     * 鑾峰彇鐏屾簤璁″垝鍒楄〃
-     * @param vo
+     * 缁堟鐏屾簤璁″垝
+     * @param planSimple
+     * @param bindingResult
      * @return
      */
-    //@GetMapping(path = "/getIrrigatePlans")
-    //public BaseResponse<QueryResultVo<List<VoIrrigatePlan>>> getIrrigatePlans(QoIrrigatePlan vo) {
-    //    try {
-    //        QueryResultVo<List<VoIrrigatePlan>> res = irrigatePlanSv.getIrrigatePlans(vo);
-    //        return BaseResponseUtils.buildSuccess(res);
-    //    } catch (Exception e) {
-    //        log.error("鑾峰彇杞亴缁勮褰曞紓甯�", e);
-    //        return BaseResponseUtils.buildException(e.getMessage());
+    //@PostMapping(path = "terminatePlan", consumes = MediaType.APPLICATION_JSON_VALUE)
+    //@Transactional(rollbackFor = Exception.class)
+    //public BaseResponse<Boolean> terminatePlan(@RequestBody @Valid PlanSimple planSimple, BindingResult bindingResult){
+    //    if(bindingResult != null && bindingResult.hasErrors()){
+    //        return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
     //    }
+    //
+    //    Long planId = planSimple.getPlanId();
+    //    Long operatorId = planSimple.getOperatorId();
+    //
+    //    IrIrrigatePlan iIrrigatePlan = new IrIrrigatePlan();
+    //    iIrrigatePlan.setId(planId);
+    //    iIrrigatePlan.setExecutingState((byte)3);
+    //    if(irrigatePlanSv.updatePlan(iIrrigatePlan) == 0){
+    //        return BaseResponseUtils.buildErrorMsg("缁堟璁″垝鐘舵�佸け璐�");
+    //    }
+    //
     //}
 }
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java
index 06c4060..0bb1ba1 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java
@@ -60,6 +60,15 @@
     }
 
     /**
+     * 淇敼鐏屾簤璁″垝
+     * @param po
+     * @return
+     */
+    public Integer updatePlan(IrIrrigatePlan po) {
+        return irrigatePlanMapper.updateByPrimaryKeySelective(po);
+    }
+
+    /**
      * 鑾峰彇鏈畬鎴愮殑璁″垝鍒楄〃锛屽皬绋嬪簭璁″垝鍒楄〃椤典娇鐢�
       * @return
      */

--
Gitblit v1.8.0