From 4b99aedffe4e64425c059611dbb89d7d28b9ed06 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 07 五月 2025 15:28:04 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java
index d741f10..1056462 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java
@@ -6,6 +6,7 @@
 import com.dy.common.multiDataSource.DataSourceContext;
 import com.dy.common.mw.protocol.Command;
 import com.dy.common.webUtil.BaseResponse;
+import com.dy.common.webUtil.BaseResponseUtils;
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pipIrrGlobal.daoPr.PrControllerMapper;
 import com.dy.pipIrrGlobal.daoPr.PrIntakeControllerMapper;
@@ -13,6 +14,7 @@
 import com.dy.pipIrrGlobal.pojoPr.PrController;
 import com.dy.pipIrrGlobal.pojoPr.PrIntakeController;
 import com.dy.pipIrrGlobal.voPr.VoController;
+import com.dy.pipIrrGlobal.voPr.VoControllerSimple;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.common.utils.PojoUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,7 +27,10 @@
 import org.springframework.web.client.RestTemplate;
 import org.springframework.web.util.UriComponentsBuilder;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
 
 /**
  * @author ZhuBaoMin
@@ -80,19 +85,13 @@
         comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw);
 
         JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com));
+
+
         if (response != null && response.getString("code").equals("0001")) {
-            //JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap");
             JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment");
 
             JSONArray jsonArray = new JSONArray();
             if(attachment != null) {
-                //HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class);
-                //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);
-                //}
                 attachment.forEach((key, value) -> {
                     JSONObject jsonObject = new JSONObject();
                     jsonObject.put("rtuAddr", key);
@@ -264,6 +263,19 @@
         } catch (Exception e) {
             e.printStackTrace();
         }
+
+        if(response == null) {
+            return BaseResponseUtils.buildErrorMsg("涓棿浠惰皟鐢ㄥけ璐�");
+        }
+
         return response.getBody();
     }
+
+    /**
+     * 涓嶅垎椤佃幏鍙栧叏閮ㄦ湭鍒犻櫎鐨勯榾鎺у櫒鍒楄〃
+     * @return
+     */
+    public List<VoControllerSimple> getSimpleControllers() {
+        return prControllerMapper.getSimpleControllers();
+    }
 }

--
Gitblit v1.8.0