From 6f6c6a480d02b7c91e72821e29a937d5927e38cc Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 19 六月 2024 17:48:21 +0800
Subject: [PATCH] 2024-06-19 朱宝民 迁移4个微信小程序接口

---
 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java
index 58b3bf7..602291e 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java
@@ -140,6 +140,32 @@
      * @return
      */
     public VoUnclosedParam getUncloseParam(Long intakeId) {
-        return rmCommandHistoryMapper.getUncloseParam(intakeId);
+        Command com = new Command() ;
+        com.id = Command.defaultId;
+        com.code = "LCD0001";
+        com.type = "innerCommand";
+
+        JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com));
+
+        if(response != null && response.getString("code").equals("0001")) {
+            JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap");
+            HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class);
+
+            JSONArray jsonArray = new JSONArray();
+            for (Map.Entry<String, Boolean> entry : onLineMap.entrySet()) {
+                JSONObject jsonObject = new JSONObject();
+                jsonObject.put("rtuAddr", entry.getKey());
+                jsonObject.put("isOnLine", entry.getValue());
+                jsonArray.add(jsonObject);
+            }
+
+            System.out.println(jsonArray);
+            return rmCommandHistoryMapper.getUncloseParam(jsonArray.toJSONString(), intakeId);
+        } else {
+            QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>();
+            VoUnclosedParam voUnclosedParam = new VoUnclosedParam();
+            return voUnclosedParam;
+        }
+
     }
 }

--
Gitblit v1.8.0