From 836ec39fdad422b1a148699a4c5fb8c5b4d395f0 Mon Sep 17 00:00:00 2001
From: zuoxiao <lf_zuo@163.com>
Date: 星期三, 25 六月 2025 11:04:33 +0800
Subject: [PATCH] feat(card): 添加管理类型卡写卡功能并优化卡片相关逻辑- 在 OperateTypeENUM 中添加 SUPPLEMENT 和 MANAGEMENT_CARD_WRITE 枚举值 - 在 SeManagementCard 中添加 cancelTime 和 state 字段 - 更新相关 mapper 和 XML 文件以支持新增字段 - 修改 CardSv 中的回调处理逻辑,支持管理类型卡写卡 - 优化 CreateManagementCardDto 中识别码的示例值

---
 pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigation/IrrigationSv.java |   34 +++++++++++++++++++++++++++-------
 1 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigation/IrrigationSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigation/IrrigationSv.java
index 205ec52..f5d7255 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigation/IrrigationSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigation/IrrigationSv.java
@@ -136,7 +136,10 @@
                 return map;
             }
             for (VoIntake intake : intakes) {
-                intake.setIsOnLine(getRtuStatus(intake.getRtuAddr()));
+                Boolean isOnLine = getOnlineStatus(intake.getRtuAddr());
+                intake.setIsOnLine(isOnLine);
+                Boolean isOpen = getOpenCloseStatus(intake.getRtuAddr());
+                intake.setIsOpen(isOpen);
             }
             voGroupIntakes.setIntakes(intakes);
 
@@ -154,12 +157,7 @@
         }
     }
 
-    /**
-     * 鑾峰彇rtu鍦ㄧ嚎鎯呭喌
-     * @param rtuAdd
-     * @return
-     */
-    public Boolean getRtuStatus(String rtuAdd) {
+    public Boolean getOnlineStatus(String rtuAdd) {
         Command com = new Command();
         com.id = Command.defaultId;
         com.code = CodeLocal.onLinePart;
@@ -180,6 +178,28 @@
         }
     }
 
+    public Boolean getOpenCloseStatus(String rtuAdd) {
+        Command com = new Command();
+        com.id = Command.defaultId;
+        com.code = CodeLocal.oneRtuStates;
+        com.type = CommandType.innerCommand;
+        com.setRtuAddr(rtuAdd);
+        com.setParam(rtuAdd);
+        JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com));
+
+        if (response == null || !response.getString("code").equals("0001") || response.getJSONObject("content").getJSONObject("attachment") == null) {
+            return false;
+        }
+
+        // if(response.getJSONObject("content").getJSONObject("attachment").get("valveOpenTrueCloseFalse").equals("true")) {
+        if(response.getJSONObject("content").getJSONObject("attachment").getBoolean("valveOpenTrueCloseFalse")) {
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
+
     /**
      * 鍙戦�佸懡浠�
      *

--
Gitblit v1.8.0