From 5ce74aa073f8f31e3c9d078bbd747609d6a5c038 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期四, 30 五月 2024 08:42:42 +0800
Subject: [PATCH] 修改单点登录模块的一些代码问题 1.全局userId变id
---
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java | 77 +++++++++++++++++++++++++++++++++-----
1 files changed, 67 insertions(+), 10 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 7482f9d..cf75af5 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
@@ -18,6 +18,7 @@
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.stereotype.Service;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -66,16 +67,6 @@
return rmCommandHistoryMapper.updateByPrimaryKeySelective(po);
}
-
- /**
- * 鏍规嵁鎿嶄綔鍛業D鑾峰彇鏈叧闃�璁板綍
- * @param operator
- * @return
- */
- public List<VoUnclosedValve> getUnclosedValves(Long operator) {
- return rmCommandHistoryMapper.getUnclosedValves(operator);
- }
-
/**
* 鑾峰彇鍙栨按鍙e垪琛�
* @return
@@ -116,4 +107,70 @@
}
}
+ /**
+ * 鏍规嵁鎿嶄綔鍛樿幏鍙栧父鐢ㄥ彇姘村彛
+ * @param operator
+ * @return
+ */
+ public List<VoOnLineIntake> getUsedIntakes(Long operator) {
+ 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);
+ }
+ return prIntakeMapper.getUsedIntakes(jsonArray.toJSONString(), operator);
+ } else {
+ return new ArrayList<>();
+ }
+ }
+
+ /**
+ * 鏍规嵁鎿嶄綔鍛業D鑾峰彇鏈叧闃�璁板綍锛堝寘鍚湪绾挎儏鍐碉級
+ * @param operator
+ * @return
+ */
+ public List<VoUnclosedValve> getUnclosedValves(Long operator) {
+ 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);
+ }
+
+ List<VoUnclosedValve> res = rmCommandHistoryMapper.getUnclosedValves(jsonArray.toJSONString(), operator);
+ if(res != null) {
+ return res;
+ } else {
+ return new ArrayList<>();
+ }
+ } else {
+ QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>();
+ return new ArrayList<>();
+ }
+ }
+
}
--
Gitblit v1.8.0