From b18f999a5a899edec35a14daec21e764cc58ff2b Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期五, 08 十一月 2024 08:51:11 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java | 29 ++++++++--------------------- 1 files changed, 8 insertions(+), 21 deletions(-) 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 146b1c4..21df891 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 @@ -17,7 +17,6 @@ import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory; import com.dy.pipIrrGlobal.pojoSe.SeClientCard; -import com.dy.pipIrrGlobal.voPr.VoOnLineIntake; import com.dy.pipIrrGlobal.voRm.VoIrrigaterProfile; import com.dy.pipIrrGlobal.voRm.VoUnclosedValve; import com.dy.pipIrrGlobal.voSe.VoVirtualCard; @@ -102,37 +101,25 @@ 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(); + JSONArray jsonArray = new JSONArray(); + if(response != null && response.getString("code").equals("0001")) { + JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); 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); jsonObject.put("isOnLine", value); jsonArray.add(jsonObject); - }); } - System.out.println(jsonArray.toJSONString()); - List<VoUnclosedValve> res = rmCommandHistoryMapper.getUnclosedValves(jsonArray.toJSONString(), operator); - if(res != null) { - return res; - } else { - return new ArrayList<>(); - } + } + + List<VoUnclosedValve> res = rmCommandHistoryMapper.getUnclosedValves(jsonArray.toJSONString(), operator); + if(res != null) { + return res; } else { - QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>(); return new ArrayList<>(); } } -- Gitblit v1.8.0